/** * Returns the singleton instance of the manager * * @return the singleton instance of the manager */ public static synchronized ApiBaselineManager getManager() { if (fInstance == null) { fInstance = new ApiBaselineManager(ApiPlugin.isRunningInFramework()); } return fInstance; }
@Override public synchronized IApiBaseline getWorkspaceBaseline() { if (ApiPlugin.isRunningInFramework()) { if (this.workspacebaseline == null) { try { this.workspacebaseline = createWorkspaceBaseline(); } catch (CoreException e) { ApiPlugin.log(e); } } return this.workspacebaseline; } return null; }
hasinfos = new HashSet<>(8); baselinecache = new LinkedHashMap<>(8); if (!ApiPlugin.isRunningInFramework()) { return;
@Override public int getSeverity() { if (ApiPlugin.isRunningInFramework()) { return ApiPlugin.getDefault().getSeverityLevel(ApiProblemFactory.getProblemSeverityId(this), null); } return ApiPlugin.SEVERITY_WARNING; }
/** * Cleans up the manager */ public void stop() { try { if (baselinecache != null) { // we should first dispose all existing baselines for (IApiBaseline iApiBaseline : baselinecache.values()) { iApiBaseline.dispose(); } baselinecache.clear(); } synchronized (this) { if (workspacebaseline != null) { workspacebaseline.dispose(); } } if (handlecache != null) { handlecache.clear(); } if (hasinfos != null) { hasinfos.clear(); } StubApiComponent.disposeAllCaches(); } finally { if (ApiPlugin.isRunningInFramework()) { ApiPlugin.getDefault().removeSaveParticipant(this); } } }
if (ApiPlugin.isRunningInFramework()) { JavaRuntime.removeVMInstallChangedListener(this);
if (ApiPlugin.isRunningInFramework() && fAutoResolve) { IStatus error = null; IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
/** * Initializes this baseline to resolve in the execution environment * associated with the given description. * * @param ee execution environment description * @throws CoreException if unable to initialize based on the given id */ private void initialize(ExecutionEnvironmentDescription ee) throws CoreException { Properties properties = null; String environmentId = ee.getProperty(ExecutionEnvironmentDescription.CLASS_LIB_LEVEL); if (ApiPlugin.isRunningInFramework()) { properties = getJavaProfileProperties(environmentId); if (properties == null) { // Java10 onwards, we take profile via this method IExecutionEnvironment ev = EnvironmentsManager.getDefault().getEnvironment(environmentId); properties = ev.getProfileProperties(); } } else { properties = Util.getEEProfile(environmentId); } if (properties == null) { abort("Unknown execution environment: " + environmentId, null); //$NON-NLS-1$ } else { initialize(properties, ee); } }