diff --git a/build/org.eclipse.cdt.autotools.core/.settings/org.eclipse.jdt.core.prefs b/build/org.eclipse.cdt.autotools.core/.settings/org.eclipse.jdt.core.prefs index 838bd9d6942..d81c1575a58 100644 --- a/build/org.eclipse.cdt.autotools.core/.settings/org.eclipse.jdt.core.prefs +++ b/build/org.eclipse.cdt.autotools.core/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,10 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve @@ -6,6 +12,89 @@ org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=warning +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.source=1.7 diff --git a/build/org.eclipse.cdt.autotools.core/.settings/org.eclipse.jdt.ui.prefs b/build/org.eclipse.cdt.autotools.core/.settings/org.eclipse.jdt.ui.prefs index 4c7131801a1..c172bfe8233 100644 --- a/build/org.eclipse.cdt.autotools.core/.settings/org.eclipse.jdt.ui.prefs +++ b/build/org.eclipse.cdt.autotools.core/.settings/org.eclipse.jdt.ui.prefs @@ -1,3 +1,61 @@ -#Tue Jan 02 14:11:13 EST 2007 eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true internal.default.compliance=default +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=true +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=false +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true +sp_cleanup.use_type_arguments=false diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsNewProjectNature.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsNewProjectNature.java index 56e31b52d34..a373b52167a 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsNewProjectNature.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsNewProjectNature.java @@ -47,33 +47,21 @@ public class AutotoolsNewProjectNature implements IProjectNature { private IProject project; - /* (non-Javadoc) - * @see org.eclipse.core.resources.IProjectNature#configure() - */ @Override public void configure() throws CoreException { addAutotoolsBuilder(project, new NullProgressMonitor()); } - /* (non-Javadoc) - * @see org.eclipse.core.resources.IProjectNature#deconfigure() - */ @Override public void deconfigure() throws CoreException { // TODO remove builder from here } - /* (non-Javadoc) - * @see org.eclipse.core.resources.IProjectNature#getProject() - */ @Override public IProject getProject() { return project; } - /* (non-Javadoc) - * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject) - */ @Override public void setProject(IProject project) { this.project = project; @@ -161,7 +149,7 @@ public class AutotoolsNewProjectNature implements IProjectNature { static ICommand[] getBuildCommandsList(IProjectDescription description, ICommand[] commands) { - ArrayList commandList = new ArrayList(); + ArrayList commandList = new ArrayList<>(); // Make sure the Autotools Configuration builder just precedes the Common Builder for (int i = 0; i < commands.length; i++) { @@ -257,7 +245,7 @@ public class AutotoolsNewProjectNature implements IProjectNature { public static void removeNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException { IProjectDescription description = project.getDescription(); String[] prevNatures = description.getNatureIds(); - List newNatures = new ArrayList(Arrays.asList(prevNatures)); + List newNatures = new ArrayList<>(Arrays.asList(prevNatures)); newNatures.remove(natureId); description.setNatureIds(newNatures.toArray(new String[newNatures.size()])); project.setDescription(description, monitor); diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsPlugin.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsPlugin.java index 5d27727aff6..090378db347 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsPlugin.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsPlugin.java @@ -83,6 +83,7 @@ public class AutotoolsPlugin extends AbstractUIPlugin { /** * This method is called upon plug-in activation */ + @Override public void start(BundleContext context) throws Exception { super.start(context); } @@ -90,6 +91,7 @@ public class AutotoolsPlugin extends AbstractUIPlugin { /** * This method is called when the plug-in is stopped */ + @Override public void stop(BundleContext context) throws Exception { super.stop(context); plugin = null; @@ -229,6 +231,7 @@ public class AutotoolsPlugin extends AbstractUIPlugin { display = Display.getDefault(); final IStatus fstatus = status; display.asyncExec(new Runnable() { + @Override public void run() { ErrorDialog.openError(null, title, null, fstatus); } diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java index 033a8e185f2..b423fd05f5e 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java @@ -103,7 +103,7 @@ public class AutotoolsConfigurationBuilder extends ACBuilder { } @Override - protected void clean(IProgressMonitor monitor) throws CoreException { + protected void clean(IProgressMonitor monitor) { IProject project = getProject(); final IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject()); if (shouldBuild(CLEAN_BUILD, info)) { @@ -123,7 +123,7 @@ public class AutotoolsConfigurationBuilder extends ACBuilder { } protected MultiStatus performMakefileGeneration(IProject project, IManagedBuildInfo info, - IProgressMonitor monitor) throws CoreException { + IProgressMonitor monitor) { MultiStatus result; try { diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java index 221578fc9df..094e6d1f640 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java @@ -42,14 +42,15 @@ public class AutotoolsEnvironmentVariableSupplier implements IConfigurationEnvir : name.equals(VerboseEnvironmentVariable.VERBOSE_VAR_NAME); } - private static IBuildEnvironmentVariable create(IConfiguration configuration) { + private static IBuildEnvironmentVariable create() { return new VerboseEnvironmentVariable(VERBOSE_VAR_NAME, VERBOSE_VAR_VALUE, IEnvironmentVariable.ENVVAR_PREPEND, null); } } + @Override public IBuildEnvironmentVariable[] getVariables(IConfiguration configuration, IEnvironmentVariableProvider provider) { - IBuildEnvironmentVariable path = VerboseEnvironmentVariable.create(configuration); + IBuildEnvironmentVariable path = VerboseEnvironmentVariable.create(); return new IBuildEnvironmentVariable[] { path }; } @@ -57,7 +58,7 @@ public class AutotoolsEnvironmentVariableSupplier implements IConfigurationEnvir public IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration, IEnvironmentVariableProvider provider) { if (VerboseEnvironmentVariable.isVar(variableName)) { - return VerboseEnvironmentVariable.create(configuration); + return VerboseEnvironmentVariable.create(); } else { return null; } diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java index ade4cc22248..8777ceccd8c 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java @@ -48,7 +48,6 @@ import org.eclipse.cdt.make.core.MakeCorePlugin; import org.eclipse.cdt.make.core.makefile.IMakefile; import org.eclipse.cdt.make.core.makefile.ITarget; import org.eclipse.cdt.make.core.makefile.ITargetRule; -import org.eclipse.cdt.managedbuilder.core.BuildException; import org.eclipse.cdt.managedbuilder.core.IBuilder; import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; @@ -65,7 +64,6 @@ import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.resources.IResourceStatus; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.runtime.CoreException; @@ -80,8 +78,6 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.remote.core.IRemoteConnection; -import org.eclipse.remote.core.IRemoteConnectionControlService; -import org.eclipse.remote.core.IRemoteConnectionPropertyService; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteResource; import org.eclipse.remote.core.IRemoteServicesManager; @@ -130,12 +126,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { private IBuilder builder; - public void generateDependencies() throws CoreException { + public void generateDependencies() { // TODO Auto-generated method stub } - public MultiStatus generateMakefiles(IResourceDelta delta) + public MultiStatus generateMakefiles() throws CoreException { return regenerateMakefiles(false); } @@ -175,12 +171,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { return project; } - public boolean isGeneratedResource(IResource resource) { + public boolean isGeneratedResource() { // TODO Auto-generated method stub return false; } - public void regenerateDependencies(boolean force) throws CoreException { + public void regenerateDependencies() { // TODO Auto-generated method stub } @@ -257,8 +253,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { } private void refresh() throws CoreException{ - IRemoteResource remRes = - (IRemoteResource)getProject().getAdapter(IRemoteResource.class); + IRemoteResource remRes = getProject().getAdapter(IRemoteResource.class); if (remRes != null) { remRes.refresh(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); } @@ -485,12 +480,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { } } - ArrayList configureEnvs = new ArrayList(); - ArrayList configureCmdParms = new ArrayList(); + ArrayList configureEnvs = new ArrayList<>(); + ArrayList configureCmdParms = new ArrayList<>(); IPath configurePath = getConfigurePath(configureEnvs, configureCmdParms); String[] configArgs = getConfigArgs(configureCmdParms); - ArrayList autogenEnvs = new ArrayList(); - ArrayList autogenCmdParms = new ArrayList(); + ArrayList autogenEnvs = new ArrayList<>(); + ArrayList autogenCmdParms = new ArrayList<>(); IPath autogenPath = getAutogenPath(autogenEnvs, autogenCmdParms); // Check if we have a config.status (meaning configure has already run). @@ -841,10 +836,8 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { } // Run a command or executable (e.g. make). - private int runCommand(IPath commandPath, IPath runPath, String[] args, - String jobDescription, String errMsg, IConsole console, - boolean consoleStart) throws BuildException, CoreException, - NullPointerException, IOException { + private int runCommand(IPath commandPath, IPath runPath, String[] args, String jobDescription, String errMsg, + IConsole console, boolean consoleStart) throws CoreException, NullPointerException, IOException { int rc = IStatus.OK; @@ -876,7 +869,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { "MakeGenerator.make.message", msgs)); //$NON-NLS-1$ - ConsoleOutputStream consoleOutStream = null; ErrorParserManager epm = null; StringBuffer buf = new StringBuffer(); @@ -884,8 +876,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { if (consoleStart) console.start(project); - try { - consoleOutStream = console.getOutputStream(); + try (ConsoleOutputStream consoleOutStream = console.getOutputStream()) { String[] consoleHeader = new String[3]; consoleHeader[0] = jobDescription; @@ -906,7 +897,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { IEnvironmentVariable variables[] = CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(cdesc, true); String[] env = null; - ArrayList envList = new ArrayList(); + ArrayList envList = new ArrayList<>(); if (variables != null) { for (int i = 0; i < variables.length; i++) { envList.add(variables[i].getName() @@ -917,7 +908,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { // Hook up an error parser manager URI uri = URIUtil.toURI(runPath); - epm = new ErrorParserManager(project, uri, this, new String[] {ErrorParser.ID}); + epm = new ErrorParserManager(project, uri, this); epm.setOutputStream(consoleOutStream); epm.addErrorParser(ErrorParser.ID, new ErrorParser(getSourcePath(), getBuildPath())); @@ -1018,8 +1009,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { // epm.reportProblems(); } finally { - if (consoleOutStream != null) - consoleOutStream.close(); if (epm != null) epm.close(); } @@ -1044,7 +1033,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { IEnvironmentVariable variables[] = CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(cdesc, true); String[] env = new String[0]; - ArrayList envList = new ArrayList(); + ArrayList envList = new ArrayList<>(); if (variables != null) { for (int i = 0; i < variables.length; i++) { envList.add(variables[i].getName() @@ -1070,8 +1059,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { // Get OS name either remotely or locally, depending on the project private String getOSName() { - IRemoteResource remRes = - (IRemoteResource)getProject().getAdapter(IRemoteResource.class); + IRemoteResource remRes = getProject().getAdapter(IRemoteResource.class); if (remRes != null) { URI uri = remRes.getActiveLocationURI(); IRemoteServicesManager remoteServiceManager = AutotoolsPlugin.getService(IRemoteServicesManager.class); @@ -1121,11 +1109,9 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { } // Run an autotools script (e.g. configure, autogen.sh, config.status). - private int runScript(IPath commandPath, IPath runPath, String[] args, - String jobDescription, String errMsg, IConsole console, - ArrayList additionalEnvs, - boolean consoleStart) throws BuildException, CoreException, - NullPointerException, IOException { + private int runScript(IPath commandPath, IPath runPath, String[] args, String jobDescription, String errMsg, + IConsole console, ArrayList additionalEnvs, boolean consoleStart) + throws CoreException, NullPointerException, IOException { int rc = IStatus.OK; boolean removePWD = false; @@ -1190,7 +1176,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { "MakeGenerator.make.message", msgs)); //$NON-NLS-1$ - ConsoleOutputStream consoleOutStream = null; ErrorParserManager epm = null; StringBuffer buf = new StringBuffer(); @@ -1198,8 +1183,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { if (consoleStart) console.start(project); - try { - consoleOutStream = console.getOutputStream(); + try (ConsoleOutputStream consoleOutStream = console.getOutputStream()) { String[] consoleHeader = new String[3]; consoleHeader[0] = jobDescription; @@ -1234,7 +1218,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { IEnvironmentVariable variables[] = CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(cdesc, true); String[] env = null; - ArrayList envList = new ArrayList(); + ArrayList envList = new ArrayList<>(); if (variables != null) { for (int i = 0; i < variables.length; i++) { // For Windows/Mac, check for PWD environment variable being passed. @@ -1262,7 +1246,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { // Hook up an error parser manager URI uri = URIUtil.toURI(runPath); - epm = new ErrorParserManager(project, uri, this, new String[] {ErrorParser.ID}); + epm = new ErrorParserManager(project, uri, this); epm.setOutputStream(consoleOutStream); epm.addErrorParser(ErrorParser.ID, new ErrorParser(getSourcePath(), getBuildPath())); @@ -1364,8 +1348,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { // .getResourceString(MARKERS)); // epm.reportProblems(); } finally { - if (consoleOutStream != null) - consoleOutStream.close(); if (epm != null) epm.close(); } @@ -1467,7 +1449,10 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { IMakefile makefile = MakeCorePlugin.createMakefile(makefileFile.toURI(), false, null); ITargetRule[] targets = makefile.getTargetRules(); ITarget target = null; - Map makeTargets = new HashMap(); // use a HashMap so duplicate names are handled + Map makeTargets = new HashMap<>(); // use a HashMap + // so duplicate + // names are + // handled String[] id = makeTargetManager.getTargetBuilders(getProject()); if (id.length == 0) { return; @@ -1492,7 +1477,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { for (int i = 0; i < targets.length; i++) { target = targets[i].getTarget(); String targetName = target.toString(); - if (!isValidTarget(targetName, makeTargetManager)) + if (!isValidTarget(targetName)) continue; try { // Bug #351660 - always create a new MakeTarget because an @@ -1505,15 +1490,15 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { makeTarget.setStopOnError(isStopOnError); makeTarget.setRunAllBuilders(false); makeTarget.setUseDefaultBuildCmd(true); - makeTarget.setBuildAttribute(IMakeTarget.BUILD_ARGUMENTS, buildArguments); - makeTarget.setBuildAttribute(IMakeTarget.BUILD_COMMAND, defaultBuildCommand); + makeTarget.setBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, buildArguments); + makeTarget.setBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, defaultBuildCommand); makeTarget.setBuildAttribute(GENERATED_TARGET, "true"); //$NON-NLS-1$ makeTarget.setBuildAttribute(IMakeTarget.BUILD_TARGET, targetName); //TODO: should this be raw build directory in macro form? - makeTarget.setBuildAttribute(IMakeTarget.BUILD_LOCATION, + makeTarget.setBuildAttribute(IMakeCommonBuildInfo.BUILD_LOCATION, buildDir); makeTargets.put(makeTarget.getName(), makeTarget); } catch (CoreException e) { @@ -1523,7 +1508,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { IMakeTarget[] makeTargetArray = new IMakeTarget[makeTargets.size()]; Collection values = makeTargets.values(); - ArrayList valueList = new ArrayList(values); + ArrayList valueList = new ArrayList<>(values); valueList.toArray(makeTargetArray); MakeTargetComparator compareMakeTargets = new MakeTargetComparator(); Arrays.sort(makeTargetArray, compareMakeTargets); @@ -1552,7 +1537,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { saveTargets(makeTargetArray); } - private boolean isValidTarget(String targetName, IMakeTargetManager makeTargetManager) { + private boolean isValidTarget(String targetName) { return !(targetName.endsWith("-am") //$NON-NLS-1$ || targetName.endsWith("PROGRAMS") //$NON-NLS-1$ || targetName.endsWith("-generic") //$NON-NLS-1$ @@ -1565,7 +1550,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { private String[] makeArray(String string) { string = string.trim(); char[] array = string.toCharArray(); - ArrayList aList = new ArrayList(); + ArrayList aList = new ArrayList<>(); StringBuilder buffer = new StringBuilder(); boolean inComment = false; for (int i = 0; i < array.length; i++) { diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java index 49f404a1903..b2db65c21df 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java @@ -25,24 +25,18 @@ import org.eclipse.core.resources.IResource; @SuppressWarnings("deprecation") public class DefaultNoDependencyCalculator implements IManagedDependencyGenerator { - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#findDependencies(org.eclipse.core.resources.IResource, org.eclipse.core.resources.IProject) - */ + @Override public IResource[] findDependencies(IResource resource, IProject project) { // Never answers any dependencies return null; } - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#getCalculatorType() - */ + @Override public int getCalculatorType() { return TYPE_NODEPS; } - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#getDependencyCommand(org.eclipse.core.resources.IResource) - */ + @Override public String getDependencyCommand(IResource resource, IManagedBuildInfo info) { // Never answers this call with an actual value return null; diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java index ffd1ef57133..003513ba588 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java @@ -151,9 +151,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser { if (!file.exists()) return null; - LineNumberReader reader = null; - try { - reader = new LineNumberReader(new FileReader(file)); + try (LineNumberReader reader = new LineNumberReader(new FileReader(file))) { // look for something like: // if test "${ac_cv_prog_WINDRES+set}" = set; then : @@ -184,14 +182,6 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser { } } catch (Exception e) { throw new RuntimeException(e); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - // Ignore. - } - } } return null; diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParserManager.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParserManager.java index af6ffdf2c6c..a07c3129235 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParserManager.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParserManager.java @@ -80,18 +80,7 @@ public class ErrorParserManager extends OutputStream { * @param markerGenerator - marker generator able to create markers. */ public ErrorParserManager(IProject project, MarkerGenerator markerGenerator) { - this(project, markerGenerator, null); - } - - /** - * Constructor. - * - * @param project - project being built. - * @param markerGenerator - marker generator able to create markers. - * @param parsersIDs - array of error parsers' IDs. - */ - public ErrorParserManager(IProject project, MarkerGenerator markerGenerator, String[] parsersIDs) { - this(project, project.getLocationURI(), markerGenerator, parsersIDs); + this(project, project.getLocationURI(), markerGenerator); } @@ -101,15 +90,14 @@ public class ErrorParserManager extends OutputStream { * @param project - project being built. * @param baseDirectoryURI - absolute location URI of working directory of where the build is performed. * @param markerGenerator - marker generator able to create markers. - * @param parsersIDs - array of error parsers' IDs. * @since 5.1 */ - public ErrorParserManager(IProject project, URI baseDirectoryURI, MarkerGenerator markerGenerator, String[] parsersIDs) { + public ErrorParserManager(IProject project, URI baseDirectoryURI, MarkerGenerator markerGenerator) { fProject = project; fMarkerGenerator = markerGenerator; - fDirectoryStack = new Vector(); - fErrors = new ArrayList(); - fErrorParsers = new LinkedHashMap(); + fDirectoryStack = new Vector<>(); + fErrors = new ArrayList<>(); + fErrorParsers = new LinkedHashMap<>(); if (baseDirectoryURI != null) fBaseDirectoryURI = baseDirectoryURI; @@ -364,7 +352,7 @@ public class ErrorParserManager extends OutputStream { * close it explicitly */ @Override - public synchronized void close() throws IOException { + public synchronized void close() { if (nOpens > 0 && --nOpens == 0) { checkLine(true); fDirectoryStack.removeAllElements(); @@ -380,17 +368,14 @@ public class ErrorParserManager extends OutputStream { outputStream.flush(); } - /** - * @see java.io.OutputStream#write(int) - */ @Override - public synchronized void write(int b) throws IOException { + public synchronized void write(int b) { currentLine.append((char) b); checkLine(false); } @Override - public synchronized void write(byte[] b, int off, int len) throws IOException { + public synchronized void write(byte[] b, int off, int len) { if (b == null) { throw new NullPointerException(); } else if (off != 0 || (len < 0) || (len > b.length)) { diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/MarkerResolutionGenerator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/MarkerResolutionGenerator.java index d0b3cbeea60..b8a5c3e0cc2 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/MarkerResolutionGenerator.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/MarkerResolutionGenerator.java @@ -16,6 +16,7 @@ import org.eclipse.ui.IMarkerResolutionGenerator; public class MarkerResolutionGenerator implements IMarkerResolutionGenerator { + @Override public IMarkerResolution[] getResolutions(IMarker marker) { // System.out.println("in marker resolution, library info is " + marker.getAttribute(IAutotoolsMarker.MARKER_LIBRARY_INFO, "")); // String libraryInfo = marker.getAttribute(IAutotoolsMarker.MARKER_LIBRARY_INFO, null); diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java index 125a150a83d..c6714b1c377 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java @@ -42,14 +42,14 @@ public class PkgconfigErrorResolution implements IMarkerResolution { } @Override - public synchronized void write(int c) throws IOException { + public synchronized void write(int c) { byte ascii[] = new byte[1]; ascii[0] = (byte) c; fBuffer.append(new String(ascii)); } @Override - public synchronized void write(byte[] b, int off, int len) throws IOException { + public synchronized void write(byte[] b, int off, int len) { fBuffer.append(new String(b, off, len)); } } diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java index b01d74f8df5..bf9fe1e8933 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java @@ -28,10 +28,12 @@ public abstract class AbstractConfigurationOption implements IConfigureOption { this.cfg = cfg; } + @Override public String getDescription() { return ConfigureMessages.getConfigureDescription(msgName); } + @Override public String getToolTip() { return ConfigureMessages.getConfigureTip(msgName); } @@ -40,6 +42,7 @@ public abstract class AbstractConfigurationOption implements IConfigureOption { return msgName; } + @Override public String getName() { return name; } @@ -48,8 +51,9 @@ public abstract class AbstractConfigurationOption implements IConfigureOption { return cfg; } + @Override public ArrayList getParameters() { - ArrayList parameters = new ArrayList(); + ArrayList parameters = new ArrayList<>(); if (isParmSet()) parameters.add(getParameter()); return parameters; @@ -59,18 +63,22 @@ public abstract class AbstractConfigurationOption implements IConfigureOption { return "--" + getName(); } + @Override public boolean isCategory() { return false; } + @Override public boolean isFlag() { return false; } + @Override public boolean isFlagValue() { return false; } + @Override public boolean isMultiArg() { return false; } diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java index f45d82b32cb..a2b65e5380c 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java @@ -119,7 +119,7 @@ public class AutotoolsConfiguration implements IAConfiguration { private boolean isDirty; private boolean isParmsDirty; private Map configOptions; - private ArrayList configParms = new ArrayList(); + private ArrayList configParms = new ArrayList<>(); public AutotoolsConfiguration(String name) { this(name, true); @@ -127,7 +127,7 @@ public class AutotoolsConfiguration implements IAConfiguration { private AutotoolsConfiguration(String name, boolean initialize) { this.id = name; - configOptions = new HashMap(); + configOptions = new HashMap<>(); if (initialize) initConfigOptions(); isParmsDirty = true; @@ -135,7 +135,7 @@ public class AutotoolsConfiguration implements IAConfiguration { private void initConfigOptions() { // Put configure options in hash map. Ignore categories. - ArrayList