From 95e8f940ab5216a9059f22dedd0e15ea02898d13 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 15 Jan 2007 08:44:08 +0000 Subject: [PATCH] 148190#32 --- .../ajde/internal/AjdeMessageHandler.java | 71 -- .../ajde/internal/AspectJBuildManager.java | 266 ------- .../ajde/internal/BuildNotifierAdapter.java | 60 -- .../ajde/internal/CompilerAdapter.java | 683 ------------------ .../ajde/internal/DebugErrorHandler.java | 32 - .../internal/LstBuildConfigFileUpdater.java | 14 +- .../ajde/internal/LstBuildConfigManager.java | 50 +- .../ajde/internal/OutputLocationAdapter.java | 44 -- 8 files changed, 42 insertions(+), 1178 deletions(-) delete mode 100644 ajde/src/org/aspectj/ajde/internal/AjdeMessageHandler.java delete mode 100644 ajde/src/org/aspectj/ajde/internal/AspectJBuildManager.java delete mode 100644 ajde/src/org/aspectj/ajde/internal/BuildNotifierAdapter.java delete mode 100644 ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java delete mode 100644 ajde/src/org/aspectj/ajde/internal/DebugErrorHandler.java delete mode 100644 ajde/src/org/aspectj/ajde/internal/OutputLocationAdapter.java diff --git a/ajde/src/org/aspectj/ajde/internal/AjdeMessageHandler.java b/ajde/src/org/aspectj/ajde/internal/AjdeMessageHandler.java deleted file mode 100644 index 2756af0e4..000000000 --- a/ajde/src/org/aspectj/ajde/internal/AjdeMessageHandler.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************** - * Copyright (c) 2006 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation - * Helen Hawkins - moved into separate class - *******************************************************************/ -package org.aspectj.ajde.internal; - -import java.util.ArrayList; -import java.util.List; - -import org.aspectj.ajde.Ajde; -import org.aspectj.ajde.TaskListManager; -import org.aspectj.bridge.AbortException; -import org.aspectj.bridge.IMessage; -import org.aspectj.bridge.IMessageHandler; -import org.aspectj.bridge.IMessage.Kind; - -/** - * IMessageHandler used by Ajde. No messages are stored - * within the handler as it delegates to the TaskListManager. - * By default IMessage.INFO and IMessage.WEAVEINFO messages - * are ignored. - */ -public class AjdeMessageHandler implements IMessageHandler { - - private TaskListManager taskListManager; - private List ignoring; - - public AjdeMessageHandler() { - ignoring = new ArrayList(); - ignore(IMessage.INFO); - ignore(IMessage.WEAVEINFO); - this.taskListManager = Ajde.getDefault().getTaskListManager(); - } - - public boolean handleMessage(IMessage message) throws AbortException { - IMessage.Kind kind = message.getKind(); - if (kind == IMessage.ABORT) return handleAbort(message); - if (isIgnoring(kind)) { - return true; - } - taskListManager.addSourcelineTask(message); - return true; - } - - private boolean handleAbort(IMessage abortMessage) { - throw new AbortException(abortMessage); - } - - public void dontIgnore(Kind kind) { - if (null != kind) { - ignoring.remove(kind); - } - } - - public boolean isIgnoring(Kind kind) { - return ((null != kind) && (ignoring.contains(kind))); - } - - public void ignore(Kind kind) { - if ((null != kind) && (!ignoring.contains(kind))) { - ignoring.add(kind); - } - } - -} diff --git a/ajde/src/org/aspectj/ajde/internal/AspectJBuildManager.java b/ajde/src/org/aspectj/ajde/internal/AspectJBuildManager.java deleted file mode 100644 index 42ca0e911..000000000 --- a/ajde/src/org/aspectj/ajde/internal/AspectJBuildManager.java +++ /dev/null @@ -1,266 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -package org.aspectj.ajde.internal; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Set; - -import org.aspectj.ajde.Ajde; -import org.aspectj.ajde.BuildListener; -import org.aspectj.ajde.BuildManager; -import org.aspectj.ajde.BuildOptionsAdapter; -import org.aspectj.ajde.BuildProgressMonitor; -import org.aspectj.ajde.ProjectPropertiesAdapter; -import org.aspectj.ajde.TaskListManager; -import org.aspectj.ajdt.internal.core.builder.AjState; -import org.aspectj.ajdt.internal.core.builder.IncrementalStateManager; -import org.aspectj.asm.AsmManager; -import org.aspectj.util.ConfigParser; - -/** - * Responsible for the build process, including compiler invocation, threading, and error - * reporting. - * - * @author Mik Kersten - */ -public class AspectJBuildManager implements BuildManager { - - private CompilerAdapter compilerAdapter = null; - private TaskListManager compilerMessages = null; - private BuildProgressMonitor progressMonitor = null; - private BuildOptionsAdapter buildOptions = null; - private ArrayList compilerListeners = new ArrayList(); - private String configFile = ""; - private String lastConfigFile = null; - private int lastCompileTime = 50; -// private boolean buildStructureOnly = false; - private boolean buildModelMode = true; - - public AspectJBuildManager( - TaskListManager compilerMessages, - BuildProgressMonitor progressMonitor, - BuildOptionsAdapter buildOptions) { - this.compilerMessages = compilerMessages; - this.progressMonitor = progressMonitor; - this.buildOptions = buildOptions; - this.compilerAdapter = new CompilerAdapter(); - } - - public void buildFresh() { - dobuild(true); - } - - /** this implementation just builds all */ - public void buildStructure() { - dobuild(true); - } - - public void build() { - dobuild(false); - } - - protected void dobuild(boolean fresh) { - dobuild(Ajde.getDefault().getConfigurationManager().getActiveConfigFile(), fresh); - } - - public void buildFresh(String configFile) { - dobuild(configFile, true); - } - - public void build(String configFile) { - dobuild(configFile, false); - } - -// public void setReportInfoMessages(boolean b) { -// if (compilerAdapter!=null) compilerAdapter.showInfoMessages(b); -// } - - - protected void dobuild(String configFile, boolean fresh) { - if (configFile == null) { - Ajde.getDefault().getErrorHandler().handleWarning("Please select a build configuration file."); - } else { - // enforce batch builds after switching configurations - // even in incremental mode - lastConfigFile = this.configFile; - this.configFile = configFile; - if (!fresh) { - // Check if we need to dig out an old incremental state - if (!configFile.equals(lastConfigFile)) { - AjState correctStateForConfig = IncrementalStateManager.retrieveStateFor(configFile); - if (correctStateForConfig==null) fresh = true; // have to full build - else { - compilerAdapter.setState(correctStateForConfig); - AsmManager.getDefault().setRelationshipMap(correctStateForConfig.getRelationshipMap()); - AsmManager.getDefault().setHierarchy(correctStateForConfig.getStructureModel()); - } - } - } - if (fresh) { - this.compilerAdapter.nextBuildFresh(); - } - CompilerThread compilerThread = new CompilerThread(); - compilerThread.start(); - } - } - - public void abortBuild() { - if (compilerAdapter != null) { - compilerAdapter.requestCompileExit(); - } - } - - public boolean isStructureDirty() { - if (compilerAdapter != null) { - return compilerAdapter.isStructureDirty(); - } else { - return false; - } - } - - public void setStructureDirty(boolean structureDirty) { - if (compilerAdapter != null) { - compilerAdapter.setStructureDirty(structureDirty); - } - } - - public void addListener(BuildListener compilerListener) { - compilerListeners.add(compilerListener); - } - - public void removeListener(BuildListener compilerListener) { - compilerListeners.remove(compilerListener); - } - - private void notifyCompileFinished(String configFile, int buildTime, boolean succeeded, boolean warnings) { - Ajde.getDefault().logEvent("build finished, succeeded: " + succeeded); - for (Iterator it = compilerListeners.iterator(); it.hasNext(); ) { - ((BuildListener)it.next()).compileFinished(configFile, buildTime, succeeded, warnings); - } - } - - private void notifyCompileStarted(String configFile) { - Ajde.getDefault().logEvent("build started: " + configFile); - for (Iterator it = compilerListeners.iterator(); it.hasNext(); ) { - ((BuildListener)it.next()).compileStarted(configFile); - } - } - -// private void notifyCompileAborted(String configFile, String message) { -// for (Iterator it = compilerListeners.iterator(); it.hasNext(); ) { -// ((BuildListener)it.next()).compileAborted(configFile, message); -// } -// } - - - public BuildOptionsAdapter getBuildOptions() { - return buildOptions; - } - - /** - * run compiler in a separate thread - */ - public class CompilerThread extends Thread { - - public void run() { - boolean succeeded = true; - boolean warnings = false; - try { - long timeStart = System.currentTimeMillis(); - notifyCompileStarted(configFile); - progressMonitor.start(configFile); - compilerMessages.clearTasks(); - - if (Ajde.getDefault().isLogging()) - Ajde.getDefault().logEvent("building with options: " - + getFormattedOptionsString(buildOptions, Ajde.getDefault().getProjectProperties())); - - succeeded = compilerAdapter.compile(configFile, progressMonitor, buildModelMode); - - long timeEnd = System.currentTimeMillis(); - lastCompileTime = (int)(timeEnd - timeStart); - } catch (ConfigParser.ParseException pe) { - Ajde.getDefault().getErrorHandler().handleWarning( - "Config file entry invalid, file: " - + pe.getFile().getPath() - + ", line number: " - + pe.getLine()); - } catch (Throwable e) { - Ajde.getDefault().getErrorHandler().handleError("Compile error, caught Throwable: " + e.toString(), e); - } finally { - warnings = compilerMessages.hasWarning(); - progressMonitor.finish(compilerAdapter.wasFullBuild()); - } - notifyCompileFinished(configFile, lastCompileTime, succeeded, warnings); - } - - // AMC - updated for AspectJ 1.1 options - private String getFormattedOptionsString(BuildOptionsAdapter buildOptions, ProjectPropertiesAdapter properties) { - return "Building with settings: " - + "\n-> output path: " + properties.getOutputPath() - + "\n-> classpath: " + properties.getClasspath() - + "\n-> bootclasspath: " + properties.getBootClasspath() - + "\n-> -injars " + formatSet(properties.getInJars()) - + "\n-> -inpath " + formatSet(properties.getInpath()) - + "\n-> -outjar " + formatOptionalString(properties.getOutJar()) - + "\n-> -sourceroots " + formatSet(properties.getSourceRoots()) - + "\n-> -aspectpath " + formatSet(properties.getAspectPath()) - + "\n-> -" + buildOptions.getComplianceLevel() - + "\n-> -source " + buildOptions.getSourceCompatibilityLevel() - + "\n-> -g:" + formatSet(buildOptions.getDebugLevel()) - + "\n-> -warn:" + formatSet(buildOptions.getWarnings()) - + "\n-> noImportError: " + buildOptions.getNoImportError() - + "\n-> preserveAllLocals:" + buildOptions.getPreserveAllLocals() - + "\n-> non-standard options: " + buildOptions.getNonStandardOptions(); -// + "\n-> [ignored-deprecated in AspectJ1.1] porting mode: " + buildOptions.getPortingMode() -// + "\n-> [ignored-deprecated in AspectJ1.1] source 1.4 mode: " + buildOptions.getSourceOnePointFourMode() -// + "\n-> [ignored-deprecated in AspectJ1.1] strict spec mode: " + buildOptions.getStrictSpecMode() -// + "\n-> [ignored-deprecated in AspectJ1.1] lenient spec mode: " + buildOptions.getLenientSpecMode() -// + "\n-> [ignored-deprecated in AspectJ1.1] use javac mode: " + buildOptions.getUseJavacMode() -// + "\n-> [ignored-deprecated in AspectJ1.1] preprocess mode: " + buildOptions.getPreprocessMode() -// + "\n-> [ignored-deprecated in AspectJ1.1] working dir: " + buildOptions.getWorkingOutputPath(); - } - - private String formatSet( Set options ) { - if ( options == null ) return ""; - if ( options.isEmpty() ) return "none"; - - StringBuffer formattedOptions = new StringBuffer(); - Iterator it = options.iterator(); - while (it.hasNext()) { - String o = it.next().toString(); - if (formattedOptions.length() > 0) formattedOptions.append(", "); - formattedOptions.append( o ); - } - return formattedOptions.toString(); - } - - private String formatOptionalString( String s ) { - if ( s == null ) { return "" ; } - else { return s; } - } - } - - public void setBuildModelMode(boolean b) { - buildModelMode = b; - } - - public CompilerAdapter getCompilerAdapter() { - return compilerAdapter; - } - -} - diff --git a/ajde/src/org/aspectj/ajde/internal/BuildNotifierAdapter.java b/ajde/src/org/aspectj/ajde/internal/BuildNotifierAdapter.java deleted file mode 100644 index 4fe8f6a5b..000000000 --- a/ajde/src/org/aspectj/ajde/internal/BuildNotifierAdapter.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -package org.aspectj.ajde.internal; - -import org.aspectj.ajde.Ajde; -import org.aspectj.ajde.BuildProgressMonitor; -import org.aspectj.ajdt.internal.core.builder.AjBuildManager; -import org.aspectj.bridge.IProgressListener; - -public class BuildNotifierAdapter implements IProgressListener { - - private BuildProgressMonitor progressMonitor; -// private AjBuildManager buildManager; -// private int numCompilationUnitPasses = 1; -// private int completedPasses = 0; - private boolean cancelRequested = false; - - public BuildNotifierAdapter(BuildProgressMonitor progressMonitor, AjBuildManager buildManager) { - this.progressMonitor = progressMonitor; -// this.buildManager = buildManager; - } - - public void begin() { - progressMonitor.start(Ajde.getDefault().getConfigurationManager().getActiveConfigFile()); - progressMonitor.setProgressText("starting build..."); - } - - public void cancelBuild() { - progressMonitor.setProgressText("cancelling build..."); - cancelRequested = true; - } - - public void setProgress(double percentDone) { - progressMonitor.setProgressBarVal((int)(percentDone * progressMonitor.getProgressBarMax())); - } - - public void setText(String text) { - progressMonitor.setProgressText(text); - } - - public void setCancelledRequested(boolean cancelRequested) { - this.cancelRequested = cancelRequested; - } - - public boolean isCancelledRequested() { - return cancelRequested; - } - -} diff --git a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java deleted file mode 100644 index 94a6232fe..000000000 --- a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java +++ /dev/null @@ -1,683 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC), - * 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * AMC 01.20.2003 extended to support new AspectJ 1.1 options, - * bugzilla #29769 - * ******************************************************************/ - - -package org.aspectj.ajde.internal; - -import java.io.File; -import java.util.*; - -import org.aspectj.ajde.*; -import org.aspectj.ajdt.ajc.*; -import org.aspectj.ajdt.internal.core.builder.*; -import org.aspectj.bridge.*; -import org.aspectj.bridge.context.CompilationAndWeavingContext; -import org.aspectj.util.LangUtil; -//import org.eclipse.core.runtime.OperationCanceledException; -import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions; - -public class CompilerAdapter { - - private static final Set DEFAULT__AJDE_WARNINGS; - - static { - DEFAULT__AJDE_WARNINGS = new HashSet(); - DEFAULT__AJDE_WARNINGS.add(BuildOptionsAdapter.WARN_ASSERT_IDENITIFIER); - DEFAULT__AJDE_WARNINGS.add(BuildOptionsAdapter.WARN_CONSTRUCTOR_NAME); - DEFAULT__AJDE_WARNINGS.add(BuildOptionsAdapter.WARN_DEPRECATION); - DEFAULT__AJDE_WARNINGS.add(BuildOptionsAdapter.WARN_MASKED_CATCH_BLOCKS); - DEFAULT__AJDE_WARNINGS.add(BuildOptionsAdapter.WARN_PACKAGE_DEFAULT_METHOD); - DEFAULT__AJDE_WARNINGS.add(BuildOptionsAdapter.WARN_UNUSED_IMPORTS); -// DEFAULT__AJDE_WARNINGS.put(BuildOptionsAdapter.WARN_); -// DEFAULT__AJDE_WARNINGS.put(BuildOptionsAdapter.WARN_); - } - -// private Map optionsMap; - private AjBuildManager buildManager = null; - private IMessageHandler messageHandler = null; - private BuildNotifierAdapter currNotifier = null; - private boolean initialized = false; - private boolean structureDirty = true; - // set to false in incremental mode to re-do initial build - private boolean nextBuild = false; - - public CompilerAdapter() { - super(); - } - - public void nextBuildFresh() { - if (nextBuild) { - nextBuild = false; - } - } - - public void requestCompileExit() { - if (currNotifier != null) { - currNotifier.cancelBuild(); - } else { - signalText("unable to cancel build process"); - } - } - - public boolean isStructureDirty() { - return structureDirty; - } - - public void setStructureDirty(boolean structureDirty) { - this.structureDirty = structureDirty; - } - - public boolean compile(String configFile, BuildProgressMonitor progressMonitor, boolean buildModel) { - if (configFile == null) { - Ajde.getDefault().getErrorHandler().handleError("Tried to build null config file."); - } - init(); - try { - CompilationAndWeavingContext.reset(); - AjBuildConfig buildConfig = genBuildConfig(configFile); - if (buildConfig == null) { - return false; - } - buildConfig.setGenerateModelMode(buildModel); - currNotifier = new BuildNotifierAdapter(progressMonitor, buildManager); - buildManager.setProgressListener(currNotifier); - - boolean incrementalEnabled = - buildConfig.isIncrementalMode() - || buildConfig.isIncrementalFileMode(); - boolean successfulBuild; - if (incrementalEnabled && nextBuild) { - successfulBuild = buildManager.incrementalBuild(buildConfig, messageHandler); - } else { - if (incrementalEnabled) { - nextBuild = incrementalEnabled; - } - successfulBuild = buildManager.batchBuild(buildConfig, messageHandler); - } - IncrementalStateManager.recordSuccessfulBuild(configFile,buildManager.getState()); - return successfulBuild; -// } catch (OperationCanceledException ce) { -// Ajde.getDefault().getErrorHandler().handleWarning( -// "build cancelled by user"); -// return false; - } catch (AbortException e) { - final IMessage message = e.getIMessage(); - if (message == null) { - signalThrown(e); - } else { - String messageText = message.getMessage() + "\n" + CompilationAndWeavingContext.getCurrentContext(); - Ajde.getDefault().getErrorHandler().handleError(messageText, message.getThrown()); - } - return false; - } catch (Throwable t) { - signalThrown(t); - return false; - } - } - - /** - * Generate AjBuildConfig from the local configFile parameter - * plus global project and build options. - * Errors signalled using signal... methods. - * @param configFile - * @return null if invalid configuration, - * corresponding AjBuildConfig otherwise - */ - public AjBuildConfig genBuildConfig(String configFilePath) { - init(); - File configFile = new File(configFilePath); - if (!configFile.exists()) { - Ajde.getDefault().getErrorHandler().handleError( - "Config file \"" + configFile + "\" does not exist." - ); - return null; - } - String[] args = new String[] { "@" + configFile.getAbsolutePath() }; - CountingMessageHandler handler - = CountingMessageHandler.makeCountingMessageHandler(messageHandler); - BuildArgParser parser = new BuildArgParser(handler); - - AjBuildConfig config = new AjBuildConfig(); - parser.populateBuildConfig(config, args, false, configFile); - configureBuildOptions(config,Ajde.getDefault().getBuildManager().getBuildOptions(),handler); - configureProjectOptions(config, Ajde.getDefault().getProjectProperties()); // !!! not what the API intended - -// // -- get globals, treat as defaults used if no local values -// AjBuildConfig global = new AjBuildConfig(); -// // AMC refactored into two methods to populate buildConfig from buildOptions and -// // project properties - bugzilla 29769. -// BuildOptionsAdapter buildOptions -// = Ajde.getDefault().getBuildManager().getBuildOptions(); -// if (!configureBuildOptions(/* global */ config, buildOptions, handler)) { -// return null; -// } -// ProjectPropertiesAdapter projectOptions = -// Ajde.getDefault().getProjectProperties(); -// configureProjectOptions(global, projectOptions); -// config.installGlobals(global); - - ISourceLocation location = null; - if (config.getConfigFile() != null) { - location = new SourceLocation(config.getConfigFile(), 0); - } - - String message = parser.getOtherMessages(true); - if (null != message) { - IMessage m = new Message(message, IMessage.ERROR, null, location); - handler.handleMessage(m); - } - - // always force model generation in AJDE - config.setGenerateModelMode(true); - if (Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap() != null) { - config.getOptions().set(Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap()); - } - return config; -// return fixupBuildConfig(config); - } - -// /** -// * Fix up build configuration just before using to compile. -// * This should be delegated to a BuildAdapter callback (XXX) -// * for implementation-specific value checks -// * (e.g., to force use of project classpath rather -// * than local config classpath). -// * This implementation does no checks and returns local. -// * @param local the AjBuildConfig generated to validate -// * @param global -// * @param buildOptions -// * @param projectOptions -// * @return null if unable to fix problems or fixed AjBuildConfig if no errors -// * -// */ -// protected AjBuildConfig fixupBuildConfig(AjBuildConfig local) { -// if (Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap() != null) { -// local.getJavaOptions().putAll(Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap()); -// } -// return local; -// } - -// /** signal error text to user */ -// protected void signalError(String text) { - -// } -// /** signal warning text to user */ -// protected void signalWarning(String text) { -// -// } - - /** signal text to user */ - protected void signalText(String text) { - Ajde.getDefault().getIdeUIAdapter().displayStatusInformation(text); - } - - /** signal Throwable to user (summary in GUI, trace to stdout). */ - protected void signalThrown(Throwable t) { // nothing to error handler? - String text = LangUtil.unqualifiedClassName(t) - + " thrown: " - + t.getMessage(); - Ajde.getDefault().getErrorHandler().handleError(text, t); - } - - /** - * Populate options in a build configuration, using the Ajde BuildOptionsAdapter. - * Added by AMC 01.20.2003, bugzilla #29769 - */ - private boolean configureBuildOptions( AjBuildConfig config, BuildOptionsAdapter options, IMessageHandler handler) { - LangUtil.throwIaxIfNull(options, "options"); - LangUtil.throwIaxIfNull(config, "config"); - Map optionsToSet = new HashMap(); - LangUtil.throwIaxIfNull(optionsToSet, "javaOptions"); - - checkNotAskedForJava6Compliance(options); - - if (options.getSourceCompatibilityLevel() != null && options.getSourceCompatibilityLevel().equals(CompilerOptions.VERSION_1_5)) { - optionsToSet.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); - optionsToSet.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); - config.setBehaveInJava5Way(true); - } else if (options.getSourceCompatibilityLevel() != null && options.getSourceCompatibilityLevel().equals(CompilerOptions.VERSION_1_4)) { - optionsToSet.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4); - optionsToSet.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4); - } - - String enc = options.getCharacterEncoding(); - if (!LangUtil.isEmpty(enc)) { - optionsToSet.put(CompilerOptions.OPTION_Encoding, enc ); - } - - String compliance = options.getComplianceLevel(); - if (!LangUtil.isEmpty(compliance)) { - String version = CompilerOptions.VERSION_1_4; - if ( compliance.equals( BuildOptionsAdapter.VERSION_13 ) ) { - version = CompilerOptions.VERSION_1_3; - } else if (compliance.equals(BuildOptionsAdapter.VERSION_15)) { - version = CompilerOptions.VERSION_1_5; - config.setBehaveInJava5Way(true); - } - optionsToSet.put(CompilerOptions.OPTION_Compliance, version ); - optionsToSet.put(CompilerOptions.OPTION_Source, version ); - } - - String sourceLevel = options.getSourceCompatibilityLevel(); - if (!LangUtil.isEmpty(sourceLevel)) { - String slVersion = CompilerOptions.VERSION_1_4; - if ( sourceLevel.equals( BuildOptionsAdapter.VERSION_13 ) ) { - slVersion = CompilerOptions.VERSION_1_3; - } - // never set a lower source level than compliance level - // Mik: prepended with 1.5 check - if (sourceLevel.equals(CompilerOptions.VERSION_1_5)) { - optionsToSet.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); - config.setBehaveInJava5Way(true); - } else { - if (optionsToSet.containsKey(CompilerOptions.OPTION_Compliance)) { - String setCompliance = (String) optionsToSet.get(CompilerOptions.OPTION_Compliance); - if (setCompliance.equals(CompilerOptions.VERSION_1_5)) { - optionsToSet.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); - config.setBehaveInJava5Way(true); - } else if ( ! (setCompliance.equals(CompilerOptions.VERSION_1_4) - && slVersion.equals(CompilerOptions.VERSION_1_3)) ) { - optionsToSet.put(CompilerOptions.OPTION_Source, slVersion); - } - } - } - } - - Set warnings = options.getWarnings(); - if (!LangUtil.isEmpty(warnings)) { - // turn off all warnings - disableWarnings( optionsToSet ); - // then selectively enable those in the set - enableWarnings( optionsToSet, warnings ); - } else if (warnings == null) { - // set default warnings on... - enableWarnings( optionsToSet, DEFAULT__AJDE_WARNINGS); - } - - Set debugOptions = options.getDebugLevel(); - if (!LangUtil.isEmpty(debugOptions)) { - // default is all options on, so just need to selectively - // disable - boolean sourceLine = false; - boolean varAttr = false; - boolean lineNo = false; - Iterator it = debugOptions.iterator(); - while (it.hasNext()){ - String debug = (String) it.next(); - if ( debug.equals( BuildOptionsAdapter.DEBUG_ALL )) { - sourceLine = true; - varAttr = true; - lineNo = true; - } else if ( debug.equals( BuildOptionsAdapter.DEBUG_LINES )) { - lineNo = true; - } else if ( debug.equals( BuildOptionsAdapter.DEBUG_SOURCE )) { - sourceLine = true; - } else if ( debug.equals( BuildOptionsAdapter.DEBUG_VARS)) { - varAttr = true; - } - } - if (sourceLine) optionsToSet.put(CompilerOptions.OPTION_SourceFileAttribute, - CompilerOptions.GENERATE); - if (varAttr) optionsToSet.put(CompilerOptions.OPTION_LocalVariableAttribute, - CompilerOptions.GENERATE); - if (lineNo) optionsToSet.put(CompilerOptions.OPTION_LineNumberAttribute, - CompilerOptions.GENERATE); - } - //XXX we can't turn off import errors in 3.0 stream -// if ( options.getNoImportError() ) { -// javaOptions.put( CompilerOptions.OPTION_ReportInvalidImport, -// CompilerOptions.WARNING); -// } - - if ( options.getPreserveAllLocals() ) { - optionsToSet.put( CompilerOptions.OPTION_PreserveUnusedLocal, - CompilerOptions.PRESERVE); - } - if ( !config.isIncrementalMode() - && options.getIncrementalMode() ) { - config.setIncrementalMode(true); - } - - Map jom = options.getJavaOptionsMap(); - if (jom!=null) { - String version = (String)jom.get(CompilerOptions.OPTION_Compliance); - if (version!=null && version.equals(CompilerOptions.VERSION_1_5)) { - config.setBehaveInJava5Way(true); - } - } - - config.getOptions().set(optionsToSet); - String toAdd = options.getNonStandardOptions(); - return LangUtil.isEmpty(toAdd) - ? true - : configureNonStandardOptions( config, toAdd, handler ); - // ignored: lenient, porting, preprocess, strict, usejavac, workingdir - } - - /** - * Check that the user hasn't specified Java 6 for the compliance, source and - * target levels. If they have then an error is thrown. - */ - private void checkNotAskedForJava6Compliance(BuildOptionsAdapter options) { - // bug 164384 - Throwing an IMessage.ERRROR rather than an IMessage.ABORT - // means that we'll continue to try to compile the code. This means that - // the user may see other errors (for example, if they're using annotations - // then they'll get errors saying that they require 5.0 compliance). - // Throwing IMessage.ABORT would prevent this, however, 'abort' is really - // for compiler exceptions. - String compliance = options.getComplianceLevel(); - if (!LangUtil.isEmpty(compliance) - && compliance.equals(BuildOptionsAdapter.VERSION_16)){ - String msg = "Java 6.0 compliance level is unsupported"; - IMessage m = new Message(msg, IMessage.ERROR, null, null); - messageHandler.handleMessage(m); - return; - } - String source = options.getSourceCompatibilityLevel(); - if (!LangUtil.isEmpty(source) - && source.equals(BuildOptionsAdapter.VERSION_16)){ - String msg = "Java 6.0 source level is unsupported"; - IMessage m = new Message(msg, IMessage.ERROR, null, null); - messageHandler.handleMessage(m); - return; - } - Map javaOptions = options.getJavaOptionsMap(); - if (javaOptions != null){ - String version = (String)javaOptions.get(CompilerOptions.OPTION_Compliance); - String sourceVersion = (String)javaOptions.get(CompilerOptions.OPTION_Source); - String targetVersion = (String)javaOptions.get(CompilerOptions.OPTION_TargetPlatform); - if (version!=null && version.equals(BuildOptionsAdapter.VERSION_16)) { - String msg = "Java 6.0 compliance level is unsupported"; - IMessage m = new Message(msg, IMessage.ERROR, null, null); - messageHandler.handleMessage(m); - } else if (sourceVersion!=null && sourceVersion.equals(BuildOptionsAdapter.VERSION_16)) { - String msg = "Java 6.0 source level is unsupported"; - IMessage m = new Message(msg, IMessage.ERROR, null, null); - messageHandler.handleMessage(m); - } else if (targetVersion!=null && targetVersion.equals(BuildOptionsAdapter.VERSION_16)) { - String msg = "Java 6.0 target level is unsupported"; - IMessage m = new Message(msg, IMessage.ERROR, null, null); - messageHandler.handleMessage(m); - } - } - } - - /** - * Helper method for configureBuildOptions - */ - private static void disableWarnings( Map options ) { - options.put( - CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, - CompilerOptions.IGNORE); - options.put( - CompilerOptions.OPTION_ReportMethodWithConstructorName, - CompilerOptions.IGNORE); - options.put( - CompilerOptions.OPTION_ReportDeprecation, - CompilerOptions.IGNORE); - options.put( - CompilerOptions.OPTION_ReportHiddenCatchBlock, - CompilerOptions.IGNORE); - options.put( - CompilerOptions.OPTION_ReportUnusedLocal, - CompilerOptions.IGNORE); - options.put( - CompilerOptions.OPTION_ReportUnusedParameter, - CompilerOptions.IGNORE); - options.put( - CompilerOptions.OPTION_ReportSyntheticAccessEmulation, - CompilerOptions.IGNORE); - options.put( - CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, - CompilerOptions.IGNORE); - options.put( - CompilerOptions.OPTION_ReportAssertIdentifier, - CompilerOptions.IGNORE); - options.put( - CompilerOptions.OPTION_ReportUnusedImport, - CompilerOptions.IGNORE); - } - - /** - * Helper method for configureBuildOptions - */ - private static void enableWarnings( Map options, Set warnings ) { - Iterator it = warnings.iterator(); - while (it.hasNext() ) { - String thisWarning = (String) it.next(); - if ( thisWarning.equals( BuildOptionsAdapter.WARN_ASSERT_IDENITIFIER )) { - options.put( CompilerOptions.OPTION_ReportAssertIdentifier, - CompilerOptions.WARNING ); - } else if ( thisWarning.equals( BuildOptionsAdapter.WARN_CONSTRUCTOR_NAME )) { - options.put( CompilerOptions.OPTION_ReportMethodWithConstructorName, - CompilerOptions.WARNING ); - } else if ( thisWarning.equals( BuildOptionsAdapter.WARN_DEPRECATION )) { - options.put( CompilerOptions.OPTION_ReportDeprecation, - CompilerOptions.WARNING ); - } else if ( thisWarning.equals( BuildOptionsAdapter.WARN_MASKED_CATCH_BLOCKS )) { - options.put( CompilerOptions.OPTION_ReportHiddenCatchBlock, - CompilerOptions.WARNING ); - } else if ( thisWarning.equals( BuildOptionsAdapter.WARN_PACKAGE_DEFAULT_METHOD )) { - options.put( CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, - CompilerOptions.WARNING ); - } else if ( thisWarning.equals( BuildOptionsAdapter.WARN_SYNTHETIC_ACCESS )) { - options.put( CompilerOptions.OPTION_ReportSyntheticAccessEmulation, - CompilerOptions.WARNING ); - } else if ( thisWarning.equals( BuildOptionsAdapter.WARN_UNUSED_ARGUMENTS )) { - options.put( CompilerOptions.OPTION_ReportUnusedParameter, - CompilerOptions.WARNING ); - } else if ( thisWarning.equals( BuildOptionsAdapter.WARN_UNUSED_IMPORTS )) { - options.put( CompilerOptions.OPTION_ReportUnusedImport, - CompilerOptions.WARNING ); - } else if ( thisWarning.equals( BuildOptionsAdapter.WARN_UNUSED_LOCALS )) { - options.put( CompilerOptions.OPTION_ReportUnusedLocal, - CompilerOptions.WARNING ); - } else if ( thisWarning.equals( BuildOptionsAdapter.WARN_NLS )) { - options.put( CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, - CompilerOptions.WARNING ); - } - } - } - - - /** Local helper method for splitting option strings */ - private static List tokenizeString(String str) { - List tokens = new ArrayList(); - StringTokenizer tok = new StringTokenizer(str); - while ( tok.hasMoreTokens() ) { - tokens.add(tok.nextToken()); - } - return tokens; - } - - /** - * Helper method for configure build options. - * This reads all command-line options specified - * in the non-standard options text entry and - * sets any corresponding unset values in config. - * @return false if config failed - */ - private static boolean configureNonStandardOptions( - AjBuildConfig config, - String nonStdOptions, - IMessageHandler messageHandler ) { - - if (LangUtil.isEmpty(nonStdOptions)) { - return true; - } - - // Break a string into a string array of non-standard options. - // Allows for one option to include a ' '. i.e. assuming it has been quoted, it - // won't accidentally get treated as a pair of options (can be needed for xlint props file option) - List tokens = new ArrayList(); - int ind = nonStdOptions.indexOf('\"'); - int ind2 = nonStdOptions.indexOf('\"',ind+1); - if ((ind > -1) && (ind2 > -1)) { // dont tokenize within double quotes - String pre = nonStdOptions.substring(0,ind); - String quoted = nonStdOptions.substring(ind+1,ind2); - String post = nonStdOptions.substring(ind2+1,nonStdOptions.length()); - tokens.addAll(tokenizeString(pre)); - tokens.add(quoted); - tokens.addAll(tokenizeString(post)); - } else { - tokens.addAll(tokenizeString(nonStdOptions)); - } - String[] args = (String[])tokens.toArray(new String[]{}); - - - // set the non-standard options in an alternate build config - // (we don't want to lose the settings we already have) - CountingMessageHandler counter - = CountingMessageHandler.makeCountingMessageHandler(messageHandler); - AjBuildConfig altConfig = AjdtCommand.genBuildConfig(args, counter); - if (counter.hasErrors()) { - return false; - } - // copy globals where local is not set - config.installGlobals(altConfig); - return true; - } - - /** - * Add new options from the ProjectPropertiesAdapter to the configuration. - * - * Subsequent changes to the ProjectPropertiesAdapter will not affect - * the configuration. - *

Added by AMC 01.20.2003, bugzilla #29769 - */ - private void configureProjectOptions( AjBuildConfig config, ProjectPropertiesAdapter properties ) { - // XXX no error handling in copying project properties - // Handle regular classpath - String propcp = properties.getClasspath(); - if (!LangUtil.isEmpty(propcp)) { - StringTokenizer st = new StringTokenizer(propcp, File.pathSeparator); - List configClasspath = config.getClasspath(); - ArrayList toAdd = new ArrayList(); - while (st.hasMoreTokens()) { - String entry = st.nextToken(); - if (!configClasspath.contains(entry)) { - toAdd.add(entry); - } - } - if (0 < toAdd.size()) { - ArrayList both = new ArrayList(configClasspath.size() + toAdd.size()); - both.addAll(configClasspath); - both.addAll(toAdd); - config.setClasspath(both); - Ajde.getDefault().logEvent("building with classpath: " + both); - } - } - - // Handle boot classpath - propcp = properties.getBootClasspath(); - if (!LangUtil.isEmpty(propcp)) { - StringTokenizer st = new StringTokenizer(propcp, File.pathSeparator); - List configClasspath = config.getBootclasspath(); - ArrayList toAdd = new ArrayList(); - while (st.hasMoreTokens()) { - String entry = st.nextToken(); - if (!configClasspath.contains(entry)) { - toAdd.add(entry); - } - } - if (0 < toAdd.size()) { - ArrayList both = new ArrayList(configClasspath.size() + toAdd.size()); - both.addAll(configClasspath); - both.addAll(toAdd); - config.setBootclasspath(both); - Ajde.getDefault().logEvent("building with boot classpath: " + both); - } - } - - - - // set outputdir and outputjar only if both not set - if ((null == config.getOutputDir() && (null == config.getOutputJar()))) { - String outPath = properties.getOutputPath(); - if (!LangUtil.isEmpty(outPath)) { - config.setOutputDir(new File(outPath)); - } - String outJar = properties.getOutJar(); - if (!LangUtil.isEmpty(outJar)) { - config.setOutputJar(new File( outJar ) ); - } - } - - // set compilation result destination manager if not set - OutputLocationManager outputLocationManager = properties.getOutputLocationManager(); - if (config.getCompilationResultDestinationManager() == null && - outputLocationManager != null) { - config.setCompilationResultDestinationManager(new OutputLocationAdapter(outputLocationManager)); - } - - join(config.getSourceRoots(), properties.getSourceRoots()); - join(config.getInJars(), properties.getInJars()); - join(config.getInpath(),properties.getInpath()); - // bug 168840 - calling 'setInPath(..)' creates BinarySourceFiles which - // are used to see if there have been changes in classes on the inpath - if (config.getInpath() != null) config.setInPath(config.getInpath()); - config.setSourcePathResources(properties.getSourcePathResources()); - join(config.getAspectpath(), properties.getAspectPath()); - } - - void join(Collection target, Collection source) { // XXX dup Util - if ((null == target) || (null == source)) { - return; - } - for (Iterator iter = source.iterator(); iter.hasNext();) { - Object next = iter.next(); - if (! target.contains(next)) { - target.add(next); - } - } - } - - private void init() { - if (!initialized) { // XXX plug into AJDE initialization -// Ajde.getDefault().setErrorHandler(new DebugErrorHandler()); - if (Ajde.getDefault().getMessageHandler() != null) { - this.messageHandler = Ajde.getDefault().getMessageHandler(); - } else { - this.messageHandler = new AjdeMessageHandler(); - } - buildManager = new AjBuildManager(messageHandler); - buildManager.environmentSupportsIncrementalCompilation(true); - // XXX need to remove the properties file each time! - initialized = true; - } - } - - public void setState(AjState buildState) { - init(); - buildManager.setState(buildState); - buildManager.setStructureModel(buildState.getStructureModel()); - } - - public IMessageHandler getMessageHandler() { - if (messageHandler == null) { - init(); - } - return messageHandler; - } - - public boolean wasFullBuild() { - return buildManager.wasFullBuild(); - } -} diff --git a/ajde/src/org/aspectj/ajde/internal/DebugErrorHandler.java b/ajde/src/org/aspectj/ajde/internal/DebugErrorHandler.java deleted file mode 100644 index c218719e1..000000000 --- a/ajde/src/org/aspectj/ajde/internal/DebugErrorHandler.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -package org.aspectj.ajde.internal; - -import org.aspectj.ajde.ErrorHandler; - -public class DebugErrorHandler implements ErrorHandler { - - public void handleWarning(String message) { - System.err.println("> WARNING: " + message); - } - - public void handleError(String errorMessage) { - handleError(errorMessage, null); - } - - public void handleError(String message, Throwable t) { - System.err.println("> ERROR: " + message); - throw (RuntimeException)t; - } -} diff --git a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java index 9c29744e2..1cce301c6 100644 --- a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java +++ b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java @@ -9,6 +9,7 @@ * * Contributors: * Xerox/PARC initial implementation + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -28,6 +29,8 @@ import java.util.TreeSet; import org.aspectj.ajde.Ajde; import org.aspectj.ajde.ui.BuildConfigNode; +import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.Message; import org.aspectj.util.ConfigParser; /** @@ -95,8 +98,9 @@ class LstBuildConfigFileUpdater { try { File configFile = new File(filePath); if (!configFile.exists()) { - Ajde.getDefault().getErrorHandler().handleWarning("Config file: " + filePath + - " does not exist. Update failed."); + Message msg = new Message("Config file: " + filePath + + " does not exist. Update failed.",IMessage.WARNING,null,null); + Ajde.getDefault().getMessageHandler().handleMessage(msg); } List fileContents = new ArrayList(); BufferedReader reader = new BufferedReader(new FileReader(configFile)); @@ -108,7 +112,8 @@ class LstBuildConfigFileUpdater { reader.close(); return fileContents; } catch (IOException ioe) { - Ajde.getDefault().getErrorHandler().handleError("Could not update build config file.", ioe); + Message msg = new Message("Could not update build config file.",IMessage.ERROR,ioe,null); + Ajde.getDefault().getMessageHandler().handleMessage(msg); } return null; } @@ -200,7 +205,8 @@ class LstBuildConfigFileUpdater { fos = new FileOutputStream(filePath, false); fos.write(contents.getBytes()); } catch (IOException ioe) { - Ajde.getDefault().getErrorHandler().handleError("Could not update build config file: " + filePath, ioe); + Message msg = new Message("Could not update build config file: " + filePath,IMessage.ERROR,ioe,null); + Ajde.getDefault().getMessageHandler().handleMessage(msg); } finally { if (fos!=null) try {fos.close();} catch (IOException ioe) {} } diff --git a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigManager.java b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigManager.java index 97a393633..f7d484e4b 100644 --- a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigManager.java +++ b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigManager.java @@ -9,17 +9,27 @@ * * Contributors: * Xerox/PARC initial implementation + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ package org.aspectj.ajde.internal; -import java.io.*; -import java.util.*; +import java.io.File; +import java.io.FileFilter; +import java.io.FilenameFilter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; -import org.aspectj.ajde.*; -import org.aspectj.ajde.ui.*; -import org.aspectj.bridge.*; +import org.aspectj.ajde.Ajde; +import org.aspectj.ajde.ui.BuildConfigModel; +import org.aspectj.ajde.ui.BuildConfigNode; +import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.Message; +import org.aspectj.bridge.SourceLocation; import org.aspectj.util.ConfigParser; import org.aspectj.util.FileUtil; @@ -28,7 +38,7 @@ import org.aspectj.util.FileUtil; */ public class LstBuildConfigManager implements BuildConfigManager { -// private List configFiles = new ArrayList(); + private List allBuildConfigFiles; private List listeners = new ArrayList(); private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater(); protected String currConfigFilePath = null; @@ -67,7 +77,7 @@ public class LstBuildConfigManager implements BuildConfigManager { IMessage.ERROR, pe, new SourceLocation(pe.getFile(), pe.getLine(), 1)); - Ajde.getDefault().getTaskListManager().addSourcelineTask(message); + Ajde.getDefault().getMessageHandler().handleMessage(message); } List relativePaths = relativizeFilePaths(configFiles, rootPath); @@ -245,20 +255,12 @@ public class LstBuildConfigManager implements BuildConfigManager { } public String getActiveConfigFile() { - if (currConfigFilePath == null) return null; - if (currConfigFilePath.equals(DEFAULT_CONFIG_LABEL)) { - return Ajde.getDefault().getProjectProperties().getDefaultBuildConfigFile();// getDefaultConfigFile(); - } else { - return currConfigFilePath; - } + return currConfigFilePath; } public void setActiveConfigFile(String currConfigFilePath) { - if (currConfigFilePath.equals(DEFAULT_CONFIG_LABEL)) { - this.currConfigFilePath = Ajde.getDefault().getProjectProperties().getDefaultBuildConfigFile();//getDefaultConfigFile(); - } else { - this.currConfigFilePath = currConfigFilePath; - } + if (currConfigFilePath == null) return; + this.currConfigFilePath = currConfigFilePath; notifyConfigChanged(); } @@ -298,6 +300,18 @@ public class LstBuildConfigManager implements BuildConfigManager { return n1.getName().compareTo(n2.getName()); } }; + + public List getAllBuildConfigFiles() { + if (allBuildConfigFiles == null) { + allBuildConfigFiles = new ArrayList(); + if (getActiveConfigFile() != null) { + allBuildConfigFiles.add(getActiveConfigFile()); + } + } + return allBuildConfigFiles; + } + + } diff --git a/ajde/src/org/aspectj/ajde/internal/OutputLocationAdapter.java b/ajde/src/org/aspectj/ajde/internal/OutputLocationAdapter.java deleted file mode 100644 index 4ec041feb..000000000 --- a/ajde/src/org/aspectj/ajde/internal/OutputLocationAdapter.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2006 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Adrian Colyer Initial implementation - * ******************************************************************/ -package org.aspectj.ajde.internal; - -import java.io.File; -import java.util.List; - -import org.aspectj.ajde.OutputLocationManager; -import org.aspectj.ajdt.internal.compiler.CompilationResultDestinationManager; - -public class OutputLocationAdapter implements CompilationResultDestinationManager { - - private OutputLocationManager locationManager; - - public OutputLocationAdapter(OutputLocationManager mgr) { - this.locationManager = mgr; - } - - public File getOutputLocationForClass(File compilationUnit) { - return this.locationManager.getOutputLocationForClass(compilationUnit); - } - - public File getOutputLocationForResource(File resource) { - return this.locationManager.getOutputLocationForResource(resource); - } - - public List getAllOutputLocations() { - return this.locationManager.getAllOutputLocations(); - } - - public File getDefaultOutputLocation() { - return this.locationManager.getDefaultOutputLocation(); - } - -} -- 2.39.5