From fc07efa909ea2702da76fe9842d258b96b4bc925 Mon Sep 17 00:00:00 2001 From: Alex Blewitt Date: Fri, 15 Apr 2016 23:41:51 +0100 Subject: [PATCH] Bug 491825 - Remove primitive wrapper creation Using `new Integer` and other wrapper types such as `new Character` results in potential extra heap utilisation as the values are not cached. The built-in `Integer.valueOf` will perform caching on numbers in the range -128..127 (at least) using a flyweight pattern. In addition, parsing `int` values can be done with `Integer.parseInt` which avoids object construction. Adjust tests such as `"true".equals(expr)` to `Boolean.parseBoolean(expr)`. Change-Id: I0408a5c69afc4ca6ede71acaf6cc4abd67538006 Signed-off-by: Alex Blewitt --- .../core/AutotoolsNewMakeGenerator.java | 6 +- .../autotools/ui/editors/automake/Util.java | 4 +- .../make/internal/core/BuildInfoFactory.java | 2 +- .../make/internal/core/ProjectTargets.java | 2 +- .../cdt/make/internal/core/makefile/Util.java | 4 +- .../gnu/GCCPerFileSIPConsoleParser.java | 4 +- .../core/scannerconfig/util/CCommandDSC.java | 4 +- .../dnd/TextTransferDropTargetListener.java | 4 +- .../ui/part/SharedPartWithButtons.java | 4 +- .../cdt/make/ui/views/DeleteTargetAction.java | 4 +- .../core/ManagedBuildManager.java | 4 +- .../buildmodel/ConfigurationBuildState.java | 16 +- .../buildmodel/ProjectBuildState.java | 4 +- .../internal/core/AdditionalInput.java | 20 +- .../managedbuilder/internal/core/Builder.java | 40 ++-- .../internal/core/HoldsOptions.java | 6 +- .../internal/core/InputOrder.java | 4 +- .../internal/core/InputType.java | 20 +- .../internal/core/MultiResourceInfo.java | 2 +- .../managedbuilder/internal/core/Option.java | 93 +++++---- .../internal/core/OptionReference.java | 10 +- .../internal/core/OutputType.java | 38 ++-- .../internal/core/ProjectType.java | 14 +- .../internal/core/ResourceConfiguration.java | 26 +-- .../internal/core/ResourceInfo.java | 6 +- .../managedbuilder/internal/core/Target.java | 10 +- .../internal/core/TargetPlatform.java | 12 +- .../managedbuilder/internal/core/Tool.java | 72 +++---- .../internal/core/ToolChain.java | 28 +-- .../dataprovider/BuildLanguageData.java | 4 +- .../providers/AbstractBuildCommandParser.java | 2 +- .../AbstractBuiltinSpecsDetector.java | 4 +- ...faultGCCDependencyCalculator2Commands.java | 6 +- ...CDependencyCalculatorPreBuildCommands.java | 12 +- .../UpdateManagedProject12.java | 6 +- .../ui/properties/ToolSettingsPrefStore.java | 4 +- .../cdt/codan/core/test/CheckerTestCase.java | 4 +- .../cdt/core/parser/tests/ObjectMapTest.java | 6 +- .../cdt/core/parser/tests/XMLDumper.java | 6 +- .../parser/tests/ast2/AST2TemplateTests.java | 6 +- .../parser/tests/ast2/CharArrayMapTest.java | 32 +-- .../tests/scanner/PortedScannerTests.java | 6 +- .../cdt/internal/pdom/tests/BTreeTests.java | 6 +- .../core/settings/model/util/CDataUtil.java | 6 +- .../core/settings/model/util/SettingsSet.java | 4 +- .../cdt/internal/core/model/ASTCache.java | 4 +- .../cdt/internal/core/model/Binary.java | 2 +- .../internal/core/model/PathEntryUtil.java | 4 +- .../eclipse/cdt/internal/core/model/Util.java | 4 +- .../core/settings/model/CLanguageSetting.java | 4 +- .../model/CProjectDescriptionPreferences.java | 6 +- .../cdt/core/parser/util/CharArrayMap.java | 4 +- .../internal/core/dom/parser/ASTProblem.java | 74 +++---- .../core/index/IndexCPPSignatureUtil.java | 4 +- .../index/provider/IndexProviderManager.java | 4 +- .../scanner/IncludeSearchPathElement.java | 2 +- .../cdt/internal/core/pdom/PDOMManager.java | 12 +- .../cdt/internal/core/pdom/db/BTree.java | 14 +- .../core/pdom/indexer/IndexerPreferences.java | 16 +- .../core/pdom/indexer/PDOMIndexerTask.java | 4 +- .../core/pdom/indexer/TodoTaskUpdater.java | 10 +- .../cdt/internal/core/BuildRunnerHelper.java | 4 +- .../internal/core/PositionTrackerManager.java | 4 +- .../core/parser/ParserLogService.java | 4 +- .../core/resources/ResourceLookupTree.java | 4 +- .../formatter/CodeFormatterVisitor.java | 4 +- .../formatter/scanner/ScannerContext.java | 4 +- .../formatter/scanner/SimpleScanner.java | 186 +++++++++--------- .../utils/org/eclipse/cdt/utils/coff/Exe.java | 28 +-- .../eclipse/cdt/utils/debug/dwarf/Dwarf.java | 18 +- .../cdt/utils/debug/dwarf/DwarfReader.java | 6 +- .../utils/debug/tools/DebugSymsRequestor.java | 4 +- .../org/eclipse/cdt/utils/macho/MachO.java | 6 +- .../org/eclipse/cdt/utils/macho/MachO64.java | 6 +- .../cdt/ui/testplugin/ResourceTestHelper.java | 4 +- .../browser/typeinfo/TypeSelectionDialog.java | 46 ++--- .../corext/codemanipulation/StubUtility.java | 4 +- .../cdt/internal/corext/util/Resources.java | 4 +- .../ui/callhierarchy/CHLabelProvider.java | 6 +- .../eclipse/cdt/internal/ui/cview/CView.java | 8 +- .../ui/dialogs/cpaths/CPElementGroup.java | 8 +- .../ui/editor/SemanticHighlightings.java | 4 +- .../cdt/internal/ui/indexview/IndexView.java | 4 +- .../CEditorHoverConfigurationBlock.java | 4 +- .../formatter/LineWrappingTabPage.java | 22 +-- .../formatter/ModifyDialogTabPage.java | 4 +- .../preferences/formatter/ProfileManager.java | 4 +- .../includes/IncludeOrganizer.java | 3 +- .../cdt/internal/ui/search/CSearchPage.java | 36 ++-- .../ui/search/CSearchTreeLabelProvider.java | 6 +- .../CSearchUnresolvedIncludesQuery.java | 4 +- .../ui/search/CountLabelProvider.java | 4 +- .../ui/text/CParameterListValidator.java | 8 +- .../CompletionProposalComputerRegistry.java | 4 +- .../contentassist/ContentAssistProcessor.java | 4 +- .../DefaultCFoldingStructureProvider.java | 4 +- .../ui/text/spelling/SpellCheckIterator.java | 4 +- .../cdt/internal/ui/viewsupport/IndexUI.java | 6 +- .../BaseClassesListDialogField.java | 12 +- .../MethodStubsListDialogField.java | 12 +- .../TeamProjectIndexExportWizardPage.java | 4 +- .../eclipse/cdt/ui/CElementLabelProvider.java | 4 +- .../ui/actions/CustomFiltersActionGroup.java | 6 +- .../uitree/UIElementTreeBuilderHelper.java | 2 +- .../uitree/uiwidgets/UIBooleanWidget.java | 6 +- .../eclipse/cdt/debug/core/CDIDebugModel.java | 24 +-- .../core/breakpoints/BreakpointProblems.java | 4 +- .../core/breakpoints/CBreakpoint.java | 4 +- .../CDirectorySourceContainerType.java | 4 +- .../CProjectSourceContainerType.java | 4 +- ...mpilationDirectorySourceContainerType.java | 4 +- ...oldersRelativePathSourceContainerType.java | 4 +- .../CBreakpointPreferenceStore.java | 6 +- .../ui/disassembly/dsf/DisassemblyUtils.java | 4 +- .../ui/pinclone/ViewIDCounterManager.java | 6 +- .../ui/tracepoints/TraceControlView.java | 4 +- .../command/GdbCommandTimeoutManager.java | 4 +- .../command/output/MIVarUpdateInfo.java | 6 +- .../dsf/gdb/framework/ServiceEventWaitor.java | 4 +- .../tests/dsf/gdb/launching/TestsPlugin.java | 4 +- .../cdt/tests/dsf/gdb/tests/MIMemoryTest.java | 4 +- .../tests/dsf/gdb/tests/MIRunControlTest.java | 17 +- .../ui/disassembly/DisassemblyPart.java | 4 +- .../ui/viewmodel/VMViewerUpdateTracing.java | 4 +- .../ui/viewmodel/SteppingController.java | 6 +- .../RegisterBitFieldCellModifier.java | 4 +- .../cdt/dsf/internal/ui/DsfUIPlugin.java | 4 +- .../concurrent/ViewerDataRequestMonitor.java | 4 +- .../dsf/ui/viewmodel/AbstractVMProvider.java | 6 +- .../update/AbstractCachingVMProvider.java | 4 +- .../dsf/concurrent/DefaultDsfExecutor.java | 4 +- .../cdt/dsf/concurrent/DsfExecutable.java | 6 +- .../cdt/dsf/concurrent/ImmediateExecutor.java | 4 +- .../debug/service/command/CommandCache.java | 4 +- .../eclipse/cdt/dsf/internal/DsfPlugin.java | 4 +- .../eclipse/cdt/dsf/service/DsfSession.java | 12 +- .../cdt/examples/pdavm/PDAVirtualMachine.java | 4 +- .../cdt/examples/dsf/pda/PDAPlugin.java | 4 +- .../dsf/timers/TriggerCellModifier.java | 4 +- .../cdt/tests/dsf/ViewerUpdatesListener.java | 8 +- ...DsfTestBreakpointAttributeTranslator2.java | 4 +- .../tests/dsf/concurrent/DsfQueryTests.java | 4 +- .../MultiLaunchConfigurationDelegate.java | 4 +- ...ltiLaunchConfigurationSelectionDialog.java | 4 +- .../launch/internal/ui/ProcessPrompter.java | 4 +- .../symboltable/SymbolTableTests.java | 8 +- .../lrparser/action/BuildASTParserAction.java | 6 +- .../ui/memory/search/FindReplaceDialog.java | 4 +- .../internal/qt/core/QmlASTNodeHandler.java | 4 +- .../qt/ui/QObjectConnectCompletion.java | 8 +- 150 files changed, 760 insertions(+), 761 deletions(-) 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 7f880bee707..c017c0bafb2 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2015 Red Hat Inc.and others. + * Copyright (c) 2009, 2016 Red Hat Inc.and others. * 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 @@ -351,7 +351,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { // status = new MultiStatus ( // ManagedBuilderCorePlugin.getUniqueIdentifier(), // IStatus.WARNING, - // new String(), + // "", // null); // // Add a new status for each of the bad folders // iter = getInvalidDirList().iterator(); @@ -367,7 +367,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { // status = new MultiStatus( // ManagedBuilderCorePlugin.getUniqueIdentifier(), // IStatus.OK, - // new String(), + // "", // null); // } diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/Util.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/Util.java index ab821331d77..7bb5b8dd7a6 100644 --- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/Util.java +++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/Util.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -42,7 +42,7 @@ public class Util { } public static int indexOf(String line, char c) { - return indexOf(line, Character.valueOf(c).toString()); + return indexOf(line, String.valueOf(c)); } /** diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java index c44712474cc..edf799e4601 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java index 41a10be49f6..71c6150455b 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Util.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Util.java index 59981f9c00d..d224ae6ab37 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Util.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Util.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -46,7 +46,7 @@ public class Util { } public static int indexOf(String line, char c) { - return indexOf(line, new Character(c).toString()); + return indexOf(line, String.valueOf(c)); } /** diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java index 4f03c75cd85..64e299aad70 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * 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 @@ -76,7 +76,7 @@ public class GCCPerFileSIPConsoleParser implements IScannerInfoConsoleParser { scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, includes); scannerInfo.put(ScannerInfoTypes.QUOTE_INCLUDE_PATHS, quoteIncludes); scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, symbols); - fCollector.contributeToScannerConfig(new Integer(commandId), scannerInfo); + fCollector.contributeToScannerConfig(Integer.valueOf(commandId), scannerInfo); commandId = -1; rc = true; } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java index 2795586ba23..c45d508b7d1 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/CCommandDSC.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * 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 @@ -91,7 +91,7 @@ public class CCommandDSC { } public Integer getCommandIdAsInteger() { - return new Integer(getCommandId()); + return Integer.valueOf(getCommandId()); } /** * @return Returns the commandId. diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java index 3775a33f341..7e438d42735 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Andrew Gvozdev. + * Copyright (c) 2008, 2016 Andrew Gvozdev. * 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 @@ -162,7 +162,7 @@ public class TextTransferDropTargetListener extends AbstractContainerAreaDropAda if (makeTargets.length > 1) { String title = MakeUIPlugin.getResourceString("MakeTargetDnD.title.createFromTextConfirm"); //$NON-NLS-1$ String question = MessageFormat.format(MakeUIPlugin.getResourceString("MakeTargetDnD.message.createFromTextConfirm"), //$NON-NLS-1$ - new Object[] { new Integer(makeTargets.length) }); + new Object[] { Integer.valueOf(makeTargets.length) }); String topTargets = ""; //$NON-NLS-1$ for (int i=0;i> fStateToPathListMap; private Properties fPathToStateProps; @@ -49,7 +49,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState { if(fStateToPathListMap == null) return new IPath[0]; - Set set = fStateToPathListMap.get(new Integer(state)); + Set set = fStateToPathListMap.get(Integer.valueOf(state)); if(set == null) return new IPath[0]; @@ -91,13 +91,13 @@ public class ConfigurationBuildState implements IConfigurationBuildState { fPathToStateProps = new Properties(); fStateToPathListMap = new HashMap>(); } - String strState = stateToString(new Integer(state)); + String strState = stateToString(Integer.valueOf(state)); Integer iState = stateToInt(strState); if(iState == null) throw new IllegalArgumentException(); if(cur != 0){ - Set set = fStateToPathListMap.get(new Integer(cur)); + Set set = fStateToPathListMap.get(Integer.valueOf(cur)); set.remove(str); if(set.size() == 0) fStateToPathListMap.remove(iState); @@ -170,7 +170,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState { private Integer stateToInt(String state){ try { - Integer i = new Integer(state); + Integer i = Integer.valueOf(state); if(i.equals(REBUILD_STATE)) return REBUILD_STATE; if(i.equals(REMOVED_STATE)) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java index 3711184d5ba..ba081f41ffe 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Intel Corporation and others. + * Copyright (c) 2007, 2016 Intel Corporation and others. * 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 @@ -118,7 +118,7 @@ public class ProjectBuildState implements IProjectBuildState { String name = props.getProperty(id); if(name == null){ if(op == OP_CREATE){ - name = new Integer(CDataUtil.genRandomNumber()).toString(); + name = Integer.toString(CDataUtil.genRandomNumber()); props.setProperty(id, name); fIsMapInfoDirty = true; // saveMapFile(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java index 56ec900b249..657fea9bd38 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 Intel Corporation and others. + * Copyright (c) 2005, 2016 Intel Corporation and others. * 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 @@ -135,11 +135,11 @@ public class AdditionalInput implements IAdditionalInput { // Copy the remaining attributes if (additionalInput.fPaths != null) { - fPaths = new String(additionalInput.fPaths); + fPaths = additionalInput.fPaths; } if (additionalInput.fKind != null) { - fKind = new Integer(additionalInput.fKind.intValue()); + fKind = additionalInput.fKind; } setDirty(true); @@ -164,11 +164,11 @@ public class AdditionalInput implements IAdditionalInput { // kind String kindStr = element.getAttribute(IAdditionalInput.KIND); if (kindStr == null || kindStr.equals(ADDITIONAL_INPUT_DEPENDENCY)) { - fKind = new Integer(KIND_ADDITIONAL_INPUT_DEPENDENCY); + fKind = Integer.valueOf(KIND_ADDITIONAL_INPUT_DEPENDENCY); } else if (kindStr.equals(ADDITIONAL_INPUT)) { - fKind = new Integer(KIND_ADDITIONAL_INPUT); + fKind = Integer.valueOf(KIND_ADDITIONAL_INPUT); } else if (kindStr.equals(ADDITIONAL_DEPENDENCY)) { - fKind = new Integer(KIND_ADDITIONAL_DEPENDENCY); + fKind = Integer.valueOf(KIND_ADDITIONAL_DEPENDENCY); } } @@ -189,11 +189,11 @@ public class AdditionalInput implements IAdditionalInput { if (element.getAttribute(IAdditionalInput.KIND) != null) { String kindStr = element.getAttribute(IAdditionalInput.KIND); if (kindStr == null || kindStr.equals(ADDITIONAL_INPUT_DEPENDENCY)) { - fKind = new Integer(KIND_ADDITIONAL_INPUT_DEPENDENCY); + fKind = Integer.valueOf(KIND_ADDITIONAL_INPUT_DEPENDENCY); } else if (kindStr.equals(ADDITIONAL_INPUT)) { - fKind = new Integer(KIND_ADDITIONAL_INPUT); + fKind = Integer.valueOf(KIND_ADDITIONAL_INPUT); } else if (kindStr.equals(ADDITIONAL_DEPENDENCY)) { - fKind = new Integer(KIND_ADDITIONAL_DEPENDENCY); + fKind = Integer.valueOf(KIND_ADDITIONAL_DEPENDENCY); } } } @@ -288,7 +288,7 @@ public class AdditionalInput implements IAdditionalInput { @Override public void setKind(int newKind) { if (fKind == null || !(fKind.intValue() == newKind)) { - fKind = new Integer(newKind); + fKind = Integer.valueOf(newKind); fIsDirty = true; setRebuildState(true); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java index 51fd2d50245..a764145d945 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2013 Intel Corporation and others. + * Copyright (c) 2004, 2016 Intel Corporation and others. * 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 @@ -278,7 +278,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider errorParserIds = builder.errorParserIds; } if (builder.isAbstract != null) { - isAbstract = builder.isAbstract.booleanValue(); + isAbstract = builder.isAbstract; } if (builder.command != null) { command = builder.command; @@ -314,7 +314,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider builderVariablePattern = builder.builderVariablePattern; if (builder.isVariableCaseSensitive != null) - isVariableCaseSensitive = Boolean.valueOf(builder.isVariableCaseSensitive.booleanValue()); + isVariableCaseSensitive = builder.isVariableCaseSensitive; if (builder.reservedMacroNames != null) reservedMacroNames = builder.reservedMacroNames.clone(); @@ -476,7 +476,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider // get the 'isVariableCaseSensitive' attribute String isCS = element.getAttribute(IS_VARIABLE_CASE_SENSITIVE); if(isCS != null) - isVariableCaseSensitive = Boolean.valueOf("true".equals(isCS)); //$NON-NLS-1$ + isVariableCaseSensitive = Boolean.parseBoolean(isCS); // get the reserved macro names String reservedNames = element.getAttribute(RESERVED_MACRO_NAMES); @@ -495,7 +495,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider // isAbstract String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT); if (isAbs != null){ - isAbstract = Boolean.valueOf("true".equals(isAbs)); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(isAbs); } // command @@ -581,7 +581,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider tmp = element.getAttribute(IS_SYSTEM); if(tmp != null) - isTest = Boolean.valueOf(tmp).booleanValue(); + isTest = Boolean.parseBoolean(tmp); IManagedConfigElement[] children = element.getChildren(); for(int i = 0; i < children.length; i++){ @@ -704,7 +704,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider if (element.getAttribute(IProjectType.IS_ABSTRACT) != null) { String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT); if (isAbs != null){ - isAbstract = Boolean.valueOf("true".equals(isAbs)); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(isAbs); } } @@ -1224,12 +1224,12 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider int numEnd = numStart + PARALLEL_PATTERN_NUM.length(); numPrefix = numStr.substring(0, numStart); numSuffix = numStr.substring(numEnd); - resolvedNum = numPrefix + new Integer(num).toString() + numSuffix; + resolvedNum = numPrefix + Integer.toString(num) + numSuffix; } else { resolvedNum = EMPTY_STRING; } } else { - resolvedNum = new Integer(num).toString(); + resolvedNum = Integer.toString(num); } result = prefix + resolvedNum + suffix; } @@ -1328,7 +1328,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider @Override public void setIsAbstract(boolean b) { - isAbstract = Boolean.valueOf(b); + isAbstract = b; setDirty(true); } @@ -1931,7 +1931,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider String updatedArgs = removeCmd(args, curCmd); if(!updatedArgs.equals(args)) setArgumentsAttribute(updatedArgs); - stopOnErr = Boolean.valueOf(on); + stopOnErr = on; } setDirty(true); } @@ -2079,7 +2079,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider @Override public void setAutoBuildEnable(boolean enabled) throws CoreException { - autoBuildEnabled = Boolean.valueOf(enabled); + autoBuildEnabled = enabled; } @Override @@ -2089,7 +2089,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider @Override public void setCleanBuildEnable(boolean enabled) throws CoreException { - cleanBuildEnabled = Boolean.valueOf(enabled); + cleanBuildEnabled = enabled; } @Override @@ -2109,7 +2109,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider @Override public void setIncrementalBuildEnable(boolean enabled) throws CoreException { - incrementalBuildEnabled = Boolean.valueOf(enabled); + incrementalBuildEnabled = enabled; } @Override @@ -2295,7 +2295,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider @Override public void setAppendEnvironment(boolean append) throws CoreException { - appendEnvironment = Boolean.valueOf(append); + appendEnvironment = append; } @Override @@ -2320,7 +2320,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider } else if(BuilderFactory.STOP_ON_ERROR.equals(name)){ stopOnErr = Boolean.valueOf(value); } else if(BuilderFactory.USE_DEFAULT_BUILD_CMD.equals(name)){ - if(value == null || Boolean.valueOf(value).booleanValue()){ + if(value == null || Boolean.parseBoolean(value)){ if(superClass != null) command = null; } @@ -2412,7 +2412,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider @Override public void setManagedBuildOn(boolean on) throws CoreException { - managedBuildOn = Boolean.valueOf(on); + managedBuildOn = on; } @Override @@ -2432,7 +2432,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider @Override public void setKeepEnvironmentVariablesInBuildfile(boolean keep) { - keepEnvVarInBuildfile = Boolean.valueOf(keep); + keepEnvVarInBuildfile = keep; } @Override @@ -2440,9 +2440,9 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider if(fSupportsCustomizedBuild == null){ IManagedBuilderMakefileGenerator makeGen = getBuildFileGenerator(); if(makeGen instanceof IManagedBuilderMakefileGenerator2) - fSupportsCustomizedBuild = Boolean.valueOf(true); + fSupportsCustomizedBuild = true; else - fSupportsCustomizedBuild = Boolean.valueOf(false); + fSupportsCustomizedBuild = false; } return fSupportsCustomizedBuild.booleanValue(); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java index 12b5e750e07..e57ecb9ec16 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 Symbian Ltd and others. + * Copyright (c) 2005, 2016 Symbian Ltd and others. * 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 @@ -582,9 +582,9 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions, String version = ManagedBuildManager.getVersionFromIdAndVersion(newSuperClass.getId()); String baseId = ManagedBuildManager.getIdFromIdAndVersion(newSuperClass.getId()); if ( version != null) { - subId = baseId + ".adjusted." + new Integer(ManagedBuildManager.getRandomNumber()) + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$ + subId = baseId + ".adjusted." + Integer.toString(ManagedBuildManager.getRandomNumber()) + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$ } else { - subId = baseId + ".adjusted." + new Integer(ManagedBuildManager.getRandomNumber()); //$NON-NLS-1$ + subId = baseId + ".adjusted." + Integer.toString(ManagedBuildManager.getRandomNumber()); //$NON-NLS-1$ } setOption = createOption(newSuperClass, subId, null, true); ((Option)setOption).setAdjusted(true); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java index c448e2cf4d9..c2de80fc8cc 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 Intel Corporation and others. + * Copyright (c) 2005, 2016 Intel Corporation and others. * 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 @@ -103,7 +103,7 @@ public class InputOrder implements IInputOrder { } if (inputOrder.fExcluded != null) { - fExcluded = inputOrder.fExcluded.booleanValue(); + fExcluded = inputOrder.fExcluded; } setDirty(true); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java index 14af19f13b3..93927ac1b96 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 Intel Corporation and others. + * Copyright (c) 2005, 2016 Intel Corporation and others. * 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 @@ -52,7 +52,7 @@ import org.osgi.framework.Version; public class InputType extends BuildObject implements IInputType { private static final String DEFAULT_SEPARATOR = ","; //$NON-NLS-1$ - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; //$NON-NLS-1$ // Superclass private IInputType superClass; @@ -262,10 +262,10 @@ public class InputType extends BuildObject implements IInputType { buildVariable = inputType.buildVariable; } if (inputType.multipleOfType != null) { - multipleOfType = inputType.multipleOfType.booleanValue(); + multipleOfType = inputType.multipleOfType; } if (inputType.primaryInput != null) { - primaryInput = inputType.primaryInput.booleanValue(); + primaryInput = inputType.primaryInput; } dependencyGeneratorElement = inputType.dependencyGeneratorElement; dependencyGenerator = inputType.dependencyGenerator; @@ -397,13 +397,13 @@ public class InputType extends BuildObject implements IInputType { // multipleOfType String isMOT = element.getAttribute(IInputType.MULTIPLE_OF_TYPE); if (isMOT != null){ - multipleOfType = Boolean.valueOf("true".equals(isMOT)); //$NON-NLS-1$ + multipleOfType = Boolean.parseBoolean(isMOT); } // primaryInput String isPI = element.getAttribute(IInputType.PRIMARY_INPUT); if (isPI != null){ - primaryInput = Boolean.valueOf("true".equals(isPI)); //$NON-NLS-1$ + primaryInput = Boolean.parseBoolean(isPI); } // buildVariable @@ -577,7 +577,7 @@ public class InputType extends BuildObject implements IInputType { if (element.getAttribute(IInputType.MULTIPLE_OF_TYPE) != null) { String isMOT = element.getAttribute(IInputType.MULTIPLE_OF_TYPE); if (isMOT != null){ - multipleOfType = Boolean.valueOf("true".equals(isMOT)); //$NON-NLS-1$ + multipleOfType = Boolean.parseBoolean(isMOT); } } @@ -585,7 +585,7 @@ public class InputType extends BuildObject implements IInputType { if (element.getAttribute(IInputType.PRIMARY_INPUT) != null) { String isPI = element.getAttribute(IInputType.PRIMARY_INPUT); if (isPI != null){ - primaryInput = Boolean.valueOf("true".equals(isPI)); //$NON-NLS-1$ + primaryInput = Boolean.parseBoolean(isPI); } } @@ -1158,7 +1158,7 @@ public class InputType extends BuildObject implements IInputType { @Override public void setMultipleOfType(boolean b) { if (multipleOfType == null || !(b == multipleOfType.booleanValue())) { - multipleOfType = Boolean.valueOf(b); + multipleOfType = b; setDirty(true); setRebuildState(true); } @@ -1185,7 +1185,7 @@ public class InputType extends BuildObject implements IInputType { @Override public void setPrimaryInput(boolean b) { if (primaryInput == null || !(b == primaryInput.booleanValue())) { - primaryInput = Boolean.valueOf(b); + primaryInput = b; setDirty(true); setRebuildState(true); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java index a7de7046c3a..89cdd9a83f1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Intel Corporation and others. + * Copyright (c) 2007, 2016 Intel Corporation and others. * 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 diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java index cb4ccfbe6b1..c8e9a76f0e4 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2016 IBM Corporation and others. * 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 @@ -50,7 +50,7 @@ import org.osgi.framework.Version; public class Option extends BuildObject implements IOption, IBuildPropertiesRestriction { // Static default return values - public static final String EMPTY_STRING = new String().intern(); + public static final String EMPTY_STRING = ""; public static final String[] EMPTY_STRING_ARRAY = new String[0]; public static final OptionStringValue[] EMPTY_LV_ARRAY = new OptionStringValue[0]; @@ -199,34 +199,34 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest // Copy the remaining attributes if (option.unusedChildren != null) { - unusedChildren = new String(option.unusedChildren); + unusedChildren = option.unusedChildren; } if (option.isAbstract != null) { - isAbstract = Boolean.valueOf(option.isAbstract.booleanValue()); + isAbstract = option.isAbstract; } if (option.command != null) { - command = new String(option.command); + command = option.command; } if (option.commandFalse != null) { - commandFalse = new String(option.commandFalse); + commandFalse = option.commandFalse; } if (option.isForScannerDiscovery != null) { - isForScannerDiscovery = Boolean.valueOf(option.isForScannerDiscovery.booleanValue()); + isForScannerDiscovery = option.isForScannerDiscovery; } if (option.tip != null) { - tip = new String(option.tip); + tip = option.tip; } if (option.contextId != null) { - contextId = new String(option.contextId); + contextId = option.contextId; } if (option.categoryId != null) { - categoryId = new String(option.categoryId); + categoryId = option.categoryId; } if (option.builtIns != null) { builtIns = new ArrayList(option.builtIns); } if (option.browseType != null) { - browseType = new Integer(option.browseType.intValue()); + browseType = option.browseType; } if (option.browseFilterPath != null) { browseFilterPath = option.browseFilterPath; @@ -235,7 +235,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest browseFilterExtensions = option.browseFilterExtensions.clone(); } if (option.resourceFilter != null) { - resourceFilter = new Integer(option.resourceFilter.intValue()); + resourceFilter = option.resourceFilter; } if (option.applicableValuesList != null) { applicableValuesList = new ArrayList(option.applicableValuesList); @@ -247,28 +247,27 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest } if (option.valueType != null) { - valueType = new Integer(option.valueType.intValue()); + valueType = option.valueType; } - Integer vType = null; try { - vType = new Integer(option.getValueType()); - switch (vType.intValue()) { + int vType = option.getValueType(); + switch (vType) { case BOOLEAN: if (option.value != null) { - value = Boolean.valueOf(((Boolean)option.value).booleanValue()); + value = (Boolean)option.value; } if (option.defaultValue != null) { - defaultValue = Boolean.valueOf(((Boolean)option.defaultValue).booleanValue()); + defaultValue = (Boolean)option.defaultValue; } break; case STRING: case ENUMERATED: case TREE: if (option.value != null) { - value = new String((String)option.value); + value = (String)option.value; } if (option.defaultValue != null) { - defaultValue = new String((String)option.defaultValue); + defaultValue = (String)option.defaultValue; } break; case STRING_LIST: @@ -317,14 +316,14 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest valueHandler = option.valueHandler; } if (option.valueHandlerExtraArgument != null) { - valueHandlerExtraArgument = new String(option.valueHandlerExtraArgument); + valueHandlerExtraArgument = option.valueHandlerExtraArgument; } if (option.fieldEditorId != null) { fieldEditorId = option.fieldEditorId; } if (option.fieldEditorExtraArgument != null) { - fieldEditorExtraArgument = new String(option.fieldEditorExtraArgument); + fieldEditorExtraArgument = option.fieldEditorExtraArgument; } if(copyIds){ @@ -364,7 +363,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest // isAbstract String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT); if (isAbs != null){ - isAbstract = Boolean.valueOf("true".equals(isAbs)); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(isAbs); } // Get the command defined for the option @@ -382,7 +381,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest // isForScannerDiscovery String isForSD = element.getAttribute(USE_BY_SCANNER_DISCOVERY); if (isForSD != null){ - isForScannerDiscovery = Boolean.valueOf("true".equals(isForSD)); //$NON-NLS-1$ + isForScannerDiscovery = Boolean.parseBoolean(isForSD); } // Get the tooltip for the option @@ -394,7 +393,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest // Options hold different types of values String valueTypeStr = element.getAttribute(VALUE_TYPE); if (valueTypeStr != null) { - valueType = new Integer(ValueTypeStrToInt(valueTypeStr)); + valueType = Integer.valueOf(ValueTypeStrToInt(valueTypeStr)); } // Note: The value and defaultValue attributes are loaded in the resolveReferences routine. @@ -410,11 +409,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest // which they should be browseType = null; } else if (browseTypeStr.equals(NONE)) { - browseType = new Integer(BROWSE_NONE); + browseType = BROWSE_NONE; } else if (browseTypeStr.equals(FILE)) { - browseType = new Integer(BROWSE_FILE); + browseType = BROWSE_FILE; } else if (browseTypeStr.equals(DIR)) { - browseType = new Integer(BROWSE_DIR); + browseType = BROWSE_DIR; } // Get the browseFilterPath attribute @@ -437,11 +436,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest // which they should be resourceFilter = null; } else if (resFilterStr.equals(ALL)) { - resourceFilter = new Integer(FILTER_ALL); + resourceFilter = FILTER_ALL; } else if (resFilterStr.equals(FILE)) { - resourceFilter = new Integer(FILTER_FILE); + resourceFilter = FILTER_FILE; } else if (resFilterStr.equals(PROJECT)) { - resourceFilter = new Integer(FILTER_PROJECT); + resourceFilter = FILTER_PROJECT; } //get enablements @@ -506,7 +505,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest if (element.getAttribute(IProjectType.IS_ABSTRACT) != null) { String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT); if (isAbs != null){ - isAbstract = Boolean.valueOf("true".equals(isAbs)); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(isAbs); } } @@ -524,7 +523,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest if (element.getAttribute(USE_BY_SCANNER_DISCOVERY) != null) { String isForSD = element.getAttribute(USE_BY_SCANNER_DISCOVERY); if (isForSD != null){ - isForScannerDiscovery = Boolean.valueOf("true".equals(isForSD)); //$NON-NLS-1$ + isForScannerDiscovery = Boolean.parseBoolean(isForSD); } } @@ -541,7 +540,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest // Options hold different types of values if (element.getAttribute(VALUE_TYPE) != null) { String valueTypeStr = element.getAttribute(VALUE_TYPE); - valueType = new Integer(ValueTypeStrToInt(valueTypeStr)); + valueType = Integer.valueOf(ValueTypeStrToInt(valueTypeStr)); } // Now get the actual value based upon value-type @@ -680,11 +679,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest // which they should be browseType = null; } else if (browseTypeStr.equals(NONE)) { - browseType = new Integer(BROWSE_NONE); + browseType = BROWSE_NONE; } else if (browseTypeStr.equals(FILE)) { - browseType = new Integer(BROWSE_FILE); + browseType = BROWSE_FILE; } else if (browseTypeStr.equals(DIR)) { - browseType = new Integer(BROWSE_DIR); + browseType = BROWSE_DIR; } } @@ -718,11 +717,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest // which they should be resourceFilter = null; } else if (resFilterStr.equals(ALL)) { - resourceFilter = new Integer(FILTER_ALL); + resourceFilter = FILTER_ALL; } else if (resFilterStr.equals(FILE)) { - resourceFilter = new Integer(FILTER_FILE); + resourceFilter = FILTER_FILE; } else if (resFilterStr.equals(PROJECT)) { - resourceFilter = new Integer(FILTER_PROJECT); + resourceFilter = FILTER_PROJECT; } } @@ -1277,7 +1276,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest @Override public boolean isForScannerDiscovery() { if (isForScannerDiscovery == null) { - isForScannerDiscovery = Boolean.valueOf(superClass != null && superClass.isForScannerDiscovery()); + isForScannerDiscovery = superClass != null && superClass.isForScannerDiscovery(); } return isForScannerDiscovery; } @@ -1601,7 +1600,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest } switch (valType) { case BOOLEAN: - val = Boolean.valueOf(false); + val = Boolean.FALSE; break; case STRING: case TREE: @@ -1662,7 +1661,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest } switch (valType) { case BOOLEAN: - val = Boolean.valueOf(false); + val = Boolean.FALSE; break; case STRING: case TREE: @@ -1862,7 +1861,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest @Override public void setResourceFilter(int filter) { if (resourceFilter == null || !(filter == resourceFilter.intValue())) { - resourceFilter = new Integer(filter); + resourceFilter = Integer.valueOf(filter); if(!isExtensionElement()){ isDirty = true; rebuildState = true; @@ -1873,7 +1872,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest @Override public void setBrowseType(int type) { if (browseType == null || !(type == browseType.intValue())) { - browseType = new Integer(type); + browseType = Integer.valueOf(type); if(!isExtensionElement()){ isDirty = true; rebuildState = true; @@ -1906,7 +1905,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest @Override public void setValue(boolean value) throws BuildException { if (/*!isExtensionElement() && */getValueType() == BOOLEAN){ - this.value = Boolean.valueOf(value); + this.value = value; } else { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ } @@ -2020,7 +2019,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest public void setValueType(int type) { // TODO: Verify that this is a valid type if (valueType == null || valueType.intValue() != type) { - valueType = new Integer(type); + valueType = Integer.valueOf(type); if(!isExtensionElement()){ setDirty(true); rebuildState = true; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java index 0f5b6ec695b..3a0f28dde79 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2016 IBM Corporation and others. * 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 @@ -354,7 +354,7 @@ public class OptionReference implements IOption { return command; } catch (BuildException e) {} } - return new String(); + return ""; //$NON-NLS-1$ } @Override @@ -368,7 +368,7 @@ public class OptionReference implements IOption { return command; } catch (BuildException e) {} } - return new String(); + return ""; //$NON-NLS-1$ } @Override @@ -679,7 +679,7 @@ public class OptionReference implements IOption { @Override public void setValue(boolean value) throws BuildException { if (getValueType() == BOOLEAN) { - this.value = Boolean.valueOf(value); + this.value = value; } else { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$ @@ -729,7 +729,7 @@ public class OptionReference implements IOption { @Override public String toString() { - String answer = new String(); + String answer = ""; //$NON-NLS-1$ if (option != null) { answer += "Reference to " + option.getName(); //$NON-NLS-1$ } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java index 7cf3cfc78f7..47368e33b3c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 Intel Corporation and others. + * Copyright (c) 2005, 2016 Intel Corporation and others. * 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 @@ -33,7 +33,7 @@ import org.osgi.framework.Version; public class OutputType extends BuildObject implements IOutputType { private static final String DEFAULT_SEPARATOR = ","; //$NON-NLS-1$ - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; //$NON-NLS-1$ // Superclass private IOutputType superClass; @@ -149,7 +149,7 @@ public class OutputType extends BuildObject implements IOutputType { superClass = outputType.superClass; if (superClass != null) { if (outputType.superClassId != null) { - superClassId = new String(outputType.superClassId); + superClassId = outputType.superClassId; } } setId(Id); @@ -159,36 +159,36 @@ public class OutputType extends BuildObject implements IOutputType { // Copy the remaining attributes if (outputType.outputContentTypeId != null) { - outputContentTypeId = new String(outputType.outputContentTypeId); + outputContentTypeId = outputType.outputContentTypeId; } outputContentType = outputType.outputContentType; if (outputType.outputs != null) { - outputs = new String(outputType.outputs); + outputs = outputType.outputs; } if (outputType.optionId != null) { - optionId = new String(outputType.optionId); + optionId = outputType.optionId; } if (outputType.buildVariable != null) { - buildVariable = new String(outputType.buildVariable); + buildVariable = outputType.buildVariable; } if (outputType.multipleOfType != null) { - multipleOfType = Boolean.valueOf(outputType.multipleOfType.booleanValue()); + multipleOfType = outputType.multipleOfType; } if (outputType.primaryInputTypeId != null) { - primaryInputTypeId = new String(outputType.primaryInputTypeId); + primaryInputTypeId = outputType.primaryInputTypeId; } primaryInputType = outputType.primaryInputType; if (outputType.primaryOutput != null) { - primaryOutput = Boolean.valueOf(outputType.primaryOutput.booleanValue()); + primaryOutput = outputType.primaryOutput; } if (outputType.outputPrefix != null) { - outputPrefix = new String(outputType.outputPrefix); + outputPrefix = outputType.outputPrefix; } if (outputType.outputNames != null) { - outputNames = new String(outputType.outputNames); + outputNames = outputType.outputNames; } if (outputType.namePattern != null) { - namePattern = new String(outputType.namePattern); + namePattern = outputType.namePattern; } nameProviderElement = outputType.nameProviderElement; @@ -237,7 +237,7 @@ public class OutputType extends BuildObject implements IOutputType { // multipleOfType String isMOT = element.getAttribute(IOutputType.MULTIPLE_OF_TYPE); if (isMOT != null){ - multipleOfType = Boolean.valueOf("true".equals(isMOT)); //$NON-NLS-1$ + multipleOfType = Boolean.parseBoolean(isMOT); } // primaryInputType @@ -246,7 +246,7 @@ public class OutputType extends BuildObject implements IOutputType { // primaryOutput String isPO = element.getAttribute(IOutputType.PRIMARY_OUTPUT); if (isPO != null){ - primaryOutput = Boolean.valueOf("true".equals(isPO)); //$NON-NLS-1$ + primaryOutput = Boolean.parseBoolean(isPO); } // outputPrefix @@ -312,7 +312,7 @@ public class OutputType extends BuildObject implements IOutputType { if (element.getAttribute(IOutputType.MULTIPLE_OF_TYPE) != null) { String isMOT = element.getAttribute(IOutputType.MULTIPLE_OF_TYPE); if (isMOT != null){ - multipleOfType = Boolean.valueOf("true".equals(isMOT)); //$NON-NLS-1$ + multipleOfType = Boolean.parseBoolean(isMOT); } } @@ -326,7 +326,7 @@ public class OutputType extends BuildObject implements IOutputType { if (element.getAttribute(IOutputType.PRIMARY_OUTPUT) != null) { String isPO = element.getAttribute(IOutputType.PRIMARY_OUTPUT); if (isPO != null){ - primaryOutput = Boolean.valueOf("true".equals(isPO)); //$NON-NLS-1$ + primaryOutput = Boolean.parseBoolean(isPO); } } @@ -510,7 +510,7 @@ public class OutputType extends BuildObject implements IOutputType { @Override public void setMultipleOfType(boolean b) { if (multipleOfType == null || !(b == multipleOfType.booleanValue())) { - multipleOfType = Boolean.valueOf(b); + multipleOfType = b; setDirty(true); setRebuildState(true); } @@ -820,7 +820,7 @@ public class OutputType extends BuildObject implements IOutputType { @Override public void setPrimaryOutput(boolean b) { if (primaryOutput == null || !(b == primaryOutput.booleanValue())) { - primaryOutput = Boolean.valueOf(b); + primaryOutput = b; setDirty(true); setRebuildState(true); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java index 44a11bafa43..a359ae7ff7c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 Intel Corporation and others. + * Copyright (c) 2004, 2016 Intel Corporation and others. * 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 @@ -42,7 +42,7 @@ import org.osgi.framework.Version; public class ProjectType extends BuildObject implements IProjectType, IBuildPropertiesRestriction, IBuildPropertyChangeListener { - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; //$NON-NLS-1$ //private static final IConfiguration[] emptyConfigs = new IConfiguration[0]; // Superclass @@ -187,13 +187,13 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp // isAbstract String isAbs = element.getAttribute(IS_ABSTRACT); if (isAbs != null){ - isAbstract = Boolean.valueOf("true".equals(isAbs)); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(isAbs); } // Is this a test project type String isTestStr = element.getAttribute(IS_TEST); if (isTestStr != null){ - isTest = Boolean.valueOf("true".equals(isTestStr)); //$NON-NLS-1$ + isTest = Boolean.parseBoolean(isTestStr); } // Store the configuration element IFF there is a configuration name provider defined @@ -323,7 +323,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp if (superClass != null) { return (superClass).getNameAttribute(); } else { - return new String(""); //$NON-NLS-1$ + return ""; //$NON-NLS-1$ } } else { return name; @@ -382,14 +382,14 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp */ @Override public void setIsAbstract(boolean b) { - isAbstract = Boolean.valueOf(b); + isAbstract = b; } /** * Sets the isTest attribute */ public void setIsTest(boolean b) { - isTest = Boolean.valueOf(b); + isTest = b; } /* diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java index fdc19621252..3aa2d51f25c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 Intel Corporation and others. + * Copyright (c) 2005, 2016 Intel Corporation and others. * 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 @@ -140,7 +140,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { setDirty(false); toolsToInvoke = EMPTY_STRING; - rcbsApplicability = new Integer(KIND_DISABLE_RCBS_TOOL); + rcbsApplicability = KIND_DISABLE_RCBS_TOOL; // Get file extension. @@ -190,7 +190,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { toolsToInvoke = new String(cloneConfig.toolsToInvoke); } if (cloneConfig.rcbsApplicability != null) { - rcbsApplicability = new Integer(cloneConfig.rcbsApplicability.intValue()); + rcbsApplicability = cloneConfig.rcbsApplicability; } boolean copyIds = cloneChildren && id.equals(cloneConfig.id); @@ -316,7 +316,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { // Copy the remaining attributes toolsToInvoke = baseInfo.toolsToInvoke; - rcbsApplicability = new Integer(KIND_DISABLE_RCBS_TOOL); + rcbsApplicability = KIND_DISABLE_RCBS_TOOL; // Clone the resource configuration's tool children if (baseInfo.toolList != null) { @@ -354,13 +354,13 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { // rcbsApplicability String rcbsApplicabilityStr = element.getAttribute(IResourceConfiguration.RCBS_APPLICABILITY); if (rcbsApplicabilityStr == null || rcbsApplicabilityStr.equals(DISABLE_RCBS_TOOL)) { - rcbsApplicability = new Integer(KIND_DISABLE_RCBS_TOOL); + rcbsApplicability = KIND_DISABLE_RCBS_TOOL; } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_BEFORE)) { - rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_BEFORE); + rcbsApplicability = KIND_APPLY_RCBS_TOOL_BEFORE; } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_AFTER)) { - rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_AFTER); + rcbsApplicability = KIND_APPLY_RCBS_TOOL_AFTER; } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_AS_OVERRIDE)) { - rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_AS_OVERRIDE); + rcbsApplicability = KIND_APPLY_RCBS_TOOL_AS_OVERRIDE; } } @@ -380,13 +380,13 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { if (element.getAttribute(IResourceConfiguration.RCBS_APPLICABILITY) != null) { String rcbsApplicabilityStr = element.getAttribute(IResourceConfiguration.RCBS_APPLICABILITY); if (rcbsApplicabilityStr == null || rcbsApplicabilityStr.equals(DISABLE_RCBS_TOOL)) { - rcbsApplicability = new Integer(KIND_DISABLE_RCBS_TOOL); + rcbsApplicability = KIND_DISABLE_RCBS_TOOL; } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_BEFORE)) { - rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_BEFORE); + rcbsApplicability = KIND_APPLY_RCBS_TOOL_BEFORE; } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_AFTER)) { - rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_AFTER); + rcbsApplicability = KIND_APPLY_RCBS_TOOL_AFTER; } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_AS_OVERRIDE)) { - rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_AS_OVERRIDE); + rcbsApplicability = KIND_APPLY_RCBS_TOOL_AS_OVERRIDE; } } } @@ -694,7 +694,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo { * Choices are before, after, or override other tools, or disable rcbs tool. */ if (rcbsApplicability == null || !(rcbsApplicability.intValue() == newValue)) { - rcbsApplicability = new Integer(newValue); + rcbsApplicability = newValue; setDirty(true); setRebuildState(true); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfo.java index be2ef288ec3..397d0e9dac4 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Intel Corporation and others. + * Copyright (c) 2007, 2016 Intel Corporation and others. * 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 @@ -135,7 +135,7 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo // exclude String excludeStr = element.getAttribute(EXCLUDE); if (excludeStr != null){ - config.setExcluded(getPath(), isFolderInfo(), ("true".equals(excludeStr))); //$NON-NLS-1$ + config.setExcluded(getPath(), isFolderInfo(), (Boolean.parseBoolean(excludeStr))); } } @@ -168,7 +168,7 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo if (element.getAttribute(EXCLUDE) != null) { String excludeStr = element.getAttribute(EXCLUDE); if (excludeStr != null){ - config.setExcluded(getPath(), isFolderInfo(), ("true".equals(excludeStr))); //$NON-NLS-1$ + config.setExcluded(getPath(), isFolderInfo(), (Boolean.parseBoolean(excludeStr))); } } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java index 7e65b2f71a7..c20d2bd9a9a 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2016 IBM Corporation and others. * 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 @@ -103,10 +103,10 @@ public class Target extends BuildObject implements ITarget { defaultExtension = SafeStringInterner.safeIntern(element.getAttribute(DEFAULT_EXTENSION)); // isAbstract - isAbstract = ("true".equals(element.getAttribute(IS_ABSTRACT))); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(element.getAttribute(IS_ABSTRACT)); // Is this a test target - isTest = ("true".equals(element.getAttribute(IS_TEST))); //$NON-NLS-1$ + isTest = Boolean.parseBoolean(element.getAttribute(IS_TEST)); // Get the clean command cleanCommand = SafeStringInterner.safeIntern(element.getAttribute(CLEAN_COMMAND)); @@ -225,11 +225,11 @@ public class Target extends BuildObject implements ITarget { parent = ManagedBuildManager.getTarget(null, parentId); // isAbstract - if ("true".equals(element.getAttribute(IS_ABSTRACT))) //$NON-NLS-1$ + if (Boolean.parseBoolean(element.getAttribute(IS_ABSTRACT))) isAbstract = true; // Is this a test target - isTest = ("true".equals(element.getAttribute(IS_TEST))); //$NON-NLS-1$ + isTest = Boolean.parseBoolean(element.getAttribute(IS_TEST)); // Get the clean command if (element.hasAttribute(CLEAN_COMMAND)) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java index 038548ef009..59286e58709 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 Intel Corporation and others. + * Copyright (c) 2004, 2016 Intel Corporation and others. * 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 @@ -30,7 +30,7 @@ import org.osgi.framework.Version; public class TargetPlatform extends BuildObject implements ITargetPlatform { - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; //$NON-NLS-1$ // Superclass private ITargetPlatform superClass; @@ -156,7 +156,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { errorParserIds = new String(targetPlatform.errorParserIds); } if (targetPlatform.isAbstract != null) { - isAbstract = Boolean.valueOf(targetPlatform.isAbstract.booleanValue()); + isAbstract = targetPlatform.isAbstract; } if (targetPlatform.osList != null) { osList = new ArrayList(targetPlatform.osList); @@ -199,7 +199,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { // isAbstract String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT); if (isAbs != null){ - isAbstract = Boolean.valueOf("true".equals(isAbs)); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(isAbs); } // Get the comma-separated list of valid OS @@ -267,7 +267,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { if (element.getAttribute(IProjectType.IS_ABSTRACT) != null) { String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT); if (isAbs != null){ - isAbstract = Boolean.valueOf("true".equals(isAbs)); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(isAbs); } } @@ -527,7 +527,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform { */ @Override public void setIsAbstract(boolean b) { - isAbstract = Boolean.valueOf(b); + isAbstract = b; setDirty(true); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java index 2c1c3c28d9d..9feba44f1ee 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2016 IBM Corporation and others. * 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 @@ -107,7 +107,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch private static final String DEFAULT_SEPARATOR = ","; //$NON-NLS-1$ //private static final IOptionCategory[] EMPTY_CATEGORIES = new IOptionCategory[0]; //private static final IOption[] EMPTY_OPTIONS = new IOption[0]; - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; //$NON-NLS-1$ private static final String EMPTY_QUOTED_STRING = "\"\""; //$NON-NLS-1$ private static final String[] EMPTY_STRING_ARRAY = new String[0]; private static final String DEFAULT_ANNOUNCEMENT_PREFIX = "Tool.default.announcement"; //$NON-NLS-1$ @@ -396,25 +396,25 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch // Copy the remaining attributes if(tool.versionsSupported != null) { - versionsSupported = new String(tool.versionsSupported); + versionsSupported = tool.versionsSupported; } if(tool.convertToId != null) { - convertToId = new String(tool.convertToId); + convertToId = tool.convertToId; } if (tool.unusedChildren != null) { - unusedChildren = new String(tool.unusedChildren); + unusedChildren = tool.unusedChildren; } if (tool.errorParserIds != null) { - errorParserIds = new String(tool.errorParserIds); + errorParserIds = tool.errorParserIds; } if (tool.isAbstract != null) { - isAbstract = Boolean.valueOf(tool.isAbstract.booleanValue()); + isAbstract = tool.isAbstract; } if (tool.command != null) { - command = new String(tool.command); + command = tool.command; } if (tool.commandLinePattern != null) { - commandLinePattern = new String(tool.commandLinePattern); + commandLinePattern = tool.commandLinePattern; } if (tool.inputExtensions != null) { inputExtensions = new ArrayList(tool.inputExtensions); @@ -423,25 +423,25 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch interfaceExtensions = new ArrayList(tool.interfaceExtensions); } if (tool.natureFilter != null) { - natureFilter = new Integer(tool.natureFilter.intValue()); + natureFilter = tool.natureFilter; } if (tool.outputExtensions != null) { - outputExtensions = new String(tool.outputExtensions); + outputExtensions = tool.outputExtensions; } if (tool.outputFlag != null) { - outputFlag = new String(tool.outputFlag); + outputFlag = tool.outputFlag; } if (tool.outputPrefix != null) { - outputPrefix = new String(tool.outputPrefix); + outputPrefix = tool.outputPrefix; } if (tool.advancedInputCategory != null) { - advancedInputCategory = Boolean.valueOf(tool.advancedInputCategory.booleanValue()); + advancedInputCategory = tool.advancedInputCategory; } if (tool.customBuildStep != null) { - customBuildStep = Boolean.valueOf(tool.customBuildStep.booleanValue()); + customBuildStep = tool.customBuildStep; } if (tool.announcement != null) { - announcement = new String(tool.announcement); + announcement = tool.announcement; } if (tool.isHidden != null) { isHidden = tool.isHidden; @@ -701,7 +701,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch // isAbstract String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT); if (isAbs != null){ - isAbstract = Boolean.valueOf("true".equals(isAbs)); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(isAbs); } // Get the semicolon separated list of IDs of the error parsers @@ -711,13 +711,13 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch String nature = element.getAttribute(NATURE); if (nature != null) { if ("both".equals(nature)) { //$NON-NLS-1$ - natureFilter = new Integer(FILTER_BOTH); + natureFilter = FILTER_BOTH; } else if ("cnature".equals(nature)) { //$NON-NLS-1$ - natureFilter = new Integer(FILTER_C); + natureFilter = FILTER_C; } else if ("ccnature".equals(nature)) { //$NON-NLS-1$ - natureFilter = new Integer(FILTER_CC); + natureFilter = FILTER_CC; } else { - natureFilter = new Integer(FILTER_BOTH); + natureFilter = FILTER_BOTH; } } @@ -757,13 +757,13 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch // Get advancedInputCategory String advInput = element.getAttribute(ITool.ADVANCED_INPUT_CATEGORY); if (advInput != null){ - advancedInputCategory = Boolean.valueOf("true".equals(advInput)); //$NON-NLS-1$ + advancedInputCategory = Boolean.parseBoolean(advInput); } // Get customBuildStep String cbs = element.getAttribute(ITool.CUSTOM_BUILD_STEP); if (cbs != null){ - customBuildStep = Boolean.valueOf("true".equals(cbs)); //$NON-NLS-1$ + customBuildStep = Boolean.parseBoolean(cbs); } // Get the announcement text @@ -842,7 +842,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch if (element.getAttribute(IProjectType.IS_ABSTRACT) != null) { String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT); if (isAbs != null){ - isAbstract = Boolean.valueOf("true".equals(isAbs)); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(isAbs); } } @@ -866,13 +866,13 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch String nature = element.getAttribute(NATURE); if (nature != null) { if ("both".equals(nature)) { //$NON-NLS-1$ - natureFilter = new Integer(FILTER_BOTH); + natureFilter = FILTER_BOTH; } else if ("cnature".equals(nature)) { //$NON-NLS-1$ - natureFilter = new Integer(FILTER_C); + natureFilter = FILTER_C; } else if ("ccnature".equals(nature)) { //$NON-NLS-1$ - natureFilter = new Integer(FILTER_CC); + natureFilter = FILTER_CC; } else { - natureFilter = new Integer(FILTER_BOTH); + natureFilter = FILTER_BOTH; } } } @@ -928,7 +928,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch if (element.getAttribute(ITool.ADVANCED_INPUT_CATEGORY) != null) { String advInput = element.getAttribute(ITool.ADVANCED_INPUT_CATEGORY); if (advInput != null){ - advancedInputCategory = Boolean.valueOf("true".equals(advInput)); //$NON-NLS-1$ + advancedInputCategory = Boolean.parseBoolean(advInput); } } @@ -936,7 +936,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch if (element.getAttribute(ITool.CUSTOM_BUILD_STEP) != null) { String cbs = element.getAttribute(ITool.CUSTOM_BUILD_STEP); if (cbs != null){ - customBuildStep = Boolean.valueOf("true".equals(cbs)); //$NON-NLS-1$ + customBuildStep = Boolean.parseBoolean(cbs); } } @@ -1673,7 +1673,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch */ @Override public void setIsAbstract(boolean b) { - isAbstract = Boolean.valueOf(b); + isAbstract = b; setDirty(true); } @@ -2081,9 +2081,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch return getSuperClass().getCommandLinePattern(); } else { if (getCustomBuildStep()) { - return new String(DEFAULT_CBS_PATTERN); // Default pattern + return DEFAULT_CBS_PATTERN; // Default pattern } else { - return new String(DEFAULT_PATTERN); // Default pattern + return DEFAULT_PATTERN; // Default pattern } } } @@ -2530,7 +2530,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch @Override public void setAdvancedInputCategory(boolean b) { if (advancedInputCategory == null || !(b == advancedInputCategory.booleanValue())) { - advancedInputCategory = Boolean.valueOf(b); + advancedInputCategory = b; setDirty(true); } } @@ -2541,7 +2541,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch @Override public void setCustomBuildStep(boolean b) { if (customBuildStep == null || !(b == customBuildStep.booleanValue())) { - customBuildStep = Boolean.valueOf(b); + customBuildStep = b; setDirty(true); } } @@ -3087,7 +3087,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch } if (found) return ret.trim(); - return (new String(command + values)).trim(); + return (command + values).trim(); } /* (non-Javadoc) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java index 53b3994a521..e7438365ba3 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2013 Intel Corporation and others. + * Copyright (c) 2004, 2016 Intel Corporation and others. * 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 @@ -66,7 +66,7 @@ import org.osgi.framework.Version; public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProvider, IRealBuildObjectAssociation { - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; //$NON-NLS-1$ private static final String REBUILD_STATE = "rebuildState"; //$NON-NLS-1$ @@ -302,7 +302,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv setSuperClassInternal(toolChain.getSuperClass()); if (getSuperClass() != null) { if (toolChain.superClassId != null) { - superClassId = new String(toolChain.superClassId); + superClassId = toolChain.superClassId; } } setId(Id); @@ -316,17 +316,17 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv // Copy the remaining attributes if(toolChain.versionsSupported != null) { - versionsSupported = new String(toolChain.versionsSupported); + versionsSupported = toolChain.versionsSupported; } if(toolChain.convertToId != null) { - convertToId = new String(toolChain.convertToId); + convertToId = toolChain.convertToId; } if (toolChain.unusedChildren != null) { - unusedChildren = new String(toolChain.unusedChildren); + unusedChildren = toolChain.unusedChildren; } if (toolChain.errorParserIds != null) { - errorParserIds = new String(toolChain.errorParserIds); + errorParserIds = toolChain.errorParserIds; } if (toolChain.osList != null) { osList = new ArrayList(toolChain.osList); @@ -335,16 +335,16 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv archList = new ArrayList(toolChain.archList); } if (toolChain.targetToolIds != null) { - targetToolIds = new String(toolChain.targetToolIds); + targetToolIds = toolChain.targetToolIds; } if (toolChain.secondaryOutputIds != null) { - secondaryOutputIds = new String(toolChain.secondaryOutputIds); + secondaryOutputIds = toolChain.secondaryOutputIds; } if (toolChain.isAbstract != null) { - isAbstract = Boolean.valueOf(toolChain.isAbstract.booleanValue()); + isAbstract = toolChain.isAbstract; } if (toolChain.scannerConfigDiscoveryProfileId != null) { - scannerConfigDiscoveryProfileId = new String(toolChain.scannerConfigDiscoveryProfileId); + scannerConfigDiscoveryProfileId = toolChain.scannerConfigDiscoveryProfileId; } isRcTypeBasedDiscovery = toolChain.isRcTypeBasedDiscovery; @@ -545,7 +545,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv // isAbstract String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT); if (isAbs != null){ - isAbstract = Boolean.valueOf("true".equals(isAbs)); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(isAbs); } // Get the semicolon separated list of IDs of the error parsers @@ -665,7 +665,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv if (element.getAttribute(IProjectType.IS_ABSTRACT) != null) { String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT); if (isAbs != null){ - isAbstract = Boolean.valueOf("true".equals(isAbs)); //$NON-NLS-1$ + isAbstract = Boolean.parseBoolean(isAbs); } } @@ -1390,7 +1390,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv @Override public void setIsAbstract(boolean b) { - isAbstract = Boolean.valueOf(b); + isAbstract = b; setDirty(true); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java index b0b305d5364..5553e64d24c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 Intel Corporation and others. + * Copyright (c) 2007, 2016 Intel Corporation and others. * 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 @@ -306,7 +306,7 @@ public class BuildLanguageData extends CLanguageData { /* private IOption[] getOptionsForType(int type){ Map map = getTypeToOptionArrayMap(); - return (IOption[])map.get(new Integer(type)); + return (IOption[])map.get(Integer.valueOf(type)); } */ diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java index daa9a5a80be..955ad3a0486 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java @@ -205,7 +205,7 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting String pattern = template .replace("${COMPILER_PATTERN}", getCompilerPatternExtended()) .replace("${EXTENSIONS_PATTERN}", getPatternFileExtensions()) - .replace("${COMPILER_GROUPS+1}", new Integer(countGroups(getCompilerPatternExtended()) + 1).toString()); + .replace("${COMPILER_GROUPS+1}", Integer.toString(countGroups(getCompilerPatternExtended()) + 1)); return pattern; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java index d27247f9db3..3ed6c149970 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 Andrew Gvozdev and others. + * Copyright (c) 2009, 2016 Andrew Gvozdev and others. * 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 @@ -950,7 +950,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti int result = super.hashCode(); result = prime * result + (isConsoleEnabled ? 1231 : 1237); result = prime * result + (isExecuted ? 1231 : 1237); - result = prime * result + new Long(envPathHash).hashCode(); + result = prime * result + Long.valueOf(envPathHash).hashCode(); return result; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java index c99a08dca26..a4a3e051970 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 Intel Corporation and others. + * Copyright (c) 2006, 2016 Intel Corporation and others. * 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 @@ -117,7 +117,7 @@ public class DefaultGCCDependencyCalculator2Commands implements new FileContextData(sourceLocation, outputLocation, null, tool)).length > 0; - if (needExplicitRuleForFile) genericCommands = Boolean.valueOf(false); + if (needExplicitRuleForFile) genericCommands = false; } /** @@ -156,7 +156,7 @@ public class DefaultGCCDependencyCalculator2Commands implements */ @Override public boolean areCommandsGeneric() { - if (genericCommands == null) genericCommands = Boolean.valueOf(true); + if (genericCommands == null) genericCommands = true; return genericCommands.booleanValue(); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java index 6db504d1714..3d7f0945d21 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 Intel Corporation and others. + * Copyright (c) 2006, 2016 Intel Corporation and others. * 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 @@ -48,7 +48,7 @@ import org.eclipse.core.runtime.IPath; */ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedDependencyPreBuild { - private static final String EMPTY_STRING = new String(); + private static final String EMPTY_STRING = ""; //$NON-NLS-1$ // Member variables set by the constructor IPath source; @@ -121,7 +121,7 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD new FileContextData(sourceLocation, outputLocation, null, tool)).length > 0; - if (needExplicitRuleForFile) genericCommands = Boolean.valueOf(false); + if (needExplicitRuleForFile) genericCommands = false; } /** @@ -158,20 +158,20 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD if (genericCommands != null) return genericCommands.booleanValue(); // If the context is a Configuration, yes if (buildContext instanceof IConfiguration || buildContext instanceof IFolderInfo) { - genericCommands = Boolean.valueOf(true); + genericCommands = true; return true; } // If the context is a Resource Configuration, determine if it overrides any // of its parent configuration's options that would affect dependency file // generation. // TODO - genericCommands = Boolean.valueOf(false); + genericCommands = false; return false; } @Override public String getBuildStepName() { - return new String("GCC_DEPENDS"); //$NON-NLS-1$ + return "GCC_DEPENDS"; //$NON-NLS-1$ } @Override diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java index 6cf70ec0696..d311c6b72a1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2013 Intel Corporation and others. + * Copyright (c) 2004, 2016 Intel Corporation and others. * 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 @@ -201,7 +201,7 @@ class UpdateManagedProject12 { name = "default"; //$NON-NLS-1$ } // Reconstruct the extension - String extension = new String(); + String extension = ""; //$NON-NLS-1$ for (int index = 1; index < nameElements.length; ++index) { extension += nameElements[index]; if (index < nameElements.length - 1) { @@ -322,7 +322,7 @@ class UpdateManagedProject12 { } // Construct the new ID - optId = new String(); + optId = ""; //$NON-NLS-1$ for (int rebuildIndex = 0; rebuildIndex < newIdVector.size(); ++ rebuildIndex) { String token = newIdVector.get(rebuildIndex); optId += token; diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsPrefStore.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsPrefStore.java index 7a5ae729bbb..ca466193066 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsPrefStore.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsPrefStore.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 Intel Corporation and others. + * Copyright (c) 2005, 2016 Intel Corporation and others. * 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 @@ -40,7 +40,7 @@ import org.eclipse.jface.util.PropertyChangeEvent; */ public class ToolSettingsPrefStore implements IPreferenceStore { public static final String DEFAULT_SEPERATOR = ";"; //$NON-NLS-1$ - private final static String EMPTY_STRING = new String(); + private final static String EMPTY_STRING = ""; //$NON-NLS-1$ static ToolSettingsPrefStore store = null; diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CheckerTestCase.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CheckerTestCase.java index e4c2772449c..a4368c09037 100644 --- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CheckerTestCase.java +++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CheckerTestCase.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2015 Alena Laskavaia + * Copyright (c) 2009, 2016 Alena Laskavaia * 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 @@ -111,7 +111,7 @@ public class CheckerTestCase extends CodanTestCase { line = (Integer) m.getAttribute(IMarker.LINE_NUMBER); if (line == null || line.equals(-1)) { Object pos = m.getAttribute(IMarker.CHAR_START); - line = new Integer(pos2line(((Integer) pos).intValue())); + line = pos2line(((Integer) pos).intValue()); } } catch (CoreException e) { fail(e.getMessage()); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ObjectMapTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ObjectMapTest.java index 861475de922..82cd9192eeb 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ObjectMapTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ObjectMapTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2012 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * 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 @@ -142,7 +142,7 @@ public class ObjectMapTest extends TestCase { public void testMapAdd() { CharArrayObjectMap map = new CharArrayObjectMap(4); char[] key1 = "key1".toCharArray(); - Object value1 = new Integer(43); + Integer value1 = 43; map.put(key1, value1); char[] key2 = "key1".toCharArray(); @@ -150,7 +150,7 @@ public class ObjectMapTest extends TestCase { assertEquals(value1, value2); for (int i = 0; i < 25; ++i) { - map.put(("ikey" + i).toCharArray(), new Integer(i)); + map.put(("ikey" + i).toCharArray(), Integer.valueOf(i)); } for (int i = 0; i < 25; ++i) { diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java index f00067acb2a..e4e8bf5b003 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2016 IBM Corporation and others. * 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 @@ -81,8 +81,8 @@ public class XMLDumper { clsName = clsName.replace('$', '.'); Element element = document.createElement(clsName); - map.put(obj, new Integer(id)); - element.setAttribute("id",String.valueOf(id++)); //$NON-NLS-1$ + map.put(obj, Integer.valueOf(id)); + element.setAttribute("id",Integer.toString(id++)); //$NON-NLS-1$ Field [] fields = cls.getDeclaredFields(); for (int i = 0; i < fields.length; ++i) { diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java index a28792b6c10..317c84a4494 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java @@ -6865,8 +6865,8 @@ public class AST2TemplateTests extends AST2TestBase { ICPPSpecialization buffRef = assertionHelper.assertNonProblem("myA.buff[0] = 1;", "buff", ICPPSpecialization.class); assertEquals(buff, buffRef.getSpecializedBinding()); - assertEquals(buffRef.getTemplateParameterMap().getArgument(0).getNonTypeValue().numericalValue(), new Long(4)); - assertEquals(buffRef.getTemplateParameterMap().getArgument(1).getNonTypeValue().numericalValue(), new Long(5)); + assertEquals(Long.valueOf(4),buffRef.getTemplateParameterMap().getArgument(0).getNonTypeValue().numericalValue()); + assertEquals(Long.valueOf(5),buffRef.getTemplateParameterMap().getArgument(1).getNonTypeValue().numericalValue()); } // template @@ -6890,7 +6890,7 @@ public class AST2TemplateTests extends AST2TestBase { assertEquals(buff, buffRef.getSpecializedBinding()); assertSameType(buffRef.getTemplateParameterMap().getArgument(0).getTypeValue(), new CPPBasicType(IBasicType.Kind.eInt, 0)); - assertEquals(buffRef.getTemplateParameterMap().getArgument(1).getNonTypeValue().numericalValue(), new Long(5)); + assertEquals(Long.valueOf(5),buffRef.getTemplateParameterMap().getArgument(1).getNonTypeValue().numericalValue()); } // template diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CharArrayMapTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CharArrayMapTest.java index 31b4b909e4c..e34efd083c7 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CharArrayMapTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CharArrayMapTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * 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 @@ -69,7 +69,7 @@ public class CharArrayMapTest extends TestCase { } assertEquals(keys.length, map.size()); for(int i = 0; i < keys.length; i++) { - assertEquals(new Integer(i), map.get(keys[i])); + assertEquals(Integer.valueOf(i), map.get(keys[i])); } return System.currentTimeMillis() - start; } @@ -78,11 +78,11 @@ public class CharArrayMapTest extends TestCase { long start = System.currentTimeMillis(); CharArrayObjectMap oldMap = new CharArrayObjectMap(keys.length); for(int i = 0; i < keys.length; i++) { - oldMap.put(keys[i], new Integer(i)); + oldMap.put(keys[i], Integer.valueOf(i)); } assertEquals(keys.length, oldMap.size()); for(int i = 0; i < keys.length; i++) { - assertEquals(new Integer(i), oldMap.get(keys[i])); + assertEquals(Integer.valueOf(i), oldMap.get(keys[i])); } return System.currentTimeMillis() - start; } @@ -105,10 +105,10 @@ public class CharArrayMapTest extends TestCase { assertFalse(map.isEmpty()); assertEquals(4, map.size()); - assertEquals(new Integer(1), map.get(key1)); - assertEquals(new Integer(2), map.get(key2)); - assertEquals(new Integer(3), map.get(key3)); - assertEquals(new Integer(4), map.get(key4)); + assertEquals(Integer.valueOf(1), map.get(key1)); + assertEquals(Integer.valueOf(2), map.get(key2)); + assertEquals(Integer.valueOf(3), map.get(key3)); + assertEquals(Integer.valueOf(4), map.get(key4)); assertTrue(map.containsKey(key1)); assertTrue(map.containsKey(key2)); @@ -131,7 +131,7 @@ public class CharArrayMapTest extends TestCase { } // remove a mapping - assertEquals(new Integer(1), map.remove(key1)); + assertEquals(Integer.valueOf(1), map.remove(key1)); assertEquals(3, map.size()); assertNull(map.get(key1)); assertFalse(map.containsKey(key1)); @@ -152,13 +152,13 @@ public class CharArrayMapTest extends TestCase { // overrideing values should map.put(key1, 100); assertEquals(1, map.size()); - assertEquals(new Integer(100), map.get(key1)); + assertEquals(Integer.valueOf(100), map.get(key1)); assertTrue(map.containsValue(100)); assertFalse(map.containsValue(null)); // override the value map.put(key1, 200); assertEquals(1, map.size()); - assertEquals(new Integer(200), map.get(key1)); + assertEquals(Integer.valueOf(200), map.get(key1)); assertTrue(map.containsValue(200)); assertFalse(map.containsValue(100)); } @@ -201,8 +201,8 @@ public class CharArrayMapTest extends TestCase { // should still work with equivalent keys for(int i = 0; i < keys.length; i++) { Slice slice = slices[i]; - assertEquals(new Integer(i), map.get(slice.chars, slice.start, slice.length)); - assertEquals(new Integer(i), map.get(keys[i])); + assertEquals(Integer.valueOf(i), map.get(slice.chars, slice.start, slice.length)); + assertEquals(Integer.valueOf(i), map.get(keys[i])); assertTrue(map.containsKey(slice.chars, slice.start, slice.length)); assertTrue(map.containsKey(keys[i])); assertTrue(map.containsValue(i)); @@ -226,8 +226,8 @@ public class CharArrayMapTest extends TestCase { // remaining keys should still be there for(int i = 0; i < 5; i++) { Slice slice = slices[i]; - assertEquals(new Integer(i), map.get(slice.chars, slice.start, slice.length)); - assertEquals(new Integer(i), map.get(keys[i])); + assertEquals(Integer.valueOf(i), map.get(slice.chars, slice.start, slice.length)); + assertEquals(Integer.valueOf(i), map.get(keys[i])); assertTrue(map.containsKey(slice.chars, slice.start, slice.length)); assertTrue(map.containsKey(keys[i])); assertTrue(map.containsValue(i)); @@ -283,7 +283,7 @@ public class CharArrayMapTest extends TestCase { public void testProperFail() { char[] hello = "hello".toCharArray(); CharArrayMap map = new CharArrayMap(); - Integer value = new Integer(9); + Integer value = 9; try { map.put(null, value); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PortedScannerTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PortedScannerTests.java index 8b335eadb5f..a61ca73fe51 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PortedScannerTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PortedScannerTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2015 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * 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 @@ -142,7 +142,7 @@ public class PortedScannerTests extends PreprocessorTestsBase { } public int symbolValue(int index) { - return new Long(Math.round(Math.pow(index, index))).intValue(); + return Long.valueOf(Math.round(Math.pow(index, index))).intValue(); } public String generateCode() { @@ -190,7 +190,7 @@ public class PortedScannerTests extends PreprocessorTestsBase { public TruthTable(int n) { numberOfVariables = n; - numberOfRows = new Long(Math.round(Math.pow(2, n))).intValue(); + numberOfRows = Long.valueOf(Math.round(Math.pow(2, n))).intValue(); rows = new TableRow[numberOfRows]; for (int i = 0; i < numberOfRows; ++i) { diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/BTreeTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/BTreeTests.java index d71d635ad8d..681d76208d8 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/BTreeTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/BTreeTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 Symbian Software Systems and others. + * Copyright (c) 2006, 2016 Symbian Software Systems and others. * 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 @@ -146,7 +146,7 @@ public class BTreeTests extends BaseTestCase { System.out.print("\t " + seed + " " + (nIterations/1000) + "K: "); for (int i = 0; i < nIterations; i++) { if (random.nextDouble() < pInsert) { - Integer value = new Integer(random.nextInt(Integer.MAX_VALUE)); + Integer value = random.nextInt(Integer.MAX_VALUE); boolean newEntry = expected.add(value); if (newEntry) { BTMockRecord btValue = new BTMockRecord(db, value.intValue()); @@ -160,7 +160,7 @@ public class BTreeTests extends BaseTestCase { int index = random.nextInt(history.size()); BTMockRecord btValue = (BTMockRecord) history.get(index); history.remove(index); - expected.remove(new Integer(btValue.intValue())); + expected.remove(Integer.valueOf(btValue.intValue())); if (DEBUG > 1) System.out.println("Remove: " + btValue.intValue() + " @ " + btValue.record); btree.delete(btValue.getRecord()); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java index c50bb1409c5..409a7a0e35e 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 Intel Corporation and others. + * Copyright (c) 2007, 2016 Intel Corporation and others. * 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 @@ -99,7 +99,7 @@ public class CDataUtil { } public static String genId(String baseId) { - String suffix = new Integer(genRandomNumber()).toString(); + String suffix = Integer.toString(genRandomNumber()); return baseId != null ? new StringBuilder(baseId).append(".").append(suffix).toString() : //$NON-NLS-1$ suffix; @@ -1131,7 +1131,7 @@ public class CDataUtil { } public static void setInteger(ICStorageElement el, String attr, int value) { - el.setAttribute(attr, new Integer(value).toString()); + el.setAttribute(attr, Integer.toString(value)); } public static ICExclusionPatternPathEntry addRemoveExclusionsToEntry(ICExclusionPatternPathEntry entry, IPath[] paths, boolean add) throws IllegalArgumentException{ diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/SettingsSet.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/SettingsSet.java index f13caaaaaf3..86f1d79f61e 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/SettingsSet.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/SettingsSet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 Intel Corporation and others. + * Copyright (c) 2007, 2016 Intel Corporation and others. * 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 @@ -376,7 +376,7 @@ public class SettingsSet { for (EntryInfo info : level.getInfos()) { EntryNameKey key = info.getContentsKey(); if (!map.containsKey(key)) - map.put(key, new Object[]{new Integer(l), info.getEntry()}); + map.put(key, new Object[]{Integer.valueOf(l), info.getEntry()}); } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java index f6a930376f6..28896549900 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 Wind River Systems, Inc. and others. All rights reserved. + * Copyright (c) 2007, 2016 Wind River Systems, Inc. and others. 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 @@ -36,7 +36,7 @@ public class ASTCache { /** * Tells whether this class is in debug mode. */ - private static final boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.cdt.core/debug/ASTCache")); //$NON-NLS-1$//$NON-NLS-2$ + private static final boolean DEBUG= Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.core/debug/ASTCache")); //$NON-NLS-1$ private static final String DEBUG_PREFIX= "[ASTCache] "; //$NON-NLS-1$ /** Fast parse mode (use PDOM) */ diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java index 7816d5657d5..241f1f0eb67 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java index b97e0d3dca5..cdc00259e5c 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -570,7 +570,7 @@ public class PathEntryUtil { try { IMarker marker = project.createMarker(ICModelMarker.PATHENTRY_PROBLEM_MARKER); marker.setAttributes(new String[]{IMarker.MESSAGE, IMarker.SEVERITY, IMarker.LOCATION, - ICModelMarker.PATHENTRY_FILE_FORMAT,}, new Object[]{status.getMessage(), new Integer(severity), "pathentry",//$NON-NLS-1$ + ICModelMarker.PATHENTRY_FILE_FORMAT,}, new Object[]{status.getMessage(), Integer.valueOf(severity), "pathentry",//$NON-NLS-1$ "false",//$NON-NLS-1$ }); } catch (CoreException e) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java index 86bfac18507..095698b0a63 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2013 IBM Corporation and others. + * Copyright (c) 2002, 2016 IBM Corporation and others. * 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 @@ -205,7 +205,7 @@ public class Util implements ICLogConstants { // Time stamp if (addTimeStamp) message = MessageFormat.format("[{0}] {1}", new Object[]{ //$NON-NLS-1$ - new Long(System.currentTimeMillis()), message}); + Long.valueOf(System.currentTimeMillis()), message}); while (message.length() > 100) { String partial = message.substring(0, 100); message = message.substring(100); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java index d0c3f2d5c4c..c08b68a6166 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Intel Corporation and others. + * Copyright (c) 2007, 2016 Intel Corporation and others. * 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 @@ -236,7 +236,7 @@ public class CLanguageSetting extends CDataProxy implements for(int i = 0; i < entries.length; i++){ ICLanguageSettingEntry entry = entries[i]; if(entry != null){ - Integer iKind = new Integer(entry.getKind()); + Integer iKind = Integer.valueOf(entry.getKind()); List[] addedRemovedListArr = (List[])map.get(iKind); if(addedRemovedListArr == null){ addedRemovedListArr = new List[2]; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java index f81c5f74dca..2a203285c8e 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Intel Corporation and others. + * Copyright (c) 2007, 2016 Intel Corporation and others. * 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 @@ -38,7 +38,7 @@ public class CProjectDescriptionPreferences implements ICProjectDescriptionPrefe fIsReadOnly = isReadOnly; if(el != null){ if(el.getAttribute(ATTR_CONFIG_RELATIONS) != null) - fConfigRelations = new Integer(CDataUtil.getInteger(el, ATTR_CONFIG_RELATIONS, DEFAULT_RELATIONS)); + fConfigRelations = Integer.valueOf(CDataUtil.getInteger(el, ATTR_CONFIG_RELATIONS, DEFAULT_RELATIONS)); } this.fSuperPreference = superPreference; @@ -77,7 +77,7 @@ public class CProjectDescriptionPreferences implements ICProjectDescriptionPrefe if(fConfigRelations != null && fConfigRelations.intValue() == status) return; - fConfigRelations = new Integer(status); + fConfigRelations = Integer.valueOf(status); fIsModified = true; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java index aa2d83da1f1..83124b75720 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayMap.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * 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 @@ -35,7 +35,7 @@ import java.util.TreeMap; * * ex: * char[] key = "one two three".toCharArray(); - * map.put(key, 4, 3, new Integer(99)); + * map.put(key, 4, 3, Integer.valueOf(99)); * map.get(key, 4, 3); // returns 99 * map.get("two".toCharArray()); // returns 99 * diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java index be9ca34a82d..3444e4c28d5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2015 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * 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 @@ -30,73 +30,73 @@ public class ASTProblem extends ASTNode implements IASTProblem { protected static final Map errorMessages; static { errorMessages = new HashMap(); - errorMessages.put(new Integer(PREPROCESSOR_POUND_ERROR), + errorMessages.put(Integer.valueOf(PREPROCESSOR_POUND_ERROR), ParserMessages.getString("ScannerProblemFactory.error.preproc.error")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_POUND_WARNING), + errorMessages.put(Integer.valueOf(PREPROCESSOR_POUND_WARNING), ParserMessages.getString("ScannerProblemFactory.error.preproc.warning")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_INCLUSION_NOT_FOUND), + errorMessages.put(Integer.valueOf(PREPROCESSOR_INCLUSION_NOT_FOUND), ParserMessages.getString("ScannerProblemFactory.error.preproc.inclusionNotFound")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_DEFINITION_NOT_FOUND), + errorMessages.put(Integer.valueOf(PREPROCESSOR_DEFINITION_NOT_FOUND), ParserMessages.getString("ScannerProblemFactory.error.preproc.definitionNotFound")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_INVALID_MACRO_DEFN), + errorMessages.put(Integer.valueOf(PREPROCESSOR_INVALID_MACRO_DEFN), ParserMessages.getString("ScannerProblemFactory.error.preproc.invalidMacroDefn")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_INVALID_MACRO_REDEFN), + errorMessages.put(Integer.valueOf(PREPROCESSOR_INVALID_MACRO_REDEFN), ParserMessages.getString("ScannerProblemFactory.error.preproc.invalidMacroRedefn")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_UNBALANCE_CONDITION), + errorMessages.put(Integer.valueOf(PREPROCESSOR_UNBALANCE_CONDITION), ParserMessages.getString("ScannerProblemFactory.error.preproc.unbalancedConditional")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_CONDITIONAL_EVAL_ERROR), + errorMessages.put(Integer.valueOf(PREPROCESSOR_CONDITIONAL_EVAL_ERROR), ParserMessages.getString("ScannerProblemFactory.error.preproc.conditionalEval")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_MACRO_USAGE_ERROR), + errorMessages.put(Integer.valueOf(PREPROCESSOR_MACRO_USAGE_ERROR), ParserMessages.getString("ScannerProblemFactory.error.preproc.macroUsage")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_CIRCULAR_INCLUSION), + errorMessages.put(Integer.valueOf(PREPROCESSOR_CIRCULAR_INCLUSION), ParserMessages.getString("ScannerProblemFactory.error.preproc.circularInclusion")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_INVALID_DIRECTIVE), + errorMessages.put(Integer.valueOf(PREPROCESSOR_INVALID_DIRECTIVE), ParserMessages.getString("ScannerProblemFactory.error.preproc.invalidDirective")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_MACRO_PASTING_ERROR), + errorMessages.put(Integer.valueOf(PREPROCESSOR_MACRO_PASTING_ERROR), ParserMessages.getString("ScannerProblemFactory.error.preproc.macroPasting")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_MISSING_RPAREN_PARMLIST), + errorMessages.put(Integer.valueOf(PREPROCESSOR_MISSING_RPAREN_PARMLIST), ParserMessages.getString("ScannerProblemFactory.error.preproc.missingRParen")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_INVALID_VA_ARGS), + errorMessages.put(Integer.valueOf(PREPROCESSOR_INVALID_VA_ARGS), ParserMessages.getString("ScannerProblemFactory.error.preproc.invalidVaArgs")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_INVALID_ESCAPECHAR), + errorMessages.put(Integer.valueOf(SCANNER_INVALID_ESCAPECHAR), ParserMessages.getString("ScannerProblemFactory.error.scanner.invalidEscapeChar")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_UNBOUNDED_STRING), + errorMessages.put(Integer.valueOf(SCANNER_UNBOUNDED_STRING), ParserMessages.getString("ScannerProblemFactory.error.scanner.unboundedString")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_BAD_FLOATING_POINT), + errorMessages.put(Integer.valueOf(SCANNER_BAD_FLOATING_POINT), ParserMessages.getString("ScannerProblemFactory.error.scanner.badFloatingPoint")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_BAD_BINARY_FORMAT), + errorMessages.put(Integer.valueOf(SCANNER_BAD_BINARY_FORMAT), ParserMessages.getString("ScannerProblemFactory.error.scanner.badBinaryFormat")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_BAD_HEX_FORMAT), + errorMessages.put(Integer.valueOf(SCANNER_BAD_HEX_FORMAT), ParserMessages.getString("ScannerProblemFactory.error.scanner.badHexFormat")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_BAD_OCTAL_FORMAT), + errorMessages.put(Integer.valueOf(SCANNER_BAD_OCTAL_FORMAT), ParserMessages.getString("ScannerProblemFactory.error.scanner.badOctalFormat")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_BAD_DECIMAL_FORMAT), + errorMessages.put(Integer.valueOf(SCANNER_BAD_DECIMAL_FORMAT), ParserMessages.getString("ScannerProblemFactory.error.scanner.badDecimalFormat")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_ASSIGNMENT_NOT_ALLOWED), + errorMessages.put(Integer.valueOf(SCANNER_ASSIGNMENT_NOT_ALLOWED), ParserMessages.getString("ScannerProblemFactory.error.scanner.assignmentNotAllowed")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_DIVIDE_BY_ZERO), + errorMessages.put(Integer.valueOf(SCANNER_DIVIDE_BY_ZERO), ParserMessages.getString("ScannerProblemFactory.error.scanner.divideByZero")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_MISSING_R_PAREN), + errorMessages.put(Integer.valueOf(SCANNER_MISSING_R_PAREN), ParserMessages.getString("ScannerProblemFactory.error.scanner.missingRParen")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_EXPRESSION_SYNTAX_ERROR), + errorMessages.put(Integer.valueOf(SCANNER_EXPRESSION_SYNTAX_ERROR), ParserMessages.getString("ScannerProblemFactory.error.scanner.expressionSyntaxError")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_ILLEGAL_IDENTIFIER), + errorMessages.put(Integer.valueOf(SCANNER_ILLEGAL_IDENTIFIER), ParserMessages.getString("ScannerProblemFactory.error.scanner.illegalIdentifier")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_BAD_CONDITIONAL_EXPRESSION), + errorMessages.put(Integer.valueOf(SCANNER_BAD_CONDITIONAL_EXPRESSION), ParserMessages.getString("ScannerProblemFactory.error.scanner.badConditionalExpression")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_UNEXPECTED_EOF), + errorMessages.put(Integer.valueOf(SCANNER_UNEXPECTED_EOF), ParserMessages.getString("ScannerProblemFactory.error.scanner.unexpectedEOF")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_BAD_CHARACTER), + errorMessages.put(Integer.valueOf(SCANNER_BAD_CHARACTER), ParserMessages.getString("ScannerProblemFactory.error.scanner.badCharacter")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_CONSTANT_WITH_BAD_SUFFIX), + errorMessages.put(Integer.valueOf(SCANNER_CONSTANT_WITH_BAD_SUFFIX), ParserMessages.getString("ScannerProblemFactory.error.scanner.constantWithBadSuffix")); //$NON-NLS-1$ - errorMessages.put(new Integer(SCANNER_FLOAT_WITH_BAD_PREFIX), + errorMessages.put(Integer.valueOf(SCANNER_FLOAT_WITH_BAD_PREFIX), ParserMessages.getString("ScannerProblemFactory.error.scanner.floatWithBadPrefix")); //$NON-NLS-1$ - errorMessages.put(new Integer(PREPROCESSOR_MULTIPLE_USER_DEFINED_SUFFIXES_IN_CONCATENATION), + errorMessages.put(Integer.valueOf(PREPROCESSOR_MULTIPLE_USER_DEFINED_SUFFIXES_IN_CONCATENATION), ParserMessages.getString("ScannerProblemFactory.error.preproc.multipleUserDefinedLiteralSuffixesOnStringLiteral")); //$NON-NLS-1$ - errorMessages.put(new Integer(SYNTAX_ERROR), + errorMessages.put(Integer.valueOf(SYNTAX_ERROR), ParserMessages.getString("ParserProblemFactory.error.syntax.syntaxError")); //$NON-NLS-1$ - errorMessages.put(new Integer(MISSING_SEMICOLON), + errorMessages.put(Integer.valueOf(MISSING_SEMICOLON), ParserMessages.getString("ParserProblemFactory.error.syntax.missingSemicolon")); //$NON-NLS-1$ } @@ -154,12 +154,12 @@ public class ASTProblem extends ASTNode implements IASTProblem { char[] file= getOriginatingFileName(); int line= getSourceLineNumber(); - Object[] args = new Object[] { msg, new String(file), new Integer(line) }; + Object[] args = new Object[] { msg, new String(file), Integer.valueOf(line) }; return ParserMessages.getFormattedString("BaseProblemFactory.problemPattern", args); //$NON-NLS-1$ } public static String getMessage(int id, String arg) { - String msg = errorMessages.get(new Integer(id)); + String msg = errorMessages.get(Integer.valueOf(id)); if (msg == null) msg = ""; //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexCPPSignatureUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexCPPSignatureUtil.java index 9538740a805..b2befabaa8a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexCPPSignatureUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexCPPSignatureUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 QNX Software Systems and others. + * Copyright (c) 2007, 2016 QNX Software Systems and others. * 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 @@ -157,7 +157,7 @@ public class IndexCPPSignatureUtil { */ public static Integer getSignatureHash(IBinding binding) throws CoreException, DOMException { String sig = getSignature(binding); - return sig.length() == 0 ? null : new Integer(sig.hashCode()); + return sig.length() == 0 ? null : Integer.valueOf(sig.hashCode()); } /** diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java index eac8c6547e6..eee33db5c2c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/IndexProviderManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 Symbian Software Systems and others. + * Copyright (c) 2007, 2016 Symbian Software Systems and others. * 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 @@ -178,7 +178,7 @@ public final class IndexProviderManager implements IElementChangedListener { } public int getOption(IConfigurationElement elem, String attributeName, int option) { - if ("true".equals(elem.getAttribute(attributeName))) //$NON-NLS-1$ + if (Boolean.parseBoolean(elem.getAttribute(attributeName))) return option; return 0; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/IncludeSearchPathElement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/IncludeSearchPathElement.java index 2e29986de34..c1d82aac1c7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/IncludeSearchPathElement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/IncludeSearchPathElement.java @@ -153,4 +153,4 @@ public final class IncludeSearchPathElement { public String toString() { return fPath; } -} \ No newline at end of file +} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java index 7d76534f521..0defa1bad1a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 QNX Software Systems and others. + * Copyright (c) 2005, 2016 QNX Software Systems and others. * 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 @@ -197,7 +197,7 @@ public class PDOMManager implements IWritableIndexManager, IListener { boolean fTraceIndexerSetup; public PDOMManager() { - PDOM.sDEBUG_LOCKS= "true".equals(Platform.getDebugOption(CCorePlugin.PLUGIN_ID + "/debug/index/locks")); //$NON-NLS-1$//$NON-NLS-2$ + PDOM.sDEBUG_LOCKS= Boolean.parseBoolean(Platform.getDebugOption(CCorePlugin.PLUGIN_ID + "/debug/index/locks")); //$NON-NLS-1$ addIndexerSetupParticipant(new WaitForRefreshJobs()); fProjectDescriptionListener= new CProjectDescriptionListener(this); fJobChangeListener= new JobChangeListener(this); @@ -596,7 +596,7 @@ public class PDOMManager implements IWritableIndexManager, IListener { boolean resume= false; pdom.acquireReadLock(); try { - resume= "true".equals(pdom.getProperty(IIndexFragment.PROPERTY_RESUME_INDEXER)); //$NON-NLS-1$ + resume= Boolean.parseBoolean(pdom.getProperty(IIndexFragment.PROPERTY_RESUME_INDEXER)); } finally { pdom.releaseReadLock(); } @@ -1185,8 +1185,8 @@ public class PDOMManager implements IWritableIndexManager, IListener { } String msg= MessageFormat.format(Messages.PDOMManager_indexMonitorDetail, new Object[] { - new Integer(sourceCount), new Integer(sourceEstimate), - new Integer(headerCount)}); + Integer.valueOf(sourceCount), Integer.valueOf(sourceEstimate), + Integer.valueOf(headerCount)}); if (detail != null) { msg += ": " + detail; //$NON-NLS-1$ } @@ -1557,7 +1557,7 @@ public class PDOMManager implements IWritableIndexManager, IListener { * @throws CoreException in case of a file access or other internal error */ public IStatus getProjectContentSyncState(ICProject cproject) throws CoreException { - if (!"true".equals(IndexerPreferences.get(cproject.getProject(), IndexerPreferences.KEY_INDEX_ALL_FILES, null))) //$NON-NLS-1$ + if (!Boolean.parseBoolean(IndexerPreferences.get(cproject.getProject(), IndexerPreferences.KEY_INDEX_ALL_FILES, null))) return null; // No check is performed in this case Set sources= new HashSet<>(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/BTree.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/BTree.java index d5cd7bb889c..5061685cc3b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/BTree.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/BTree.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 QNX Software Systems and others. + * Copyright (c) 2005, 2016 QNX Software Systems and others. * 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 @@ -314,7 +314,7 @@ public class BTree { } throw new BTreeKeyNotFoundException( MessageFormat.format(Messages.getString("BTree.DeletionOnAbsentKey"), //$NON-NLS-1$ - new Object[] { new Long(key), new Integer(mode) })); + new Object[] { Long.valueOf(key), Integer.valueOf(mode) })); } } else { if (keyIndexInNode != -1) { @@ -407,7 +407,7 @@ public class BTree { throw new BTreeKeyNotFoundException( MessageFormat.format(Messages.getString("BTree.DeletionOnAbsentKey"), //$NON-NLS-1$ - new Object[]{new Long(key), new Integer(mode)})); + new Object[]{Long.valueOf(key), Integer.valueOf(mode)})); } } } @@ -664,14 +664,14 @@ public class BTree { if (!full && !empty) { valid = false; msg += MessageFormat.format(Messages.getString("BTree.IntegrityErrorA"), //$NON-NLS-1$ - new Object[] { new Long(node), new Integer(indexFirstBlankKey), new Integer(indexLastNonBlankKey) }); + new Object[] { Long.valueOf(node), Integer.valueOf(indexFirstBlankKey), Integer.valueOf(indexLastNonBlankKey) }); } } // Check: Key number constrains child numbers if (childCount != 0 && childCount != keyCount + 1) { valid = false; - msg += MessageFormat.format(Messages.getString("BTree.IntegrityErrorB"), new Object[] { new Long(node) }); //$NON-NLS-1$ + msg += MessageFormat.format(Messages.getString("BTree.IntegrityErrorB"), new Object[] { Long.valueOf(node) }); //$NON-NLS-1$ } // The root node is excused from the remaining node constraints. @@ -682,13 +682,13 @@ public class BTree { // Check: Non-root nodes must have a keyCount within a certain range if (keyCount < MIN_RECORDS || keyCount > MAX_RECORDS) { valid = false; - msg += MessageFormat.format(Messages.getString("BTree.IntegrityErrorC"), new Object[] { new Long(node) }); //$NON-NLS-1$ + msg += MessageFormat.format(Messages.getString("BTree.IntegrityErrorC"), new Object[] { Long.valueOf(node) }); //$NON-NLS-1$ } // Check: All leaf nodes are at the same depth if (childCount == 0) { if (leafDepth == null) { - leafDepth = new Integer(depth); + leafDepth = Integer.valueOf(depth); } if (depth != leafDepth.intValue()) { valid = false; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerPreferences.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerPreferences.java index a598c6e75c6..eeddfcb2aea 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerPreferences.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/IndexerPreferences.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others. + * Copyright (c) 2007, 2016 Wind River Systems, Inc. and others. * 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 @@ -182,7 +182,7 @@ public class IndexerPreferences { private static void migrateProperties(Properties props) { if (props.get(KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG) == null) { // backward compatibility - if ("true".equals(props.get(KEY_INDEX_ALL_FILES))) { //$NON-NLS-1$ + if (Boolean.parseBoolean((String) props.get(KEY_INDEX_ALL_FILES))) { props.put(KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, "true"); //$NON-NLS-1$ } } @@ -427,18 +427,18 @@ public class IndexerPreferences { public static boolean preferDefaultLanguage(IProject project) { IPreferencesService prefService = Platform.getPreferencesService(); Preferences[] prefs= IndexerPreferences.getPreferences(project); - if ("true".equals(prefService.get(KEY_INDEX_UNUSED_HEADERS_WITH_ALTERNATE_LANG, null, prefs)) && //$NON-NLS-1$ - "true".equals(prefService.get(KEY_INDEX_ALL_FILES, null, prefs)) && //$NON-NLS-1$ - !"true".equals(prefService.get(KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, null, prefs))) { //$NON-NLS-1$ + if (Boolean.parseBoolean(prefService.get(KEY_INDEX_UNUSED_HEADERS_WITH_ALTERNATE_LANG, null, prefs)) && + Boolean.parseBoolean(prefService.get(KEY_INDEX_ALL_FILES, null, prefs)) && + !Boolean.parseBoolean(prefService.get(KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, null, prefs))) { return false; } return true; } public static boolean preferDefaultLanguage(Properties props) { - if ("true".equals(props.get(KEY_INDEX_UNUSED_HEADERS_WITH_ALTERNATE_LANG)) && //$NON-NLS-1$ - "true".equals(props.get(KEY_INDEX_ALL_FILES)) && //$NON-NLS-1$ - !"true".equals(props.get(KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG))) { //$NON-NLS-1$ + if (Boolean.parseBoolean((String) props.get(KEY_INDEX_UNUSED_HEADERS_WITH_ALTERNATE_LANG)) && + Boolean.parseBoolean((String) props.get(KEY_INDEX_ALL_FILES)) && + !Boolean.parseBoolean((String) props.get(KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG))) { return false; } return true; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java index aa5c4ccb79c..68c5c5424e6 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2014 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2016 Wind River Systems, Inc. and others. * 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 @@ -320,7 +320,7 @@ public abstract class PDOMIndexerTask extends AbstractIndexerTask implements IPD + hits + " hits, " //$NON-NLS-1$ + misses + "(" + nfPercent.format(missPct) + ") misses."); //$NON-NLS-1$ //$NON-NLS-2$ - if ("true".equals(System.getProperty("SHOW_COMPRESSED_INDEXER_INFO"))) { //$NON-NLS-1$ //$NON-NLS-2$ + if (Boolean.parseBoolean(System.getProperty("SHOW_COMPRESSED_INDEXER_INFO"))) { //$NON-NLS-1$ Calendar cal = Calendar.getInstance(); NumberFormat twoDigits= NumberFormat.getNumberInstance(); twoDigits.setMinimumIntegerDigits(2); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/TodoTaskUpdater.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/TodoTaskUpdater.java index 3682ede8991..18402ad4364 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/TodoTaskUpdater.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/TodoTaskUpdater.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 Google, Inc and others. + * Copyright (c) 2007, 2016 Google, Inc and others. * 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 @@ -180,10 +180,10 @@ public class TodoTaskUpdater implements ITodoTaskUpdater { TASK_MARKER_ATTRIBUTE_NAMES, new Object[] { description, - new Integer(task.getPriority()), - new Integer(task.getStart()), - new Integer(task.getEnd()), - new Integer(task.getLineNumber()), + Integer.valueOf(task.getPriority()), + Integer.valueOf(task.getStart()), + Integer.valueOf(task.getEnd()), + Integer.valueOf(task.getLineNumber()), Boolean.FALSE, SOURCE_ID }); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java index 9e3a4e97bc8..cc98945a5b4 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 Andrew Gvozdev and others. + * Copyright (c) 2012, 2016 Andrew Gvozdev and others. * 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 @@ -285,7 +285,7 @@ public class BuildRunnerHelper implements Closeable { isCancelled = monitor.isCanceled(); if (!isCancelled && project != null) { - project.setSessionProperty(progressPropertyName, new Integer(streamProgressMonitor.getWorkDone())); + project.setSessionProperty(progressPropertyName, Integer.valueOf(streamProgressMonitor.getWorkDone())); } } catch (Exception e) { CCorePlugin.log(e); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java index a1d64b8e0ee..428a4197483 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2014 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2016 Wind River Systems, Inc. and others. * 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 @@ -189,7 +189,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf private synchronized void addChain(SortedMap> map, PositionTrackerChain chain) { long or= chain.getOldestRetirement(); if (or != Long.MAX_VALUE) { - Long lor= new Long(or); + Long lor= Long.valueOf(or); List list= map.get(lor); if (list == null) { list= new LinkedList(); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/parser/ParserLogService.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/parser/ParserLogService.java index 47a46759f93..3e2de8ef248 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/parser/ParserLogService.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/parser/ParserLogService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2011 IBM Corporation and others. + * Copyright (c) 2002, 2016 IBM Corporation and others. * 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 @@ -56,7 +56,7 @@ public class ParserLogService extends AbstractParserLogService implements ICance @Override public boolean isTracing(String option) { - return "true".equals(Platform.getDebugOption(option)); //$NON-NLS-1$ + return Boolean.parseBoolean(Platform.getDebugOption(option)); } @Override diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceLookupTree.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceLookupTree.java index 72e75b81654..f89f04aecaf 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceLookupTree.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/resources/ResourceLookupTree.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 Wind River Systems, Inc. and others. + * Copyright (c) 2008, 2016 Wind River Systems, Inc. and others. * 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 @@ -135,7 +135,7 @@ class ResourceLookupTree implements IResourceChangeListener, IResourceDeltaVisit } }; fUnrefJob.setSystem(true); - fTrace= "true".equals(Platform.getDebugOption(CCorePlugin.PLUGIN_ID + "/debug/resourceLookup")); //$NON-NLS-1$//$NON-NLS-2$ + fTrace= Boolean.parseBoolean(Platform.getDebugOption(CCorePlugin.PLUGIN_ID + "/debug/resourceLookup")); //$NON-NLS-1$ } public void startup() { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java index 1d82d114a3d..b76967f03ec 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2016 Wind River Systems, Inc. and others. * 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 @@ -171,7 +171,7 @@ import org.eclipse.text.edits.TextEdit; * @since 4.0 */ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor, ICASTVisitor { - private static boolean DEBUG = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.cdt.core/debug/formatter")); //$NON-NLS-1$ //$NON-NLS-2$ + private static boolean DEBUG = Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.core/debug/formatter")); //$NON-NLS-1$ private static class ASTProblemException extends RuntimeException { ASTProblemException(IASTProblem problem) { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/ScannerContext.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/ScannerContext.java index 53fbf50bbc7..a61407dfc7d 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/ScannerContext.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/ScannerContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * 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 @@ -79,6 +79,6 @@ public class ScannerContext { * @param undo The undo to set */ public void pushUndo(int undo) { - this.fUndo.push(new Integer(undo)); + this.fUndo.push(Integer.valueOf(undo)); } } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java index 3d3b60cc821..801e9ed2db9 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2014 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * 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 @@ -873,98 +873,98 @@ public class SimpleScanner { } static { - fgKeywords.put("and", new Integer(Token.t_and)); //$NON-NLS-1$ - fgKeywords.put("and_eq", new Integer(Token.t_and_eq)); //$NON-NLS-1$ - fgKeywords.put("asm", new Integer(Token.t_asm)); //$NON-NLS-1$ - fgKeywords.put("auto", new Integer(Token.t_auto)); //$NON-NLS-1$ - fgKeywords.put("bitand", new Integer(Token.t_bitand)); //$NON-NLS-1$ - fgKeywords.put("bitor", new Integer(Token.t_bitor)); //$NON-NLS-1$ - fgKeywords.put("bool", new Integer(Token.t_bool)); //$NON-NLS-1$ - fgKeywords.put("break", new Integer(Token.t_break)); //$NON-NLS-1$ - fgKeywords.put("case", new Integer(Token.t_case)); //$NON-NLS-1$ - fgKeywords.put("catch", new Integer(Token.t_catch)); //$NON-NLS-1$ - fgKeywords.put("char", new Integer(Token.t_char)); //$NON-NLS-1$ - fgKeywords.put("class", new Integer(Token.t_class)); //$NON-NLS-1$ - fgKeywords.put("compl", new Integer(Token.t_compl)); //$NON-NLS-1$ - fgKeywords.put("const", new Integer(Token.t_const)); //$NON-NLS-1$ - fgKeywords.put("const_cast", new Integer(Token.t_const_cast)); //$NON-NLS-1$ - fgKeywords.put("continue", new Integer(Token.t_continue)); //$NON-NLS-1$ - fgKeywords.put("default", new Integer(Token.t_default)); //$NON-NLS-1$ - fgKeywords.put("delete", new Integer(Token.t_delete)); //$NON-NLS-1$ - fgKeywords.put("do", new Integer(Token.t_do)); //$NON-NLS-1$ - fgKeywords.put("double", new Integer(Token.t_double)); //$NON-NLS-1$ - fgKeywords.put("dynamic_cast", new Integer(Token.t_dynamic_cast)); //$NON-NLS-1$ - fgKeywords.put("else", new Integer(Token.t_else)); //$NON-NLS-1$ - fgKeywords.put("enum", new Integer(Token.t_enum)); //$NON-NLS-1$ - fgKeywords.put("explicit", new Integer(Token.t_explicit)); //$NON-NLS-1$ - fgKeywords.put("export", new Integer(Token.t_export)); //$NON-NLS-1$ - fgKeywords.put("extern", new Integer(Token.t_extern)); //$NON-NLS-1$ - fgKeywords.put("false", new Integer(Token.t_false)); //$NON-NLS-1$ - fgKeywords.put("float", new Integer(Token.t_float)); //$NON-NLS-1$ - fgKeywords.put("for", new Integer(Token.t_for)); //$NON-NLS-1$ - fgKeywords.put("friend", new Integer(Token.t_friend)); //$NON-NLS-1$ - fgKeywords.put("goto", new Integer(Token.t_goto)); //$NON-NLS-1$ - fgKeywords.put("if", new Integer(Token.t_if)); //$NON-NLS-1$ - fgKeywords.put("inline", new Integer(Token.t_inline)); //$NON-NLS-1$ - fgKeywords.put("int", new Integer(Token.t_int)); //$NON-NLS-1$ - fgKeywords.put("long", new Integer(Token.t_long)); //$NON-NLS-1$ - fgKeywords.put("mutable", new Integer(Token.t_mutable)); //$NON-NLS-1$ - fgKeywords.put("namespace", new Integer(Token.t_namespace)); //$NON-NLS-1$ - fgKeywords.put("new", new Integer(Token.t_new)); //$NON-NLS-1$ - fgKeywords.put("not", new Integer(Token.t_not)); //$NON-NLS-1$ - fgKeywords.put("not_eq", new Integer(Token.t_not_eq)); //$NON-NLS-1$ - fgKeywords.put("operator", new Integer(Token.t_operator)); //$NON-NLS-1$ - fgKeywords.put("or", new Integer(Token.t_or)); //$NON-NLS-1$ - fgKeywords.put("or_eq", new Integer(Token.t_or_eq)); //$NON-NLS-1$ - fgKeywords.put("private", new Integer(Token.t_private)); //$NON-NLS-1$ - fgKeywords.put("protected", new Integer(Token.t_protected)); //$NON-NLS-1$ - fgKeywords.put("public", new Integer(Token.t_public)); //$NON-NLS-1$ - fgKeywords.put("register", new Integer(Token.t_register)); //$NON-NLS-1$ - fgKeywords.put("reinterpret_cast", new Integer(Token.t_reinterpret_cast)); //$NON-NLS-1$ - fgKeywords.put("return", new Integer(Token.t_return)); //$NON-NLS-1$ - fgKeywords.put("short", new Integer(Token.t_short)); //$NON-NLS-1$ - fgKeywords.put("signed", new Integer(Token.t_signed)); //$NON-NLS-1$ - fgKeywords.put("sizeof", new Integer(Token.t_sizeof)); //$NON-NLS-1$ - fgKeywords.put("static", new Integer(Token.t_static)); //$NON-NLS-1$ - fgKeywords.put("static_cast", new Integer(Token.t_static_cast)); //$NON-NLS-1$ - fgKeywords.put("struct", new Integer(Token.t_struct)); //$NON-NLS-1$ - fgKeywords.put("switch", new Integer(Token.t_switch)); //$NON-NLS-1$ - fgKeywords.put("template", new Integer(Token.t_template)); //$NON-NLS-1$ - fgKeywords.put("this", new Integer(Token.t_this)); //$NON-NLS-1$ - fgKeywords.put("throw", new Integer(Token.t_throw)); //$NON-NLS-1$ - fgKeywords.put("true", new Integer(Token.t_true)); //$NON-NLS-1$ - fgKeywords.put("try", new Integer(Token.t_try)); //$NON-NLS-1$ - fgKeywords.put("typedef", new Integer(Token.t_typedef)); //$NON-NLS-1$ - fgKeywords.put("typeid", new Integer(Token.t_typeid)); //$NON-NLS-1$ - fgKeywords.put("typename", new Integer(Token.t_typename)); //$NON-NLS-1$ - fgKeywords.put("union", new Integer(Token.t_union)); //$NON-NLS-1$ - fgKeywords.put("unsigned", new Integer(Token.t_unsigned)); //$NON-NLS-1$ - fgKeywords.put("using", new Integer(Token.t_using)); //$NON-NLS-1$ - fgKeywords.put("virtual", new Integer(Token.t_virtual)); //$NON-NLS-1$ - fgKeywords.put("void", new Integer(Token.t_void)); //$NON-NLS-1$ - fgKeywords.put("volatile", new Integer(Token.t_volatile)); //$NON-NLS-1$ - fgKeywords.put("wchar_t", new Integer(Token.t_wchar_t)); //$NON-NLS-1$ - fgKeywords.put("while", new Integer(Token.t_while)); //$NON-NLS-1$ - fgKeywords.put("xor", new Integer(Token.t_xor)); //$NON-NLS-1$ - fgKeywords.put("xor_eq", new Integer(Token.t_xor_eq)); //$NON-NLS-1$ + fgKeywords.put("and", Integer.valueOf(Token.t_and)); //$NON-NLS-1$ + fgKeywords.put("and_eq", Integer.valueOf(Token.t_and_eq)); //$NON-NLS-1$ + fgKeywords.put("asm", Integer.valueOf(Token.t_asm)); //$NON-NLS-1$ + fgKeywords.put("auto", Integer.valueOf(Token.t_auto)); //$NON-NLS-1$ + fgKeywords.put("bitand", Integer.valueOf(Token.t_bitand)); //$NON-NLS-1$ + fgKeywords.put("bitor", Integer.valueOf(Token.t_bitor)); //$NON-NLS-1$ + fgKeywords.put("bool", Integer.valueOf(Token.t_bool)); //$NON-NLS-1$ + fgKeywords.put("break", Integer.valueOf(Token.t_break)); //$NON-NLS-1$ + fgKeywords.put("case", Integer.valueOf(Token.t_case)); //$NON-NLS-1$ + fgKeywords.put("catch", Integer.valueOf(Token.t_catch)); //$NON-NLS-1$ + fgKeywords.put("char", Integer.valueOf(Token.t_char)); //$NON-NLS-1$ + fgKeywords.put("class", Integer.valueOf(Token.t_class)); //$NON-NLS-1$ + fgKeywords.put("compl", Integer.valueOf(Token.t_compl)); //$NON-NLS-1$ + fgKeywords.put("const", Integer.valueOf(Token.t_const)); //$NON-NLS-1$ + fgKeywords.put("const_cast", Integer.valueOf(Token.t_const_cast)); //$NON-NLS-1$ + fgKeywords.put("continue", Integer.valueOf(Token.t_continue)); //$NON-NLS-1$ + fgKeywords.put("default", Integer.valueOf(Token.t_default)); //$NON-NLS-1$ + fgKeywords.put("delete", Integer.valueOf(Token.t_delete)); //$NON-NLS-1$ + fgKeywords.put("do", Integer.valueOf(Token.t_do)); //$NON-NLS-1$ + fgKeywords.put("double", Integer.valueOf(Token.t_double)); //$NON-NLS-1$ + fgKeywords.put("dynamic_cast", Integer.valueOf(Token.t_dynamic_cast)); //$NON-NLS-1$ + fgKeywords.put("else", Integer.valueOf(Token.t_else)); //$NON-NLS-1$ + fgKeywords.put("enum", Integer.valueOf(Token.t_enum)); //$NON-NLS-1$ + fgKeywords.put("explicit", Integer.valueOf(Token.t_explicit)); //$NON-NLS-1$ + fgKeywords.put("export", Integer.valueOf(Token.t_export)); //$NON-NLS-1$ + fgKeywords.put("extern", Integer.valueOf(Token.t_extern)); //$NON-NLS-1$ + fgKeywords.put("false", Integer.valueOf(Token.t_false)); //$NON-NLS-1$ + fgKeywords.put("float", Integer.valueOf(Token.t_float)); //$NON-NLS-1$ + fgKeywords.put("for", Integer.valueOf(Token.t_for)); //$NON-NLS-1$ + fgKeywords.put("friend", Integer.valueOf(Token.t_friend)); //$NON-NLS-1$ + fgKeywords.put("goto", Integer.valueOf(Token.t_goto)); //$NON-NLS-1$ + fgKeywords.put("if", Integer.valueOf(Token.t_if)); //$NON-NLS-1$ + fgKeywords.put("inline", Integer.valueOf(Token.t_inline)); //$NON-NLS-1$ + fgKeywords.put("int", Integer.valueOf(Token.t_int)); //$NON-NLS-1$ + fgKeywords.put("long", Integer.valueOf(Token.t_long)); //$NON-NLS-1$ + fgKeywords.put("mutable", Integer.valueOf(Token.t_mutable)); //$NON-NLS-1$ + fgKeywords.put("namespace", Integer.valueOf(Token.t_namespace)); //$NON-NLS-1$ + fgKeywords.put("new", Integer.valueOf(Token.t_new)); //$NON-NLS-1$ + fgKeywords.put("not", Integer.valueOf(Token.t_not)); //$NON-NLS-1$ + fgKeywords.put("not_eq", Integer.valueOf(Token.t_not_eq)); //$NON-NLS-1$ + fgKeywords.put("operator", Integer.valueOf(Token.t_operator)); //$NON-NLS-1$ + fgKeywords.put("or", Integer.valueOf(Token.t_or)); //$NON-NLS-1$ + fgKeywords.put("or_eq", Integer.valueOf(Token.t_or_eq)); //$NON-NLS-1$ + fgKeywords.put("private", Integer.valueOf(Token.t_private)); //$NON-NLS-1$ + fgKeywords.put("protected", Integer.valueOf(Token.t_protected)); //$NON-NLS-1$ + fgKeywords.put("public", Integer.valueOf(Token.t_public)); //$NON-NLS-1$ + fgKeywords.put("register", Integer.valueOf(Token.t_register)); //$NON-NLS-1$ + fgKeywords.put("reinterpret_cast", Integer.valueOf(Token.t_reinterpret_cast)); //$NON-NLS-1$ + fgKeywords.put("return", Integer.valueOf(Token.t_return)); //$NON-NLS-1$ + fgKeywords.put("short", Integer.valueOf(Token.t_short)); //$NON-NLS-1$ + fgKeywords.put("signed", Integer.valueOf(Token.t_signed)); //$NON-NLS-1$ + fgKeywords.put("sizeof", Integer.valueOf(Token.t_sizeof)); //$NON-NLS-1$ + fgKeywords.put("static", Integer.valueOf(Token.t_static)); //$NON-NLS-1$ + fgKeywords.put("static_cast", Integer.valueOf(Token.t_static_cast)); //$NON-NLS-1$ + fgKeywords.put("struct", Integer.valueOf(Token.t_struct)); //$NON-NLS-1$ + fgKeywords.put("switch", Integer.valueOf(Token.t_switch)); //$NON-NLS-1$ + fgKeywords.put("template", Integer.valueOf(Token.t_template)); //$NON-NLS-1$ + fgKeywords.put("this", Integer.valueOf(Token.t_this)); //$NON-NLS-1$ + fgKeywords.put("throw", Integer.valueOf(Token.t_throw)); //$NON-NLS-1$ + fgKeywords.put("true", Integer.valueOf(Token.t_true)); //$NON-NLS-1$ + fgKeywords.put("try", Integer.valueOf(Token.t_try)); //$NON-NLS-1$ + fgKeywords.put("typedef", Integer.valueOf(Token.t_typedef)); //$NON-NLS-1$ + fgKeywords.put("typeid", Integer.valueOf(Token.t_typeid)); //$NON-NLS-1$ + fgKeywords.put("typename", Integer.valueOf(Token.t_typename)); //$NON-NLS-1$ + fgKeywords.put("union", Integer.valueOf(Token.t_union)); //$NON-NLS-1$ + fgKeywords.put("unsigned", Integer.valueOf(Token.t_unsigned)); //$NON-NLS-1$ + fgKeywords.put("using", Integer.valueOf(Token.t_using)); //$NON-NLS-1$ + fgKeywords.put("virtual", Integer.valueOf(Token.t_virtual)); //$NON-NLS-1$ + fgKeywords.put("void", Integer.valueOf(Token.t_void)); //$NON-NLS-1$ + fgKeywords.put("volatile", Integer.valueOf(Token.t_volatile)); //$NON-NLS-1$ + fgKeywords.put("wchar_t", Integer.valueOf(Token.t_wchar_t)); //$NON-NLS-1$ + fgKeywords.put("while", Integer.valueOf(Token.t_while)); //$NON-NLS-1$ + fgKeywords.put("xor", Integer.valueOf(Token.t_xor)); //$NON-NLS-1$ + fgKeywords.put("xor_eq", Integer.valueOf(Token.t_xor_eq)); //$NON-NLS-1$ // additional java keywords - fgKeywords.put("abstract", new Integer(Token.t_abstract)); //$NON-NLS-1$ - fgKeywords.put("boolean", new Integer(Token.t_boolean)); //$NON-NLS-1$ - fgKeywords.put("byte", new Integer(Token.t_byte)); //$NON-NLS-1$ - fgKeywords.put("extends", new Integer(Token.t_extends)); //$NON-NLS-1$ - fgKeywords.put("final", new Integer(Token.t_final)); //$NON-NLS-1$ - fgKeywords.put("finally", new Integer(Token.t_finally)); //$NON-NLS-1$ - fgKeywords.put("implements", new Integer(Token.t_implements)); //$NON-NLS-1$ - fgKeywords.put("import", new Integer(Token.t_import)); //$NON-NLS-1$ - fgKeywords.put("interface", new Integer(Token.t_interface)); //$NON-NLS-1$ - fgKeywords.put("instanceof", new Integer(Token.t_instanceof)); //$NON-NLS-1$ - fgKeywords.put("native", new Integer(Token.t_native)); //$NON-NLS-1$ - fgKeywords.put("null", new Integer(Token.t_null)); //$NON-NLS-1$ - fgKeywords.put("package", new Integer(Token.t_package)); //$NON-NLS-1$ - fgKeywords.put("super", new Integer(Token.t_super)); //$NON-NLS-1$ - fgKeywords.put("synchronized", new Integer(Token.t_synchronized)); //$NON-NLS-1$ - fgKeywords.put("throws", new Integer(Token.t_throws)); //$NON-NLS-1$ - fgKeywords.put("transient", new Integer(Token.t_transient)); //$NON-NLS-1$ + fgKeywords.put("abstract", Integer.valueOf(Token.t_abstract)); //$NON-NLS-1$ + fgKeywords.put("boolean", Integer.valueOf(Token.t_boolean)); //$NON-NLS-1$ + fgKeywords.put("byte", Integer.valueOf(Token.t_byte)); //$NON-NLS-1$ + fgKeywords.put("extends", Integer.valueOf(Token.t_extends)); //$NON-NLS-1$ + fgKeywords.put("final", Integer.valueOf(Token.t_final)); //$NON-NLS-1$ + fgKeywords.put("finally", Integer.valueOf(Token.t_finally)); //$NON-NLS-1$ + fgKeywords.put("implements", Integer.valueOf(Token.t_implements)); //$NON-NLS-1$ + fgKeywords.put("import", Integer.valueOf(Token.t_import)); //$NON-NLS-1$ + fgKeywords.put("interface", Integer.valueOf(Token.t_interface)); //$NON-NLS-1$ + fgKeywords.put("instanceof", Integer.valueOf(Token.t_instanceof)); //$NON-NLS-1$ + fgKeywords.put("native", Integer.valueOf(Token.t_native)); //$NON-NLS-1$ + fgKeywords.put("null", Integer.valueOf(Token.t_null)); //$NON-NLS-1$ + fgKeywords.put("package", Integer.valueOf(Token.t_package)); //$NON-NLS-1$ + fgKeywords.put("super", Integer.valueOf(Token.t_super)); //$NON-NLS-1$ + fgKeywords.put("synchronized", Integer.valueOf(Token.t_synchronized)); //$NON-NLS-1$ + fgKeywords.put("throws", Integer.valueOf(Token.t_throws)); //$NON-NLS-1$ + fgKeywords.put("transient", Integer.valueOf(Token.t_transient)); //$NON-NLS-1$ } -} \ No newline at end of file +} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Exe.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Exe.java index c12f7a61ab7..fcd75d4a68b 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Exe.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Exe.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -97,54 +97,54 @@ public class Exe { buffer.append(NL); buffer.append("lastsize: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_lastsize).longValue())); + buffer.append(Long.toHexString(e_lastsize)); buffer.append(NL); buffer.append("nblocks: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_nblocks).longValue())); + buffer.append(Long.toHexString(e_nblocks)); buffer.append(NL); buffer.append("nreloc: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_nreloc).longValue())); + buffer.append(Long.toHexString(e_nreloc)); buffer.append(NL); buffer.append("hdrsize: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_hdrsize).longValue())); + buffer.append(Long.toHexString(e_hdrsize)); buffer.append(NL); buffer.append("minalloc: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_minalloc).longValue())); + buffer.append(Long.toHexString(e_minalloc)); buffer.append(NL); buffer.append("maxalloc: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_maxalloc).longValue())); + buffer.append(Long.toHexString(e_maxalloc)); buffer.append(NL); buffer.append("ss: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_ss).longValue())); + buffer.append(Long.toHexString(e_ss)); buffer.append(NL); buffer.append("sp: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_sp).longValue())); + buffer.append(Long.toHexString(e_sp)); buffer.append(NL); buffer.append("checksum: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_checksum).longValue())); + buffer.append(Long.toHexString(e_checksum)); buffer.append(NL); buffer.append("ip: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_ip).longValue())); + buffer.append(Long.toHexString(e_ip)); buffer.append(NL); buffer.append("cs: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_cs).longValue())); + buffer.append(Long.toHexString(e_cs)); buffer.append(NL); buffer.append("relocoffs: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_relocoffs).longValue())); + buffer.append(Long.toHexString(e_relocoffs)); buffer.append(NL); buffer.append("overlay: 0x"); //$NON-NLS-1$ - buffer.append(Long.toHexString(new Short(e_noverlay).longValue())); + buffer.append(Long.toHexString(e_noverlay)); buffer.append(NL); return buffer.toString(); } diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java index 896fba521f0..0a70433f559 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -566,7 +566,7 @@ public class Dwarf { if (printEnabled) System.out.println("\t\t " + Long.toHexString(name) + " " + Long.toHexString(form)); //$NON-NLS-1$ //$NON-NLS-2$ } while (name != 0 && form != 0); - abbrevs.put(new Long(code), entry); + abbrevs.put(Long.valueOf(code), entry); } } } @@ -577,7 +577,7 @@ public class Dwarf { throws IOException { while (in.remaining() > 0) { long code = read_unsigned_leb128(in); - AbbreviationEntry entry = abbrevs.get(new Long(code)); + AbbreviationEntry entry = abbrevs.get(Long.valueOf(code)); if (entry != null) { int len = entry.attributes.size(); List list = new ArrayList(len); @@ -768,15 +768,15 @@ public class Dwarf { } case DwarfConstants.DW_FORM_GNU_ref_alt : if (header.offsetSize == 8) - obj = new Long(read_8_bytes(in)); + obj = Long.valueOf(read_8_bytes(in)); else - obj = new Long(read_4_bytes(in) & 0xffffffffL); + obj = Long.valueOf(read_4_bytes(in) & 0xffffffffL); break; case DwarfConstants.DW_FORM_sec_offset : if (header.offsetSize == 8) - obj = new Long(read_8_bytes(in)); + obj = Long.valueOf(read_8_bytes(in)); else - obj = new Long(read_4_bytes(in) & 0xffffffffL); + obj = Long.valueOf(read_4_bytes(in) & 0xffffffffL); break; case DwarfConstants.DW_FORM_exprloc : long size = read_unsigned_leb128(in); @@ -789,7 +789,7 @@ public class Dwarf { obj = Byte.valueOf((byte)1); break; case DwarfConstants.DW_FORM_ref_sig8 : - obj = new Long(read_8_bytes(in)); + obj = Long.valueOf(read_8_bytes(in)); break; default : @@ -903,7 +903,7 @@ public class Dwarf { default : // ???? } - return new Long(value); + return Long.valueOf(value); } /** diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/DwarfReader.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/DwarfReader.java index f3839d71238..21b084f1cf7 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/DwarfReader.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/DwarfReader.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 Nokia and others. + * Copyright (c) 2007, 2016 Nokia and others. * 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 @@ -309,7 +309,7 @@ public class DwarfReader extends Dwarf implements ISymbolReader, ICompileOptions */ // Remember the CU line tables we've parsed. - Integer cuOffset = new Integer(cuStmtList); + Integer cuOffset = Integer.valueOf(cuStmtList); boolean dwarf64Bit = false; if (! m_parsedLineTableOffsets.contains(cuOffset)) { @@ -429,7 +429,7 @@ public class DwarfReader extends Dwarf implements ISymbolReader, ICompileOptions while (lineTableStart < sectionSize - minHeaderSize) { data.position(lineTableStart); - Integer currLineTableStart = new Integer(lineTableStart); + Integer currLineTableStart = Integer.valueOf(lineTableStart); // Read length of the line table for one compile unit // Note the length does not including the "length" field(s) itself. diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/tools/DebugSymsRequestor.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/tools/DebugSymsRequestor.java index 08a4012e4b9..c20a28e9b44 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/tools/DebugSymsRequestor.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/tools/DebugSymsRequestor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -53,7 +53,7 @@ public class DebugSymsRequestor implements IDebugEntryRequestor { public DebugSym getEntry(long addr) { DebugSym[] entries = getSortedEntries(); - int insertion = Arrays.binarySearch(entries, new Long(addr)); + int insertion = Arrays.binarySearch(entries, Long.valueOf(addr)); if (insertion >= 0) { return entries[insertion]; } diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO.java index 94f06f8a7af..84508d3adf2 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -865,7 +865,7 @@ public class MachO { return null; } - int ndx = Arrays.binarySearch(lines, new Long(value)); + int ndx = Arrays.binarySearch(lines, Long.valueOf(value)); if ( ndx >= 0 ) return lines[ndx]; if ( ndx == -1 ) { @@ -1614,7 +1614,7 @@ public class MachO { return null; } - int ndx = Arrays.binarySearch(symbols, new Long(vma), symbol_comparator); + int ndx = Arrays.binarySearch(symbols, Long.valueOf(vma), symbol_comparator); if ( ndx > 0 ) return symbols[ndx]; if ( ndx == -1 ) { diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO64.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO64.java index 73f2bc579bf..3527830d5ce 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO64.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO64.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -921,7 +921,7 @@ public class MachO64 { return null; } - int ndx = Arrays.binarySearch(lines, new Long(value)); + int ndx = Arrays.binarySearch(lines, Long.valueOf(value)); if (ndx >= 0 ) return lines[ndx]; if (ndx == -1 ) { @@ -1727,7 +1727,7 @@ public class MachO64 { return null; } - int ndx = Arrays.binarySearch(symbols, new Long(vma), symbol_comparator); + int ndx = Arrays.binarySearch(symbols, Long.valueOf(vma), symbol_comparator); if (ndx > 0 ) return symbols[ndx]; if (ndx == -1 ) { diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java index 719d2cb80c0..d503873ada5 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/ResourceTestHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * 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 @@ -192,7 +192,7 @@ public class ResourceTestHelper { continue; if (i < buffer.length() - 1 && Character.isJavaIdentifierPart(buffer.charAt(i + identifier.length()))) continue; - positions.add(new Integer(i)); + positions.add(Integer.valueOf(i)); } return positions; } diff --git a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java index 0cbb6f4c316..e7272429bd3 100644 --- a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java +++ b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2015 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * 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 @@ -125,7 +125,7 @@ public class TypeSelectionDialog extends TwoPaneElementSelector { ITypeInfo info = (ITypeInfo) element; IQualifiedTypeName qualifiedName = info.getQualifiedTypeName(); - if (fVisibleTypes != null && !fVisibleTypes.contains(new Integer(info.getCElementType()))) + if (fVisibleTypes != null && !fVisibleTypes.contains(Integer.valueOf(info.getCElementType()))) return false; if (!fShowLowLevelTypes && qualifiedName.isLowLevel()) @@ -417,7 +417,7 @@ public class TypeSelectionDialog extends TwoPaneElementSelector { // The 'for' loop is here to guarantee that we always create the checkboxes in the same order. for (int i = 0; i < ALL_TYPES.length; ++i) { - Integer typeObject = new Integer(ALL_TYPES[i]); + Integer typeObject = Integer.valueOf(ALL_TYPES[i]); if (fKnownTypes.contains(typeObject)) createTypeCheckbox(upperRow, typeObject); } @@ -492,16 +492,16 @@ public class TypeSelectionDialog extends TwoPaneElementSelector { section.put(SETTINGS_WIDTH, size.x); section.put(SETTINGS_HEIGHT, size.y); } - section.put(SETTINGS_SHOW_NAMESPACES, fFilterMatcher.getVisibleTypes().contains(new Integer(ICElement.C_NAMESPACE))); - section.put(SETTINGS_SHOW_CLASSES, fFilterMatcher.getVisibleTypes().contains(new Integer(ICElement.C_CLASS))); - section.put(SETTINGS_SHOW_STRUCTS, fFilterMatcher.getVisibleTypes().contains(new Integer(ICElement.C_STRUCT))); - section.put(SETTINGS_SHOW_TYPEDEFS, fFilterMatcher.getVisibleTypes().contains(new Integer(ICElement.C_TYPEDEF))); - section.put(SETTINGS_SHOW_ENUMS, fFilterMatcher.getVisibleTypes().contains(new Integer(ICElement.C_ENUMERATION))); - section.put(SETTINGS_SHOW_UNIONS, fFilterMatcher.getVisibleTypes().contains(new Integer(ICElement.C_UNION))); - section.put(SETTINGS_SHOW_FUNCTIONS, fFilterMatcher.getVisibleTypes().contains(new Integer(ICElement.C_FUNCTION))); - section.put(SETTINGS_SHOW_VARIABLES, fFilterMatcher.getVisibleTypes().contains(new Integer(ICElement.C_VARIABLE))); - section.put(SETTINGS_SHOW_ENUMERATORS, fFilterMatcher.getVisibleTypes().contains(new Integer(ICElement.C_ENUMERATOR))); - section.put(SETTINGS_SHOW_MACROS, fFilterMatcher.getVisibleTypes().contains(new Integer(ICElement.C_MACRO))); + section.put(SETTINGS_SHOW_NAMESPACES, fFilterMatcher.getVisibleTypes().contains(Integer.valueOf(ICElement.C_NAMESPACE))); + section.put(SETTINGS_SHOW_CLASSES, fFilterMatcher.getVisibleTypes().contains(Integer.valueOf(ICElement.C_CLASS))); + section.put(SETTINGS_SHOW_STRUCTS, fFilterMatcher.getVisibleTypes().contains(Integer.valueOf(ICElement.C_STRUCT))); + section.put(SETTINGS_SHOW_TYPEDEFS, fFilterMatcher.getVisibleTypes().contains(Integer.valueOf(ICElement.C_TYPEDEF))); + section.put(SETTINGS_SHOW_ENUMS, fFilterMatcher.getVisibleTypes().contains(Integer.valueOf(ICElement.C_ENUMERATION))); + section.put(SETTINGS_SHOW_UNIONS, fFilterMatcher.getVisibleTypes().contains(Integer.valueOf(ICElement.C_UNION))); + section.put(SETTINGS_SHOW_FUNCTIONS, fFilterMatcher.getVisibleTypes().contains(Integer.valueOf(ICElement.C_FUNCTION))); + section.put(SETTINGS_SHOW_VARIABLES, fFilterMatcher.getVisibleTypes().contains(Integer.valueOf(ICElement.C_VARIABLE))); + section.put(SETTINGS_SHOW_ENUMERATORS, fFilterMatcher.getVisibleTypes().contains(Integer.valueOf(ICElement.C_ENUMERATOR))); + section.put(SETTINGS_SHOW_MACROS, fFilterMatcher.getVisibleTypes().contains(Integer.valueOf(ICElement.C_MACRO))); section.put(SETTINGS_SHOW_LOWLEVEL, fFilterMatcher.getShowLowLevelTypes()); } @@ -540,52 +540,52 @@ public class TypeSelectionDialog extends TwoPaneElementSelector { } if (section.getBoolean(SETTINGS_SHOW_NAMESPACES)) { - Integer typeObject = new Integer(ICElement.C_NAMESPACE); + Integer typeObject = ICElement.C_NAMESPACE; if (fKnownTypes.contains(typeObject)) fFilterMatcher.getVisibleTypes().add(typeObject); } if (section.getBoolean(SETTINGS_SHOW_CLASSES)) { - Integer typeObject = new Integer(ICElement.C_CLASS); + Integer typeObject = ICElement.C_CLASS; if (fKnownTypes.contains(typeObject)) fFilterMatcher.getVisibleTypes().add(typeObject); } if (section.getBoolean(SETTINGS_SHOW_STRUCTS)) { - Integer typeObject = new Integer(ICElement.C_STRUCT); + Integer typeObject = ICElement.C_STRUCT; if (fKnownTypes.contains(typeObject)) fFilterMatcher.getVisibleTypes().add(typeObject); } if (section.getBoolean(SETTINGS_SHOW_TYPEDEFS)) { - Integer typeObject = new Integer(ICElement.C_TYPEDEF); + Integer typeObject = ICElement.C_TYPEDEF; if (fKnownTypes.contains(typeObject)) fFilterMatcher.getVisibleTypes().add(typeObject); } if (section.getBoolean(SETTINGS_SHOW_ENUMS)) { - Integer typeObject = new Integer(ICElement.C_ENUMERATION); + Integer typeObject = ICElement.C_ENUMERATION; if (fKnownTypes.contains(typeObject)) fFilterMatcher.getVisibleTypes().add(typeObject); } if (section.getBoolean(SETTINGS_SHOW_UNIONS)) { - Integer typeObject = new Integer(ICElement.C_UNION); + Integer typeObject = ICElement.C_UNION; if (fKnownTypes.contains(typeObject)) fFilterMatcher.getVisibleTypes().add(typeObject); } if (section.getBoolean(SETTINGS_SHOW_FUNCTIONS)) { - Integer typeObject = new Integer(ICElement.C_FUNCTION); + Integer typeObject = ICElement.C_FUNCTION; if (fKnownTypes.contains(typeObject)) fFilterMatcher.getVisibleTypes().add(typeObject); } if (section.getBoolean(SETTINGS_SHOW_VARIABLES)) { - Integer typeObject = new Integer(ICElement.C_VARIABLE); + Integer typeObject = ICElement.C_VARIABLE; if (fKnownTypes.contains(typeObject)) fFilterMatcher.getVisibleTypes().add(typeObject); } if (section.getBoolean(SETTINGS_SHOW_ENUMERATORS)) { - Integer typeObject = new Integer(ICElement.C_ENUMERATOR); + Integer typeObject = ICElement.C_ENUMERATOR; if (fKnownTypes.contains(typeObject)) fFilterMatcher.getVisibleTypes().add(typeObject); } if (section.getBoolean(SETTINGS_SHOW_MACROS)) { - Integer typeObject = new Integer(ICElement.C_MACRO); + Integer typeObject = ICElement.C_MACRO; if (fKnownTypes.contains(typeObject)) fFilterMatcher.getVisibleTypes().add(typeObject); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java index d310172480e..56af3c8445e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2015 IBM Corporation and others. + * Copyright (c) 2001, 2016 IBM Corporation and others. * 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 @@ -471,7 +471,7 @@ public class StubUtility { IRegion lineInfo= doc.getLineInformation(line); int offset= lineInfo.getOffset(); String str= doc.get(offset, lineInfo.getLength()); - if (Strings.containsOnlyWhitespaces(str) && nLines > line + 1 && removedLines.add(new Integer(line))) { + if (Strings.containsOnlyWhitespaces(str) && nLines > line + 1 && removedLines.add(Integer.valueOf(line))) { int nextStart= doc.getLineOffset(line + 1); int length= nextStart - offset; edit.addChild(new DeleteEdit(offset, length)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/Resources.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/Resources.java index 9d50e36c73e..e2906736a56 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/Resources.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/Resources.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * 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 @@ -133,7 +133,7 @@ public class Resources { Map map= new HashMap(); for (Iterator iter= files.iterator(); iter.hasNext(); ) { IFile file= (IFile)iter.next(); - map.put(file, new Long(file.getModificationStamp())); + map.put(file, Long.valueOf(file.getModificationStamp())); } return map; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java index e6a1331fc19..1c535c683ca 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2016 Wind River Systems, Inc. and others. * 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 @@ -89,7 +89,7 @@ public class CHLabelProvider extends AppearanceAwareLabelProvider { } int refCount= node.getReferenceCount(); if (refCount > 1) { - label += NLS.bind(" ({0} {1})", new Integer(refCount), CHMessages.CHLabelProvider_matches); //$NON-NLS-1$ + label += NLS.bind(" ({0} {1})", Integer.valueOf(refCount), CHMessages.CHLabelProvider_matches); //$NON-NLS-1$ } return decorateText(label, element); } @@ -118,7 +118,7 @@ public class CHLabelProvider extends AppearanceAwareLabelProvider { int refCount= node.getReferenceCount(); if (refCount > 1) { final int offset= label.length(); - label.append(NLS.bind(" ({0} {1})", new Integer(refCount), CHMessages.CHLabelProvider_matches)); //$NON-NLS-1$ + label.append(NLS.bind(" ({0} {1})", Integer.valueOf(refCount), CHMessages.CHLabelProvider_matches)); //$NON-NLS-1$ label.setStyle(offset, label.length() - offset, StyledString.COUNTER_STYLER); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java index 35e0b361636..1a457f310dd 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -988,9 +988,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha try { String posStr = memento.getString(TAG_VERTICAL_POSITION); int position; - position = new Integer(posStr).intValue(); - bar.setSelection(position); - position = new Integer(posStr).intValue(); + position = Integer.parseInt(posStr); bar.setSelection(position); } catch (NumberFormatException e) { } @@ -1000,7 +998,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha try { String posStr = memento.getString(TAG_HORIZONTAL_POSITION); int position; - position = new Integer(posStr).intValue(); + position = Integer.parseInt(posStr); bar.setSelection(position); } catch (NumberFormatException e) { } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementGroup.java index d95475dc685..292d33a2bb9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementGroup.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPElementGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2010 QNX Software Systems and others. + * Copyright (c) 2004, 2016 QNX Software Systems and others. * 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 @@ -126,7 +126,7 @@ public class CPElementGroup { public void setChildren(CPElement[] elements) { if (elements.length > 0) { if (childrenListMap != null) { - childrenListMap.put(new Integer(elements[0].getEntryKind()), new ArrayList(Arrays.asList(elements))); + childrenListMap.put(Integer.valueOf(elements[0].getEntryKind()), new ArrayList(Arrays.asList(elements))); } else { childrenList = new ArrayList(Arrays.asList(elements)); } @@ -194,10 +194,10 @@ public class CPElementGroup { if (childrenList != null) { children = childrenList; } else { - children = childrenListMap.get(new Integer(kind)); + children = childrenListMap.get(Integer.valueOf(kind)); if (children == null && create) { children = new ArrayList(); - childrenListMap.put(new Integer(kind), children); + childrenListMap.put(Integer.valueOf(kind), children); } } return children; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java index c4e6ac69eef..576079b9107 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * 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 @@ -203,7 +203,7 @@ public class SemanticHighlightings { public static final String OVERLOADED_OPERATOR= "overloadedOperator"; //$NON-NLS-1$ /** Init debugging mode */ - private static final boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.cdt.ui/debug/SemanticHighlighting")); //$NON-NLS-1$//$NON-NLS-2$ + private static final boolean DEBUG= Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.ui/debug/SemanticHighlighting")); //$NON-NLS-1$ /** * Semantic highlightings diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/IndexView.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/IndexView.java index 4bc1295d8f4..255381c65a8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/IndexView.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/IndexView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 QNX Software Systems and others. + * Copyright (c) 2005, 2016 QNX Software Systems and others. * 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 @@ -247,7 +247,7 @@ public class IndexView extends ViewPart implements PDOM.IListener, IElementChang IPDOM pdom = CCoreInternals.getPDOMManager().getPDOM(cproject); pdom.acquireReadLock(); try { - fTimestampPerProject.put(cproject.getElementName(), new Long(pdom.getLastWriteAccess())); + fTimestampPerProject.put(cproject.getElementName(), Long.valueOf(pdom.getLastWriteAccess())); IPDOMNode[] linkages= pdom.getLinkageImpls(); if (linkages.length == 1) { // Skip linkages in hierarchy if there is only one diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorHoverConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorHoverConfigurationBlock.java index 0753467be84..aa1c11f93e4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorHoverConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorHoverConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2012 QNX Software Systems and others. + * Copyright (c) 2002, 2016 QNX Software Systems and others. * 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 @@ -532,7 +532,7 @@ public class CEditorHoverConfigurationBlock implements IPreferenceConfigurationB while (fStatus.isOK() && i < fHoverConfigs.length) { if (fHoverConfigs[i].fIsEnabled) { String label= getContributedHovers()[i].getLabel(); - Integer stateMask= new Integer(fHoverConfigs[i].fStateMask); + Integer stateMask= fHoverConfigs[i].fStateMask; if (fHoverConfigs[i].fStateMask == -1) fStatus= new StatusInfo(IStatus.ERROR, NLS.bind(PreferencesMessages.CEditorHoverConfigurationBlock_modifierIsNotValidForHover, new String[] {fHoverConfigs[i].fModifierString, label})); else if (stateMasks.containsKey(stateMask)) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java index f614aee927a..e3708b24659 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * 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 @@ -255,13 +255,13 @@ public class LineWrappingTabPage extends FormatterTabPage { Boolean forceWrapping; try { - wrappingStyle= new Integer(DefaultCodeFormatterConstants.getWrappingStyle(value)); - indentStyle= new Integer(DefaultCodeFormatterConstants.getIndentStyle(value)); + wrappingStyle= Integer.valueOf(DefaultCodeFormatterConstants.getWrappingStyle(value)); + indentStyle= Integer.valueOf(DefaultCodeFormatterConstants.getIndentStyle(value)); forceWrapping= Boolean.valueOf(DefaultCodeFormatterConstants.getForceWrapping(value)); } catch (IllegalArgumentException e) { - forceWrapping= Boolean.valueOf(false); - indentStyle= new Integer(DefaultCodeFormatterConstants.INDENT_DEFAULT); - wrappingStyle= new Integer(DefaultCodeFormatterConstants.WRAP_NO_SPLIT); + forceWrapping= Boolean.FALSE; + indentStyle= Integer.valueOf(DefaultCodeFormatterConstants.INDENT_DEFAULT); + wrappingStyle= Integer.valueOf(DefaultCodeFormatterConstants.WRAP_NO_SPLIT); } increaseMapEntry(wrappingMap, wrappingStyle); @@ -272,9 +272,9 @@ public class LineWrappingTabPage extends FormatterTabPage { private void increaseMapEntry(Map map, Object type) { Integer count= map.get(type); if (count == null) // not in map yet -> count == 0 - map.put(type, new Integer(1)); + map.put(type, Integer.valueOf(1)); else - map.put(type, new Integer(count.intValue() + 1)); + map.put(type, Integer.valueOf(count.intValue() + 1)); } private void refreshControls(Map wrappingStyleMap, Map indentStyleMap, @@ -291,7 +291,7 @@ public class LineWrappingTabPage extends FormatterTabPage { private Integer getWrappingStyleMax(Map wrappingStyleMap) { int maxCount= 0, maxStyle= 0; for (int i= 0; i < WRAPPING_NAMES.length; i++) { - Integer count= wrappingStyleMap.get(new Integer(i)); + Integer count= wrappingStyleMap.get(Integer.valueOf(i)); if (count == null) continue; if (count.intValue() > maxCount) { @@ -299,7 +299,7 @@ public class LineWrappingTabPage extends FormatterTabPage { maxStyle= i; } } - return new Integer(maxStyle); + return Integer.valueOf(maxStyle); } private void updateButton(Map forceWrappingMap) { @@ -343,7 +343,7 @@ public class LineWrappingTabPage extends FormatterTabPage { int maxCount= 0, maxStyle= 0; for(int i = 0; i < items.length; i++) { - Integer count= map.get(new Integer(i)); + Integer count= map.get(Integer.valueOf(i)); int val= (count == null) ? 0 : count.intValue(); if (val > maxCount) { maxCount= val; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java index faf64668b91..6a20a663b5b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * 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 @@ -494,7 +494,7 @@ public abstract class ModifyDialogTabPage implements IModifyDialogTabPage { public void add(Control control) { control.addFocusListener(this); fItemList.add(fIndex, control); - fItemMap.put(control, new Integer(fIndex++)); + fItemMap.put(control, Integer.valueOf(fIndex++)); } public void add(Preference preference) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java index 2287f6c7012..2261cfc3319 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * 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 @@ -462,7 +462,7 @@ public abstract class ProfileManager extends Observable { */ protected void notifyObservers(int message) { setChanged(); - notifyObservers(new Integer(message)); + notifyObservers(Integer.valueOf(message)); } public static boolean hasProjectSpecificSettings(IScopeContext context, KeySet[] keySets) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java index b8e7c287183..c26426b9e46 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java @@ -1,4 +1,5 @@ /******************************************************************************* + * Copyright (c) 2012, 2016 Google, Inc and others. * 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 @@ -85,7 +86,7 @@ import org.eclipse.cdt.internal.formatter.ChangeFormatter; */ public class IncludeOrganizer { private static boolean DEBUG_HEADER_SUBSTITUTION = - "true".equalsIgnoreCase(Platform.getDebugOption(CUIPlugin.PLUGIN_ID + "/debug/includeOrganizer/headerSubstitution")); //$NON-NLS-1$ //$NON-NLS-2$ + Boolean.parseBoolean(Platform.getDebugOption(CUIPlugin.PLUGIN_ID + "/debug/includeOrganizer/headerSubstitution")); //$NON-NLS-1$ private static final Collator COLLATOR = Collator.getInstance(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java index 5f42e6b8f84..c2ea5879c77 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 QNX Software Systems and others. + * Copyright (c) 2006, 2016 QNX Software Systems and others. * 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 @@ -103,18 +103,18 @@ public class CSearchPage extends DialogPage implements ISearchPage { // These must be in the same order as the Text private static final Integer[] searchForData = { - new Integer(CSearchPatternQuery.FIND_CLASS_STRUCT), - new Integer(CSearchPatternQuery.FIND_FUNCTION), - new Integer(CSearchPatternQuery.FIND_VARIABLE), - new Integer(CSearchPatternQuery.FIND_UNION), - new Integer(CSearchPatternQuery.FIND_METHOD), - new Integer(CSearchPatternQuery.FIND_FIELD), - new Integer(CSearchPatternQuery.FIND_ENUM), - new Integer(CSearchPatternQuery.FIND_ENUMERATOR), - new Integer(CSearchPatternQuery.FIND_NAMESPACE), - new Integer(CSearchPatternQuery.FIND_TYPEDEF), - new Integer(CSearchPatternQuery.FIND_MACRO), - new Integer(CSearchPatternQuery.FIND_ALL_TYPES) + CSearchPatternQuery.FIND_CLASS_STRUCT, + CSearchPatternQuery.FIND_FUNCTION, + CSearchPatternQuery.FIND_VARIABLE, + CSearchPatternQuery.FIND_UNION, + CSearchPatternQuery.FIND_METHOD, + CSearchPatternQuery.FIND_FIELD, + CSearchPatternQuery.FIND_ENUM, + CSearchPatternQuery.FIND_ENUMERATOR, + CSearchPatternQuery.FIND_NAMESPACE, + CSearchPatternQuery.FIND_TYPEDEF, + CSearchPatternQuery.FIND_MACRO, + CSearchPatternQuery.FIND_ALL_TYPES }; // the index of FIND_ALL_TYPES @@ -129,10 +129,10 @@ public class CSearchPage extends DialogPage implements ISearchPage { // Must be in the same order as the text private static Integer[] limitToData = { - new Integer(CSearchQuery.FIND_DECLARATIONS), - new Integer(CSearchQuery.FIND_DEFINITIONS), - new Integer(CSearchQuery.FIND_REFERENCES), - new Integer(CSearchQuery.FIND_ALL_OCCURRENCES), + CSearchQuery.FIND_DECLARATIONS, + CSearchQuery.FIND_DEFINITIONS, + CSearchQuery.FIND_REFERENCES, + CSearchQuery.FIND_ALL_OCCURRENCES, }; // The index of FIND_ALL_OCCURANCES @@ -776,4 +776,4 @@ public class CSearchPage extends DialogPage implements ISearchPage { } super.setVisible(visible); } -} \ No newline at end of file +} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchTreeLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchTreeLabelProvider.java index 5f8938c1dee..5a263d5693e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchTreeLabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchTreeLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 QNX Software Systems and others. + * Copyright (c) 2006, 2016 QNX Software Systems and others. * 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 @@ -36,7 +36,7 @@ public class CSearchTreeLabelProvider extends CSearchLabelProvider { return text; } return text + " " //$NON-NLS-1$ - + Messages.format(CSearchMessages.CSearchResultCollector_matches, new Integer(count)); + + Messages.format(CSearchMessages.CSearchResultCollector_matches, Integer.valueOf(count)); } @Override @@ -46,7 +46,7 @@ public class CSearchTreeLabelProvider extends CSearchLabelProvider { final int count= getMatchCount(element); if (count > 1) { final String matchesCount = " " //$NON-NLS-1$ - + Messages.format(CSearchMessages.CSearchResultCollector_matches, new Integer(count)); + + Messages.format(CSearchMessages.CSearchResultCollector_matches, Integer.valueOf(count)); styled.append(matchesCount, StyledString.COUNTER_STYLER); return styled; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUnresolvedIncludesQuery.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUnresolvedIncludesQuery.java index 877b17408fb..f1a53a008a0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUnresolvedIncludesQuery.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUnresolvedIncludesQuery.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 Wind River Systems, Inc. and others. + * Copyright (c) 2008, 2016 Wind River Systems, Inc. and others. * 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 @@ -61,7 +61,7 @@ public class CSearchUnresolvedIncludesQuery extends CSearchQuery { @Override public String getResultLabel(int matchCount) { - String countLabel = Messages.format(CSearchMessages.CSearchResultCollector_matches, new Integer(matchCount)); + String countLabel = Messages.format(CSearchMessages.CSearchResultCollector_matches, Integer.valueOf(matchCount)); return getLabel() + " " + countLabel; //$NON-NLS-1$ } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CountLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CountLabelProvider.java index 2da77457499..55e40c04328 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CountLabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CountLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * 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 @@ -55,7 +55,7 @@ public class CountLabelProvider extends LabelProvider { String text= fLabelProvider.getText(element); if (c == 0) return text; - Integer matchCount= new Integer(c); + Integer matchCount= c; return fLabelProvider.getText(element) + " "+ Messages.format(CSearchMessages.CSearchResultCollector_matches, matchCount); //$NON-NLS-1$ } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CParameterListValidator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CParameterListValidator.java index 275932dda99..5bae4607ca6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CParameterListValidator.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CParameterListValidator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -218,12 +218,12 @@ public class CParameterListValidator implements IContextInformationValidator, IC final int length= code.length(); int pos= 0; List positions= new ArrayList<>(); - positions.add(new Integer(-1)); + positions.add(Integer.valueOf(-1)); while (pos < length && pos != -1) { char ch= code.charAt(pos); switch (ch) { case ',': - positions.add(new Integer(pos)); + positions.add(Integer.valueOf(pos)); break; case '(': pos= indexOfClosingPeer(code, '(', ')', pos); @@ -243,7 +243,7 @@ public class CParameterListValidator implements IContextInformationValidator, IC if (pos != -1) pos++; } - positions.add(new Integer(length)); + positions.add(Integer.valueOf(length)); int[] fields= new int[positions.size()]; for (int i= 0; i < fields.length; i++) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java index 7f8ddce8774..0c09172d37d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionProposalComputerRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * 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 @@ -279,7 +279,7 @@ public final class CompletionProposalComputerRegistry { StringTokenizer inner= new StringTokenizer(tok.nextToken(), ":"); //$NON-NLS-1$ String id= inner.nextToken(); int rank= Integer.parseInt(inner.nextToken()); - ordered.put(id, new Integer(rank)); + ordered.put(id, Integer.valueOf(rank)); } List categories= new ArrayList(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistProcessor.java index 00063fcb142..88f7cac355d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistProcessor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 IBM Corporation and others. + * Copyright (c) 2005, 2016 IBM Corporation and others. * 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 @@ -82,7 +82,7 @@ import org.eclipse.cdt.internal.ui.util.Messages; * @since 4.0 */ public class ContentAssistProcessor implements IContentAssistProcessor { - private static final boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.cdt.ui/debug/contentassist")); //$NON-NLS-1$//$NON-NLS-2$ + private static final boolean DEBUG= Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.ui/debug/contentassist")); //$NON-NLS-1$ /** * Dialog settings key for the "all categories are disabled" warning dialog. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java index 0d4f8391351..1a1e206d7c6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * 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 @@ -859,7 +859,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi } } - private final static boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.cdt.ui/debug/folding")); //$NON-NLS-1$//$NON-NLS-2$; + private final static boolean DEBUG= Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.ui/debug/folding")); //$NON-NLS-1$ private ITextEditor fEditor; private ProjectionListener fProjectionListener; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckIterator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckIterator.java index 965654b7388..11df9b84cf0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckIterator.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/spelling/SpellCheckIterator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * 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 @@ -99,7 +99,7 @@ public class SpellCheckIterator implements ISpellCheckIterator { int offset= iterator.current(); while (offset != BreakIterator.DONE) { - fSentenceBreaks.add(new Integer(offset)); + fSentenceBreaks.add(Integer.valueOf(offset)); offset= iterator.next(); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/IndexUI.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/IndexUI.java index df1b82fa32a..7668cbdd6e9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/IndexUI.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/IndexUI.java @@ -552,9 +552,9 @@ public class IndexUI { IResource res= tu.getResource(); if (res != null) { Properties props= IndexerPreferences.getProperties(res.getProject()); - if (props == null || !"true".equals(props.get(IndexerPreferences.KEY_INDEX_ALL_FILES)) || //$NON-NLS-1$ - (!"true".equals(props.get(IndexerPreferences.KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG)) && //$NON-NLS-1$ - !"true".equals(props.get(IndexerPreferences.KEY_INDEX_UNUSED_HEADERS_WITH_ALTERNATE_LANG)))) { //$NON-NLS-1$ + if (props == null || !Boolean.parseBoolean((String) props.get(IndexerPreferences.KEY_INDEX_ALL_FILES)) || + (!Boolean.parseBoolean((String) props.get(IndexerPreferences.KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG)) && + !Boolean.parseBoolean((String) props.get(IndexerPreferences.KEY_INDEX_UNUSED_HEADERS_WITH_ALTERNATE_LANG)))) { msg= msg + " " + Messages.IndexUI_infoSelectIndexAllFiles; //$NON-NLS-1$ } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/BaseClassesListDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/BaseClassesListDialogField.java index d15c8b43b35..77a40156d8e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/BaseClassesListDialogField.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/BaseClassesListDialogField.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2012 QNX Software Systems and others. + * Copyright (c) 2004, 2016 QNX Software Systems and others. * 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 @@ -37,11 +37,11 @@ public class BaseClassesListDialogField extends ListDialogField private static final String CP_NAME = "name"; //$NON-NLS-1$ private static final String CP_ACCESS = "access"; //$NON-NLS-1$ private static final String CP_VIRTUAL = "virtual"; //$NON-NLS-1$ - static final Integer INDEX_YES = new Integer(0); - static final Integer INDEX_NO = new Integer(1); - static final Integer INDEX_PUBLIC = new Integer(0); - static final Integer INDEX_PROTECTED = new Integer(1); - static final Integer INDEX_PRIVATE = new Integer(2); + static final Integer INDEX_YES = 0; + static final Integer INDEX_NO = 1; + static final Integer INDEX_PUBLIC = 0; + static final Integer INDEX_PROTECTED = 1; + static final Integer INDEX_PRIVATE = 2; private final class CellHandler implements ICellModifier { @Override diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MethodStubsListDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MethodStubsListDialogField.java index 6f0b6df60d4..db6ae83e6f3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MethodStubsListDialogField.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MethodStubsListDialogField.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2012 QNX Software Systems and others. + * Copyright (c) 2004, 2016 QNX Software Systems and others. * 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 @@ -38,11 +38,11 @@ public class MethodStubsListDialogField extends CheckedListDialogField(filterDescs.length); for (FilterDescriptor filterDesc : filterDescs) { String id= filterDesc.getId(); - Boolean isEnabled= Boolean.valueOf(filterDesc.isEnabled()); + Boolean isEnabled= filterDesc.isEnabled(); //if (fEnabledFilterIds.containsKey(id)) // CUIPlugin.log(new Status("WARNING: Duplicate id for extension-point \"org.eclipse.jdt.ui.CElementFilters\"")); //$NON-NLS-1$ fEnabledFilterIds.put(id, isEnabled); @@ -523,7 +523,7 @@ public class CustomFiltersActionGroup extends ActionGroup { Iterator iter= fEnabledFilterIds.keySet().iterator(); while (iter.hasNext()) { String id= iter.next(); - Boolean isEnabled= Boolean.valueOf(store.getBoolean(id)); + Boolean isEnabled= store.getBoolean(id); fEnabledFilterIds.put(id, isEnabled); } diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java index 41ee8777539..42da2c519e5 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Symbian Software Limited and others. + * Copyright (c) 2007, 2016 Symbian Software Limited and others. * 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 diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java index e51b005e01c..de8f146693b 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 Symbian Software Limited and others. + * Copyright (c) 2007, 2016 Symbian Software Limited and others. * 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 @@ -74,7 +74,7 @@ public class UIBooleanWidget extends InputUIElement { */ @Override public void setValues(Map valueMap) { - booleanValue = Boolean.valueOf(valueMap.get(uiAttributes.get(UIElement.ID))).booleanValue(); + booleanValue = Boolean.parseBoolean(valueMap.get(uiAttributes.get(UIElement.ID))); } /* @@ -102,7 +102,7 @@ public class UIBooleanWidget extends InputUIElement { booleanContainer.setLayoutData(gridcData); button = new Button(booleanContainer, SWT.CHECK); button.setData(".uid", uiAttributes.get(UIElement.ID)); //$NON-NLS-1$ - button.setSelection(Boolean.valueOf(booleanValue).booleanValue()); + button.setSelection(booleanValue); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java index d9feb25195f..447626c74a7 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2014 QNX Software Systems and others. + * Copyright (c) 2004, 2016 QNX Software Systems and others. * 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 @@ -290,9 +290,9 @@ public class CDIDebugModel { public static void setLineBreakpointAttributes(Map attributes, String sourceHandle, Integer type, int lineNumber, boolean enabled, int ignoreCount, String condition) { attributes.put(IBreakpoint.ID, getPluginIdentifier()); - attributes.put(IMarker.LINE_NUMBER, new Integer(lineNumber)); + attributes.put(IMarker.LINE_NUMBER, Integer.valueOf(lineNumber)); attributes.put(IBreakpoint.ENABLED, Boolean.valueOf(enabled)); - attributes.put(ICBreakpoint.IGNORE_COUNT, new Integer(ignoreCount)); + attributes.put(ICBreakpoint.IGNORE_COUNT, Integer.valueOf(ignoreCount)); attributes.put(ICBreakpoint.CONDITION, condition); attributes.put(ICBreakpoint.SOURCE_HANDLE, sourceHandle); attributes.put(ICBreakpointType.TYPE, type); @@ -302,7 +302,7 @@ public class CDIDebugModel { attributes.put(ICLineBreakpoint2.REQUESTED_SOURCE_HANDLE, sourceHandle); } if (!attributes.containsKey(ICLineBreakpoint2.REQUESTED_LINE)) { - attributes.put(ICLineBreakpoint2.REQUESTED_LINE, new Integer(lineNumber)); + attributes.put(ICLineBreakpoint2.REQUESTED_LINE, Integer.valueOf(lineNumber)); } if (attributes.containsKey(IMarker.CHAR_START) && !attributes.containsKey(ICLineBreakpoint2.REQUESTED_CHAR_START)) { @@ -537,8 +537,8 @@ public class CDIDebugModel { String sourceHandle, int type, int lineNumber, IAddress address, boolean enabled, int ignoreCount, String condition) { setLineBreakpointAttributes(attributes, sourceHandle, type, lineNumber, enabled, ignoreCount, condition); - attributes.put(IMarker.CHAR_START, new Integer(-1)); - attributes.put(IMarker.CHAR_END, new Integer(-1)); + attributes.put(IMarker.CHAR_START, Integer.valueOf(-1)); + attributes.put(IMarker.CHAR_END, Integer.valueOf(-1)); attributes.put(ICLineBreakpoint.ADDRESS, address.toHexAddressString()); attributes.put(ICBreakpoint.MODULE, module); } @@ -700,9 +700,9 @@ public class CDIDebugModel { HashMap attributes = new HashMap(10); setWatchPointAttributes(attributes, sourceHandle, resource, writeAccess, readAccess, expression, memorySpace, range, enabled, ignoreCount, condition); - attributes.put(IMarker.CHAR_START, new Integer(charStart)); - attributes.put(IMarker.CHAR_END, new Integer(charEnd)); - attributes.put(IMarker.LINE_NUMBER, new Integer(lineNumber)); + attributes.put(IMarker.CHAR_START, Integer.valueOf(charStart)); + attributes.put(IMarker.CHAR_END, Integer.valueOf(charEnd)); + attributes.put(IMarker.LINE_NUMBER, Integer.valueOf(lineNumber)); return new CWatchpoint(resource, attributes, register); } @@ -789,7 +789,7 @@ public class CDIDebugModel { boolean enabled, int ignoreCount, String condition) { attributes.put(IBreakpoint.ID, getPluginIdentifier()); attributes.put(IBreakpoint.ENABLED, Boolean.valueOf(enabled)); - attributes.put(ICBreakpoint.IGNORE_COUNT, new Integer(ignoreCount)); + attributes.put(ICBreakpoint.IGNORE_COUNT, Integer.valueOf(ignoreCount)); attributes.put(ICBreakpoint.CONDITION, condition); attributes.put(ICBreakpoint.SOURCE_HANDLE, sourceHandle); attributes.put(ICWatchpoint.EXPRESSION, expression); @@ -1091,8 +1091,8 @@ public class CDIDebugModel { public static void setFunctionBreakpointAttributes(Map attributes, String sourceHandle, int type, String function, int charStart, int charEnd, int lineNumber, boolean enabled, int ignoreCount, String condition) { setLineBreakpointAttributes(attributes, sourceHandle, type, lineNumber, enabled, ignoreCount, condition); - attributes.put(IMarker.CHAR_START, new Integer(charStart)); - attributes.put(IMarker.CHAR_END, new Integer(charEnd)); + attributes.put(IMarker.CHAR_START, Integer.valueOf(charStart)); + attributes.put(IMarker.CHAR_END, Integer.valueOf(charEnd)); attributes.put(ICLineBreakpoint.FUNCTION, function); } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointProblems.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointProblems.java index 3c479c25cae..5588d0fefd4 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointProblems.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointProblems.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 Nokia and others. + * Copyright (c) 2007, 2016 Nokia and others. * 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 @@ -39,7 +39,7 @@ public class BreakpointProblems { public static final String BREAKPOINT_CONTEXT_ID = "bp_context_id"; //$NON-NLS-1$ public static IMarker reportBreakpointMoved(ICBreakpoint breakpoint, int oldLineNumber, int newLineNumber, String contextName, String contextID) throws CoreException { - String message = MessageFormat.format(BreakpointMessages.getString("BreakpointProblems_Moved"), new Object[] { new Integer(oldLineNumber), new Integer(newLineNumber) }); //$NON-NLS-1$ + String message = MessageFormat.format(BreakpointMessages.getString("BreakpointProblems_Moved"), new Object[] { Integer.valueOf(oldLineNumber), Integer.valueOf(newLineNumber) }); //$NON-NLS-1$ IMarker marker = BreakpointProblems.reportBreakpointProblem(breakpoint, message, IMarker.SEVERITY_INFO, MOVED, true, false, contextName, contextID); return marker; } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java index b24026641f3..498248c85aa 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2014 QNX Software Systems and others. + * Copyright (c) 2004, 2016 QNX Software Systems and others. * 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 @@ -228,7 +228,7 @@ public abstract class CBreakpoint extends Breakpoint implements ICBreakpoint2, I StringBuffer sb = new StringBuffer(); int ignoreCount = getIgnoreCount(); if ( ignoreCount > 0 ) { - sb.append( MessageFormat.format( BreakpointMessages.getString( "CBreakpoint.1" ), new Object[] { new Integer( ignoreCount ) } ) ); //$NON-NLS-1$ + sb.append( MessageFormat.format( BreakpointMessages.getString( "CBreakpoint.1" ), new Object[] { ignoreCount } ) ); //$NON-NLS-1$ } String condition = getCondition(); if ( condition != null && condition.length() > 0 ) { diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceContainerType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceContainerType.java index 71c295053eb..0f1a7073f39 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceContainerType.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceContainerType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2012 QNX Software Systems and others. + * Copyright (c) 2004, 2016 QNX Software Systems and others. * 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 @@ -38,7 +38,7 @@ public class CDirectorySourceContainerType extends AbstractSourceContainerTypeDe abort(InternalSourceLookupMessages.CDirectorySourceContainerType_0, null); } String nest = element.getAttribute("nest"); //$NON-NLS-1$ - boolean nested = "true".equals(nest); //$NON-NLS-1$ + boolean nested = Boolean.parseBoolean(nest); return new DirectorySourceContainer(new Path(string), nested); } abort(InternalSourceLookupMessages.CDirectorySourceContainerType_1, null); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceContainerType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceContainerType.java index 626a2e6aee8..e9b9f961194 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceContainerType.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceContainerType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2016 IBM Corporation and others. * 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 @@ -58,7 +58,7 @@ public class CProjectSourceContainerType extends AbstractSourceContainerTypeDele project = ResourcesPlugin.getWorkspace().getRoot().getProject(string); } String nest = element.getAttribute("referencedProjects"); //$NON-NLS-1$ - boolean ref = "true".equals(nest); //$NON-NLS-1$ + boolean ref = Boolean.parseBoolean(nest); return new CProjectSourceContainer(project, ref); } abort(InternalSourceLookupMessages.CProjectSourceContainerType_1, null); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CompilationDirectorySourceContainerType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CompilationDirectorySourceContainerType.java index 58d5b4400eb..a9feedb841a 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CompilationDirectorySourceContainerType.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CompilationDirectorySourceContainerType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2015 Google, Inc and others. + * Copyright (c) 2010, 2016 Google, Inc and others. * 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 @@ -48,7 +48,7 @@ public class CompilationDirectorySourceContainerType extends AbstractSourceConta abort(InternalSourceLookupMessages.CompilationDirectorySourceContainerType_0, null); } String nest = element.getAttribute("nest"); //$NON-NLS-1$ - boolean nested = "true".equals(nest); //$NON-NLS-1$ + boolean nested = Boolean.parseBoolean(nest); return new CompilationDirectorySourceContainer(new Path(path), nested); } abort(InternalSourceLookupMessages.CompilationDirectorySourceContainerType_1, null); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceFoldersRelativePathSourceContainerType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceFoldersRelativePathSourceContainerType.java index f226cdbf01f..678b32e3dbb 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceFoldersRelativePathSourceContainerType.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceFoldersRelativePathSourceContainerType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 Google, Inc and others. + * Copyright (c) 2010, 2016 Google, Inc and others. * 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 @@ -56,7 +56,7 @@ public class SourceFoldersRelativePathSourceContainerType extends AbstractSource project = ResourcesPlugin.getWorkspace().getRoot().getProject(string); } String nest = element.getAttribute("referencedProjects"); //$NON-NLS-1$ - boolean ref = "true".equals(nest); //$NON-NLS-1$ + boolean ref = Boolean.parseBoolean(nest); return new SourceFoldersRelativePathSourceContainer(project, ref); } abort(InternalSourceLookupMessages.SourceFoldersRelativePathSourceContainerType_1, null); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java index 55cae377932..20cf915c50a 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -360,9 +360,9 @@ public class CBreakpointPreferenceStore implements IPersistentPreferenceStore { public void setValue(String name, int value) { int oldValue = getInt(name); if (oldValue != value) { - fProperties.put( name, new Integer(value) ); + fProperties.put( name, Integer.valueOf(value) ); setDirty(true); - firePropertyChangeEvent(name, new Integer(oldValue), new Integer(value) ); + firePropertyChangeEvent(name, Integer.valueOf(oldValue), Integer.valueOf(value) ); } } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyUtils.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyUtils.java index de51911dd21..85cc95a5776 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyUtils.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Wind River Systems, Inc. and others. + * Copyright (c) 2010, 2016 Wind River Systems, Inc. and others. * 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 @@ -25,7 +25,7 @@ public class DisassemblyUtils { * Trace option. The view started out and continues to be in DSF but * backends can be non-DSF. */ - public final static boolean DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/disassembly")); //$NON-NLS-1$//$NON-NLS-2$ + public final static boolean DEBUG = Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/disassembly")); //$NON-NLS-1$ public static String getAddressText(BigInteger address) { if (address == null) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/ViewIDCounterManager.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/ViewIDCounterManager.java index 0e9b1493928..ebec351c3e7 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/ViewIDCounterManager.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/ViewIDCounterManager.java @@ -1,5 +1,5 @@ /***************************************************************** - * Copyright (c) 2010, 2012 Texas Instruments and others + * Copyright (c) 2010, 2016 Texas Instruments and others * 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 @@ -187,7 +187,7 @@ public final class ViewIDCounterManager { if (secondaryId != null) { Set secondaryIdSet = viewIdToNextCounterMap.get(viewId); if (secondaryIdSet != null) { - secondaryIdSet.remove(new Integer(PinCloneUtils.decodeClonedPartSecondaryId(secondaryId))); + secondaryIdSet.remove(Integer.valueOf(PinCloneUtils.decodeClonedPartSecondaryId(secondaryId))); } } } @@ -201,7 +201,7 @@ public final class ViewIDCounterManager { } for (int i = 1; i < Integer.MAX_VALUE; ++i) { - Integer next = new Integer(i); + Integer next = Integer.valueOf(i); if (!secondaryIdSet.contains(next)) { secondaryIdSet.add(next); return next; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceControlView.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceControlView.java index c1e863cd961..94d386144a1 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceControlView.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceControlView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2015 Ericsson and others. + * Copyright (c) 2010, 2016 Ericsson and others. * 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 @@ -550,7 +550,7 @@ public class TraceControlView extends ViewPart implements IViewPart { if (traceData.getCurrentTraceFrameId() != null) { fl += TracepointsMessages.bind(TracepointsMessages.TraceControlView_frame_looking, new Object[] { traceData.getCurrentTraceFrameId(), - new Integer(traceData.getTracepointNumberForCurrentTraceFrame())} ); + Integer.valueOf(traceData.getTracepointNumberForCurrentTraceFrame())} ); int recId = 0; try { recId = Integer.parseInt(traceData.getCurrentTraceFrameId()); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java index 2f1711f3bbd..8a9d7a821e9 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GdbCommandTimeoutManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 Mentor Graphics and others. + * Copyright (c) 2011, 2016 Mentor Graphics and others. * 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 @@ -57,7 +57,7 @@ public class GdbCommandTimeoutManager implements ICommandListener, IPreferenceCh * @deprecated The DEBUG flag is replaced with the GdbDebugOptions.DEBUG_COMMAND_TIMEOUTS */ @Deprecated - public final static boolean DEBUG = "true".equals( Platform.getDebugOption( "org.eclipse.cdt.dsf.gdb/debug/timeouts" ) ); //$NON-NLS-1$//$NON-NLS-2$ + public final static boolean DEBUG = Boolean.parseBoolean( Platform.getDebugOption( "org.eclipse.cdt.dsf.gdb/debug/timeouts" ) ); //$NON-NLS-1$ private class QueueEntry { private long fTimestamp; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarUpdateInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarUpdateInfo.java index d1fd9f49dfd..53a926e3413 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarUpdateInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarUpdateInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 QNX Software Systems and others. + * Copyright (c) 2000, 2016 QNX Software Systems and others. * 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 @@ -94,11 +94,11 @@ public class MIVarUpdateInfo extends MIInfo { } } else if (var.equals("in_scope")) { //$NON-NLS-1$ if (change != null) { - change.setInScope("true".equals(str)); //$NON-NLS-1$ + change.setInScope(Boolean.parseBoolean(str)); } } else if (var.equals("type_changed")) { //$NON-NLS-1$ if (change != null) { - change.setChanged("true".equals(str)); //$NON-NLS-1$ + change.setChanged(Boolean.parseBoolean(str)); } } else if (var.equals("new_type")) { //$NON-NLS-1$ if (change != null) { diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/ServiceEventWaitor.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/ServiceEventWaitor.java index 3814137d1c4..d4969126cae 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/ServiceEventWaitor.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/ServiceEventWaitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 Ericsson and others. + * Copyright (c) 2007, 2016 Ericsson and others. * 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 @@ -54,7 +54,7 @@ public class ServiceEventWaitor { /** * Trace option for wait metrics */ - private static final boolean LOG = TestsPlugin.DEBUG && "true".equals(Platform.getDebugOption("org.eclipse.cdt.tests.dsf.gdb/debug/waitMetrics")); //$NON-NLS-1$//$NON-NLS-2$ + private static final boolean LOG = TestsPlugin.DEBUG && Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.tests.dsf.gdb/debug/waitMetrics")); //$NON-NLS-1$ /** * Constructor diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/launching/TestsPlugin.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/launching/TestsPlugin.java index c1cc93c1f07..9da53ea9967 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/launching/TestsPlugin.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/launching/TestsPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 Wind River Systems and others. + * Copyright (c) 2007, 2016 Wind River Systems and others. * 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 @@ -34,7 +34,7 @@ public class TestsPlugin extends Plugin { public static final String PLUGIN_ID = "org.eclipse.cdt.tests.dsf.gdb"; //$NON-NLS-1$ /** Base tracing option for this plugin */ - public static final boolean DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.cdt.tests.dsf.gdb/debug")); //$NON-NLS-1$//$NON-NLS-2$ + public static final boolean DEBUG = Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.tests.dsf.gdb/debug")); //$NON-NLS-1$ /** * The constructor. diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java index 1140295ab73..ef1f16c9090 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 Ericsson and others. + * Copyright (c) 2007, 2016 Ericsson and others. * 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 @@ -83,7 +83,7 @@ public class MIMemoryTest extends BaseParametrizedTestCase { // Keeps track of the MemoryChangedEvents private final int BLOCK_SIZE = 256; private IAddress fBaseAddress; - private Integer fMemoryChangedEventCount = new Integer(0); + private Integer fMemoryChangedEventCount = 0; private boolean[] fMemoryAddressesChanged = new boolean[BLOCK_SIZE]; @Rule diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java index 65574f07487..90785318395 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 Ericsson and others. + * Copyright (c) 2007, 2016 Ericsson and others. * 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 @@ -235,12 +235,13 @@ public class MIRunControlTest extends BaseParametrizedTestCase { // The ordering of the contexts is not deterministic LinkedList ids = new LinkedList(Arrays.asList(new Integer[] {1})); if (sProgramIsCygwin) { - ids.add(new Integer(2)); + ids.add(2); } - assertTrue(ids.remove(new Integer(((IMIExecutionDMContext)ctxts[0]).getThreadId()))); + // Note that List.remove(int) and List.remove(Integer) have different effects so this should stay remove(Integer) + assertTrue(ids.remove(Integer.valueOf(((IMIExecutionDMContext)ctxts[0]).getThreadId()))); if (sProgramIsCygwin) { - assertTrue(ids.remove(new Integer(((IMIExecutionDMContext)ctxts[1]).getThreadId()))); + assertTrue(ids.remove(Integer.valueOf(((IMIExecutionDMContext)ctxts[1]).getThreadId()))); } wait.waitReset(); @@ -312,13 +313,13 @@ public class MIRunControlTest extends BaseParametrizedTestCase { // The ordering of the contexts is not deterministic LinkedList ids = new LinkedList(Arrays.asList(new Integer[] {1,2})); if (sProgramIsCygwin) { - ids.add(new Integer(3)); + ids.add(3); } - assertTrue(ids.remove(new Integer(((IMIExecutionDMContext)data[0]).getThreadId()))); - assertTrue(ids.remove(new Integer(((IMIExecutionDMContext)data[1]).getThreadId()))); + assertTrue(ids.remove(Integer.valueOf(((IMIExecutionDMContext)data[0]).getThreadId()))); + assertTrue(ids.remove(Integer.valueOf(((IMIExecutionDMContext)data[1]).getThreadId()))); if (sProgramIsCygwin) { - assertTrue(ids.remove(new Integer(((IMIExecutionDMContext)data[2]).getThreadId()))); + assertTrue(ids.remove(Integer.valueOf(((IMIExecutionDMContext)data[2]).getThreadId()))); } } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java index fa96dd120c3..83c2f2c241a 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems and others. + * Copyright (c) 2007, 2016 Wind River Systems and others. * 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 @@ -196,7 +196,7 @@ import com.ibm.icu.text.MessageFormat; @SuppressWarnings("restriction") public abstract class DisassemblyPart extends WorkbenchPart implements IDisassemblyPart, IViewportListener, ITextPresentationListener, IDisassemblyPartCallback { - final static boolean DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/disassembly")); //$NON-NLS-1$//$NON-NLS-2$ + final static boolean DEBUG = Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/disassembly")); //$NON-NLS-1$//$NON-NLS-2$ /** * Annotation model attachment key for breakpoint annotations. diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/VMViewerUpdateTracing.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/VMViewerUpdateTracing.java index 66bf66858b8..cccd7f5e219 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/VMViewerUpdateTracing.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/VMViewerUpdateTracing.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Freescale Semiconductors and others. + * Copyright (c) 2009, 2016 Freescale Semiconductors and others. * 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 @@ -34,7 +34,7 @@ public final class VMViewerUpdateTracing { * Has the "debug/vmUpdates/properties" tracing option been turned on? Requires * "debug/vmUpdates" to also be turned on. */ - public static final boolean DEBUG_VMUPDATES = DsfUIPlugin.DEBUG && "true".equals(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/vm/updates")); //$NON-NLS-1$//$NON-NLS-2$ + public static final boolean DEBUG_VMUPDATES = DsfUIPlugin.DEBUG && Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/vm/updates")); //$NON-NLS-1$ /** * Looks at the optional filter (regular expression) set in the tracing diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SteppingController.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SteppingController.java index 22276797c3f..b0c601992e8 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SteppingController.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SteppingController.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems and others. + * Copyright (c) 2006, 2016 Wind River Systems and others. * 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 @@ -79,7 +79,7 @@ public final class SteppingController { */ public final static int MAX_STEP_DELAY= 5000; - private final static boolean DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/stepping")); //$NON-NLS-1$ //$NON-NLS-2$ + private final static boolean DEBUG = Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/stepping")); //$NON-NLS-1$ /** * Indicates that the given context has been stepping for some time, @@ -675,4 +675,4 @@ public final class SteppingController { } } } -} \ No newline at end of file +} diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterBitFieldCellModifier.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterBitFieldCellModifier.java index 5686a500800..c5a44ee4dc1 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterBitFieldCellModifier.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterBitFieldCellModifier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Wind River Systems and others. + * Copyright (c) 2008, 2016 Wind River Systems and others. * 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 @@ -129,7 +129,7 @@ public class RegisterBitFieldCellModifier extends WatchExpressionCellModifier { int index = 0 ; for ( IMnemonic mnemonic : fBitFieldData.getMnemonics() ) { if ( mnemonic.equals( curMnemonic ) ) { - return new Integer( index ); + return index; } index ++; } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/internal/ui/DsfUIPlugin.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/internal/ui/DsfUIPlugin.java index a6e95a7b362..f13b6765091 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/internal/ui/DsfUIPlugin.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/internal/ui/DsfUIPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2014 Wind River Systems and others. + * Copyright (c) 2006, 2016 Wind River Systems and others. * 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 @@ -61,7 +61,7 @@ public class DsfUIPlugin extends AbstractUIPlugin { public void start(BundleContext context) throws Exception { fgBundleContext = context; super.start(context); - DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug")); //$NON-NLS-1$//$NON-NLS-2$ + DEBUG = Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug")); //$NON-NLS-1$//$NON-NLS-2$ fSourceDocumentProvider = new SourceDocumentProvider(); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/ViewerDataRequestMonitor.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/ViewerDataRequestMonitor.java index 5e766b15d08..ace9ed70660 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/ViewerDataRequestMonitor.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/ViewerDataRequestMonitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Wind River Systems and others. + * Copyright (c) 2007, 2016 Wind River Systems and others. * 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 @@ -33,7 +33,7 @@ public class ViewerDataRequestMonitor extends DataRequestMonitor { /** * Same as {@link DsfExecutable#DEBUG_MONITORS} */ - static private boolean DEBUG_MONITORS = DsfPlugin.DEBUG && "true".equals( //$NON-NLS-1$ + static private boolean DEBUG_MONITORS = DsfPlugin.DEBUG && Boolean.parseBoolean( Platform.getDebugOption("org.eclipse.cdt.dsf/debug/monitors")); //$NON-NLS-1$ diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java index 67556c920f8..f3b92cb8a44 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems and others. + * Copyright (c) 2006, 2016 Wind River Systems and others. * 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 @@ -79,10 +79,10 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene if (!DsfUIPlugin.DEBUG || "".equals(DEBUG_PRESENTATION_ID)) { //$NON-NLS-1$ DEBUG_PRESENTATION_ID = null; } - DEBUG_CONTENT_PROVIDER = DsfUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$ + DEBUG_CONTENT_PROVIDER = DsfUIPlugin.DEBUG && Boolean.parseBoolean( Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/vm/contentProvider")); //$NON-NLS-1$ - DEBUG_DELTA = DsfUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$ + DEBUG_DELTA = DsfUIPlugin.DEBUG && Boolean.parseBoolean( Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/vm/delta")); //$NON-NLS-1$ } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java index 1b30ddc34f1..978d1605392 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems and others. + * Copyright (c) 2007, 2016 Wind River Systems and others. * 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 @@ -80,7 +80,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider static boolean DEBUG_CACHE = false; static { - DEBUG_CACHE = DsfUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$ + DEBUG_CACHE = DsfUIPlugin.DEBUG && Boolean.parseBoolean( Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/vm/cache")); //$NON-NLS-1$ } diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java index cd1cc79f256..c9758967a09 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems and others. + * Copyright (c) 2006, 2016 Wind River Systems and others. * 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 @@ -132,7 +132,7 @@ public class DefaultDsfExecutor extends ScheduledThreadPoolExecutor protected static String DEBUG_EXECUTOR_NAME = ""; //$NON-NLS-1$ protected static boolean ASSERTIONS_ENABLED = false; static { - DEBUG_EXECUTOR = DsfPlugin.DEBUG && "true".equals( //$NON-NLS-1$ + DEBUG_EXECUTOR = DsfPlugin.DEBUG && Boolean.parseBoolean( Platform.getDebugOption("org.eclipse.cdt.dsf/debug/executor")); //$NON-NLS-1$ DEBUG_EXECUTOR_NAME = DsfPlugin.DEBUG ? Platform.getDebugOption("org.eclipse.cdt.dsf/debug/executorName") : ""; //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java index 462ebb8f219..e1373792c69 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems and others. + * Copyright (c) 2006, 2016 Wind River Systems and others. * 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 @@ -81,10 +81,10 @@ public class DsfExecutable { static { assert (ASSERTIONS_ENABLED = true) == true; - DEBUG_EXECUTOR = DsfPlugin.DEBUG && "true".equals( //$NON-NLS-1$ + DEBUG_EXECUTOR = DsfPlugin.DEBUG && Boolean.parseBoolean( Platform.getDebugOption("org.eclipse.cdt.dsf/debug/executor")); //$NON-NLS-1$ - DEBUG_MONITORS = DsfPlugin.DEBUG && "true".equals( //$NON-NLS-1$ + DEBUG_MONITORS = DsfPlugin.DEBUG && Boolean.parseBoolean( Platform.getDebugOption("org.eclipse.cdt.dsf/debug/monitors")); //$NON-NLS-1$ } diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateExecutor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateExecutor.java index 13bfd893513..f8f69604330 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateExecutor.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateExecutor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems and others. + * Copyright (c) 2007, 2016 Wind River Systems and others. * 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 @@ -34,7 +34,7 @@ public class ImmediateExecutor implements Executor { */ protected static boolean DEBUG_EXECUTOR = false; static { - DEBUG_EXECUTOR = DsfPlugin.DEBUG && "true".equals( //$NON-NLS-1$ + DEBUG_EXECUTOR = DsfPlugin.DEBUG && Boolean.parseBoolean( Platform.getDebugOption("org.eclipse.cdt.dsf/debug/executor")); //$NON-NLS-1$ } diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java index 2c3f701ae83..c7b87ef3bb9 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems and others. + * Copyright (c) 2007, 2016 Wind River Systems and others. * 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 @@ -176,7 +176,7 @@ public class CommandCache implements ICommandListener private static final String CACHE_TRACE_IDENTIFIER = " [CHE]"; //$NON-NLS-1$ private static String BLANK_CACHE_TRACE_IDENTIFIER = ""; //$NON-NLS-1$ static { - DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.cdt.dsf/debugCache")); //$NON-NLS-1$//$NON-NLS-2$ + DEBUG = Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.dsf/debugCache")); //$NON-NLS-1$ for (int i=0; i(); fChildrenUpdatesScheduled.put(path, childrenIndexes); } - childrenIndexes.add(new Integer(index)); + childrenIndexes.add(index); } public void removeChildrenUpdate(TreePath path, int index) { Set childrenIndexes = fChildrenUpdatesScheduled.get(path); if (childrenIndexes != null) { - childrenIndexes.remove(new Integer(index)); + childrenIndexes.remove(Integer.valueOf(index)); if (childrenIndexes.isEmpty()) { fChildrenUpdatesScheduled.remove(path); } @@ -368,7 +368,7 @@ public class ViewerUpdatesListener Set childrenIndexes = fChildrenUpdatesScheduled.get(update.getElementPath()); if (childrenIndexes != null) { for (int i = start; i < end; i++) { - childrenIndexes.remove(new Integer(i)); + childrenIndexes.remove(Integer.valueOf(i)); } if (childrenIndexes.isEmpty()) { fChildrenUpdatesScheduled.remove(update.getElementPath()); diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpointAttributeTranslator2.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpointAttributeTranslator2.java index 7d182f69254..67af3a7da1d 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpointAttributeTranslator2.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpointAttributeTranslator2.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 Wind River Systems and others. + * Copyright (c) 2008, 2016 Wind River Systems and others. * 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 @@ -48,7 +48,7 @@ public class DsfTestBreakpointAttributeTranslator2 implements IBreakpointAttribu { Integer num = (Integer)bpAttrs.get(DsfTestBreakpoint.ATTR_NUM_TARGET_BREAKPOINTS); if (num == null) { - num = new Integer(1); + num = 1; } List> subBpsAttrs = new ArrayList>(num); for (int i = 0; i < num; i++) { diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfQueryTests.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfQueryTests.java index ebfc48e2d54..a8f0d74d0b9 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfQueryTests.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfQueryTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems and others. + * Copyright (c) 2006, 2016 Wind River Systems and others. * 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 @@ -265,7 +265,7 @@ public class DsfQueryTests { // Complete rm and query. @SuppressWarnings("unchecked") DataRequestMonitor drm = (DataRequestMonitor)rmHolder[0]; - drm.setData(new Integer(1)); + drm.setData(Integer.valueOf(1)); rmHolder[0].done(); // Try to retrieve data again, it should still result in diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java index 94475d402d1..6550fc375bd 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 QNX Software Systems and others. + * Copyright (c) 2009, 2016 QNX Software Systems and others. * 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 @@ -528,7 +528,7 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat el.action = action; el.actionParam = actionParam; el.mode = (String) attrs.get(getProp(index, MODE_PROP)); - el.enabled = "true".equals(attrs.get(getProp(index, ENABLED_PROP))); //$NON-NLS-1$ + el.enabled = Boolean.parseBoolean((String) attrs.get(getProp(index, ENABLED_PROP))); try { el.data = findLaunch(el.name); } catch (Exception e) { diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java index b193689b5df..e7452c869e9 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 QNX Software Systems and others. + * Copyright (c) 2009, 2016 QNX Software Systems and others. * 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 @@ -248,7 +248,7 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp public void modifyText(ModifyEvent e) { String text = ((Text)e.widget).getText(); try { - actionParam = new Integer(Integer.parseInt(text)); + actionParam = Integer.valueOf(text); } catch (NumberFormatException exc) { actionParam = null; diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/ProcessPrompter.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/ProcessPrompter.java index bc45210fa76..6aa0eb067e7 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/ProcessPrompter.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/ProcessPrompter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2012 QNX Software Systems and others. + * Copyright (c) 2004, 2016 QNX Software Systems and others. * 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 @@ -105,7 +105,7 @@ public class ProcessPrompter implements IStatusHandler { if (dialog.open() == Window.OK) { IProcessInfo info = (IProcessInfo)dialog.getFirstResult(); if (info != null) { - return new Integer(info.getPid()); + return Integer.valueOf(info.getPid()); } } return null; diff --git a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/SymbolTableTests.java b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/SymbolTableTests.java index 811a734bfa8..6b598bdaac4 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/SymbolTableTests.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/symboltable/SymbolTableTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * 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 @@ -36,7 +36,7 @@ public class SymbolTableTests {//extends TestCase { // a new symbol table was created assertFalse(st1.isEmpty()); - assertEquals(new Integer(1), st1.lookup(KEYS[0])); + assertEquals(Integer.valueOf(1), st1.lookup(KEYS[0])); FunctionalMap st2 = st1.insert(KEYS[1], 2); FunctionalMap st3 = st2.insert(KEYS[2], 3); @@ -95,8 +95,8 @@ public class SymbolTableTests {//extends TestCase { FunctionalMap map2 = map1.insert(KEYS[5], 999); FunctionalMap map3 = map2.insert(KEYS[5], null); - assertEquals(new Integer(5), map1.lookup(KEYS[5])); - assertEquals(new Integer(999), map2.lookup(KEYS[5])); + assertEquals(Integer.valueOf(5), map1.lookup(KEYS[5])); + assertEquals(Integer.valueOf(999), map2.lookup(KEYS[5])); assertNull(map3.lookup(KEYS[5])); } diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/BuildASTParserAction.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/BuildASTParserAction.java index dd028e5e9ce..0a67e49d777 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/BuildASTParserAction.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/BuildASTParserAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2014 IBM Corporation and others. + * Copyright (c) 2006, 2016 IBM Corporation and others. * 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 @@ -1021,7 +1021,7 @@ public abstract class BuildASTParserAction extends AbstractParserAction { private boolean discardInitializer(IASTExpression expression) { return initializerListNestingLevel > 0 - && "true".equals(properties.get(LRParserProperties.SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS)) //$NON-NLS-1$ + && Boolean.parseBoolean(properties.get(LRParserProperties.SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS)) && !ASTQueries.canContainName(expression); } @@ -1097,4 +1097,4 @@ public abstract class BuildASTParserAction extends AbstractParserAction { astStack.push(problemHolder); } -} \ No newline at end of file +} diff --git a/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java b/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java index 9eb10680509..cc88420123f 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007-2012 Wind River Systems, Inc. and others. + * Copyright (c) 2007-2016 Wind River Systems, Inc. and others. * 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 @@ -203,7 +203,7 @@ public class FindReplaceDialog extends SelectionDialog value = new BigInteger(element.substring(1), 8); else value = new BigInteger(element, 10); - Byte b = new Byte(value.byteValue()); + Byte b = value.byteValue(); if(value.compareTo(BigInteger.valueOf(255)) > 0) return null; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QmlASTNodeHandler.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QmlASTNodeHandler.java index e20a6b0e1b8..46e98663935 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QmlASTNodeHandler.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QmlASTNodeHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 QNX Software Systems and others. + * Copyright (c) 2015, 2016 QNX Software Systems and others. * 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 @@ -194,7 +194,7 @@ public class QmlASTNodeHandler implements InvocationHandler { if (value instanceof Number) { return value; } - return new Integer(0); + return 0; } else if (expectedType.isEnum()) { return expectedType.getMethod(CREATE_ENUM_METHOD, Object.class).invoke(null, value); } else if (value instanceof Bindings) { diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java index 13627e3c13a..aef8dadb422 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015 QNX Software Systems and others. + * Copyright (c) 2013, 2016 QNX Software Systems and others. * 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 @@ -154,12 +154,12 @@ public class QObjectConnectCompletion { final int length = code.length(); int pos = 0; List positions = new ArrayList(); - positions.add(new Integer(-1)); + positions.add(-1); while (pos < length && pos != -1) { char ch = code.charAt(pos); switch (ch) { case ',': - positions.add(new Integer(pos)); + positions.add(Integer.valueOf(pos)); break; case '(': pos = indexOfClosingPeer(code, '(', ')', pos); @@ -176,7 +176,7 @@ public class QObjectConnectCompletion { if (pos != -1) pos++; } - positions.add(new Integer(length)); + positions.add(Integer.valueOf(length)); int[] fields = new int[positions.size()]; for (int i = 0; i < fields.length; i++)