]> source.dussan.org Git - aspectj.git/commitdiff
Use the diamond operator where possible 2/head
authorLars Grefer <eclipse@larsgrefer.de>
Wed, 12 Aug 2020 23:01:58 +0000 (01:01 +0200)
committerLars Grefer <eclipse@larsgrefer.de>
Wed, 12 Aug 2020 23:01:58 +0000 (01:01 +0200)
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
243 files changed:
ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/BrowserManager.java
ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserOutputLocationManager.java
ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserMessageHandler.java
ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/EditorManager.java
ajde.core/src/main/java/org/aspectj/ajde/core/JavaOptions.java
ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreBuildManager.java
ajde.core/src/test/java/org/aspectj/ajde/core/AjdeCoreTestCase.java
ajde.core/src/test/java/org/aspectj/ajde/core/TestBuildProgressMonitor.java
ajde.core/src/test/java/org/aspectj/ajde/core/TestCompilerConfiguration.java
ajde.core/src/test/java/org/aspectj/ajde/core/TestMessageHandler.java
ajde.core/src/test/java/org/aspectj/ajde/core/TestOutputLocationManager.java
ajde.core/src/test/java/org/aspectj/ajde/core/tests/AjConfigTest.java
ajde.core/src/test/java/org/aspectj/ajde/core/tests/DuplicateManifestTest.java
ajde.core/src/test/java/org/aspectj/ajde/core/tests/InpathTest.java
ajde.core/src/test/java/org/aspectj/ajde/core/tests/OutxmlTest.java
ajde.core/src/test/java/org/aspectj/ajde/core/tests/ResourceCopyTest.java
ajde.core/src/test/java/org/aspectj/ajde/core/tests/ReweavableTest.java
ajde.core/src/test/java/org/aspectj/ajde/core/tests/ShowWeaveMessagesTest.java
ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileParser.java
ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java
ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java
ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java
ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigNode.java
ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java
ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java
ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java
ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java
asm/src/main/java/org/aspectj/asm/AsmManager.java
asm/src/main/java/org/aspectj/asm/IProgramElement.java
asm/src/main/java/org/aspectj/asm/internal/AspectJElementHierarchy.java
asm/src/main/java/org/aspectj/asm/internal/ProgramElement.java
asm/src/main/java/org/aspectj/asm/internal/RelationshipMap.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/FieldOrMethod.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/JavaClass.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Method.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Utility.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGen.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGenOrMethodGen.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionHandle.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MethodGen.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Type.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderRepository.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/util/SyntheticRepository.java
bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java
bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/BcelTestCase.java
bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GeneratingAnnotatedClassesTest.java
bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericSignatureParsingTest.java
bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/NonCachingClassLoaderRepositoryTest.java
bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ParameterAnnotationsTest.java
bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java
bridge/src/main/java/org/aspectj/bridge/AbortException.java
bridge/src/main/java/org/aspectj/bridge/CountingMessageHandler.java
bridge/src/main/java/org/aspectj/bridge/MessageHandler.java
bridge/src/main/java/org/aspectj/bridge/MessageUtil.java
bridge/src/main/java/org/aspectj/bridge/context/CompilationAndWeavingContext.java
build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java
build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java
build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java
build/src/main/java/org/aspectj/internal/tools/build/Builder.java
build/src/main/java/org/aspectj/internal/tools/build/Module.java
build/src/main/java/org/aspectj/internal/tools/build/Modules.java
build/src/main/java/org/aspectj/internal/tools/build/Result.java
build/src/main/java/org/aspectj/internal/tools/build/SampleGatherer.java
build/src/test/java/org/aspectj/build/BuildModuleTests.java
build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java
build/src/test/java/org/aspectj/internal/build/ModulesTest.java
loadtime/src/main/java/org/aspectj/weaver/loadtime/Aj.java
loadtime/src/main/java/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
loadtime/src/main/java/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java
loadtime/src/test/java/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptorTest.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/ConfigParser.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/HelperInterfaceBinding.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PushinCollector.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfigTest.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjStateTest.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTVisitorTest.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTest.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTestCase.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/MainTest.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractReferenceTypeDelegate.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/CrosscuttingMembers.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/CrosscuttingMembersSet.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/IntMap.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/Iterators.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/JoinPointSignatureIterator.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/MemberImpl.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/ReferenceType.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedMemberImpl.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedType.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/ShadowMunger.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/StandardAnnotation.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeFactory.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/WeaverStateInfo.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AndSignaturePattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/BasicTokenSource.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/CflowPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareAnnotation.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareParents.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ExactTypePattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/IfPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ModifiersPattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/OrSignaturePattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PatternParser.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PerCflow.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PointcutRewriter.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ReferencePointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/SignaturePattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternList.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternQuestions.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/reflect/ReflectionWorld.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/PointcutParser.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/StandardPointcutParser.java
org.aspectj.matcher/src/test/java/org/aspectj/weaver/CommonWorldTests.java
org.aspectj.matcher/src/test/java/org/aspectj/weaver/TestUtils.java
org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ConstantPoolSimulator.java
org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ParserTestCase.java
runtime/src/main/java/org/aspectj/internal/lang/reflect/AjTypeImpl.java
runtime/src/main/java/org/aspectj/lang/reflect/AjTypeSystem.java
runtime/src/main/java/org/aspectj/runtime/reflect/JoinPointImpl.java
taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java
taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java
taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/compilers/Ajc.java
testing/src/test/java/org/aspectj/internal/tools/ant/taskdefs/Ajctest.java
testing/src/test/java/org/aspectj/testing/AjcTest.java
testing/src/test/java/org/aspectj/testing/AutowiredXMLBasedAjcTestCase.java
testing/src/test/java/org/aspectj/testing/CompileSpec.java
testing/src/test/java/org/aspectj/testing/MakeTestClass.java
testing/src/test/java/org/aspectj/testing/OutputSpec.java
testing/src/test/java/org/aspectj/testing/RunSpec.java
testing/src/test/java/org/aspectj/testing/WeaveSpec.java
testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java
testing/src/test/java/org/aspectj/testing/harness/bridge/AbstractRunSpec.java
testing/src/test/java/org/aspectj/testing/harness/bridge/AjcTest.java
testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java
testing/src/test/java/org/aspectj/testing/util/AccumulatingFileFilter.java
testing/src/test/java/org/aspectj/testing/util/Diffs.java
testing/src/test/java/org/aspectj/testing/util/LinkCheck.java
testing/src/test/java/org/aspectj/testing/util/StructureModelUtil.java
testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java
tests/src/test/java/org/aspectj/systemtest/ajc154/CustomMungerExtensionTest.java
tests/src/test/java/org/aspectj/systemtest/incremental/tools/AbstractMultiProjectIncrementalAjdeInteractionTestbed.java
tests/src/test/java/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
tests/src/test/java/org/aspectj/systemtest/incremental/tools/AnnotationProcessingTests.java
tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjTestBuildProgressMonitor.java
tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjTestCompilerConfiguration.java
tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjTestMessageHandler.java
tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
tests/src/test/java/org/aspectj/systemtest/model/ModelTestCase.java
util/src/main/java/org/aspectj/util/FileUtil.java
util/src/main/java/org/aspectj/util/GenericSignatureParser.java
util/src/main/java/org/aspectj/util/LangUtil.java
util/src/main/java/org/aspectj/util/PartialOrder.java
util/src/main/java/org/aspectj/util/Reflection.java
util/src/main/java/org/aspectj/util/SoftHashMap.java
util/src/main/java/org/aspectj/util/UtilClassLoader.java
util/src/test/java/org/aspectj/util/FileUtilTest.java
weaver/src/main/java/org/aspectj/weaver/bcel/AtAjAttributes.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelAdvice.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelAnnotation.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXConverter.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelMethod.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelTypeMunger.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelWorld.java
weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java
weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java
weaver/src/main/java/org/aspectj/weaver/bcel/LazyMethodGen.java
weaver/src/main/java/org/aspectj/weaver/bcel/Utility.java
weaver/src/main/java/org/aspectj/weaver/loadtime/definition/Definition.java
weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java
weaver/src/main/java/org/aspectj/weaver/loadtime/definition/LightXMLParser.java
weaver/src/main/java/org/aspectj/weaver/model/AsmRelationshipProvider.java
weaver/src/main/java/org/aspectj/weaver/reflect/JavaLangTypeToResolvedTypeConverter.java
weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java
weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractIndexedFileCacheBacking.java
weaver/src/main/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBacking.java
weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolver.java
weaver/src/main/java/org/aspectj/weaver/tools/cache/FlatFileCacheBacking.java
weaver/src/main/java/org/aspectj/weaver/tools/cache/WeavedClassCache.java
weaver/src/main/java/org/aspectj/weaver/tools/cache/ZippedFileCacheBacking.java
weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java
weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java
weaver/src/test/java/org/aspectj/weaver/WeaverMessagesTestCase.java
weaver/src/test/java/org/aspectj/weaver/bcel/MegaZipTestCase.java
weaver/src/test/java/org/aspectj/weaver/bcel/WeaveTestCase.java
weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternMatchingTestCase.java
weaver/src/test/java/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java
weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java
weaver/src/test/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBackingTestSupport.java
weaver/src/test/java/org/aspectj/weaver/tools/cache/FlatFileCacheBackingTest.java
weaver/src/test/java/org/aspectj/weaver/tools/cache/WeavedClassCacheTest.java
weaver/src/test/java/org/aspectj/weaver/tools/cache/ZippedFileCacheBackingTest.java

index e59c1610369ae4d192cd8a5694dcc62055a57554..a5856afd982ee2c862c793d0f16db5693c1a972c 100644 (file)
@@ -61,7 +61,7 @@ public class BrowserManager {
        private UserPreferencesAdapter preferencesAdapter;
        private static TopFrame topFrame = null;
 
-       private List<String> configFiles = new ArrayList<String>();
+       private List<String> configFiles = new ArrayList<>();
        private JavaBuildOptions javaBuildOptions;
 
        public static BrowserManager getDefault() {
@@ -182,7 +182,7 @@ public class BrowserManager {
        }
 
        private List<String> getConfigFilesList(String[] configFiles) {
-               List<String> configs = new ArrayList<String>();
+               List<String> configs = new ArrayList<>();
                for (String configFile : configFiles) {
                        if (configFile.endsWith(BuildConfigManager.CONFIG_FILE_SUFFIX)) {
                                configs.add(configFile);
index 1b754d2f1e82962480c21dd0e975aac6f2313f64..c721394e2410b39854e7d2f6148e0b97ada68501 100644 (file)
@@ -47,7 +47,7 @@ public class BrowserOutputLocationManager implements IOutputLocationManager {
        }
 
        public List<File> getAllOutputLocations() {
-               List<File> outputDirs = new ArrayList<File>();
+               List<File> outputDirs = new ArrayList<>();
                outputDirs.add(new File(getCommonOutputDir()));
                return outputDirs;
        }
index b8dcf1c41a7910d9bfae3e683aec1205abe27689..5188f8daf916db3a83d76d6e0db25facb707cac4 100644 (file)
@@ -32,8 +32,8 @@ public class BrowserMessageHandler implements IUIBuildMessageHandler {
        private List<IMessage> messages;
 
        public BrowserMessageHandler() {
-               ignoring = new ArrayList<IMessage.Kind>();
-               messages = new ArrayList<IMessage>();
+               ignoring = new ArrayList<>();
+               messages = new ArrayList<>();
                ignore(IMessage.INFO);
                ignore(IMessage.WEAVEINFO);
        }
index 12a7f8938c2a42eb16d516358a104e802954ca6f..b737cf07e9be09c1318a1684d57950452afbeac5 100644 (file)
@@ -43,8 +43,8 @@ public class EditorManager {
 
        private EditorAdapter editor = null;
        private BasicEditor basicEditor = null;
-       private ArrayList<EditorListener> editorListeners = new ArrayList<EditorListener>();
-       private Vector<EditorAdapter> editors = new Vector<EditorAdapter>();
+       private ArrayList<EditorListener> editorListeners = new ArrayList<>();
+       private Vector<EditorAdapter> editors = new Vector<>();
        private JPanel editor_panel = null;
        private Box editors_box = Box.createVerticalBox();
 
index 5de225339e1ab18bb0572cf0c37773ae741cf2d3..cab96198bd5edc2aa261d78d6ebdf660f50a6c2a 100644 (file)
@@ -68,7 +68,7 @@ public final class JavaOptions {
        public static Map<String,String> getDefaultJavaOptions() {
                if (defaultOptionsMap != null) return defaultOptionsMap;
                
-               defaultOptionsMap = new HashMap<String,String>();
+               defaultOptionsMap = new HashMap<>();
                defaultOptionsMap.put(COMPLIANCE_LEVEL, VERSION_14);
                defaultOptionsMap.put(SOURCE_COMPATIBILITY_LEVEL, VERSION_13);
                defaultOptionsMap.put(PRESERVE_ALL_LOCALS, OPTIMIZE);
index b64588001fc83248a57baa73db22051024e79cc7..6547d101ce4cb67fb4de6cf978aeab3ea1cfa5d5 100644 (file)
@@ -272,7 +272,7 @@ public class AjdeCoreBuildManager {
                if (propcp != null && propcp.length() != 0) {
                        StringTokenizer st = new StringTokenizer(propcp, File.pathSeparator);
                        List<String> configClasspath = config.getClasspath();
-                       ArrayList<String> toAdd = new ArrayList<String>();
+                       ArrayList<String> toAdd = new ArrayList<>();
                        while (st.hasMoreTokens()) {
                                String entry = st.nextToken();
                                if (!configClasspath.contains(entry)) {
@@ -280,7 +280,7 @@ public class AjdeCoreBuildManager {
                                }
                        }
                        if (0 < toAdd.size()) {
-                               ArrayList<String> both = new ArrayList<String>(configClasspath.size() + toAdd.size());
+                               ArrayList<String> both = new ArrayList<>(configClasspath.size() + toAdd.size());
                                both.addAll(configClasspath);
                                both.addAll(toAdd);
                                config.setClasspath(both);
@@ -376,7 +376,7 @@ public class AjdeCoreBuildManager {
                // Break a string into a string array of non-standard options.
                // Allows for one option to include a ' '. i.e. assuming it has been quoted, it
                // won't accidentally get treated as a pair of options (can be needed for xlint props file option)
-               List<String> tokens = new ArrayList<String>();
+               List<String> tokens = new ArrayList<>();
                int ind = nonStdOptions.indexOf('\"');
                int ind2 = nonStdOptions.indexOf('\"', ind + 1);
                if ((ind > -1) && (ind2 > -1)) { // dont tokenize within double quotes
@@ -404,7 +404,7 @@ public class AjdeCoreBuildManager {
 
        /** Local helper method for splitting option strings */
        private List<String> tokenizeString(String str) {
-               List<String> tokens = new ArrayList<String>();
+               List<String> tokens = new ArrayList<>();
                StringTokenizer tok = new StringTokenizer(str);
                while (tok.hasMoreTokens()) {
                        tokens.add(tok.nextToken());
index c692d6d50eb52bb8112d05e65f728e00c29f267c..2d17fc41e5aaa33c6fdddf74b8cb7388fbf763f7 100644 (file)
@@ -139,7 +139,7 @@ public abstract class AjdeCoreTestCase extends TestCase {
        }
 
        public List<String> getSourceFileList(String[] files) {
-               List<String> sourceFiles = new ArrayList<String>();
+               List<String> sourceFiles = new ArrayList<>();
                for (String file : files) {
                        sourceFiles.add(getAbsoluteProjectDir() + File.separator + file);
                }
index e214faeae7ce0b08c3e43223452bf9e7ef031cf1..f732d2acb011b9fe346e70a38ac888c94a418cda 100644 (file)
@@ -28,7 +28,7 @@ public class TestBuildProgressMonitor implements IBuildProgressMonitor {
     
        private String programmableString;
        private int count;
-       private List<String> messagesReceived = new ArrayList<String>();
+       private List<String> messagesReceived = new ArrayList<>();
        private int currentVal;
        private boolean isCancelRequested = false;
                
index e8432c8cf7fbd1600db09a308bab045b0c063d75..d2081df15fe98dee7870fc56ed4c43d005127cdc 100644 (file)
@@ -39,7 +39,7 @@ public class TestCompilerConfiguration implements ICompilerConfiguration {
        private String outjar;
        private Map<String, String> javaOptions;
        private String nonStandardOptions;
-       private List<String> projectSourceFiles = new ArrayList<String>();
+       private List<String> projectSourceFiles = new ArrayList<>();
        private Map<String, File> sourcePathResources;
 
        private String srcDirName = "src";
@@ -76,7 +76,7 @@ public class TestCompilerConfiguration implements ICompilerConfiguration {
 
        public Map<String, String> getJavaOptionsMap() {
                if (javaOptions == null) {
-                       javaOptions = new Hashtable<String, String>();
+                       javaOptions = new Hashtable<>();
                        javaOptions.put(JavaOptions.COMPLIANCE_LEVEL, JavaOptions.VERSION_13);
                        javaOptions.put(JavaOptions.SOURCE_COMPATIBILITY_LEVEL, JavaOptions.VERSION_13);
                }
@@ -111,7 +111,7 @@ public class TestCompilerConfiguration implements ICompilerConfiguration {
 
        public Map<String, File> getSourcePathResources() {
                if (sourcePathResources == null) {
-                       sourcePathResources = new HashMap<String, File>();
+                       sourcePathResources = new HashMap<>();
 
                        /* Allow the user to override the testProjectPath by using sourceRoots */
                        File[] srcBase = new File[] { new File(projectPath + File.separator + srcDirName) };
index 6cc8b8a8deadfc67b75753429619912758eede4f..662971cfeda97fa1997d451991a3ac84bb9e03af 100644 (file)
@@ -29,9 +29,9 @@ public class TestMessageHandler implements IBuildMessageHandler {
        private List<TestMessage> errors;
 
        public TestMessageHandler() {
-               ignoring = new ArrayList<Kind>();
-               messages = new ArrayList<TestMessage>();
-               errors = new ArrayList<TestMessage>();
+               ignoring = new ArrayList<>();
+               messages = new ArrayList<>();
+               errors = new ArrayList<>();
                ignore(IMessage.INFO);
                ignore(IMessage.WEAVEINFO);
        }
index 4249d2d569f60f96a59be2c2d0ff98da0cc95311..6313dd4a238d66b1e17a1941c690e4e4123abddb 100644 (file)
@@ -67,7 +67,7 @@ public class TestOutputLocationManager implements IOutputLocationManager {
        @Override
        public List<File> getAllOutputLocations() {
                if (allOutputLocations == null) {
-                       allOutputLocations = new ArrayList<File>();
+                       allOutputLocations = new ArrayList<>();
                        initLocations();
                        allOutputLocations.add(classOutputLoc);
                        if (!classOutputLoc.equals(resourceOutputLoc)) {
index 15d2ff696c9ae3a29150f2b1a1b1b44de1d076bb..b32ea26233281ad97134466a4f66ac10d6f73dbf 100644 (file)
@@ -60,7 +60,7 @@ public class AjConfigTest extends AjdeCoreTestCase {
        }
 
        public void testAspectPath() {
-               Set<File> aspects = new HashSet<File>();
+               Set<File> aspects = new HashSet<>();
                compilerConfig.setAspectPath(aspects);
                AjBuildConfig buildConfig = genAjBuildConfig();
                List<File> aPath = buildConfig.getAspectpath();
@@ -83,7 +83,7 @@ public class AjConfigTest extends AjdeCoreTestCase {
        }
 
        public void testInpath() {
-               Set<File> jars = new HashSet<File>();
+               Set<File> jars = new HashSet<>();
                compilerConfig.setInpath(jars);
                AjBuildConfig buildConfig = genAjBuildConfig();
                List<File> inJars = buildConfig.getInpath();
@@ -130,7 +130,7 @@ public class AjConfigTest extends AjdeCoreTestCase {
        }
 
        public void testSourcePathResources() {
-               Map<String, File> m = new HashMap<String, File>();
+               Map<String, File> m = new HashMap<>();
                m.put("newFile.txt", getWorkingDir());
                compilerConfig.setSourcePathResources(m);
                AjBuildConfig buildConfig = genAjBuildConfig();
index b7c2a92512b6ac6b33ec728092b7e4f2c494f83a..c438715b7be85bb684c25b48c6f5640c328242cf 100644 (file)
@@ -46,10 +46,10 @@ public class DuplicateManifestTest extends AjdeCoreTestCase {
        }
 
        public void testWeave() {
-               Set<File> injars = new HashSet<File>();
+               Set<File> injars = new HashSet<>();
                injars.add(openFile(injarName));
                compilerConfig.setInpath(injars);
-               Set<File> aspectpath = new HashSet<File>();
+               Set<File> aspectpath = new HashSet<>();
                aspectpath.add(openFile(aspectjarName));
                compilerConfig.setAspectPath(aspectpath);
                File outjar = openFile(outjarName);
index 2d1b3fd7c7de68e09ee5d05f6c9a868d17964c92..ee54cef969d52c5d01d4d48021a8176c813f723b 100644 (file)
@@ -71,7 +71,7 @@ public class InpathTest extends AjdeCoreTestCase {
         * Expected result = output jar file contains contents of indir1 and class file for source that was in src
         */
        public void testInpathToOutjar() {
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                File indir1 = openFile(indir1Name);
                inpath.add(indir1);
                compilerConfig.setInpath(inpath);
@@ -83,7 +83,7 @@ public class InpathTest extends AjdeCoreTestCase {
                doBuild(true);
                assertTrue("Expected no compiler errors or warnings but found " + handler.getMessages(), handler.getMessages().isEmpty());
 
-               Set<String> expectedOutputJarContents = new HashSet<String>();
+               Set<String> expectedOutputJarContents = new HashSet<>();
                // From indir1
                // If we don't copy resources, these next three files won't make it.
                // expectedOutputJarContents.add("META-INF/MANIFEST.MF");
@@ -100,7 +100,7 @@ public class InpathTest extends AjdeCoreTestCase {
         * 
         */
        public void testInpathToBin() {
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                File indir1 = openFile(indir1Name);
                inpath.add(indir1);
                compilerConfig.setInpath(inpath);
@@ -109,7 +109,7 @@ public class InpathTest extends AjdeCoreTestCase {
                doBuild(true);
                assertTrue("Expected no compiler errors or warnings but found " + handler.getMessages(), handler.getMessages().isEmpty());
 
-               Set<String> expectedBindirContents = new HashSet<String>();
+               Set<String> expectedBindirContents = new HashSet<>();
                // From indir1
                // If we don't copy resources, these next three files won't make it
                // expectedBindirContents.add("META-INF/MANIFEST.MF");
@@ -133,7 +133,7 @@ public class InpathTest extends AjdeCoreTestCase {
         * An extra check is done at the end of this test to verify that HelloWorld has changed size (due to the weaving).
         */
        public void testInpathToOutjar2() {
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                File indir2 = openFile(indir2Name);
                inpath.add(indir2);
                compilerConfig.setInpath(inpath);
@@ -145,7 +145,7 @@ public class InpathTest extends AjdeCoreTestCase {
                doBuild(true);
                assertTrue("Expected no compiler errors or warnings but found " + handler.getMessages(), handler.getMessages().isEmpty());
 
-               Set<String> expectedOutputJarContents = new HashSet<String>();
+               Set<String> expectedOutputJarContents = new HashSet<>();
                // From indir1
                expectedOutputJarContents.add("example/HelloWorld.class");
 
@@ -181,7 +181,7 @@ public class InpathTest extends AjdeCoreTestCase {
         * 
         */
        public void testInpathAndInjarToBin() {
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                File indir2 = openFile(indir2Name);
                inpath.add(indir2);
                inpath.add(openFile(injarName));
@@ -191,7 +191,7 @@ public class InpathTest extends AjdeCoreTestCase {
                doBuild(true);
                assertTrue("Expected no compiler errors or warnings but found " + handler.getMessages(), handler.getMessages().isEmpty());
 
-               Set<String> expectedBindirContents = new HashSet<String>();
+               Set<String> expectedBindirContents = new HashSet<>();
 
                // From indir1
                expectedBindirContents.add("example/HelloWorld.class");
index 7cf08b1c775806c48dd2f8afd88efc3e90b20199..6434629bf80711ea1d268641cc7104f76ce8aa17 100644 (file)
@@ -112,7 +112,7 @@ public class OutxmlTest extends AjdeCoreTestCase {
         */
        public void testOutxmlToOutjarWithAop_xml () {
                File f = new File( getAbsoluteProjectDir() + File.separator + "src-resources" + File.separator + "testjar.jar");
-               Set<File> roots = new HashSet<File>();
+               Set<File> roots = new HashSet<>();
                roots.add(f);
                compilerConfig.setInpath(roots);
                
index 889e2e5ce652671a6c395623e296934ee1fb55b3..3176f1e31eafa976bd22f505db9c31cead25d083 100644 (file)
@@ -68,7 +68,7 @@ public class ResourceCopyTest extends AjdeCoreTestCase {
        }
 
        public void testInjarsToOutjar() {
-               Set<File> injars = new HashSet<File>();
+               Set<File> injars = new HashSet<>();
                File injar1 = openFile(injar1Name);
                injars.add(injar1);
                compilerConfig.setInpath(injars);
@@ -81,7 +81,7 @@ public class ResourceCopyTest extends AjdeCoreTestCase {
        }
 
        public void testDuplicateResources() {
-               Set<File> injars = new HashSet<File>();
+               Set<File> injars = new HashSet<>();
                File injar1 = openFile(injar1Name);
                File injar2 = openFile(injar2Name);
                injars.add(injar1);
@@ -110,7 +110,7 @@ public class ResourceCopyTest extends AjdeCoreTestCase {
        }
 
        public void testInjarsToBin() {
-               Set<File> injars = new HashSet<File>();
+               Set<File> injars = new HashSet<>();
                File injar1 = openFile(injar1Name);
                injars.add(injar1);
                compilerConfig.setInpath(injars);
@@ -133,7 +133,7 @@ public class ResourceCopyTest extends AjdeCoreTestCase {
        // }
 
        public void testInjarsToOutjarOddNames() {
-               Set<File> injars = new HashSet<File>();
+               Set<File> injars = new HashSet<>();
                File injar1 = openFile("input1");
                File outjar = openFile(outjarName + ".fozout");
                injars.add(injar1);
index 24723b253c43fc5023c3c54645313df28b99e49b..c29f4ba212b14e5eda9285525aaef1c55d4afa8c 100644 (file)
@@ -324,7 +324,7 @@ public class ReweavableTest extends AjdeCoreTestCase {
                Set<File> paths = new HashSet<>();
                paths.add(openFile(binDir));
                compilerConfig.setInpath(paths);
-               compilerConfig.setProjectSourceFiles(new ArrayList<String>());
+               compilerConfig.setProjectSourceFiles(new ArrayList<>());
                doBuild(true);
 
                String expMessage = "aspect tjp.GetInfo cannot be found when reweaving tjp.Demo";
@@ -356,7 +356,7 @@ public class ReweavableTest extends AjdeCoreTestCase {
                Set<File> paths = new HashSet<>();
                paths.add(openFile(binDir));
                compilerConfig.setInpath(paths);
-               compilerConfig.setProjectSourceFiles(new ArrayList<String>());
+               compilerConfig.setProjectSourceFiles(new ArrayList<>());
                doBuild(true);
 
                String expMessage = "successfully verified type tjp.GetInfo exists";
index bc4263f4e806b55a4e9625ee65d7da48fc7ef1aa..4e5a87882dff940d30cbb525276f42bc99259b57 100644 (file)
@@ -202,10 +202,10 @@ public class ShowWeaveMessagesTest extends AjdeCoreTestCase {
        public void testWeaveMessagesBinaryAdvice() {
                if (debugTests)
                        System.out.println("\ntestWeaveMessagesBinaryAdvice: Simple.jar + AspectAdvice.jar");
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                inpath.add(openFile("Simple.jar"));
                compilerConfig.setInpath(inpath);
-               Set<File> aspectpath = new HashSet<File>();
+               Set<File> aspectpath = new HashSet<>();
                aspectpath.add(openFile("AspectAdvice.jar"));
                compilerConfig.setAspectPath(aspectpath);
                doBuild();
@@ -216,10 +216,10 @@ public class ShowWeaveMessagesTest extends AjdeCoreTestCase {
        public void testWeaveMessagesBinaryITD() {
                if (debugTests)
                        System.out.println("\ntestWeaveMessagesBinaryITD: Simple.jar + AspectITD.jar");
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                inpath.add(openFile("Simple.jar"));
                compilerConfig.setInpath(inpath);
-               Set<File> aspectpath = new HashSet<File>();
+               Set<File> aspectpath = new HashSet<>();
                aspectpath.add(openFile("AspectITD.jar"));
                compilerConfig.setAspectPath(aspectpath);
                doBuild();
@@ -230,10 +230,10 @@ public class ShowWeaveMessagesTest extends AjdeCoreTestCase {
        public void testWeaveMessagesBinaryDeclare() {
                if (debugTests)
                        System.out.println("\ntestWeaveMessagesBinaryDeclare: Simple.jar + AspectDeclare.jar");
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                inpath.add(openFile("Simple.jar"));
                compilerConfig.setInpath(inpath);
-               Set<File> aspectpath = new HashSet<File>();
+               Set<File> aspectpath = new HashSet<>();
                aspectpath.add(openFile("AspectDeclare.jar"));
                compilerConfig.setAspectPath(aspectpath);
                doBuild();
@@ -247,10 +247,10 @@ public class ShowWeaveMessagesTest extends AjdeCoreTestCase {
        public void testWeaveMessagesBinaryDeclareSoft() {
                if (debugTests)
                        System.out.println("\ntestWeaveMessagesBinaryDeclareSoft: Simple.jar + AspectDeclareSoft.jar");
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                inpath.add(openFile("Simple.jar"));
                compilerConfig.setInpath(inpath);
-               Set<File> aspectpath = new HashSet<File>();
+               Set<File> aspectpath = new HashSet<>();
                aspectpath.add(openFile("AspectDeclareSoft.jar"));
                compilerConfig.setAspectPath(aspectpath);
                doBuild();
@@ -261,10 +261,10 @@ public class ShowWeaveMessagesTest extends AjdeCoreTestCase {
        public void testWeaveMessagesBinaryAdviceInPackageFromJar() {
                if (debugTests)
                        System.out.println("\ntestWeaveMessagesBinaryAdviceInPackageFromJar: Simple.jar + AspectInPackage.jar");
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                inpath.add(openFile("Simple.jar"));
                compilerConfig.setInpath(inpath);
-               Set<File> aspectpath = new HashSet<File>();
+               Set<File> aspectpath = new HashSet<>();
                aspectpath.add(openFile("AspectInPackage.jar"));
                compilerConfig.setAspectPath(aspectpath);
                doBuild();
@@ -275,10 +275,10 @@ public class ShowWeaveMessagesTest extends AjdeCoreTestCase {
        public void testWeaveMessagesBinaryAdviceInPackage() {
                if (debugTests)
                        System.out.println("\ntestWeaveMessagesBinaryAdviceInPackage: Simple.jar + AspectInPackage.jar");
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                inpath.add(openFile("Simple.jar"));
                compilerConfig.setInpath(inpath);
-               Set<File> aspectpath = new HashSet<File>();
+               Set<File> aspectpath = new HashSet<>();
                aspectpath.add(openFile("pkg"));
                compilerConfig.setAspectPath(aspectpath);
                doBuild();
@@ -291,10 +291,10 @@ public class ShowWeaveMessagesTest extends AjdeCoreTestCase {
        public void testWeaveMessagesBinaryAdviceNoDebugInfo() {
                if (debugTests)
                        System.out.println("\ntestWeaveMessagesBinaryAdvice: Simple.jar + AspectAdvice.jar");
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                inpath.add(openFile("Simple_nodebug.jar"));
                compilerConfig.setInpath(inpath);
-               Set<File> aspectpath = new HashSet<File>();
+               Set<File> aspectpath = new HashSet<>();
                aspectpath.add(openFile("AspectAdvice_nodebug.jar"));
                compilerConfig.setAspectPath(aspectpath);
                doBuild();
@@ -319,10 +319,10 @@ public class ShowWeaveMessagesTest extends AjdeCoreTestCase {
        public void testWeaveMessagesBinaryDeclareNoDebugInfo() {
                if (debugTests)
                        System.out.println("\ntestWeaveMessagesBinaryDeclareNoDebugInfo: Simple.jar + AspectDeclare.jar");
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                inpath.add(openFile("Simple_nodebug.jar"));
                compilerConfig.setInpath(inpath);
-               Set<File> aspectpath = new HashSet<File>();
+               Set<File> aspectpath = new HashSet<>();
                aspectpath.add(openFile("AspectDeclare_nodebug.jar"));
                compilerConfig.setAspectPath(aspectpath);
                doBuild();
@@ -336,10 +336,10 @@ public class ShowWeaveMessagesTest extends AjdeCoreTestCase {
        public void testWeaveMessagesBinaryDeclareSoftNoDebugInfo() {
                if (debugTests)
                        System.out.println("\ntestWeaveMessagesBinaryDeclareSoftNoDebugInfo: Simple.jar + AspectDeclareSoft.jar");
-               Set<File> inpath = new HashSet<File>();
+               Set<File> inpath = new HashSet<>();
                inpath.add(openFile("Simple_nodebug.jar"));
                compilerConfig.setInpath(inpath);
-               Set<File> aspectpath = new HashSet<File>();
+               Set<File> aspectpath = new HashSet<>();
                aspectpath.add(openFile("AspectDeclareSoft_nodebug.jar"));
                compilerConfig.setAspectPath(aspectpath);
                doBuild();
index 7eb195716d004d09985c23a08b5fd0f8bb66402e..9f0d1c818a65419e43cb9268d682c2a3151943de 100644 (file)
@@ -24,8 +24,8 @@ import org.aspectj.ajdt.ajc.ConfigParser;
  */
 public class LstBuildConfigFileParser extends ConfigParser {
 
-       private List<File> importedFiles = new ArrayList<File>();
-       private List<String> problemEntries = new ArrayList<String>();
+       private List<File> importedFiles = new ArrayList<>();
+       private List<String> problemEntries = new ArrayList<>();
 
        // private String currFilePath;
 
index 4e59e5d744ed92def655fbe7e5d05bb911fa7df9..4ca7316f41027e7aed1e6d5e3487c149a68351ea 100644 (file)
@@ -100,7 +100,7 @@ class LstBuildConfigFileUpdater {
                                                null);
                                Ajde.getDefault().getMessageHandler().handleMessage(msg);
                        }
-                       List<String> fileContents = new ArrayList<String>();
+                       List<String> fileContents = new ArrayList<>();
                        BufferedReader reader = new BufferedReader(new FileReader(configFile));
                        String line = reader.readLine();
                        while (line != null) {
@@ -146,13 +146,13 @@ class LstBuildConfigFileUpdater {
                        ConfigParser configParser = new ConfigParser();
                        configParser.parseConfigFile(new File(path));
                        List<File> files = configParser.getFiles();
-                       List<String> relativeFiles = new ArrayList<String>();
+                       List<String> relativeFiles = new ArrayList<>();
                        for (File file : files) {
                                relativeFiles.add(relativizePath(file.getPath(), rootPath));
                        }
                        return relativeFiles;
                } catch (ConfigParser.ParseException pe) {
-                       return new ArrayList<String>();
+                       return new ArrayList<>();
                }
        }
 
index feda7df0c633aa7faae37874e7696000a8890386..cde164cc1c800c9cc56e78097c1d337d19453934 100644 (file)
@@ -39,7 +39,7 @@ public class LstBuildConfigManager implements BuildConfigManager {
 
 
        private List<String> allBuildConfigFiles;
-       private List<BuildConfigListener> listeners = new ArrayList<BuildConfigListener>();
+       private List<BuildConfigListener> listeners = new ArrayList<>();
        private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater();
        protected String currConfigFilePath = null;
 
@@ -63,8 +63,8 @@ public class LstBuildConfigManager implements BuildConfigManager {
                String rootPath = configFile.getParent();
                String configFileName = configFile.getName();
                BuildConfigModel model = new BuildConfigModel(configFilePath);
-               List<File> configFiles = new ArrayList<File>();
-               List<File> importedFiles = new ArrayList<File>();
+               List<File> configFiles = new ArrayList<>();
+               List<File> importedFiles = new ArrayList<>();
                List<String> badEntries = null;
                try {
                        LstBuildConfigFileParser configParser = new LstBuildConfigFileParser(configFilePath);
@@ -134,7 +134,7 @@ public class LstBuildConfigManager implements BuildConfigManager {
        }
 
        private List<String> relativizeFilePaths(List<File> configFiles, String rootPath) {
-               List<String> relativePathsList = new ArrayList<String>();
+               List<String> relativePathsList = new ArrayList<>();
                for (File file : configFiles) {
                        relativePathsList.add(fileUpdater.relativizePath(file.getPath(), rootPath));
                }
@@ -308,7 +308,7 @@ public class LstBuildConfigManager implements BuildConfigManager {
        @Override
        public List<String> getAllBuildConfigFiles() {
                if (allBuildConfigFiles == null) {
-                       allBuildConfigFiles = new ArrayList<String>();
+                       allBuildConfigFiles = new ArrayList<>();
                        if (getActiveConfigFile() != null) {
                                allBuildConfigFiles.add(getActiveConfigFile());
                        }
index 560766bf639cfb9996b3ce3508007133b882c3f2..659ada21d010f88acecc6251522e3d3239979eea 100644 (file)
@@ -71,7 +71,7 @@ public class BuildConfigModel {
        }
 
        public List<BuildConfigNode> getActiveNodes(BuildConfigNode.Kind kind) {
-               List<BuildConfigNode> nodes = new ArrayList<BuildConfigNode>();
+               List<BuildConfigNode> nodes = new ArrayList<>();
                getActiveNodesHelper(root, kind, nodes);
                return nodes;
        }
index 73e0bead05b8621cb7d4931335ae452b31da4330..06749bf23448e5805de9859cff8a2c41a8b37440 100644 (file)
@@ -33,7 +33,7 @@ public class BuildConfigNode {
        protected String name = "";
        protected Kind kind;
        // children.listIterator() should support remove() operation
-       protected List<BuildConfigNode> children = new ArrayList<BuildConfigNode>();
+       protected List<BuildConfigNode> children = new ArrayList<>();
        protected IMessage message = null;
        protected ISourceLocation sourceLocation = null;
 
@@ -78,7 +78,7 @@ public class BuildConfigNode {
 
        public void addChild(BuildConfigNode child) {
                if (children == null) {
-                       children = new ArrayList<BuildConfigNode>();
+                       children = new ArrayList<>();
                }
                children.add(child);
                child.setParent(this);
@@ -86,7 +86,7 @@ public class BuildConfigNode {
 
        public void addChild(int position, BuildConfigNode child) {
                if (children == null) {
-                       children = new ArrayList<BuildConfigNode>();
+                       children = new ArrayList<>();
                }
                children.add(position, child);
                child.setParent(this);
index 86f7a50252c87f0c90723b5d6efa572c0959c727..0e7e09abc69e917fc63c9b912a0e9180fac403f9 100644 (file)
@@ -103,7 +103,7 @@ public class JavaDebugOptionsPanel extends OptionsPanel {
 
                JComboBox<String> debug = null;
                if (javaOptionToSet.equals(JavaOptions.PRESERVE_ALL_LOCALS)) {
-                       debug = new JComboBox<String>(preserveOptions);
+                       debug = new JComboBox<>(preserveOptions);
                        String value = javaBuildOptions.getJavaBuildOptionsMap().get(javaOptionToSet);
                        if (value.equals(JavaOptions.PRESERVE)) {
                                debug.setSelectedIndex(0);
@@ -111,7 +111,7 @@ public class JavaDebugOptionsPanel extends OptionsPanel {
                                debug.setSelectedIndex(1);
                        }
                } else {
-                       debug = new JComboBox<String>(debugOptions);
+                       debug = new JComboBox<>(debugOptions);
                        String value = javaBuildOptions.getJavaBuildOptionsMap().get(javaOptionToSet);
                        if (value.equals(JavaOptions.GENERATE)) {
                                debug.setSelectedIndex(0);
index 44708bb01c7aaf35f6d162e0130a1ef461e6b76a..41d13e37e9937686811d650160eb61039070864c 100644 (file)
@@ -48,7 +48,7 @@ class HtmlDecorator {
        private static final String ITD_FIELD_SUMMARY = "Inter-Type Field Summary";
        private static final String ITD_CONSTRUCTOR_SUMMARY = "Inter-Type Constructor Summary";
 
-       static List<String> visibleFileList = new ArrayList<String>();
+       static List<String> visibleFileList = new ArrayList<>();
        static Hashtable declIDTable = null;
        static File rootDir = null;
        static String docVisibilityModifier;
@@ -295,9 +295,9 @@ class HtmlDecorator {
        }
 
        static void addAspectDocumentation(IProgramElement node, StringBuffer fileBuffer, int index) {
-               List<IProgramElement> pointcuts = new ArrayList<IProgramElement>();
-               List<IProgramElement> advice = new ArrayList<IProgramElement>();
-               List<IProgramElement> declares = new ArrayList<IProgramElement>();
+               List<IProgramElement> pointcuts = new ArrayList<>();
+               List<IProgramElement> advice = new ArrayList<>();
+               List<IProgramElement> declares = new ArrayList<>();
                List<IProgramElement> methodsDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.INTER_TYPE_METHOD);
                if (methodsDeclaredOn != null && !methodsDeclaredOn.isEmpty()) {
                        insertDeclarationsSummary(fileBuffer, methodsDeclaredOn, ITD_METHOD_SUMMARY, index);
index 0f01a058f62f024a563bbfaa01fb4c41e3fc8c93..2b2a24a26a0d76ef4ef9cd626544eff2686fe76b 100644 (file)
@@ -86,13 +86,13 @@ public class Main implements Config {
        private static String outputWorkingDir = Config.WORKING_DIR;
 
        public static void clearState() {
-               options = new Vector<String>();
-               ajcOptions = new Vector<String>();
-               filenames = new Vector<String>();
-               fileList = new Vector<String>();
-               packageList = new Vector<String>();
+               options = new Vector<>();
+               ajcOptions = new Vector<>();
+               filenames = new Vector<>();
+               fileList = new Vector<>();
+               packageList = new Vector<>();
                docModifier = "package";
-               sourcepath = new Vector<String>();
+               sourcepath = new Vector<>();
                verboseMode = false;
                packageMode = false;
                rootDir = null;
@@ -170,7 +170,7 @@ public class Main implements Config {
         * package-summary properly.
         */
        private static void packageHTML(AsmManager model, File[] inputFiles) throws IOException {
-               ArrayList<String> dirList = new ArrayList<String>();
+               ArrayList<String> dirList = new ArrayList<>();
                for (File inputFile : inputFiles) {
                        String packageName = StructureUtil.getPackageDeclarationFromFile(model, inputFile);
                        // Only copy the package.html file once.
@@ -239,7 +239,7 @@ public class Main implements Config {
                System.out.println("> Calling javadoc...");
                String[] javadocargs = null;
 
-               List<String> files = new ArrayList<String>();
+               List<String> files = new ArrayList<>();
                if (packageMode) {
                        int numExtraArgs = 2;
                        if (authorStandardDocletSwitch)
@@ -268,7 +268,7 @@ public class Main implements Config {
                                javadocargs[numExtraArgs + options.size() + packageList.size() + k] = fileList.elementAt(k);
                        }
                        if (LangUtil.is19VMOrGreater()) {
-                               options = new Vector<String>();
+                               options = new Vector<>();
                                for (String a: javadocargs) {
                                        options.add(a);
                                }
@@ -362,7 +362,7 @@ public class Main implements Config {
        }
 
        static Vector<String> getSourcePath() {
-               Vector<String> sourcePath = new Vector<String>();
+               Vector<String> sourcePath = new Vector<>();
                boolean found = false;
                for (int i = 0; i < options.size(); i++) {
                        String currOption = options.elementAt(i);
@@ -471,7 +471,7 @@ public class Main implements Config {
                                String line = "";
                                line = br.readLine();
                                StringTokenizer st = new StringTokenizer(line, " ");
-                               List<String> argList = new ArrayList<String>();
+                               List<String> argList = new ArrayList<>();
                                while (st.hasMoreElements()) {
                                        argList.add(st.nextToken());
                                }
@@ -490,7 +490,7 @@ public class Main implements Config {
                                ioe.printStackTrace();
                        }
                }
-               List<String> vargs = new LinkedList<String>(Arrays.asList(args));
+               List<String> vargs = new LinkedList<>(Arrays.asList(args));
                vargs.add("-Xset:minimalModel=false");
                parseArgs(vargs, new File(".")); // !!!
 
@@ -722,7 +722,7 @@ public class Main implements Config {
        }
 
        static void expandAtSignFile(String filename, File currentWorkingDir) {
-               List<String> result = new LinkedList<String>();
+               List<String> result = new LinkedList<>();
 
                File atFile = qualifiedFile(filename, currentWorkingDir);
                String atFileParent = atFile.getParent();
index 2fdd95698b96ab22ff218b40e02659fc6b6a3eb8..d4cdb9cd521bd7c5b1778b348e2f189e772a2e83 100644 (file)
@@ -42,7 +42,7 @@ public class StructureUtil {
         * @return null if a relationship of that kind is not found
         */
        public static List<String> getTargets(IProgramElement node, IRelationship.Kind kind, String relName) {
-               List<IRelationship> relations = new ArrayList<IRelationship>();
+               List<IRelationship> relations = new ArrayList<>();
                List<IRelationship> rels = node.getModel().getRelationshipMap().get(node);
                if (rels != null) {
                        relations.addAll(rels);
@@ -64,7 +64,7 @@ public class StructureUtil {
                }
                if (relations == null || relations.isEmpty())
                        return null;
-               List<String> targets = new ArrayList<String>();
+               List<String> targets = new ArrayList<>();
                for (IRelationship rtn : relations) {
                        if (rtn.getKind().equals(kind) && ((relName != null && relName.equals(rtn.getName())) || relName == null)) {
                                List<String> targs = rtn.getTargets();
@@ -79,7 +79,7 @@ public class StructureUtil {
        }
 
        static List<IProgramElement> getDeclareInterTypeTargets(IProgramElement node, IProgramElement.Kind kind) {
-               List<IProgramElement> targets = new ArrayList<IProgramElement>();
+               List<IProgramElement> targets = new ArrayList<>();
                List<String> stringTargets = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE_INTER_TYPE);
                if (stringTargets == null) {
                        return null;
index 797c766604e18c4c65e5bb19942e4ae9362da6cf..43101840115f4e9a0366bcbb2886fd8c9272ed75 100644 (file)
@@ -60,7 +60,7 @@ public class AjdocOutputChecker {
         * @throws Exception
         */     
        public static List<String> getMissingStringsInFile(File htmlFile, String[] requiredStrings) throws Exception {
-               List<String> missingStrings = new ArrayList<String>();
+               List<String> missingStrings = new ArrayList<>();
                for (String string : requiredStrings) {
                        if (!containsString(htmlFile, string)) {
                                missingStrings.add(string);
@@ -120,7 +120,7 @@ public class AjdocOutputChecker {
         */
        public static List<String> getMissingStringsInSection(File htmlFile,
                        String[] requiredStrings, String sectionHeader) throws Exception {
-               List<String> missingStrings = new ArrayList<String>();
+               List<String> missingStrings = new ArrayList<>();
                for (String string : requiredStrings) {
                        if (!containsStringWithinSection(htmlFile, string, sectionHeader)) {
                                missingStrings.add(string);
index b8a8989cb5e2a7f3b5269e72ecf54bbb9123b977..dc766eb7f247ba9c73565a671edccf42a676ad13 100644 (file)
@@ -73,7 +73,7 @@ public class AsmManager implements IStructureModel {
 
        private static boolean completingTypeBindings = false;
 
-       private final List<IHierarchyListener> structureListeners = new ArrayList<IHierarchyListener>();
+       private final List<IHierarchyListener> structureListeners = new ArrayList<>();
 
        // The model is 'manipulated' by the AjBuildManager.setupModel() code which
        // trashes all the
@@ -95,10 +95,10 @@ public class AsmManager implements IStructureModel {
        private final CanonicalFilePathMap canonicalFilePathMap = new CanonicalFilePathMap();
        // Record the Set<File> for which the model has been modified during the
        // last incremental build
-       private final Set<File> lastBuildChanges = new HashSet<File>();
+       private final Set<File> lastBuildChanges = new HashSet<>();
 
        // Record the Set<File> of aspects that wove the files listed in lastBuildChanges
-       final Set<File> aspectsWeavingInLastBuild = new HashSet<File>();
+       final Set<File> aspectsWeavingInLastBuild = new HashSet<>();
 
        // static {
        // setReporting("c:/model.nfo",true,true,true,true);
@@ -149,16 +149,16 @@ public class AsmManager implements IStructureModel {
                        return null;
                }
 
-               HashMap<Integer, List<IProgramElement>> annotations = new HashMap<Integer, List<IProgramElement>>();
+               HashMap<Integer, List<IProgramElement>> annotations = new HashMap<>();
                IProgramElement node = hierarchy.findElementForSourceFile(sourceFile);
                if (node == IHierarchy.NO_STRUCTURE) {
                        return null;
                } else {
                        IProgramElement fileNode = node;
-                       ArrayList<IProgramElement> peNodes = new ArrayList<IProgramElement>();
+                       ArrayList<IProgramElement> peNodes = new ArrayList<>();
                        getAllStructureChildren(fileNode, peNodes, showSubMember, showMemberAndType);
                        for (IProgramElement peNode : peNodes) {
-                               List<IProgramElement> entries = new ArrayList<IProgramElement>();
+                               List<IProgramElement> entries = new ArrayList<>();
                                entries.add(peNode);
                                ISourceLocation sourceLoc = peNode.getSourceLocation();
                                if (null != sourceLoc) {
@@ -296,7 +296,7 @@ public class AsmManager implements IStructureModel {
        private static class CanonicalFilePathMap {
                private static final int MAX_SIZE = 4000;
 
-               private final Map<String, String> pathMap = new HashMap<String, String>(20);
+               private final Map<String, String> pathMap = new HashMap<>(20);
 
                // // guards to ensure correctness and liveness
                // private boolean cacheInUse = false;
@@ -549,7 +549,7 @@ public class AsmManager implements IStructureModel {
 
                boolean modelModified = false;
 
-               Set<String> deletedNodes = new HashSet<String>();
+               Set<String> deletedNodes = new HashSet<>();
                for (File fileForCompilation : files) {
                        String correctedPath = getCanonicalFilePath(fileForCompilation);
                        IProgramElement progElem = (IProgramElement) hierarchy.findInFileMap(correctedPath);
@@ -690,15 +690,15 @@ public class AsmManager implements IStructureModel {
                        return;
                }
 
-               Set<String> sourcesToRemove = new HashSet<String>();
-               Map<String, String> handleToTypenameCache = new HashMap<String, String>();
+               Set<String> sourcesToRemove = new HashSet<>();
+               Map<String, String> handleToTypenameCache = new HashMap<>();
                // Iterate over the source handles in the relationships map, the aim
                // here is to remove any 'affected by'
                // relationships where the source of the relationship is the specified
                // type (since it will be readded
                // when the type is woven)
                Set<String> sourcehandlesSet = mapper.getEntries();
-               List<IRelationship> relationshipsToRemove = new ArrayList<IRelationship>();
+               List<IRelationship> relationshipsToRemove = new ArrayList<>();
                for (String hid : sourcehandlesSet) {
                        if (isPhantomHandle(hid)) {
                                // inpath handle - but for which type?
@@ -780,7 +780,7 @@ public class AsmManager implements IStructureModel {
                                                continue;
                                        }
                                        List<String> targets = rel.getTargets();
-                                       List<String> targetsToRemove = new ArrayList<String>();
+                                       List<String> targetsToRemove = new ArrayList<>();
 
                                        // find targets that target the type we are interested in,
                                        // they need removing
@@ -928,8 +928,8 @@ public class AsmManager implements IStructureModel {
 
                        // Now sort out the relationships map
                        // IRelationshipMap irm = AsmManager.getDefault().getRelationshipMap();
-                       Set<String> sourcesToRemove = new HashSet<String>();
-                       Set<String> nonExistingHandles = new HashSet<String>(); // Cache of handles that we
+                       Set<String> sourcesToRemove = new HashSet<>();
+                       Set<String> nonExistingHandles = new HashSet<>(); // Cache of handles that we
                        // *know* are invalid
 //                     int srchandlecounter = 0;
 //                     int tgthandlecounter = 0;
@@ -956,12 +956,12 @@ public class AsmManager implements IStructureModel {
                                        } else {
                                                // Ok, so the source is valid, what about the targets?
                                                List<IRelationship> relationships = mapper.get(hid);
-                                               List<IRelationship> relationshipsToRemove = new ArrayList<IRelationship>();
+                                               List<IRelationship> relationshipsToRemove = new ArrayList<>();
                                                // Iterate through the relationships against this source
                                                // handle
                                                for (IRelationship rel : relationships) {
                                                        List<String> targets = rel.getTargets();
-                                                       List<String> targetsToRemove = new ArrayList<String>();
+                                                       List<String> targetsToRemove = new ArrayList<>();
 
                                                        // Iterate through the targets for this relationship
                                                        for (String targethid : targets) {
@@ -1168,7 +1168,7 @@ public class AsmManager implements IStructureModel {
         * A ModelInfo object captures basic information about the structure model. It is used for testing and producing debug info.
         */
        public static class ModelInfo {
-               private final Hashtable<String, Integer> nodeTypeCount = new Hashtable<String, Integer>();
+               private final Hashtable<String, Integer> nodeTypeCount = new Hashtable<>();
                private final Properties extraProperties = new Properties();
 
                private ModelInfo(IHierarchy hierarchy, IRelationshipMap relationshipMap) {
index 402376217792be6c0bacabc60aa8e3943c492ddf..8d47666818dd5148851e4568d652ed8076db823a 100644 (file)
@@ -349,7 +349,7 @@ public interface IProgramElement extends Serializable {
                }
 
                public static List<Kind> getNonAJMemberKinds() {
-                       List<Kind> list = new ArrayList<Kind>();
+                       List<Kind> list = new ArrayList<>();
                        list.add(METHOD);
                        list.add(ENUM_VALUE);
                        list.add(FIELD);
index 6019964c6b4b767ce4d612533f210600793799b9..869affd91f3de6ca51c1e5c00de95e75ec0bb2d3 100644 (file)
@@ -43,7 +43,7 @@ public class AspectJElementHierarchy implements IHierarchy {
        // Access to the handleMap and typeMap are now synchronized - at least the find methods and the updateHandleMap function
        // see pr305788
        private Map<String, IProgramElement> fileMap = null;
-       private Map<String, IProgramElement> handleMap = new HashMap<String, IProgramElement>();
+       private Map<String, IProgramElement> handleMap = new HashMap<>();
        private Map<String, IProgramElement> typeMap = null;
 
        public AspectJElementHierarchy(AsmManager asm) {
@@ -84,8 +84,8 @@ public class AspectJElementHierarchy implements IHierarchy {
 
        public void setRoot(IProgramElement root) {
                this.root = root;
-               handleMap = new HashMap<String, IProgramElement>();
-               typeMap = new HashMap<String, IProgramElement>();
+               handleMap = new HashMap<>();
+               typeMap = new HashMap<>();
        }
 
        public void addToFileMap(String key, IProgramElement value) {
@@ -230,7 +230,7 @@ public class AspectJElementHierarchy implements IHierarchy {
                if ((children.get(0)).getKind() == IProgramElement.Kind.SOURCE_FOLDER) {
                        String searchPackageName = (packagename == null ? "" : packagename); // default package means match on ""
                        // dealing with source folders
-                       List<IProgramElement> matchingPackageNodes = new ArrayList<IProgramElement>();
+                       List<IProgramElement> matchingPackageNodes = new ArrayList<>();
                        for (IProgramElement sourceFolder : children) {
                                List<IProgramElement> possiblePackageNodes = sourceFolder.getChildren();
                                for (IProgramElement possiblePackageNode : possiblePackageNodes) {
@@ -248,11 +248,11 @@ public class AspectJElementHierarchy implements IHierarchy {
                        // thing to return in the list
                        if (packagename == null) {
                                // default package
-                               List<IProgramElement> result = new ArrayList<IProgramElement>();
+                               List<IProgramElement> result = new ArrayList<>();
                                result.add(root);
                                return result;
                        }
-                       List<IProgramElement> result = new ArrayList<IProgramElement>();
+                       List<IProgramElement> result = new ArrayList<>();
                        for (IProgramElement possiblePackage : children) {
                                if (possiblePackage.getKind() == IProgramElement.Kind.PACKAGE && possiblePackage.getName().equals(packagename)) {
                                        result.add(possiblePackage);
@@ -643,7 +643,7 @@ public class AspectJElementHierarchy implements IHierarchy {
        // TODO rename this method ... it does more than just the handle map
        public void updateHandleMap(Set<String> deletedFiles) {
                // Only delete the entries we need to from the handle map - for performance reasons
-               List<String> forRemoval = new ArrayList<String>();
+               List<String> forRemoval = new ArrayList<>();
                Set<String> k = null;
                synchronized (this) {
                        k = handleMap.keySet();
index 9842830cbb4eb6ffd2898e7881bbc6c80e437e65..8c13747be9a191d7ab4e1023edbaae8f3ef50d1f 100644 (file)
@@ -223,7 +223,7 @@ public class ProgramElement implements IProgramElement {
        }
 
        private static List<IProgramElement.Modifiers> genModifiers(int modifiers) {
-               List<IProgramElement.Modifiers> modifiersList = new ArrayList<IProgramElement.Modifiers>();
+               List<IProgramElement.Modifiers> modifiersList = new ArrayList<>();
                if ((modifiers & AccStatic) != 0) {
                        modifiersList.add(IProgramElement.Modifiers.STATIC);
                }
@@ -551,7 +551,7 @@ public class ProgramElement implements IProgramElement {
 
        public void addChild(IProgramElement child) {
                if (children == null || children == Collections.EMPTY_LIST) {
-                       children = new ArrayList<IProgramElement>();
+                       children = new ArrayList<>();
                }
                children.add(child);
                child.setParent(this);
@@ -559,7 +559,7 @@ public class ProgramElement implements IProgramElement {
 
        public void addChild(int position, IProgramElement child) {
                if (children == null || children == Collections.EMPTY_LIST) {
-                       children = new ArrayList<IProgramElement>();
+                       children = new ArrayList<>();
                }
                children.add(position, child);
                child.setParent(this);
@@ -750,7 +750,7 @@ public class ProgramElement implements IProgramElement {
                if (l == null || l.isEmpty()) {
                        return Collections.emptyList();
                }
-               List<char[]> params = new ArrayList<char[]>();
+               List<char[]> params = new ArrayList<>();
                for (char[] param : l) {
                        params.add(NameConvertor.convertFromSignature(param));
                }
@@ -805,7 +805,7 @@ public class ProgramElement implements IProgramElement {
 
        private void fixMap() {
                if (kvpairs == Collections.EMPTY_MAP) {
-                       kvpairs = new HashMap<String, Object>();
+                       kvpairs = new HashMap<>();
                }
        }
 
index 0df2fdd897c0f903b6de9b26682bf66a08f1cfa5..5a5e18b46b3ca5bd2a050d4845b991f7bd1b6b88 100644 (file)
@@ -55,8 +55,8 @@ public class RelationshipMap extends HashMap<String, List<IRelationship>> implem
                        if (!createIfMissing) {
                                return null;
                        }
-                       relationships = new ArrayList<IRelationship>();
-                       IRelationship rel = new Relationship(relationshipName, kind, source, new ArrayList<String>(), runtimeTest);
+                       relationships = new ArrayList<>();
+                       IRelationship rel = new Relationship(relationshipName, kind, source, new ArrayList<>(), runtimeTest);
                        relationships.add(rel);
 
                        super.put(source, relationships);
@@ -70,7 +70,7 @@ public class RelationshipMap extends HashMap<String, List<IRelationship>> implem
                        if (createIfMissing) {
                                // At this point we did find some relationships for 'source' but not one that looks like what we are
                                // after (either the kind or the name or the dynamictests setting don't match)
-                               IRelationship rel = new Relationship(relationshipName, kind, source, new ArrayList<String>(), runtimeTest);
+                               IRelationship rel = new Relationship(relationshipName, kind, source, new ArrayList<>(), runtimeTest);
                                relationships.add(rel);
                                return rel;
                        }
@@ -112,7 +112,7 @@ public class RelationshipMap extends HashMap<String, List<IRelationship>> implem
                List<IRelationship> existingRelationships = super.get(source);
                if (existingRelationships == null) {
                        // new entry
-                       existingRelationships = new ArrayList<IRelationship>();
+                       existingRelationships = new ArrayList<>();
                        existingRelationships.add(relationship);
                        super.put(source, existingRelationships);
                } else {
index de8f9c650f27c472d945a3ba102d9e63cdd96d5e..4609a3e0967048dc8f0d66c0bed0bd2ff0c489e1 100644 (file)
@@ -71,9 +71,9 @@ public class ConstantPool implements Node {
        private Constant[] pool;
        private int poolSize; // number of entries in the pool (could be < pool.length as the array is resized in 'chunks')
 
-       private Map<String, Integer> utf8Cache = new HashMap<String, Integer>();
-       private Map<String, Integer> methodCache = new HashMap<String, Integer>();
-       private Map<String, Integer> fieldCache = new HashMap<String, Integer>();
+       private Map<String, Integer> utf8Cache = new HashMap<>();
+       private Map<String, Integer> methodCache = new HashMap<>();
+       private Map<String, Integer> fieldCache = new HashMap<>();
 
        public int getSize() {
                return poolSize;
index 8689e31b9f72ae0fdf53ef7fa2fbc98af9218e4c..f0fc8c5a7d96f1a33eb213f524472b14aeadb2a2 100644 (file)
@@ -167,7 +167,7 @@ public abstract class FieldOrMethod extends Modifiers implements Node {
                // remain there.
                if (annotations == null) {
                        // Find attributes that contain annotation data
-                       List<AnnotationGen> accumulatedAnnotations = new ArrayList<AnnotationGen>();
+                       List<AnnotationGen> accumulatedAnnotations = new ArrayList<>();
                        for (Attribute attribute : attributes) {
                                if (attribute instanceof RuntimeAnnos) {
                                        RuntimeAnnos runtimeAnnotations = (RuntimeAnnos) attribute;
index 59c092239a06e1bc178c7a8313db41006cc5f3a0..dd1097ff04853560a4a7f4ea65e51a80c450549d 100644 (file)
@@ -286,7 +286,7 @@ public class JavaClass extends Modifiers implements Cloneable, Node {
        public AnnotationGen[] getAnnotations() {
                if (annotationsOutOfDate) {
                        // Find attributes that contain annotation data
-                       List<AnnotationGen> accumulatedAnnotations = new ArrayList<AnnotationGen>();
+                       List<AnnotationGen> accumulatedAnnotations = new ArrayList<>();
                        for (Attribute attribute : attributes) {
                                if (attribute instanceof RuntimeAnnos) {
                                        RuntimeAnnos runtimeAnnotations = (RuntimeAnnos) attribute;
@@ -742,7 +742,7 @@ public class JavaClass extends Modifiers implements Cloneable, Node {
         */
        public JavaClass[] getSuperClasses() {
                JavaClass clazz = this;
-               List<JavaClass> vec = new ArrayList<JavaClass>();
+               List<JavaClass> vec = new ArrayList<>();
                for (clazz = clazz.getSuperClass(); clazz != null; clazz = clazz.getSuperClass()) {
                        vec.add(clazz);
                }
@@ -772,8 +772,8 @@ public class JavaClass extends Modifiers implements Cloneable, Node {
         * Get all interfaces implemented by this JavaClass (transitively).
         */
        public Collection<JavaClass> getAllInterfaces() {
-               Queue<JavaClass> queue = new LinkedList<JavaClass>();
-               List<JavaClass> interfaceList = new ArrayList<JavaClass>();
+               Queue<JavaClass> queue = new LinkedList<>();
+               List<JavaClass> interfaceList = new ArrayList<>();
 
                queue.add(this);
 
index baa0629c6a5ee8fb7097ca9da658413a00f12f6f..12608940ab6c9e8bbbbfce0898c81ad07fd18667 100644 (file)
@@ -223,7 +223,7 @@ public final class Method extends FieldOrMethod {
                boolean foundSome = false;
                // Build a list of annotation arrays, one per argument
                if (parameterAnnotationsInvis != null || parameterAnnotationsVis != null) {
-                       List<AnnotationGen[]> annotationsForEachParameter = new ArrayList<AnnotationGen[]>();
+                       List<AnnotationGen[]> annotationsForEachParameter = new ArrayList<>();
                        AnnotationGen[] visibleOnes = null;
                        AnnotationGen[] invisibleOnes = null;
                        for (int i = 0; i < parameterCount; i++) {
index 9168847b085744926394a8999c7e59c9dd0dbf9c..71573a311e37070663b73bf82af3fd2e42da8e22 100644 (file)
@@ -606,7 +606,7 @@ public abstract class Utility {
                                riaIndex = cp.addUtf8("RuntimeInvisibleAnnotations");
                        }
 
-                       List<RuntimeAnnos> newAttributes = new ArrayList<RuntimeAnnos>();
+                       List<RuntimeAnnos> newAttributes = new ArrayList<>();
                        if (rvaData.length > 2) {
                                newAttributes.add(new RuntimeVisAnnos(rvaIndex, rvaData.length, rvaData, cp));
                        }
@@ -699,7 +699,7 @@ public abstract class Utility {
                                riaIndex = cp.addUtf8("RuntimeInvisibleParameterAnnotations");
                        }
 
-                       List<RuntimeParamAnnos> newAttributes = new ArrayList<RuntimeParamAnnos>();
+                       List<RuntimeParamAnnos> newAttributes = new ArrayList<>();
 
                        if (totalVisCount > 0) {
                                newAttributes.add(new RuntimeVisParamAnnos(rvaIndex, rvaData.length, rvaData, cp));
index 8074e383e92c149e5a0da2365401a85df71de3f6..8418abdb8a0b019cfb233439a711e2de3837ff4b 100644 (file)
@@ -44,7 +44,7 @@ public class AnnotationGen {
        }
 
        private List<NameValuePair> copyValues(List<NameValuePair> in, ConstantPool cpool, boolean copyPoolEntries) {
-               List<NameValuePair> out = new ArrayList<NameValuePair>();
+               List<NameValuePair> out = new ArrayList<>();
                for (NameValuePair nvp : in) {
                        out.add(new NameValuePair(nvp, cpool, copyPoolEntries));
                }
@@ -89,7 +89,7 @@ public class AnnotationGen {
 
        public void addElementNameValuePair(NameValuePair evp) {
                if (pairs == Collections.EMPTY_LIST) {
-                       pairs = new ArrayList<NameValuePair>();
+                       pairs = new ArrayList<>();
                }
                pairs.add(evp);
        }
index ecb1d539d71bbb5c6dc7c8adfc0e580d61442972..e18174410581c1d7cddfa67b77a62adfe927d57b 100644 (file)
@@ -34,13 +34,13 @@ public abstract class RuntimeAnnos extends Attribute {
        public RuntimeAnnos(byte attrid, boolean visible, int nameIdx, int len, ConstantPool cpool) {
                super(attrid, nameIdx, len, cpool);
                this.visible = visible;
-               annotations = new ArrayList<AnnotationGen>();
+               annotations = new ArrayList<>();
        }
 
        public RuntimeAnnos(byte attrid, boolean visible, int nameIdx, int len, byte[] data, ConstantPool cpool) {
                super(attrid, nameIdx, len, cpool);
                this.visible = visible;
-               annotations = new ArrayList<AnnotationGen>();
+               annotations = new ArrayList<>();
                annotation_data = data;
        }
 
@@ -76,7 +76,7 @@ public abstract class RuntimeAnnos extends Attribute {
                        DataInputStream dis = new DataInputStream(new ByteArrayInputStream(annotation_data));
                        int numberOfAnnotations = dis.readUnsignedShort();
                        if (numberOfAnnotations > 0) {
-                               List<AnnotationGen> inflatedAnnotations = new ArrayList<AnnotationGen>();
+                               List<AnnotationGen> inflatedAnnotations = new ArrayList<>();
                                for (int i = 0; i < numberOfAnnotations; i++) {
                                        inflatedAnnotations.add(AnnotationGen.read(dis, getConstantPool(), visible));
                                }
index 42bf903a11c8f38e4c07bfa2c7b806d4601f6403..5b1dcafff722332e8648c6b38385c8411f02d81c 100644 (file)
@@ -36,13 +36,13 @@ public abstract class RuntimeParamAnnos extends Attribute {
             int nameIdx, int len, ConstantPool cpool) {
                super(attrid,nameIdx,len,cpool);
                this.visible = visible; 
-               parameterAnnotations = new ArrayList<AnnotationGen[]>();
+               parameterAnnotations = new ArrayList<>();
        }
        
        public RuntimeParamAnnos(byte attrid,boolean visible,int nameIdx,int len,byte[] data,ConstantPool cpool) {
                super(attrid,nameIdx,len,cpool);
                this.visible = visible;
-               parameterAnnotations = new ArrayList<AnnotationGen[]>();
+               parameterAnnotations = new ArrayList<>();
                annotation_data = data;
        }
        
@@ -88,7 +88,7 @@ public abstract class RuntimeParamAnnos extends Attribute {
                        DataInputStream dis = new DataInputStream(new ByteArrayInputStream(annotation_data));
                        int numParameters = dis.readUnsignedByte();
                        if (numParameters > 0) {
-                               List<AnnotationGen[]> inflatedParameterAnnotations = new ArrayList<AnnotationGen[]>();
+                               List<AnnotationGen[]> inflatedParameterAnnotations = new ArrayList<>();
                                for (int i=0; i<numParameters; i++) {
                                        int numAnnotations = dis.readUnsignedShort();
                                        if (numAnnotations == 0 ) {
index 8b7f0dd3f013c70b71e5f2f869674560acd5259c..943b77f6e6c20a49cfa06179788a955a632e57ce 100644 (file)
@@ -97,11 +97,11 @@ public class ClassGen extends Modifiers implements Cloneable {
        private int major = Constants.MAJOR_1_1;
        private int minor = Constants.MINOR_1_1;
        private ConstantPool cpool;
-       private List<Field> fieldsList = new ArrayList<Field>();
-       private List<Method> methodsList = new ArrayList<Method>();
-       private List<Attribute> attributesList = new ArrayList<Attribute>();
-       private List<String> interfaceList = new ArrayList<String>();
-       private List<AnnotationGen> annotationsList = new ArrayList<AnnotationGen>();
+       private List<Field> fieldsList = new ArrayList<>();
+       private List<Method> methodsList = new ArrayList<>();
+       private List<Attribute> attributesList = new ArrayList<>();
+       private List<String> interfaceList = new ArrayList<>();
+       private List<AnnotationGen> annotationsList = new ArrayList<>();
 
        public ClassGen(String classname, String superclassname, String filename, int modifiers, String[] interfacenames,
                        ConstantPool cpool) {
@@ -187,7 +187,7 @@ public class ClassGen extends Modifiers implements Cloneable {
                        attributes = attributesList;
                } else {
                        // TODO: Sometime later, trash any attributes called 'RuntimeVisibleAnnotations' or 'RuntimeInvisibleAnnotations'
-                       attributes = new ArrayList<Attribute>();
+                       attributes = new ArrayList<>();
                        attributes.addAll(Utility.getAnnotationAttributes(cpool, annotationsList));
                        attributes.addAll(attributesList);
                }
@@ -503,7 +503,7 @@ public class ClassGen extends Modifiers implements Cloneable {
                        // (relevant modifiers are ACC_PUBLIC, ACC_PRIVATE,
                        // ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ACC_VOLATILE,
                        // ACC_TRANSIENT)
-                       List<Field> relevantFields = new ArrayList<Field>();
+                       List<Field> relevantFields = new ArrayList<>();
                        for (Field field : fieldsList) {
                                if (!(field.isPrivate() && field.isStatic()) && !(field.isPrivate() && field.isTransient())) {
                                        relevantFields.add(field);
@@ -519,8 +519,8 @@ public class ClassGen extends Modifiers implements Cloneable {
                        }
 
                        // some up front method processing: discover clinit, init and ordinary methods of interest:
-                       List<Method> relevantMethods = new ArrayList<Method>();
-                       List<Method> relevantCtors = new ArrayList<Method>();
+                       List<Method> relevantMethods = new ArrayList<>();
+                       List<Method> relevantCtors = new ArrayList<>();
                        boolean hasClinit = false;
                        for (Method m : methodsList) {
                                boolean couldBeInitializer = m.getName().charAt(0) == '<';
index ff8b6f42cb8aaf31501097daa2af5cd081def7c9..c8e1fe2fb4411adf0aff63751a5c3793124a49dc 100644 (file)
@@ -76,8 +76,8 @@ public abstract class FieldGenOrMethodGen extends Modifiers {
        protected String name;
        protected Type type;
        protected ConstantPool cp;
-       private ArrayList<Attribute> attributeList = new ArrayList<Attribute>();
-       protected ArrayList<AnnotationGen> annotationList = new ArrayList<AnnotationGen>();
+       private ArrayList<Attribute> attributeList = new ArrayList<>();
+       protected ArrayList<AnnotationGen> annotationList = new ArrayList<>();
 
        protected FieldGenOrMethodGen() {
        }
index 2f2691df12e241a539184602d2184098bc2fa64f..c5c2448695dc80c06afcbe1945a142bbd473bc09 100644 (file)
@@ -156,7 +156,7 @@ public class InstructionHandle implements java.io.Serializable {
         */
        public void addTargeter(InstructionTargeter t) {
                if (targeters == Collections.EMPTY_SET) {
-                       targeters = new HashSet<InstructionTargeter>();
+                       targeters = new HashSet<>();
                }
                targeters.add(t);
        }
@@ -170,7 +170,7 @@ public class InstructionHandle implements java.io.Serializable {
        }
 
        public Set<InstructionTargeter> getTargetersCopy() {
-               Set<InstructionTargeter> copy = new HashSet<InstructionTargeter>();
+               Set<InstructionTargeter> copy = new HashSet<>();
                copy.addAll(targeters);
                return copy;
        }
index dd010b758ff90f926f38dd30450ab3bfa6cea1b2..156adf0ad149487d251eb6ba4f532a81ccd67333 100644 (file)
@@ -690,7 +690,7 @@ public class InstructionList implements Serializable {
                        return;
                }
 
-               ArrayList<InstructionHandle> target_vec = new ArrayList<InstructionHandle>();
+               ArrayList<InstructionHandle> target_vec = new ArrayList<>();
 
                for (InstructionHandle ih = first; ih != null; ih = ih.next) {
                        ih.getInstruction().dispose(); // e.g. BranchInstructions release their targets
@@ -1003,7 +1003,7 @@ public class InstructionList implements Serializable {
         */
        public Instruction[] getInstructions() {
                ByteSequence bytes = new ByteSequence(getByteCode());
-               ArrayList<Instruction> instructions = new ArrayList<Instruction>();
+               ArrayList<Instruction> instructions = new ArrayList<>();
 
                try {
                        while (bytes.available() > 0) {
@@ -1089,7 +1089,7 @@ public class InstructionList implements Serializable {
         * @return complete, i.e., deep copy of this list
         */
        public InstructionList copy() {
-               HashMap<InstructionHandle, InstructionHandle> map = new HashMap<InstructionHandle, InstructionHandle>();
+               HashMap<InstructionHandle, InstructionHandle> map = new HashMap<>();
                InstructionList il = new InstructionList();
 
                /*
index 46b5581465cf08633074b0e35c531f14983a1ae4..cf8c068347996a0674a68f64e7ee40beb78c8079 100644 (file)
@@ -103,11 +103,11 @@ public class MethodGen extends FieldGenOrMethodGen {
 
        private int highestLineNumber = 0;
 
-       private ArrayList<LocalVariableGen> localVariablesList = new ArrayList<LocalVariableGen>();
-       private ArrayList<LineNumberGen> lineNumbersList = new ArrayList<LineNumberGen>();
-       private ArrayList<CodeExceptionGen> exceptionsList = new ArrayList<CodeExceptionGen>();
-       private ArrayList<String> exceptionsThrown = new ArrayList<String>();
-       private ArrayList<Attribute> codeAttributesList = new ArrayList<Attribute>();
+       private ArrayList<LocalVariableGen> localVariablesList = new ArrayList<>();
+       private ArrayList<LineNumberGen> lineNumbersList = new ArrayList<>();
+       private ArrayList<CodeExceptionGen> exceptionsList = new ArrayList<>();
+       private ArrayList<String> exceptionsThrown = new ArrayList<>();
+       private ArrayList<Attribute> codeAttributesList = new ArrayList<>();
        private List<AnnotationGen>[] param_annotations; // Array of lists containing AnnotationGen objects
        private boolean hasParameterAnnotations = false;
        private boolean haveUnpackedParameterAnnotations = false;
@@ -933,8 +933,8 @@ public class MethodGen extends FieldGenOrMethodGen {
        }
 
        static final class BranchStack {
-               Stack<BranchTarget> branchTargets = new Stack<BranchTarget>();
-               Hashtable<InstructionHandle, BranchTarget> visitedTargets = new Hashtable<InstructionHandle, BranchTarget>();
+               Stack<BranchTarget> branchTargets = new Stack<>();
+               Hashtable<InstructionHandle, BranchTarget> visitedTargets = new Hashtable<>();
 
                public void push(InstructionHandle target, int stackDepth) {
                        if (visited(target)) {
@@ -1106,7 +1106,7 @@ public class MethodGen extends FieldGenOrMethodGen {
                                if (!hasParameterAnnotations) {
                                        param_annotations = new List[parameterTypes.length];
                                        for (int j = 0; j < parameterTypes.length; j++) {
-                                               param_annotations[j] = new ArrayList<AnnotationGen>();
+                                               param_annotations[j] = new ArrayList<>();
                                        }
                                }
 
@@ -1139,7 +1139,7 @@ public class MethodGen extends FieldGenOrMethodGen {
        }
 
        private List /* AnnotationGen */<AnnotationGen> makeMutableVersion(AnnotationGen[] mutableArray) {
-               List<AnnotationGen> result = new ArrayList<AnnotationGen>();
+               List<AnnotationGen> result = new ArrayList<>();
                for (AnnotationGen annotationGen : mutableArray) {
                        result.add(new AnnotationGen(annotationGen, getConstantPool(), false));
                }
@@ -1156,7 +1156,7 @@ public class MethodGen extends FieldGenOrMethodGen {
                if (existingAnnotations != null) {
                        existingAnnotations.add(annotation);
                } else {
-                       List<AnnotationGen> l = new ArrayList<AnnotationGen>();
+                       List<AnnotationGen> l = new ArrayList<>();
                        l.add(annotation);
                        param_annotations[parameterIndex] = l;
                }
index 68b68f3d6c6b02100920cb7a7db070dc6de4d2c6..ed8995ef0f44a14a20ae4576c67859fe013dff74 100644 (file)
@@ -113,7 +113,7 @@ public abstract class Type {
        public static final Type[] STRINGARRAY6 = new Type[] { STRING, STRING, STRING, STRING, STRING, STRING };
        public static final Type[] STRINGARRAY7 = new Type[] { STRING, STRING, STRING, STRING, STRING, STRING, STRING };
 
-       private static Map<String, Type> commonTypes = new HashMap<String, Type>();
+       private static Map<String, Type> commonTypes = new HashMap<>();
 
        static {
                commonTypes.put(STRING.getSignature(), STRING);
@@ -314,7 +314,7 @@ public abstract class Type {
         */
        // OPTIMIZE crap impl
        public static Type[] getArgumentTypes(String signature) {
-               List<Type> argumentTypes = new ArrayList<Type>();
+               List<Type> argumentTypes = new ArrayList<>();
                int index;
                Type[] types;
 
index e3c59556ba805f1825ca649d56c8cd59c1a03a81..4f18bd70f8d1c641bba0f16b411613794fc9fe91 100644 (file)
@@ -88,8 +88,8 @@ public class ClassLoaderRepository implements Repository {
        private ClassLoaderReference loaderRef;
 
        // Choice of cache...
-       private WeakHashMap<URL, SoftReference<JavaClass>> localCache = new WeakHashMap<URL, SoftReference<JavaClass>>();
-       private static SoftHashMap /* <URL,JavaClass> */sharedCache = new SoftHashMap(Collections.synchronizedMap(new HashMap<Object, SpecialValue>()));
+       private WeakHashMap<URL, SoftReference<JavaClass>> localCache = new WeakHashMap<>();
+       private static SoftHashMap /* <URL,JavaClass> */sharedCache = new SoftHashMap(Collections.synchronizedMap(new HashMap<>()));
 
        // For fast translation of the classname *intentionally not static*
        private SoftHashMap /* <String,URL> */nameMap = new SoftHashMap(new HashMap(), false);
@@ -216,7 +216,7 @@ public class ClassLoaderRepository implements Repository {
                        sharedCache.put(url, clazz);
                } else {
                        clazz.setRepository(this);
-                       localCache.put(url, new SoftReference<JavaClass>(clazz));
+                       localCache.put(url, new SoftReference<>(clazz));
                }
        }
 
index 95552dd6a9c83bf5e44d2b1318739657b5dfe0de..1798005403313af776b9b805410f2dcfcd495ec4 100644 (file)
@@ -106,7 +106,7 @@ public class ClassPath implements Serializable {
        public ClassPath(String class_path) {
                this.class_path = class_path;
 
-               ArrayList<PathEntry> vec = new ArrayList<PathEntry>();
+               ArrayList<PathEntry> vec = new ArrayList<>();
 
                for (StringTokenizer tok = new StringTokenizer(class_path, System.getProperty("path.separator")); tok
                                .hasMoreTokens();) {
@@ -193,12 +193,12 @@ public class ClassPath implements Serializable {
                String ext_path = System.getProperty("java.ext.dirs");
                String vm_version = System.getProperty("java.version");
 
-               ArrayList<String> list = new ArrayList<String>();
+               ArrayList<String> list = new ArrayList<>();
 
                getPathComponents(class_path, list);
                getPathComponents(boot_path, list);
 
-               ArrayList<String> dirs = new ArrayList<String>();
+               ArrayList<String> dirs = new ArrayList<>();
                getPathComponents(ext_path, dirs);
 
                for (String string : dirs) {
index fe43a7bef549e204e621ef74dc4c0705277b4d32..a7689b10878cbc8d5f56f9f54cac9e008b584ec9 100644 (file)
@@ -96,7 +96,7 @@ public class NonCachingClassLoaderRepository implements Repository {
                }
 
                public SoftHashMap() {
-                       this(new HashMap<Object,SpecialValue>());
+                       this(new HashMap<>());
                }
 
                public SoftHashMap(Map<Object,SpecialValue> map, boolean b) {
index ea0e49216b041621b774a2c82ebeb4e600fd0107..baf3b75cd14c92c8386b57289767e1c2c391f2fd 100644 (file)
@@ -80,12 +80,12 @@ import org.aspectj.apache.bcel.classfile.JavaClass;
 public class SyntheticRepository implements Repository {
        private static final String DEFAULT_PATH = ClassPath.getClassPath();
 
-       private static HashMap<ClassPath, SyntheticRepository> _instances = new HashMap<ClassPath, SyntheticRepository>(); // CLASSPATH
+       private static HashMap<ClassPath, SyntheticRepository> _instances = new HashMap<>(); // CLASSPATH
                                                                                                                                                                                                                                                // X
                                                                                                                                                                                                                                                // REPOSITORY
 
        private ClassPath _path = null;
-       private WeakHashMap<String, JavaClass> _loadedClasses = new WeakHashMap<String, JavaClass>(); // CLASSNAME X JAVACLASS
+       private WeakHashMap<String, JavaClass> _loadedClasses = new WeakHashMap<>(); // CLASSNAME X JAVACLASS
 
        private SyntheticRepository(ClassPath path) {
                _path = path;
index d9a4ce780cf1713899e283eec099323a3a9fd075..d684144eb2e9e161c5ed8bb4bd3cd0f3c45fca41 100644 (file)
@@ -64,7 +64,7 @@ public class AnnotationGenTest extends BcelTestCase {
 
                ObjectType t = new ObjectType("SimpleAnnotation");
 
-               List<NameValuePair> elements = new ArrayList<NameValuePair>();
+               List<NameValuePair> elements = new ArrayList<>();
                elements.add(nvGen);
 
                // Build an annotation of type 'SimpleAnnotation' with 'id=4' as the only value :)
@@ -91,13 +91,13 @@ public class AnnotationGenTest extends BcelTestCase {
 
                ObjectType t = new ObjectType("SimpleAnnotation");
 
-               List<NameValuePair> elements = new ArrayList<NameValuePair>();
+               List<NameValuePair> elements = new ArrayList<>();
                elements.add(nvGen);
 
                // Build a RV annotation of type 'SimpleAnnotation' with 'id=4' as the only value :)
                AnnotationGen a = new AnnotationGen(t, elements, true, cp);
 
-               Vector<AnnotationGen> v = new Vector<AnnotationGen>();
+               Vector<AnnotationGen> v = new Vector<>();
                v.add(a);
                Collection<RuntimeAnnos> attributes = Utility.getAnnotationAttributes(cp, v);
                boolean foundRV = false;
@@ -113,7 +113,7 @@ public class AnnotationGenTest extends BcelTestCase {
                // Build a RIV annotation of type 'SimpleAnnotation' with 'id=4' as the only value :)
                AnnotationGen a2 = new AnnotationGen(t, elements, false, cp);
 
-               Vector<AnnotationGen> v2 = new Vector<AnnotationGen>();
+               Vector<AnnotationGen> v2 = new Vector<>();
                v2.add(a2);
                Collection<RuntimeAnnos> attributes2 = Utility.getAnnotationAttributes(cp, v2);
                boolean foundRIV = false;
index 57505a9c5576371b8b685f333cdd6f2cf77fd20c..b18d51308a95dc492c0f1699f7cd58ddff2ee02f 100644 (file)
@@ -93,7 +93,7 @@ public abstract class BcelTestCase extends TestCase {
 
        protected Attribute[] findAttribute(String name, JavaClass clazz) {
                Attribute[] all = clazz.getAttributes();
-               List<Attribute> chosenAttrsList = new ArrayList<Attribute>();
+               List<Attribute> chosenAttrsList = new ArrayList<>();
                for (Attribute attribute : all) {
                        if (verbose)
                                System.err.println("Attribute: " + attribute.getName());
@@ -104,7 +104,7 @@ public abstract class BcelTestCase extends TestCase {
        }
 
        protected Attribute findAttribute(String name, Attribute[] all) {
-               List<Attribute> chosenAttrsList = new ArrayList<Attribute>();
+               List<Attribute> chosenAttrsList = new ArrayList<>();
                for (Attribute attribute : all) {
                        if (verbose)
                                System.err.println("Attribute: " + attribute.getName());
@@ -158,7 +158,7 @@ public abstract class BcelTestCase extends TestCase {
                SimpleElementValue evg = new SimpleElementValue(ElementValue.STRING, cp, aFruit);
                NameValuePair nvGen = new NameValuePair("fruit", evg, cp);
                ObjectType t = new ObjectType("SimpleStringAnnotation");
-               List<NameValuePair> elements = new ArrayList<NameValuePair>();
+               List<NameValuePair> elements = new ArrayList<>();
                elements.add(nvGen);
                return new AnnotationGen(t, elements, visibility, cp);
        }
index b826fc7a0160473cc37aba945bd1d121b59775e4..45fd47c7b9ca6ab1112452596ebcbf00f43d46a1 100644 (file)
@@ -523,7 +523,7 @@ public class GeneratingAnnotatedClassesTest extends BcelTestCase {
 
                ObjectType t = new ObjectType("SimpleAnnotation");
 
-               List<NameValuePair> elements = new ArrayList<NameValuePair>();
+               List<NameValuePair> elements = new ArrayList<>();
                elements.add(nvGen);
 
                AnnotationGen a = new AnnotationGen(t, elements, true, cp);
@@ -534,7 +534,7 @@ public class GeneratingAnnotatedClassesTest extends BcelTestCase {
                SimpleElementValue evg = new SimpleElementValue(ElementValue.STRING, cp, aFruit);
                NameValuePair nvGen = new NameValuePair("fruit", evg, cp);
                ObjectType t = new ObjectType("SimpleStringAnnotation");
-               List<NameValuePair> elements = new ArrayList<NameValuePair>();
+               List<NameValuePair> elements = new ArrayList<>();
                elements.add(nvGen);
                return new AnnotationGen(t, elements, true, cp);
        }
@@ -545,7 +545,7 @@ public class GeneratingAnnotatedClassesTest extends BcelTestCase {
                ArrayElementValue array = new ArrayElementValue(cp);
                array.addElement(new AnnotationElementValue(a, cp));
                NameValuePair nvp = new NameValuePair("value", array, cp);
-               List<NameValuePair> elements = new ArrayList<NameValuePair>();
+               List<NameValuePair> elements = new ArrayList<>();
                elements.add(nvp);
                return new AnnotationGen(new ObjectType("CombinedAnnotation"), elements, true, cp);
        }
@@ -557,7 +557,7 @@ public class GeneratingAnnotatedClassesTest extends BcelTestCase {
 
                ObjectType t = new ObjectType("SimpleAnnotation");
 
-               List<NameValuePair> elements = new ArrayList<NameValuePair>();
+               List<NameValuePair> elements = new ArrayList<>();
                elements.add(nvGen);
 
                AnnotationGen a = new AnnotationGen(t, elements, false, cp);
index b15e5f325f0d09e3fcde169e12b95d86a705748d..255dc77ffcee3c0945e235344bc4a475bf17d813 100644 (file)
@@ -415,7 +415,7 @@ public class GenericSignatureParsingTest extends BcelTestCase {
           * @return              Array of argument types
           */
          public static final String[] methodSignatureArgumentTypes(String signature,boolean chopit) throws ClassFormatException {
-           ArrayList<String> vec = new ArrayList<String>();
+           ArrayList<String> vec = new ArrayList<>();
            int       index;
            String[]  types;
        
index c8eda5d4067e9c9adcc2d160002d6c515c33636d..e9fd785615a4c9cf47380b4452c1ed75d919fe20 100644 (file)
@@ -121,7 +121,7 @@ public class NonCachingClassLoaderRepositoryTest extends TestCase {
        }
 
        public void testConcurrency() throws ClassNotFoundException, InterruptedException {
-               List<DoneChecker> loaders = new ArrayList<DoneChecker>();
+               List<DoneChecker> loaders = new ArrayList<>();
                int i1 = 1000;
                for (int i = 0; i < i1; i++) {
                        DoneChecker loader = new Loader();
index 351caa002b78d6eb6770f6b9757aedab9c7afd7b..8a979b73fdd482b01dcba88f320c706a1e858583 100644 (file)
@@ -551,7 +551,7 @@ public class ParameterAnnotationsTest extends BcelTestCase {
 
                ObjectType t = new ObjectType("SimpleAnnotation");
 
-               List<NameValuePair> elements = new ArrayList<NameValuePair>();
+               List<NameValuePair> elements = new ArrayList<>();
                elements.add(nvGen);
 
                AnnotationGen a = new AnnotationGen(t, elements,true, cp);
@@ -564,7 +564,7 @@ public class ParameterAnnotationsTest extends BcelTestCase {
                ArrayElementValue array = new ArrayElementValue(cp);
                array.addElement(new AnnotationElementValue(a,cp)); 
                NameValuePair nvp = new NameValuePair("value",array,cp);
-               List<NameValuePair> elements = new ArrayList<NameValuePair>();
+               List<NameValuePair> elements = new ArrayList<>();
                elements.add(nvp);
                return new AnnotationGen(new ObjectType("CombinedAnnotation"),elements,true,cp);
        }
@@ -577,7 +577,7 @@ public class ParameterAnnotationsTest extends BcelTestCase {
 
                ObjectType t = new ObjectType("SimpleAnnotation");
 
-               List<NameValuePair> elements = new ArrayList<NameValuePair>();
+               List<NameValuePair> elements = new ArrayList<>();
                elements.add(nvGen);
 
                AnnotationGen a = new AnnotationGen(t, elements,false, cp);
index af3df5c6a6e3390c879c796fdbdf492430fe95f4..a4926caa54d2afa9f1d481e2d2d6da0142d30e23 100644 (file)
@@ -383,7 +383,7 @@ public class RuntimeVisibleAnnotationAttributeTest extends BcelTestCase {
 
        public static List<String> getListOfAnnotationNames(AnnotationGen a) {
                List<NameValuePair> l = a.getValues();
-           List<String> names = new ArrayList<String>();
+           List<String> names = new ArrayList<>();
                for (NameValuePair element : l) {
                        names.add(element.getNameString());
                }
index acde7cd28bf161ea30f4b58a59265a61dbcb14eb..6dac2005ead92e0388679086957900ca336c4420 100644 (file)
@@ -45,7 +45,7 @@ public class AbortException extends RuntimeException { // XXX move porters out,
        /** used when message text is null */
        public static final String NO_MESSAGE_TEXT = "AbortException (no message)";
 
-       private static final ArrayList<AbortException> porters = new ArrayList<AbortException>();
+       private static final ArrayList<AbortException> porters = new ArrayList<>();
 
        /**
         * Get a porter exception from the pool. Porter exceptions do <b>not</b> have valid stack traces. They are used only to avoid
index 4ce55087675c8776cb4aeffda37442686a81a5a9..1a1e8f0147f344f112f7bc2309d08eee3e2e9ca2 100644 (file)
@@ -38,7 +38,7 @@ public class CountingMessageHandler implements IMessageHandler {
        public CountingMessageHandler(IMessageHandler delegate) {
                LangUtil.throwIaxIfNull(delegate, "delegate");
                this.delegate = delegate;
-               this.counters = new Hashtable<IMessage.Kind, IntHolder>();
+               this.counters = new Hashtable<>();
                proxy = (delegate instanceof CountingMessageHandler ? (CountingMessageHandler) delegate : null);
        }
 
index 6fd8539cc0645ec62e45ce91efe4134cacb0f0b1..23c2ef3b2628f48d62284b0f3ec0b1eae0c588b2 100644 (file)
@@ -48,8 +48,8 @@ public class MessageHandler implements IMessageHolder {
         * @param accumulateOnly the result of handleMessage (i.e., if true, then only accumulate messages - stop processing
         */
        public MessageHandler(boolean accumulateOnly) {
-               messages = new ArrayList<IMessage>();
-               ignoring = new ArrayList<IMessage.Kind>();
+               messages = new ArrayList<>();
+               ignoring = new ArrayList<>();
                init(accumulateOnly);
                ignore(IMessage.WEAVEINFO); // Off by default, need to explicitly be enabled (see -showWeaveInfo)
        }
@@ -207,7 +207,7 @@ public class MessageHandler implements IMessageHolder {
                if (null == kind) {
                        return messages.toArray(IMessage.RA_IMessage);
                }
-               ArrayList<IMessage> result = new ArrayList<IMessage>();
+               ArrayList<IMessage> result = new ArrayList<>();
                if (!orGreater) {
                        for (IMessage m : messages) {
                                if (kind == m.getKind()) {
index 77f9c90a884fc30ad1b627f3702b371c6da6aa40..d55ac3c3b4f35449a04e56d81af14d89cabfd68c 100644 (file)
@@ -409,7 +409,7 @@ public class MessageUtil {
                if (null == kind) {
                        return messages;
                }
-               ArrayList<IMessage> result = new ArrayList<IMessage>();
+               ArrayList<IMessage> result = new ArrayList<>();
                for (IMessage message : messages) {
                        if (kind == message.getKind()) {
                                result.add(message);
@@ -478,7 +478,7 @@ public class MessageUtil {
                        return IMessage.RA_IMessage;
                }
                LangUtil.throwIaxIfNull(visitor, "visitor");
-               ArrayList<IMessage> result = (accumulate ? new ArrayList<IMessage>() : null);
+               ArrayList<IMessage> result = (accumulate ? new ArrayList<>() : null);
                for (IMessage m : messages) {
                        if (visitor.handleMessage(m)) {
                                if (accumulate) {
index 6117b96a907f0e187297ba33d2caa6899da0c064..2ae13a27915850b1459e8f9f6d5646cea9c01e89 100644 (file)
@@ -87,13 +87,13 @@ public class CompilationAndWeavingContext {
                        "type munging for @AspectJ aspectOf" };
 
        // context stacks, one per thread
-       private static ThreadLocal<Stack<ContextStackEntry>> contextMap = new ThreadLocal<Stack<ContextStackEntry>>();
+       private static ThreadLocal<Stack<ContextStackEntry>> contextMap = new ThreadLocal<>();
 
        // single thread mode stack
-       private static Stack<ContextStackEntry> contextStack = new Stack<ContextStackEntry>();
+       private static Stack<ContextStackEntry> contextStack = new Stack<>();
 
        // formatters, by phase id
-       private static Map<Integer, ContextFormatter> formatterMap = new HashMap<Integer, ContextFormatter>();
+       private static Map<Integer, ContextFormatter> formatterMap = new HashMap<>();
 
        private static ContextFormatter defaultFormatter = new DefaultFormatter();
 
@@ -131,7 +131,7 @@ public class CompilationAndWeavingContext {
         */
        public static String getCurrentContext() {
                Stack<ContextStackEntry> contextStack = getContextStack();
-               Stack<String> explanationStack = new Stack<String>();
+               Stack<String> explanationStack = new Stack<>();
                for (ContextStackEntry entry : contextStack) {
                        Object data = entry.getData();
                        if (data != null) {
@@ -150,7 +150,7 @@ public class CompilationAndWeavingContext {
        public static ContextToken enteringPhase(int phaseId, Object data) {
                Stack<ContextStackEntry> contextStack = getContextStack();
                ContextTokenImpl nextToken = nextToken();
-               contextStack.push(new ContextStackEntry(nextToken, phaseId, new WeakReference<Object>(data)));
+               contextStack.push(new ContextStackEntry(nextToken, phaseId, new WeakReference<>(data)));
                return nextToken;
        }
 
@@ -183,7 +183,7 @@ public class CompilationAndWeavingContext {
                } else {
                        Stack<ContextStackEntry> contextStack = contextMap.get();
                        if (contextStack == null) {
-                               contextStack = new Stack<ContextStackEntry>();
+                               contextStack = new Stack<>();
                                contextMap.set(contextStack);
                        }
                        return contextStack;
index 12286748e25b4bb70cf8662a1cf6857f3f0f6f17..91506e43907639a0d3c492b3249a7d698527ce3b 100644 (file)
@@ -409,7 +409,7 @@ public class AntBuilder extends Builder {
         */
        @Override
        protected Result[] getAntecedantResults(Result moduleResult) {
-               Hashtable<String,Target> targets = new Hashtable<String, Target>();
+               Hashtable<String,Target> targets = new Hashtable<>();
                makeTargetsForResult(moduleResult, targets);
                String targetName = resultToTargetName(moduleResult);
                // bug: doc says topoSort returns String, but returns Target
@@ -419,7 +419,7 @@ public class AntBuilder extends Builder {
                if (0 == result.size()) {
                        return new Result[0];
                }
-               ArrayList<String> toReturn = new ArrayList<String>();
+               ArrayList<String> toReturn = new ArrayList<>();
                for (Target target : result) {
                        String name = target.getName();
                        if (null == name) {
index aa0c35e354f5ffbe24313fc20c2b273ce90eedbb..ed64e74e01f914ac3ef15c9216673208cc0ef716 100644 (file)
@@ -83,7 +83,7 @@ public class Checklics extends MatchingTask {
                License MPL_ONLY = new License(MPL_ONLY_TAG, LIC_MPL);
                License MPL_PARC = new License(MPL_PARC_TAG, LIC_MPL, PARC);
                License PARC_COPYRIGHT = new License(PARC_COPYRIGHT_TAG, null, PARC);
-               LICENSES = new Hashtable<String,License>();
+               LICENSES = new Hashtable<>();
                LICENSES.put(APL.tag, APL);
                LICENSES.put(MPL.tag, MPL);
                LICENSES.put(MPL_PARC.tag, MPL_PARC);
@@ -469,7 +469,7 @@ class HeaderInfo {
                this.lastLine = lastLine;
                this.file = file;
                this.hasLicense = hasLicense;
-               List<String> newYears = new ArrayList<String>();
+               List<String> newYears = new ArrayList<>();
                newYears.addAll(years);
                Collections.sort(newYears);
                this.years = Collections.unmodifiableList(newYears);
@@ -618,7 +618,7 @@ class Header {
        }
 
        public static HeaderInfo checkFile(final File file) {
-               ArrayList<String> years = new ArrayList<String>();
+               ArrayList<String> years = new ArrayList<>();
                int endLine = 0;
                BufferedReader input = null;
                int lineNum = 0;
index e717959128b6fabc8761e9fad3ba5912c6c0bb2f..431f9b25bffb5eeb6d96d2297a02755794911af7 100644 (file)
@@ -28,7 +28,7 @@ public abstract class ConditionalTask extends Task {
 
     private   List<If> ifs;
     protected List<If> ifs() {
-        return ifs != null ? ifs : (ifs = new Vector<If>());
+        return ifs != null ? ifs : (ifs = new Vector<>());
     }
 
     public If createIf() {
@@ -169,7 +169,7 @@ public abstract class ConditionalTask extends Task {
 
     protected List<String> getFalses() {
         Iterator<If> iter = ifs().iterator();
-        List<String> result = new Vector<String>();
+        List<String> result = new Vector<>();
         while (iter.hasNext()) {
             If next = iter.next();
             String name = next.getName();
index fe80190ada2a01d798f3c675ee321336d28e6c79..ac13870c853cab6d8ab7023544c76c3faacf2c32 100644 (file)
@@ -149,7 +149,7 @@ public abstract class Builder {
         if ((null == text) || (0 == text.length())) {
             return Collections.EMPTY_LIST;
         }
-        List<String> strings = new ArrayList<String>();
+        List<String> strings = new ArrayList<>();
         StringTokenizer tok = new StringTokenizer(text, ",");
         while (tok.hasMoreTokens()) {
             String token = tok.nextToken().trim();
@@ -275,7 +275,7 @@ public abstract class Builder {
             return buildProduct(buildSpec);
         }
         Result result = specifyResultFor(buildSpec);
-        ArrayList<String> errors = new ArrayList<String>();
+        ArrayList<String> errors = new ArrayList<>();
         try {
             return buildAll(result, errors);
         } finally {
@@ -340,7 +340,7 @@ public abstract class Builder {
      */
     protected final boolean buildAll(Result result, List<String> errors) {
         Result[] buildList = skipUptodate(getAntecedantResults(result));
-        ArrayList<String> doneList = new ArrayList<String>();
+        ArrayList<String> doneList = new ArrayList<>();
         if ((null != buildList) && (0 < buildList.length)) {
             if (isLogging()) {
                 handler.log("modules to build: " + Arrays.asList(buildList));
@@ -543,7 +543,7 @@ public abstract class Builder {
      * deliverables.
      */
     protected ProductModule[] discoverModules(File productDir, Modules modules) {
-        final ArrayList<File> found = new ArrayList<File>();
+        final ArrayList<File> found = new ArrayList<>();
         FileFilter filter = new FileFilter() {// empty jar files
             public boolean accept(File file) {
                 if ((null != file) && file.canRead()
@@ -555,7 +555,7 @@ public abstract class Builder {
             }
         };
         Util.visitFiles(productDir, filter);
-        ArrayList<ProductModule> results = new ArrayList<ProductModule>();
+        ArrayList<ProductModule> results = new ArrayList<>();
         for (File file: found) {
             String jarName = moduleAliasFor(file.getName().toLowerCase());
             if (jarName.endsWith(".jar") || jarName.endsWith(".zip")) { // XXXFileLiteral
index 65d929707b1d7db5c4e861d1f53d598c1c7e1b25..3f34b3f5ea876ed46ff5f56ca5efc19eec0cd609 100644 (file)
@@ -69,7 +69,7 @@ public class Module {
 
     /** @return all source files under srcDir */
     private static Iterator<File> sourceFiles(File srcDir) {
-        ArrayList<File> result = new ArrayList<File>();
+        ArrayList<File> result = new ArrayList<>();
         sourceFiles(srcDir, result);
         return result.iterator();
     }
@@ -198,11 +198,11 @@ public class Module {
         Util.iaxIfNull(name, "name");
         Util.iaxIfNull(modules, "modules");
         this.moduleDir = moduleDir;
-        this.libJars = new ArrayList<File>();
-        this.exportedLibJars = new ArrayList<File>();
-        this.requiredModules = new ArrayList<Module>();
-        this.srcDirs = new ArrayList<File>();
-        this.classpathVariables = new ArrayList<String>();
+        this.libJars = new ArrayList<>();
+        this.exportedLibJars = new ArrayList<>();
+        this.requiredModules = new ArrayList<>();
+        this.srcDirs = new ArrayList<>();
+        this.classpathVariables = new ArrayList<>();
         this.properties = new Properties();
         this.name = name;
         this.modules = modules;
@@ -609,7 +609,7 @@ public class Module {
         String[] tokenize(String line) {
             final String DELIM = " \n\t\\<>\"=";
             StringTokenizer st = new StringTokenizer(line, DELIM, true);
-            ArrayList<String> result = new ArrayList<String>();
+            ArrayList<String> result = new ArrayList<>();
             StringBuffer quote = new StringBuffer();
             boolean inQuote = false;
             while (st.hasMoreTokens()) {
index 83686820e6b1b9ddc139e8bd16fb239508ba4232..ca2b50aac91cc0e5f3f5a4977d73bbd04efb65e9 100644 (file)
@@ -24,7 +24,7 @@ import java.util.Hashtable;
  */
 public class Modules {
     
-    private final Hashtable<String,Module> modules = new Hashtable<String,Module>();
+    private final Hashtable<String,Module> modules = new Hashtable<>();
     public final File baseDir;
     public final File jarDir;
     private final Messager handler;
index b17ac656e2d2a3b0e3001601eb3fb7ecefe347e3..563a6932e41457701243c3c183e6dd69d578d95a 100644 (file)
@@ -38,7 +38,7 @@ public class Result {
 
     private static final Kind[] KINDS = { RELEASE, TEST, RELEASE_ALL, TEST_ALL };
 
-    private static final HashMap<String,Result> nameToResult = new HashMap<String, Result>();
+    private static final HashMap<String,Result> nameToResult = new HashMap<>();
 
     public static boolean isTestingJar(String name) {
         name = name.toLowerCase();
@@ -177,11 +177,11 @@ public class Result {
     Result(Kind kind, Module module, File jarDir) {
         this.kind = kind;
         this.module = module;
-        this.libJars = new ArrayList<File>();
-        this.exportedLibJars = new ArrayList<File>();
-        this.srcDirs = new ArrayList<File>();
-        this.classpathVariables = new ArrayList<String>();
-        this.requiredResults = new ArrayList<Result>();
+        this.libJars = new ArrayList<>();
+        this.exportedLibJars = new ArrayList<>();
+        this.srcDirs = new ArrayList<>();
+        this.classpathVariables = new ArrayList<>();
+        this.requiredResults = new ArrayList<>();
         String name = module.name;
         if (!kind.normal) {
             name += "-test";
@@ -217,7 +217,7 @@ public class Result {
 
     /** @return List (File) of jar's required */
     public List<File> findJarRequirements() {
-        ArrayList<File> result = new ArrayList<File>();
+        ArrayList<File> result = new ArrayList<>();
         Module.doFindJarRequirements(this, result);
         return result;
     }
index 4df90dbbe2e04fc2d2688498c15ad6c0d45b8575..ca041b33dcab15ee825e146c3cd35e203929c5bb 100644 (file)
@@ -404,7 +404,7 @@ class Sample {
  * type-safe Collection of samples.
  */
 class Samples {
-    private ArrayList<Sample> samples = new ArrayList<Sample>();
+    private ArrayList<Sample> samples = new ArrayList<>();
     int size() {
         return samples.size();
     }
@@ -419,7 +419,7 @@ class Samples {
     }
 
     List<Sample> getSortedSamples(Comparator<Sample> comparer) {
-        ArrayList<Sample> result = new ArrayList<Sample>();
+        ArrayList<Sample> result = new ArrayList<>();
         result.addAll(samples);
         Collections.sort(result, comparer);
         return result;
@@ -966,7 +966,7 @@ class SampleUtil {
     }
 
     public static String[] splitAnchorName(String anchorName) {
-        ArrayList<String> result = new ArrayList<String>();
+        ArrayList<String> result = new ArrayList<>();
         int start = 0;
         int loc = anchorName.indexOf("-", start);
         String next;
index 042548d3f70c7d64dda25ce06ce2fbbfb208488f..f4aaa570861fb1cb46a7052a8dac61ab7dbb6d2b 100644 (file)
@@ -69,7 +69,7 @@ public class BuildModuleTests extends TestCase {
      * @return
      */
     private static File[] findSourceRoots(File moduleDir) {
-        ArrayList<File> result = new ArrayList<File>();
+        ArrayList<File> result = new ArrayList<>();
         for (String name: SOURCE_NAMES) {
             File srcDir = new File(moduleDir, name);
             if (srcDir.canRead() && srcDir.isDirectory()) {
@@ -198,7 +198,7 @@ public class BuildModuleTests extends TestCase {
         
         // separate check to verify all file types (suffixes) are known
         if (!isTestFolder(srcDir)) {
-            ArrayList<File> unknownFiles = new ArrayList<File>();
+            ArrayList<File> unknownFiles = new ArrayList<>();
             UnknownFileCheck.SINGLETON.unknownFiles(srcDir, unknownFiles);
             System.out.println(unknownFiles);
             if (!unknownFiles.isEmpty()) {
@@ -225,12 +225,12 @@ public class BuildModuleTests extends TestCase {
      */
     static class UnknownFileCheck implements FileFilter {
         private static final UnknownFileCheck SINGLETON = new UnknownFileCheck();
-        private static final ArrayList<String> STATIC_ERRORS = new ArrayList<String>();
+        private static final ArrayList<String> STATIC_ERRORS = new ArrayList<>();
         // Builder.BINARY_SOURCE_PATTERN and Builder.RESOURCE_PATTERN
         public static final List<String> KNOWN_SUFFIXES;
 
         static {
-            List<String> suffixes = new ArrayList<String>();
+            List<String> suffixes = new ArrayList<>();
             // sources from org.aspectj.util.FileUtil.SOURCE_SUFFIXES
             suffixes.add(".aj");
             suffixes.add(".java");
index 81600ca949fdced387f1cf4f24ce6905852d4ca6..7693ddb11edc78cb2e1fd19fd781f3ce7afefd87 100644 (file)
@@ -80,7 +80,7 @@ public class BuildModuleTest extends TestCase {
         }
     }
         
-    ArrayList<File> tempFiles = new ArrayList<File>();
+    ArrayList<File> tempFiles = new ArrayList<>();
     private File jarDir;
     private boolean deleteJars;
     boolean building;  // must be enabled for tests to run
@@ -343,7 +343,7 @@ public class BuildModuleTest extends TestCase {
         try {
             zipFile = new ZipFile(weaverAllJar);
             Enumeration e = zipFile.entries();
-            ArrayList<String> entryNames = new ArrayList<String>();
+            ArrayList<String> entryNames = new ArrayList<>();
             while (e.hasMoreElements()) {
                 ZipEntry entry = (ZipEntry) e.nextElement();
                 String name = entry.getName();
index 383b3859d29b5be7704a5665f0f35859e74eef27..494084e0c9e3500e232c47c21451b354f7b46bb3 100644 (file)
@@ -72,7 +72,7 @@ public class ModulesTest extends TestCase {
         }
     }
 
-    ArrayList<File> tempFiles = new ArrayList<File>();
+    ArrayList<File> tempFiles = new ArrayList<>();
      
        public ModulesTest(String name) {
                super(name);
@@ -101,7 +101,7 @@ public class ModulesTest extends TestCase {
     }
       
     public void testAllModulesCreation() {
-        ArrayList<Module> badModules = new ArrayList<Module>();
+        ArrayList<Module> badModules = new ArrayList<>();
         for (String name: MODULE_NAMES) {
             File dir = new File(BASE_DIR, name);
             if (dir.isDirectory()) {
index abd8ecc871e528c771c051572910cf5a53cc4f97..57db3092f1efe03c275c141d3e3edbb84fc7149f 100644 (file)
@@ -265,7 +265,7 @@ public class Aj implements ClassPreProcessor {
                        if (loadersToSkipProperty != null && loadersToSkip == null) {
                                if (st.hasMoreTokens()) {
 //                                     System.out.println("aj.weaving.loadersToSkip is set. Skipping loaders: '"+loadersToSkipProperty+"'");
-                                       loadersToSkip = new ArrayList<String>();
+                                       loadersToSkip = new ArrayList<>();
                                }
                                while (st.hasMoreTokens()) {
                                        String nextLoader = st.nextToken();
@@ -283,7 +283,7 @@ public class Aj implements ClassPreProcessor {
        static class WeaverContainer {
 
                final static Map<AdaptorKey,ExplicitlyInitializedClassLoaderWeavingAdaptor> weavingAdaptors = 
-                               Collections.synchronizedMap(new HashMap<AdaptorKey,ExplicitlyInitializedClassLoaderWeavingAdaptor>());
+                               Collections.synchronizedMap(new HashMap<>());
 
                static WeavingAdaptor getWeaver(ClassLoader loader, IWeavingContext weavingContext) {
                        ExplicitlyInitializedClassLoaderWeavingAdaptor adaptor = null;
index 5827f2e646d0da112e165b71be46206e2cd1a6f4..0edd5572132d044f3ba79e08141f87d401e95f38 100644 (file)
@@ -69,33 +69,33 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
 
        private boolean initialized;
 
-       private List<TypePattern> dumpTypePattern = new ArrayList<TypePattern>();
+       private List<TypePattern> dumpTypePattern = new ArrayList<>();
        private boolean dumpBefore = false;
        private boolean dumpDirPerClassloader = false;
 
        private boolean hasExcludes = false;
-       private List<TypePattern> excludeTypePattern = new ArrayList<TypePattern>(); // anything
-       private List<String> excludeStartsWith = new ArrayList<String>(); // com.foo..*
-       private List<String> excludeStarDotDotStar = new ArrayList<String>(); // *..*CGLIB*
-       private List<String> excludeExactName = new ArrayList<String>(); // com.foo.Bar
-       private List<String> excludeEndsWith = new ArrayList<String>(); // com.foo.Bar
-       private List<String[]> excludeSpecial = new ArrayList<String[]>();
+       private List<TypePattern> excludeTypePattern = new ArrayList<>(); // anything
+       private List<String> excludeStartsWith = new ArrayList<>(); // com.foo..*
+       private List<String> excludeStarDotDotStar = new ArrayList<>(); // *..*CGLIB*
+       private List<String> excludeExactName = new ArrayList<>(); // com.foo.Bar
+       private List<String> excludeEndsWith = new ArrayList<>(); // com.foo.Bar
+       private List<String[]> excludeSpecial = new ArrayList<>();
 
        private boolean hasIncludes = false;
-       private List<TypePattern> includeTypePattern = new ArrayList<TypePattern>();
-       private List<String> includeStartsWith = new ArrayList<String>();
-       private List<String> includeExactName = new ArrayList<String>();
+       private List<TypePattern> includeTypePattern = new ArrayList<>();
+       private List<String> includeStartsWith = new ArrayList<>();
+       private List<String> includeExactName = new ArrayList<>();
        private boolean includeStar = false;
 
-       private List<TypePattern> aspectExcludeTypePattern = new ArrayList<TypePattern>();
-       private List<String> aspectExcludeStartsWith = new ArrayList<String>();
-       private List<TypePattern> aspectIncludeTypePattern = new ArrayList<TypePattern>();
-       private List<String> aspectIncludeStartsWith = new ArrayList<String>();
+       private List<TypePattern> aspectExcludeTypePattern = new ArrayList<>();
+       private List<String> aspectExcludeStartsWith = new ArrayList<>();
+       private List<TypePattern> aspectIncludeTypePattern = new ArrayList<>();
+       private List<String> aspectIncludeStartsWith = new ArrayList<>();
 
        private StringBuffer namespace;
        private IWeavingContext weavingContext;
 
-       private List<ConcreteAspectCodeGen> concreteAspects = new ArrayList<ConcreteAspectCodeGen>();
+       private List<ConcreteAspectCodeGen> concreteAspects = new ArrayList<>();
 
        private static Trace trace = TraceFactory.getTraceFactory().getTrace(ClassLoaderWeavingAdaptor.class);
 
@@ -218,7 +218,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
         * @return
         */
        List<String> getAspectClassNames(List<Definition> definitions) {
-               List<String> aspects = new LinkedList<String>();
+               List<String> aspects = new LinkedList<>();
                for (Definition def : definitions) {
                        List<String> defAspects = def.getAspectClassNames();
                        if (defAspects != null) {
@@ -238,7 +238,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
                        trace.enter("parseDefinitions", this);
                }
 
-               List<Definition> definitions = new ArrayList<Definition>();
+               List<Definition> definitions = new ArrayList<>();
                try {
                        info("register classloader " + getClassLoaderName(loader));
                        // TODO av underoptimized: we will parse each XML once per CL that see it
@@ -277,7 +277,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
                                        Enumeration<URL> xmls = weavingContext.getResources(nextDefinition);
                                        // System.out.println("? registerDefinitions: found-aop.xml=" + xmls.hasMoreElements() + ", loader=" + loader);
 
-                                       Set<URL> seenBefore = new HashSet<URL>();
+                                       Set<URL> seenBefore = new HashSet<>();
                                        while (xmls.hasMoreElements()) {
                                                URL xml = xmls.nextElement();
                                                if (trace.isTraceEnabled()) {
@@ -1002,7 +1002,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
         */
        public void flushGeneratedClasses() {
                // System.err.println("? ClassLoaderWeavingAdaptor.flushGeneratedClasses() generatedClasses=" + generatedClasses);
-               generatedClasses = new HashMap<String, IUnwovenClassFile>();
+               generatedClasses = new HashMap<>();
        }
 
        /**
index 7f87e40c9442726d9e4a3863212553c357318aed..fcc89ac75515276c0d89f48b2bd9bcec980c3095 100644 (file)
@@ -218,7 +218,7 @@ public class ConcreteAspectCodeGen {
                }
 
                // must have all abstractions defined
-               List<String> elligibleAbstractions = new ArrayList<String>();
+               List<String> elligibleAbstractions = new ArrayList<>();
 
                Collection<ResolvedMember> abstractMethods = getOutstandingAbstractMethods(parent);
                for (ResolvedMember method : abstractMethods) {
@@ -254,7 +254,7 @@ public class ConcreteAspectCodeGen {
                                }
                        }
                }
-               List<String> pointcutNames = new ArrayList<String>();
+               List<String> pointcutNames = new ArrayList<>();
                for (Definition.Pointcut abstractPc : concreteAspect.pointcuts) {
                        pointcutNames.add(abstractPc.name);
                }
@@ -283,7 +283,7 @@ public class ConcreteAspectCodeGen {
        }
 
        private Collection<ResolvedMember> getOutstandingAbstractMethods(ResolvedType type) {
-               Map<String, ResolvedMember> collector = new HashMap<String, ResolvedMember>();
+               Map<String, ResolvedMember> collector = new HashMap<>();
                // let's get to the top of the hierarchy and then walk down ...
                // recording abstract methods then removing
                // them if they get defined further down the hierarchy
@@ -411,7 +411,7 @@ public class ConcreteAspectCodeGen {
                        cg.addAnnotation(ag);
                } else {
                        // List elems = new ArrayList();
-                       List<NameValuePair> elems = new ArrayList<NameValuePair>();
+                       List<NameValuePair> elems = new ArrayList<>();
                        elems.add(new NameValuePair("value",
                                        new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), perclauseString), cg.getConstantPool()));
                        AnnotationGen ag = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/Aspect"), elems, true,
@@ -420,7 +420,7 @@ public class ConcreteAspectCodeGen {
                }
                if (concreteAspect.precedence != null) {
                        SimpleElementValue svg = new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), concreteAspect.precedence);
-                       List<NameValuePair> elems = new ArrayList<NameValuePair>();
+                       List<NameValuePair> elems = new ArrayList<>();
                        elems.add(new NameValuePair("value", svg, cg.getConstantPool()));
                        AnnotationGen agprec = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/DeclarePrecedence"), elems, true,
                                        cg.getConstantPool());
@@ -440,7 +440,7 @@ public class ConcreteAspectCodeGen {
                        // TODO AV - respect visibility instead of opening up as public?
                        LazyMethodGen mg = new LazyMethodGen(Modifier.PUBLIC, Type.VOID, abstractPc.name, EMPTY_TYPES, EMPTY_STRINGS, cg);
                        SimpleElementValue svg = new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), abstractPc.expression);
-                       List<NameValuePair> elems = new ArrayList<NameValuePair>();
+                       List<NameValuePair> elems = new ArrayList<>();
                        elems.add(new NameValuePair("value", svg, cg.getConstantPool()));
                        AnnotationGen mag = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/Pointcut"), elems, true,
                                        cg.getConstantPool());
@@ -462,7 +462,7 @@ public class ConcreteAspectCodeGen {
 
                                FieldGen field = new FieldGen(Modifier.FINAL, ObjectType.STRING, "rule" + (counter++), cg.getConstantPool());
                                SimpleElementValue svg = new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), deow.pointcut);
-                               List<NameValuePair> elems = new ArrayList<NameValuePair>();
+                               List<NameValuePair> elems = new ArrayList<>();
                                elems.add(new NameValuePair("value", svg, cg.getConstantPool()));
                                AnnotationGen mag = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/Declare"
                                                + (deow.isError ? "Error" : "Warning")), elems, true, cg.getConstantPool());
@@ -601,7 +601,7 @@ public class ConcreteAspectCodeGen {
                        // Discover the name and name/value pairs
                        String name = annotationString.substring(0,paren);
                        // break the rest into pieces based on the commas
-                       List<String> values = new ArrayList<String>();
+                       List<String> values = new ArrayList<>();
                        int pos = paren+1;
                        int depth = 0;
                        int len = annotationString.length();
@@ -776,7 +776,7 @@ public class ConcreteAspectCodeGen {
                        reportError("declare is using an annotation type that does not have runtime retention: "+typename);
                        return null;
                }
-               List<NameValuePair> elems = new ArrayList<NameValuePair>();
+               List<NameValuePair> elems = new ArrayList<>();
                return new AnnotationGen(new ObjectType(annoname), elems, true, cp);
        }
        
@@ -820,8 +820,8 @@ public class ConcreteAspectCodeGen {
                }
 
                // Extract parameter types and names
-               List<Type> paramTypes = new ArrayList<Type>();
-               List<String> paramNames = new ArrayList<String>();
+               List<Type> paramTypes = new ArrayList<>();
+               List<String> paramNames = new ArrayList<>();
                if (signature.charAt(1) != ')') {
                        // there are parameters to convert into a signature
                        StringBuilder convertedSignature = new StringBuilder("(");
@@ -968,7 +968,7 @@ public class ConcreteAspectCodeGen {
         */
        private AnnotationAJ buildAdviceAnnotation(LazyClassGen cg, PointcutAndAdvice paa) {
                SimpleElementValue svg = new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), paa.pointcut);
-               List<NameValuePair> elems = new ArrayList<NameValuePair>();
+               List<NameValuePair> elems = new ArrayList<>();
                elems.add(new NameValuePair("value", svg, cg.getConstantPool()));
                AnnotationGen mag = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/" + paa.adviceKind.toString()), elems,
                                true, cg.getConstantPool());
index 3b2ee51e3528ffe26e735dcae95aef8c3ad85654..77603e12c9288cb5205f920cf717880127de794d 100644 (file)
@@ -686,7 +686,7 @@ public class ClassLoaderWeavingAdaptorTest extends TestCase {
 
        static class TestWeavingContext extends DefaultWeavingContext {
 
-               List<Definition> testList = new ArrayList<Definition>();
+               List<Definition> testList = new ArrayList<>();
 
                public TestWeavingContext(ClassLoader loader) {
                        super(loader);
index 57af301f294311f9a4198cd77ef3d4d9bf163912..07332990f765b7bbae9b74efeb9028a5f3ec0b83 100644 (file)
@@ -152,10 +152,10 @@ public class BuildArgParser extends Main {
 
                        boolean incrementalMode = buildConfig.isIncrementalMode() || buildConfig.isIncrementalFileMode();
 
-                       List<File> xmlfileList = new ArrayList<File>();
+                       List<File> xmlfileList = new ArrayList<>();
                        xmlfileList.addAll(parser.getXmlFiles());
 
-                       List<File> fileList = new ArrayList<File>();
+                       List<File> fileList = new ArrayList<>();
                        List<File> files = parser.getFiles();
                        if (!LangUtil.isEmpty(files)) {
                                if (incrementalMode) {
@@ -165,7 +165,7 @@ public class BuildArgParser extends Main {
                                }
                        }
 
-                       List<String> javaArgList = new ArrayList<String>();
+                       List<String> javaArgList = new ArrayList<>();
                        // disable all special eclipse warnings by default - why???
                        // ??? might want to instead override getDefaultOptions()
                        javaArgList.add("-warn:none");
@@ -280,7 +280,7 @@ public class BuildArgParser extends Main {
        }
 
        private ArrayList<String> toArrayList(java.util.List<File> files) {
-               ArrayList<String> arrayList = new ArrayList<String>();
+               ArrayList<String> arrayList = new ArrayList<>();
                for (File file: files) {
                        arrayList.add(file.getAbsolutePath());
                }
@@ -363,7 +363,7 @@ public class BuildArgParser extends Main {
        }
 
        public List<String> getBootclasspath(AjcConfigParser parser) {
-               List<String> ret = new ArrayList<String>();
+               List<String> ret = new ArrayList<>();
 
                if (parser.bootclasspath == null) {
                        if (LangUtil.is19VMOrGreater()) {
@@ -378,13 +378,13 @@ public class BuildArgParser extends Main {
        }
        
        public List<String> getModulepath(AjcConfigParser parser) {
-               List<String> ret = new ArrayList<String>();
+               List<String> ret = new ArrayList<>();
                addClasspath(parser.modulepath, ret);
                return ret;
        }
 
        public List<String> getModulesourcepath(AjcConfigParser parser) {
-               List<String> ret = new ArrayList<String>();
+               List<String> ret = new ArrayList<>();
                addClasspath(parser.modulesourcepath, ret);
                return ret;
        }
@@ -565,7 +565,7 @@ public class BuildArgParser extends Main {
                                buildConfig.setMakeReflectable(true);
                        } else if (arg.equals("-sourceroots")) {
                                if (args.size() > nextArgIndex) {
-                                       List<File> sourceRoots = new ArrayList<File>();
+                                       List<File> sourceRoots = new ArrayList<>();
                                        StringTokenizer st = new StringTokenizer(args.get(nextArgIndex).getValue(),
                                                        File.pathSeparator);
                                        while (st.hasMoreTokens()) {
index bdb87cb2be81b7aee6a0d54328c5d4700ece0425..f290d910acf1962e70dc5bcaed65fde98f06872c 100644 (file)
@@ -26,8 +26,8 @@ import java.util.StringTokenizer;
 public class ConfigParser {
        Location location;
        protected File relativeDirectory = null;
-       protected List<File> files = new LinkedList<File>();
-       protected List<File> xmlfiles = new ArrayList<File>();
+       protected List<File> files = new LinkedList<>();
+       protected List<File> xmlfiles = new ArrayList<>();
        private boolean fileParsed = false;
        protected static String CONFIG_MSG = "build config error: ";
 
@@ -41,7 +41,7 @@ public class ConfigParser {
 
        public void parseCommandLine(String[] argsArray) throws ParseException {
                location = new CommandLineLocation();
-               LinkedList<Arg> args = new LinkedList<Arg>();
+               LinkedList<Arg> args = new LinkedList<>();
                for (String s : argsArray) {
                        args.add(new Arg(s, location));
                }
@@ -80,7 +80,7 @@ public class ConfigParser {
                        return;
                }
 
-               LinkedList<Arg> args = new LinkedList<Arg>();
+               LinkedList<Arg> args = new LinkedList<>();
                int lineNum = 0;
 
                try {
index 6ea87826537054c833482b8dc0d807380e011530..5c2e4d2c76058b7a318b153b710b333386cbc48a 100644 (file)
@@ -108,7 +108,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
        private IOutputClassFileNameProvider outputFileNameProvider;
        private IBinarySourceProvider binarySourceProvider;
        private WeaverMessageHandler weaverMessageHandler;
-       private Map<String, List<UnwovenClassFile>> binarySourceSetForFullWeave = new HashMap<String, List<UnwovenClassFile>>();
+       private Map<String, List<UnwovenClassFile>> binarySourceSetForFullWeave = new HashMap<>();
 
        private ContextToken processingToken = null;
        private ContextToken resolvingToken = null;
@@ -118,7 +118,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
        private AjState incrementalCompilationState;
 
        // Maintains a list of whats weaving - whilst the pipeline is stalled, this accumulates aspects.
-       List<InterimCompilationResult> resultsPendingWeave = new ArrayList<InterimCompilationResult>();
+       List<InterimCompilationResult> resultsPendingWeave = new ArrayList<>();
 
        // pipelining info
        private boolean pipelineStalled = true;
@@ -200,8 +200,8 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
                }
 
                // Break the units into two lists...
-               List<CompilationUnitDeclaration> aspects = new ArrayList<CompilationUnitDeclaration>();
-               List<CompilationUnitDeclaration> nonaspects = new ArrayList<CompilationUnitDeclaration>();
+               List<CompilationUnitDeclaration> aspects = new ArrayList<>();
+               List<CompilationUnitDeclaration> nonaspects = new ArrayList<>();
                for (CompilationUnitDeclaration unit : units) {
                        if (containsAnAspect(unit)) {
                                aspects.add(unit);
@@ -255,7 +255,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
        }
 
        public void beforeCompiling(ICompilationUnit[] sourceUnits) {
-               resultsPendingWeave = new ArrayList<InterimCompilationResult>();
+               resultsPendingWeave = new ArrayList<>();
                reportedErrors = false;
                droppingBackToFullBuild = false;
        }
@@ -475,7 +475,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
 
        private List<InterimCompilationResult> getBinarySourcesFrom(Map<String, List<UnwovenClassFile>> binarySourceEntries) {
                // Map is fileName |-> List<UnwovenClassFile>
-               List<InterimCompilationResult> ret = new ArrayList<InterimCompilationResult>();
+               List<InterimCompilationResult> ret = new ArrayList<>();
                for (String sourceFileName : binarySourceEntries.keySet()) {
                        List<UnwovenClassFile> unwovenClassFiles = binarySourceEntries.get(sourceFileName);
                        // XXX - see bugs 57432,58679 - final parameter on next call should be "compiler.options.maxProblemsPerUnit"
index eb5ca53d909e0a9657a6ef793bb708f811d96777..364aea401c0ca62b8aac1dce1c2777f2044d733e 100644 (file)
@@ -209,7 +209,7 @@ public class WeaverMessageHandler implements IMessageHandler {
 
        private IProblem[] buildSeeAlsoProblems(IProblem originalProblem, List sourceLocations, CompilationResult problemSource,
                        boolean usedBinarySourceFileName) {
-               List<IProblem> ret = new ArrayList<IProblem>();
+               List<IProblem> ret = new ArrayList<>();
 
                for (Object sourceLocation : sourceLocations) {
                        ISourceLocation loc = (ISourceLocation) sourceLocation;
index 5bf9946daf20c0f583ea247a24d7bf1daf21d178..68fc6f74f27f1f69c278ab3744033c8199aec3d2 100644 (file)
@@ -66,7 +66,7 @@ public class AccessForInlineVisitor extends ASTVisitor {
        PrivilegedHandler handler;
        AspectDeclaration inAspect;
        EclipseFactory world; // alias for inAspect.world
-       private Map<TypeBinding, Map<FieldBinding, ResolvedMember>> alreadyProcessedReceivers = new HashMap<TypeBinding, Map<FieldBinding, ResolvedMember>>();
+       private Map<TypeBinding, Map<FieldBinding, ResolvedMember>> alreadyProcessedReceivers = new HashMap<>();
 
        // set to true for ClassLiteralAccess and AssertStatement
        // ??? A better answer would be to transform these into inlinable forms
@@ -174,7 +174,7 @@ public class AccessForInlineVisitor extends ASTVisitor {
                // Avoid repeatedly building ResolvedMembers by using info on any done previously in this visitor
                Map<FieldBinding, ResolvedMember> alreadyResolvedMembers = alreadyProcessedReceivers.get(receiverType);
                if (alreadyResolvedMembers == null) {
-                       alreadyResolvedMembers = new HashMap<FieldBinding, ResolvedMember>();
+                       alreadyResolvedMembers = new HashMap<>();
                        alreadyProcessedReceivers.put(receiverType, alreadyResolvedMembers);
                }
                ResolvedMember m = alreadyResolvedMembers.get(binding);
index 91d99869249cccc92f6f19d25a9a2179df708f24..675f0656f4144338a99fe1f3fd43a2a545e8c4c1 100644 (file)
@@ -65,7 +65,7 @@ public class AdviceDeclaration extends AjMethodDeclaration {
        public int adviceSequenceNumberInType;
 
        public MethodBinding proceedMethodBinding; // set during this.resolveStaments, referenced by Proceed
-       public List<Proceed> proceedCalls = new ArrayList<Proceed>(2); // populated during Proceed.findEnclosingAround
+       public List<Proceed> proceedCalls = new ArrayList<>(2); // populated during Proceed.findEnclosingAround
 
        private boolean proceedInInners;
        private ResolvedMember[] proceedCallSignatures;
@@ -80,7 +80,7 @@ public class AdviceDeclaration extends AjMethodDeclaration {
 
        // override
        protected int generateInfoAttributes(ClassFile classFile) {
-               List<EclipseAttributeAdapter> l = new ArrayList<EclipseAttributeAdapter>(1);
+               List<EclipseAttributeAdapter> l = new ArrayList<>(1);
                l.add(new EclipseAttributeAdapter(makeAttribute()));
                addDeclarationStartLineAttribute(l, classFile);
                return classFile.generateMethodInfoAttributes(binding, l);
index 78cca38c010728660eabc6a82d916a5bd5dd42e3..777de27e430d7a665d91acfe6ea54d80b0b871a9 100644 (file)
@@ -84,8 +84,8 @@ public class AspectDeclaration extends TypeDeclaration {
        public ResolvedMember aspectOfMethod;
        public ResolvedMember ptwGetWithinTypeNameMethod;
        public ResolvedMember hasAspectMethod;
-       public Map<ResolvedMember, Binding> accessForInline = new LinkedHashMap<ResolvedMember, Binding>();
-       public Map<ResolvedMember, AccessForInlineVisitor.SuperAccessMethodPair> superAccessForInline = new HashMap<ResolvedMember, AccessForInlineVisitor.SuperAccessMethodPair>();
+       public Map<ResolvedMember, Binding> accessForInline = new LinkedHashMap<>();
+       public Map<ResolvedMember, AccessForInlineVisitor.SuperAccessMethodPair> superAccessForInline = new HashMap<>();
        public boolean isPrivileged;
        public EclipseSourceType concreteName;
        public ReferenceType typeX;
@@ -418,7 +418,7 @@ public class AspectDeclaration extends TypeDeclaration {
        }
 
        protected List<EclipseAttributeAdapter> makeEffectiveSignatureAttribute(ResolvedMember sig, Shadow.Kind kind, boolean weaveBody) {
-               List<EclipseAttributeAdapter> l = new ArrayList<EclipseAttributeAdapter>(1);
+               List<EclipseAttributeAdapter> l = new ArrayList<>(1);
                l.add(new EclipseAttributeAdapter(new AjAttribute.EffectiveSignatureAttribute(sig, kind, weaveBody)));
                return l;
        }
index 0384617f9a7c27729299649a51ef3635b57165c4..d79755dde9f1ece4ea88c51cf6323fd35480e82c 100644 (file)
@@ -93,7 +93,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
        public EclipseFactory factory = null;
 
        // private boolean builtInterTypesAndPerClauses = false;
-       private final List<SourceTypeBinding> pendingTypesToWeave = new ArrayList<SourceTypeBinding>();
+       private final List<SourceTypeBinding> pendingTypesToWeave = new ArrayList<>();
 
        // Q: What are dangerousInterfaces?
        // A: An interface is considered dangerous if an ITD has been made upon it
@@ -190,8 +190,8 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
                // need to build inter-type declarations for all AspectDeclarations at
                // this point
                // this MUST be done in order from super-types to subtypes
-               List<SourceTypeBinding> typesToProcess = new ArrayList<SourceTypeBinding>();
-               List<SourceTypeBinding> aspectsToProcess = new ArrayList<SourceTypeBinding>();
+               List<SourceTypeBinding> typesToProcess = new ArrayList<>();
+               List<SourceTypeBinding> aspectsToProcess = new ArrayList<>();
                for (int i = lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
                        CompilationUnitScope cus = units[i].scope;
                        SourceTypeBinding[] stbs = cus.topLevelTypes;
@@ -250,7 +250,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
                boolean typeProcessingOrderIsImportant = declareParents.size() > 0 || declareAnnotationOnTypes.size() > 0; // DECAT
 
                if (typeProcessingOrderIsImportant) {
-                       typesToProcess = new ArrayList<SourceTypeBinding>();
+                       typesToProcess = new ArrayList<>();
                        for (int i = lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
                                CompilationUnitScope cus = units[i].scope;
                                SourceTypeBinding[] stbs = cus.topLevelTypes;
@@ -259,7 +259,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
                                }
                        }
 
-                       List<SourceTypeBinding> stb2 = new ArrayList<SourceTypeBinding>();
+                       List<SourceTypeBinding> stb2 = new ArrayList<>();
                        stb2.addAll(typesToProcess);
 
                        while (typesToProcess.size() > 0) {
@@ -730,8 +730,8 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
                        // not-exposed to weaver
                        // messages...
 
-                       List<DeclareParents> decpToRepeat = new ArrayList<DeclareParents>();
-                       List<DeclareAnnotation> decaToRepeat = new ArrayList<DeclareAnnotation>();
+                       List<DeclareParents> decpToRepeat = new ArrayList<>();
+                       List<DeclareAnnotation> decaToRepeat = new ArrayList<>();
                        boolean anyNewParents = false;
                        boolean anyNewAnnotations = false;
 
@@ -768,7 +768,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
                                }
                        }
 
-                       List<Object> forRemoval = new ArrayList<Object>();
+                       List<Object> forRemoval = new ArrayList<>();
                        // now lets loop over and over until we have done all we can
                        while ((anyNewAnnotations || anyNewParents) && (!decpToRepeat.isEmpty() || !decaToRepeat.isEmpty())) {
                                anyNewParents = anyNewAnnotations = false;
@@ -927,7 +927,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
                if ((bits & TagBits.AnnotationTargetMASK) == 0) {
                        return "";
                }
-               Set<String> s = new HashSet<String>();
+               Set<String> s = new HashSet<>();
                if ((bits & TagBits.AnnotationForAnnotationType) != 0) {
                        s.add("ANNOTATION_TYPE");
                }
index 6e9fafff909175a0e35b3238b7a1b99f486cdbb2..a990767aff30c3774bc46fdb7d74493797ac0958 100644 (file)
@@ -95,8 +95,8 @@ public class EclipseFactory {
 
        // We can get clashes if we don't treat raw types differently - we end up looking
        // up a raw and getting the generic type (pr115788)
-       private final Map<UnresolvedType, TypeBinding> typexToBinding = new HashMap<UnresolvedType, TypeBinding>();
-       private final Map<UnresolvedType, TypeBinding> rawTypeXToBinding = new HashMap<UnresolvedType, TypeBinding>();
+       private final Map<UnresolvedType, TypeBinding> typexToBinding = new HashMap<>();
+       private final Map<UnresolvedType, TypeBinding> rawTypeXToBinding = new HashMap<>();
 
        // XXX currently unused
        // private Map/*TypeBinding, ResolvedType*/ bindingToResolvedTypeX = new HashMap();
@@ -361,7 +361,7 @@ public class EclipseFactory {
        /**
         * Some type variables refer to themselves recursively, this enables us to avoid recursion problems.
         */
-       private static Map<TypeVariableBinding,UnresolvedType> typeVariableBindingsInProgress = new HashMap<TypeVariableBinding,UnresolvedType>();
+       private static Map<TypeVariableBinding,UnresolvedType> typeVariableBindingsInProgress = new HashMap<>();
 
        /**
         * Convert from the eclipse form of type variable (TypeVariableBinding) to the AspectJ form (TypeVariable).
@@ -462,7 +462,7 @@ public class EclipseFactory {
 
        public void finishTypeMungers() {
                // make sure that type mungers are
-               List<ConcreteTypeMunger> ret = new ArrayList<ConcreteTypeMunger>();
+               List<ConcreteTypeMunger> ret = new ArrayList<>();
                List<ConcreteTypeMunger> baseTypeMungers = getWorld().getCrosscuttingMembersSet().getTypeMungers();
 
                // XXX by Andy: why do we mix up the mungers here? it means later we know about two sets
@@ -533,7 +533,7 @@ public class EclipseFactory {
         * Before converting the parts of a methodbinding (params, return type) we store the type variables in this structure, then
         * should any component of the method binding refer to them, we grab them from the map.
         */
-       private final Map<String,UnresolvedType> typeVariablesForThisMember = new HashMap<String, UnresolvedType>();
+       private final Map<String,UnresolvedType> typeVariablesForThisMember = new HashMap<>();
 
        /**
         * This is a map from typevariablebindings (eclipsey things) to the names the user originally specified in their ITD. For
@@ -1003,7 +1003,7 @@ public class EclipseFactory {
        // map back to the same type binding - this is important later when Eclipse code is processing
        // a methodbinding trying to come up with possible bindings for the type variables.
        // key is currently the name of the type variable...is that ok?
-       private final Map<String,TypeVariableBinding> typeVariableToTypeBinding = new HashMap<String,TypeVariableBinding>();
+       private final Map<String,TypeVariableBinding> typeVariableToTypeBinding = new HashMap<>();
 
        // /**
        // * Converts from an TypeVariableReference to a TypeVariableBinding. A TypeVariableReference
index 26c2606286bad6fa58ec17292574442c7d1d1bb5..06191629fce51560eb4f5fbbb5e34b44d32e74ed 100644 (file)
@@ -157,8 +157,8 @@ public class EclipseScope implements IScope {
                if (importedNames != null)
                        return;
 
-               List<String> importedNamesList = new ArrayList<String>();
-               List<String> importedPrefixesList = new ArrayList<String>();
+               List<String> importedNamesList = new ArrayList<>();
+               List<String> importedPrefixesList = new ArrayList<>();
 
                Scope currentScope = scope;
                // add any enclosing types to this list
index efd4fb0dbc33b8877d7159ef5361a09c4ea7070e..1941ad6304758f769c32def779e2c110c34e4e8d 100644 (file)
@@ -101,8 +101,8 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
        protected ResolvedMember[] declaredMethods = null;
        protected ResolvedMember[] declaredFields = null;
 
-       public List<Declare> declares = new ArrayList<Declare>();
-       public List<EclipseTypeMunger> typeMungers = new ArrayList<EclipseTypeMunger>();
+       public List<Declare> declares = new ArrayList<>();
+       public List<EclipseTypeMunger> typeMungers = new ArrayList<>();
 
        private final EclipseFactory factory;
 
@@ -258,9 +258,9 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
        }
 
        protected void fillDeclaredMembers() {
-               List<ResolvedMember> declaredPointcuts = new ArrayList<ResolvedMember>();
-               List<ResolvedMember> declaredMethods = new ArrayList<ResolvedMember>();
-               List<ResolvedMember> declaredFields = new ArrayList<ResolvedMember>();
+               List<ResolvedMember> declaredPointcuts = new ArrayList<>();
+               List<ResolvedMember> declaredMethods = new ArrayList<>();
+               List<ResolvedMember> declaredFields = new ArrayList<>();
 
                MethodBinding[] ms = binding.methods(); // the important side-effect of this call is to make
                // sure bindings are completed
@@ -610,7 +610,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
                // }
                // return targetKind;
                if (isAnnotation()) {
-                       List<AnnotationTargetKind> targetKinds = new ArrayList<AnnotationTargetKind>();
+                       List<AnnotationTargetKind> targetKinds = new ArrayList<>();
 
                        if ((binding.getAnnotationTagBits() & TagBits.AnnotationForAnnotationType) != 0) {
                                targetKinds.add(AnnotationTargetKind.ANNOTATION_TYPE);
index a9c4bd532aebca2e910fc0d269a5c2e06e45e619..e8423c2a494a2bfb6b2332c9cc9575e1ff0cbfc4 100644 (file)
@@ -30,7 +30,7 @@ import org.aspectj.weaver.UnresolvedType;
 public class HelperInterfaceBinding extends SourceTypeBinding {
        private UnresolvedType typeX;
        SourceTypeBinding enclosingType;
-       List<MethodBinding> methods = new ArrayList<MethodBinding>();
+       List<MethodBinding> methods = new ArrayList<>();
 
        public HelperInterfaceBinding(SourceTypeBinding enclosingType, UnresolvedType typeX) {
                super();
index d3e449534d3490590e483e83e6b0133b17e3ca37..80ffe4222812d1384fcf2436493e4a76c347cfee 100644 (file)
@@ -39,8 +39,8 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
  * The member finder looks after intertype declared members on a type, there is one member finder per type that was hit by an ITD.
  */
 public class InterTypeMemberFinder implements IMemberFinder {
-       private List<FieldBinding> interTypeFields = new ArrayList<FieldBinding>();
-       private List<MethodBinding> interTypeMethods = new ArrayList<MethodBinding>();
+       private List<FieldBinding> interTypeFields = new ArrayList<>();
+       private List<MethodBinding> interTypeMethods = new ArrayList<>();
 
        public SourceTypeBinding sourceTypeBinding;
 
@@ -254,7 +254,7 @@ public class InterTypeMemberFinder implements IMemberFinder {
                MethodBinding[] orig = sourceTypeBinding.methodsBase();
                // if (interTypeMethods.isEmpty()) return orig;
 
-               List<MethodBinding> ret = new ArrayList<MethodBinding>(Arrays.asList(orig));
+               List<MethodBinding> ret = new ArrayList<>(Arrays.asList(orig));
                for (MethodBinding method : interTypeMethods) {
                        ret.add(method);
                }
@@ -299,7 +299,7 @@ public class InterTypeMemberFinder implements IMemberFinder {
                        return orig;
                }
 
-               Set<MethodBinding> ret = new HashSet<MethodBinding>(Arrays.asList(orig));
+               Set<MethodBinding> ret = new HashSet<>(Arrays.asList(orig));
                // System.err.println("declared method: " + ret + " inters = " + interTypeMethods);
 
                for (MethodBinding method : interTypeMethods) {
index 0f131c62ec2f9c474d5e77f2cc913b728dbf39d6..7f78e0bea4b3023a66cabcae05d7b8485403a195 100644 (file)
@@ -96,7 +96,7 @@ public class InterTypeScope extends ClassScope {
                        TypeVariableBinding tvb = sourceType.typeVariables()[aliased];
                        tvb.fPackage = sourceType.fPackage;
                        if (usedAliases == null)
-                               usedAliases = new HashMap<TypeVariableBinding, String>();
+                               usedAliases = new HashMap<>();
                        usedAliases.put(tvb, variableName);
                        return tvb;
                } else {
index 5ba0229dc7aa2d289cef6ea5f6f802d40b7605e2..3ee6368e563e3b2bbb25bc19897ce872db60a5f8 100644 (file)
@@ -32,7 +32,7 @@ public class IntertypeMemberTypeFinder implements ITypeFinder {
        public SourceTypeBinding targetTypeBinding;
 
        // The new types declared onto the target
-       private Set<ReferenceBinding> intertypeMemberTypes = new HashSet<ReferenceBinding>();
+       private Set<ReferenceBinding> intertypeMemberTypes = new HashSet<>();
 
        public void addInterTypeMemberType(ReferenceBinding binding) {
                intertypeMemberTypes.add(binding);
index e3d228e0b3fd2c2cfd4cd5f9e28bd0e7cfdc7843..894492bf37868444fc5456817dd40fe6fa7ea0b1 100644 (file)
@@ -65,16 +65,16 @@ public class PushinCollector {
        private String suffix;
 
        // This first collection stores the 'text' for the declarations.
-       private Map<AbstractMethodDeclaration, RepresentationAndLocation> codeRepresentation = new HashMap<AbstractMethodDeclaration, RepresentationAndLocation>();
+       private Map<AbstractMethodDeclaration, RepresentationAndLocation> codeRepresentation = new HashMap<>();
 
        // This stores the new annotations
-       private Map<SourceTypeBinding, List<String>> additionalAnnotations = new HashMap<SourceTypeBinding, List<String>>();
+       private Map<SourceTypeBinding, List<String>> additionalAnnotations = new HashMap<>();
 
        // This stores the new parents
-       private Map<SourceTypeBinding, List<ExactTypePattern>> additionalParents = new HashMap<SourceTypeBinding, List<ExactTypePattern>>();
+       private Map<SourceTypeBinding, List<ExactTypePattern>> additionalParents = new HashMap<>();
 
        // This indicates which types are affected by which intertype declarations
-       private Map<SourceTypeBinding, List<AbstractMethodDeclaration>> newDeclarations = new HashMap<SourceTypeBinding, List<AbstractMethodDeclaration>>();
+       private Map<SourceTypeBinding, List<AbstractMethodDeclaration>> newDeclarations = new HashMap<>();
 
        private PushinCollector(World world, Properties configuration) {
                this.world = world;
@@ -255,7 +255,7 @@ public class PushinCollector {
                }
                List<AbstractMethodDeclaration> amds = newDeclarations.get(sourceType);
                if (amds == null) {
-                       amds = new ArrayList<AbstractMethodDeclaration>();
+                       amds = new ArrayList<>();
                        newDeclarations.put(sourceType, amds);
                }
                amds.add(sourceMethod);
@@ -264,7 +264,7 @@ public class PushinCollector {
        public void tagAsMunged(SourceTypeBinding sourceType, String annotationString) {
                List<String> annos = additionalAnnotations.get(sourceType);
                if (annos == null) {
-                       annos = new ArrayList<String>();
+                       annos = new ArrayList<>();
                        additionalAnnotations.put(sourceType, annos);
                }
                annos.add(annotationString);
@@ -322,7 +322,7 @@ public class PushinCollector {
                if (typePattern instanceof ExactTypePattern) {
                        List<ExactTypePattern> annos = additionalParents.get(sourceType);
                        if (annos == null) {
-                               annos = new ArrayList<ExactTypePattern>();
+                               annos = new ArrayList<>();
                                additionalParents.put(sourceType, annos);
                        }
                        annos.add((ExactTypePattern) typePattern);
index 4cd8445901508d20c90b2487dc093d0474511dfd..cfda723570a5e977508de59a4ba8e2cf12e4eb20 100644 (file)
@@ -55,27 +55,27 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
        private File outputJar;
        private String outxmlName;
        private CompilationResultDestinationManager compilationResultDestinationManager = null;
-       private List<File> sourceRoots = new ArrayList<File>();
+       private List<File> sourceRoots = new ArrayList<>();
        private List<File> changedFiles;
-       private List<File> files = new ArrayList<File>();
-       private List<File> xmlfiles = new ArrayList<File>();
+       private List<File> files = new ArrayList<>();
+       private List<File> xmlfiles = new ArrayList<>();
        private String processor;
        private String processorPath;
-       private List<BinarySourceFile> binaryFiles = new ArrayList<BinarySourceFile>(); // .class files in indirs...
-       private List<File> inJars = new ArrayList<File>();
-       private List<File> inPath = new ArrayList<File>();
-       private Map<String, File> sourcePathResources = new HashMap<String, File>();
-       private List<File> aspectpath = new ArrayList<File>();
-       private List<String> classpath = new ArrayList<String>();
-       private List<String> modulepath = new ArrayList<String>();
+       private List<BinarySourceFile> binaryFiles = new ArrayList<>(); // .class files in indirs...
+       private List<File> inJars = new ArrayList<>();
+       private List<File> inPath = new ArrayList<>();
+       private Map<String, File> sourcePathResources = new HashMap<>();
+       private List<File> aspectpath = new ArrayList<>();
+       private List<String> classpath = new ArrayList<>();
+       private List<String> modulepath = new ArrayList<>();
        // Expensive to compute (searching modules, parsing module-info)
        private ArrayList<Classpath> modulepathClasspathEntries = null;
-       private List<String> modulesourcepath = new ArrayList<String>();
+       private List<String> modulesourcepath = new ArrayList<>();
        // Expensive to compute (searching modules, parsing module-info)
        private ArrayList<Classpath> modulesourcepathClasspathEntries = null;
        private Classpath[] checkedClasspaths = null;
-       private List<String> bootclasspath = new ArrayList<String>();
-       private List<String> cpElementsWithModifiedContents = new ArrayList<String>();
+       private List<String> bootclasspath = new ArrayList<>();
+       private List<String> cpElementsWithModifiedContents = new ArrayList<>();
        private IModule moduleDesc;
 
        private File configFile;
@@ -251,7 +251,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
        }
        
        private List<Classpath> processFilePath(List<File> path, java.lang.String encoding) {
-               List<Classpath> entries = new ArrayList<Classpath>();
+               List<Classpath> entries = new ArrayList<>();
                for (File file: path) {
                        entries.add(FileSystem.getClasspath(file.getAbsolutePath(), encoding, null, ClasspathLocation.BINARY, null));
                }
@@ -259,7 +259,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
        }
 
        private List<Classpath> processStringPath(List<String> path, java.lang.String encoding) {
-               List<Classpath> entries = new ArrayList<Classpath>();
+               List<Classpath> entries = new ArrayList<>();
                for (String file: path) {
                        entries.add(FileSystem.getClasspath(file, encoding, null, ClasspathLocation.BINARY, null));
                }
@@ -317,7 +317,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
 
        public void processInPath() {
                // remember all the class files in directories on the inpath
-               binaryFiles = new ArrayList<BinarySourceFile>();
+               binaryFiles = new ArrayList<>();
                FileFilter filter = new FileFilter() {
                        @Override
                        public boolean accept(File pathname) {
@@ -377,7 +377,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
         *         classpath), and output dir or jar
         */
        public List<String> getFullClasspath() {
-               List<String> full = new ArrayList<String>();
+               List<String> full = new ArrayList<>();
                full.addAll(getBootclasspath()); // XXX Is it OK that boot classpath overrides inpath/injars/aspectpath?
                for (File file: inJars) {
                        full.add(file.getAbsolutePath());
@@ -581,7 +581,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
                        // Possibly a name=value comma separated list of configurations
                        if (lintMode.contains("=")) {
                                this.lintMode = AJLINT_DEFAULT;
-                               lintOptionsMap = new HashMap<String,String>();
+                               lintOptionsMap = new HashMap<>();
                                StringTokenizer tokenizer = new StringTokenizer(lintMode,",");
                                while (tokenizer.hasMoreElements()) {
                                        String option = tokenizer.nextToken();
@@ -596,7 +596,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
                }
 
                if (lintValue != null || lintOptionsMap != null ) {
-                       Map<String, String> lintOptions = new HashMap<String, String>();
+                       Map<String, String> lintOptions = new HashMap<>();
                        setOption(AjCompilerOptions.OPTION_ReportInvalidAbsoluteTypeName, lintValue, lintOptions);
                        setOption(AjCompilerOptions.OPTION_ReportInvalidWildcardTypeName, lintValue, lintOptions);
                        setOption(AjCompilerOptions.OPTION_ReportUnresolvableMember, lintValue, lintOptions);
@@ -930,7 +930,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
                // What to do about bootclasspath on java 9?
                
                // ArrayList<Classpath> allPaths = handleBootclasspath(bootclasspaths, customEncoding);
-               ArrayList<FileSystem.Classpath> allPaths = new ArrayList<FileSystem.Classpath>(); 
+               ArrayList<FileSystem.Classpath> allPaths = new ArrayList<>();
                allPaths.addAll(processStringPath(bootclasspath, encoding));
                allPaths.addAll(processFilePath(inJars, encoding));
                allPaths.addAll(processFilePath(inPath, encoding)); 
index dfdcba12cbdff7288a568ba487d80e4713f34b08..9510bec565eefa1da83169a892af0e41a68a14d7 100644 (file)
@@ -138,7 +138,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
        private boolean batchCompile = true;
        private INameEnvironment environment;
 
-       private Map<String, List<UnwovenClassFile>> /* String -> List<UCF> */binarySourcesForTheNextCompile = new HashMap<String, List<UnwovenClassFile>>();
+       private Map<String, List<UnwovenClassFile>> /* String -> List<UCF> */binarySourcesForTheNextCompile = new HashMap<>();
 
        // FIXME asc should this really be in here?
        // private AsmManager structureModel;
@@ -708,7 +708,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
         * aspects which are sent to that ouptut directory
         */
        private Map<File, List<String>> findOutputDirsForAspects() {
-               Map<File, List<String>> outputDirsToAspects = new HashMap<File, List<String>>();
+               Map<File, List<String>> outputDirsToAspects = new HashMap<>();
                Map<String, char[]> aspectNamesToFileNames = state.getAspectNamesToFileNameMap();
                if (buildConfig.getCompilationResultDestinationManager() == null
                                || buildConfig.getCompilationResultDestinationManager().getAllOutputLocations().size() == 1) {
@@ -717,7 +717,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
                        if (buildConfig.getCompilationResultDestinationManager() != null) {
                                outputDir = buildConfig.getCompilationResultDestinationManager().getDefaultOutputLocation();
                        }
-                       List<String> aspectNames = new ArrayList<String>();
+                       List<String> aspectNames = new ArrayList<>();
                        if (aspectNamesToFileNames != null) {
                                Set<String> keys = aspectNamesToFileNames.keySet();
                                for (String name : keys) {
@@ -729,7 +729,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
                        List outputDirs = buildConfig.getCompilationResultDestinationManager().getAllOutputLocations();
             for (Object dir : outputDirs) {
                 File outputDir = (File) dir;
-                outputDirsToAspects.put(outputDir, new ArrayList<String>());
+                outputDirsToAspects.put(outputDir, new ArrayList<>());
             }
                        if (aspectNamesToFileNames != null) {
                                Set<Map.Entry<String, char[]>> entrySet = aspectNamesToFileNames.entrySet();
@@ -739,7 +739,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
                     File outputDir = buildConfig.getCompilationResultDestinationManager().getOutputLocationForClass(
                             new File(new String(fileName)));
                     if (!outputDirsToAspects.containsKey(outputDir)) {
-                        outputDirsToAspects.put(outputDir, new ArrayList<String>());
+                        outputDirsToAspects.put(outputDir, new ArrayList<>());
                     }
                     ((List) outputDirsToAspects.get(outputDir)).add(aspectName);
                 }
@@ -796,7 +796,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
                }
                model.setRoot(new ProgramElement(structureModel, rootLabel, kind, new ArrayList()));
 
-               model.setFileMap(new HashMap<String, IProgramElement>());
+               model.setFileMap(new HashMap<>());
                // setStructureModel(model);
                state.setStructureModel(structureModel);
                // state.setRelationshipMap(AsmManager.getDefault().getRelationshipMap());
@@ -903,7 +903,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
                                File[] binSrcs = FileUtil.listFiles(inPathElement, binarySourceFilter);
                 for (File binSrc : binSrcs) {
                     UnwovenClassFile ucf = bcelWeaver.addClassFile(binSrc, inPathElement, outputDir);
-                    List<UnwovenClassFile> ucfl = new ArrayList<UnwovenClassFile>();
+                    List<UnwovenClassFile> ucfl = new ArrayList<>();
                     ucfl.add(ucf);
                     state.recordBinarySource(binSrc.getPath(), ucfl);
                 }
index f4518ead371a4413834fa46cd6b06fb9cef27e0c..18fa2f96df0068ad9b99288f095056eab42087ab 100644 (file)
@@ -96,7 +96,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
         * When looking at changes on the classpath, this set accumulates files in our state instance that affected by those changes.
         * Then if we can do an incremental build - these must be compiled.
         */
-       private final Set<File> affectedFiles = new HashSet<File>();
+       private final Set<File> affectedFiles = new HashSet<>();
 
        // these are references created on a particular compile run - when looping round in
        // addAffectedSourceFiles(), if some have been created then we look at which source files
@@ -110,7 +110,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
        private Set<BinarySourceFile> addedBinaryFiles;
        private Set<BinarySourceFile> deletedBinaryFiles;
        // For a particular build run, this set records the changes to classesFromName
-       public final Set<String> deltaAddedClasses = new HashSet<String>();
+       public final Set<String> deltaAddedClasses = new HashSet<>();
 
        // now follows non static, but transient state - no need to write out, DOES need reinitializing when read AjState instance
        // reloaded
@@ -125,7 +125,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
        private boolean batchBuildRequiredThisTime = false;
        private AjBuildConfig buildConfig;
        private long lastSuccessfulFullBuildTime = -1;
-       private final Hashtable<String, Long> structuralChangesSinceLastFullBuild = new Hashtable<String, Long>();
+       private final Hashtable<String, Long> structuralChangesSinceLastFullBuild = new Hashtable<>();
        private long lastSuccessfulBuildTime = -1;
        private long currentBuildTime = -1;
        private AsmManager structureModel;
@@ -134,18 +134,18 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
         * For a given source file, records the ClassFiles (which contain a fully qualified name and a file name) that were created when
         * the source file was compiled. Populated in noteResult and used in addDependentsOf(File)
         */
-       private final Map<File, List<ClassFile>> fullyQualifiedTypeNamesResultingFromCompilationUnit = new HashMap<File, List<ClassFile>>();
+       private final Map<File, List<ClassFile>> fullyQualifiedTypeNamesResultingFromCompilationUnit = new HashMap<>();
 
        /**
         * Source files defining aspects Populated in noteResult and used in processDeletedFiles
         */
-       private final Set<File> sourceFilesDefiningAspects = new HashSet<File>();
+       private final Set<File> sourceFilesDefiningAspects = new HashSet<>();
 
        /**
         * Populated in noteResult to record the set of types that should be recompiled if the given file is modified or deleted.
         * Referred to during addAffectedSourceFiles when calculating incremental compilation set.
         */
-       private final Map<File, ReferenceCollection> references = new HashMap<File, ReferenceCollection>();
+       private final Map<File, ReferenceCollection> references = new HashMap<>();
 
        /**
         * Holds UnwovenClassFiles (byte[]s) originating from the given file source. This could be a jar file, a directory, or an
@@ -165,25 +165,25 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
         * input file has changed.
         * 
         */
-       private Map<String, List<UnwovenClassFile>> binarySourceFiles = new HashMap<String, List<UnwovenClassFile>>();
+       private Map<String, List<UnwovenClassFile>> binarySourceFiles = new HashMap<>();
 
        /**
         * Initially a duplicate of the information held in binarySourceFiles, with the key difference that the values are ClassFiles
         * (type name, File) not UnwovenClassFiles (which also have all the byte code in them). After a batch build, binarySourceFiles
         * is cleared, leaving just this much lighter weight map to use in processing subsequent incremental builds.
         */
-       private final Map<String, List<ClassFile>> inputClassFilesBySource = new HashMap<String, List<ClassFile>>();
+       private final Map<String, List<ClassFile>> inputClassFilesBySource = new HashMap<>();
 
        /**
         * A list of the .class files created by this state that contain aspects.
         */
-       private final List<String> aspectClassFiles = new ArrayList<String>();
+       private final List<String> aspectClassFiles = new ArrayList<>();
 
        /**
         * Holds structure information on types as they were at the end of the last build. It would be nice to get rid of this too, but
         * can't see an easy way to do that right now.
         */
-       private final Map<String, CompactTypeStructureRepresentation> resolvedTypeStructuresFromLastBuild = new HashMap<String, CompactTypeStructureRepresentation>();
+       private final Map<String, CompactTypeStructureRepresentation> resolvedTypeStructuresFromLastBuild = new HashMap<>();
 
        /**
         * Populated in noteResult to record the set of UnwovenClassFiles (intermediate results) that originated from compilation of the
@@ -193,7 +193,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
         * 
         * Passed into StatefulNameEnvironment during incremental compilation to support findType lookups.
         */
-       private final Map<String, File> classesFromName = new HashMap<String, File>();
+       private final Map<String, File> classesFromName = new HashMap<>();
 
        /**
         * Populated by AjBuildManager to record the aspects with the file name in which they're contained. This is later used when
@@ -203,8 +203,8 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
         */
        private Map<String, char[]> aspectsFromFileNames;
 
-       private Set<File> compiledSourceFiles = new HashSet<File>();
-       private final Map<String, File> resources = new HashMap<String, File>();
+       private Set<File> compiledSourceFiles = new HashSet<>();
+       private final Map<String, File> resources = new HashMap<>();
 
        SoftHashMap/* <baseDir,SoftHashMap<theFile,className>> */fileToClassNameMap = new SoftHashMap();
 
@@ -313,21 +313,21 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
                        addedFiles = Collections.emptySet();
                        deletedFiles = Collections.emptySet();
                } else {
-                       Set<File> oldFiles = new HashSet<File>(buildConfig.getFiles());
-                       Set<File> newFiles = new HashSet<File>(newBuildConfig.getFiles());
+                       Set<File> oldFiles = new HashSet<>(buildConfig.getFiles());
+                       Set<File> newFiles = new HashSet<>(newBuildConfig.getFiles());
 
-                       addedFiles = new HashSet<File>(newFiles);
+                       addedFiles = new HashSet<>(newFiles);
                        addedFiles.removeAll(oldFiles);
-                       deletedFiles = new HashSet<File>(oldFiles);
+                       deletedFiles = new HashSet<>(oldFiles);
                        deletedFiles.removeAll(newFiles);
                }
 
-               Set<BinarySourceFile> oldBinaryFiles = new HashSet<BinarySourceFile>(buildConfig.getBinaryFiles());
-               Set<BinarySourceFile> newBinaryFiles = new HashSet<BinarySourceFile>(newBuildConfig.getBinaryFiles());
+               Set<BinarySourceFile> oldBinaryFiles = new HashSet<>(buildConfig.getBinaryFiles());
+               Set<BinarySourceFile> newBinaryFiles = new HashSet<>(newBuildConfig.getBinaryFiles());
 
-               addedBinaryFiles = new HashSet<BinarySourceFile>(newBinaryFiles);
+               addedBinaryFiles = new HashSet<>(newBinaryFiles);
                addedBinaryFiles.removeAll(oldBinaryFiles);
-               deletedBinaryFiles = new HashSet<BinarySourceFile>(oldBinaryFiles);
+               deletedBinaryFiles = new HashSet<>(oldBinaryFiles);
                deletedBinaryFiles.removeAll(newBinaryFiles);
 
                boolean couldStillBeIncremental = processDeletedFiles(deletedFiles);
@@ -376,7 +376,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
        }
 
        Collection<File> getModifiedFiles(long lastBuildTime) {
-               Set<File> ret = new HashSet<File>();
+               Set<File> ret = new HashSet<>();
 
                // Check if the build configuration knows what files have changed...
                List<File> modifiedFiles = buildConfig.getModifiedFiles();
@@ -408,7 +408,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
        }
 
        Collection<BinarySourceFile> getModifiedBinaryFiles(long lastBuildTime) {
-               List<BinarySourceFile> ret = new ArrayList<BinarySourceFile>();
+               List<BinarySourceFile> ret = new ArrayList<>();
                // not our job to account for new and deleted files
                for (BinarySourceFile bsfile : buildConfig.getBinaryFiles()) {
                        File file = bsfile.binSrc;
@@ -865,7 +865,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
                if ((changes & (CLASSPATH_CHANGED | ASPECTPATH_CHANGED | INPATH_CHANGED | OUTPUTDESTINATIONS_CHANGED | INJARS_CHANGED)) != 0) {
                        List<File> oldOutputLocs = getOutputLocations(previousConfig);
 
-                       Set<String> alreadyAnalysedPaths = new HashSet<String>();
+                       Set<String> alreadyAnalysedPaths = new HashSet<>();
 
                        List<String> oldClasspath = previousConfig.getClasspath();
                        List<String> newClasspath = newConfig.getClasspath();
@@ -926,7 +926,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
         * @return a list of file objects
         */
        private List<File> getOutputLocations(AjBuildConfig config) {
-               List<File> outputLocs = new ArrayList<File>();
+               List<File> outputLocs = new ArrayList<>();
                // Is there a default location?
                if (config.getOutputDir() != null) {
                        try {
@@ -1074,9 +1074,9 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
        }
 
        public Set<File> getFilesToCompile(boolean firstPass) {
-               Set<File> thisTime = new HashSet<File>();
+               Set<File> thisTime = new HashSet<>();
                if (firstPass) {
-                       compiledSourceFiles = new HashSet<File>();
+                       compiledSourceFiles = new HashSet<>();
                        Collection<File> modifiedFiles = getModifiedFiles();
                        // System.out.println("modified: " + modifiedFiles);
                        thisTime.addAll(modifiedFiles);
@@ -1120,9 +1120,9 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
                        return binarySourceFiles;
                }
                // else incremental...
-               Map<String, List<UnwovenClassFile>> toWeave = new HashMap<String, List<UnwovenClassFile>>();
+               Map<String, List<UnwovenClassFile>> toWeave = new HashMap<>();
                if (firstTime) {
-                       List<BinarySourceFile> addedOrModified = new ArrayList<BinarySourceFile>();
+                       List<BinarySourceFile> addedOrModified = new ArrayList<>();
                        addedOrModified.addAll(addedBinaryFiles);
                        addedOrModified.addAll(getModifiedBinaryFiles());
                        for (BinarySourceFile bsf : addedOrModified) {
@@ -1130,11 +1130,11 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
                                if (ucf == null) {
                                        continue;
                                }
-                               List<UnwovenClassFile> ucfs = new ArrayList<UnwovenClassFile>();
+                               List<UnwovenClassFile> ucfs = new ArrayList<>();
                                ucfs.add(ucf);
                                recordTypeChanged(ucf.getClassName());
                                binarySourceFiles.put(bsf.binSrc.getPath(), ucfs);
-                               List<ClassFile> cfs = new ArrayList<ClassFile>(1);
+                               List<ClassFile> cfs = new ArrayList<>(1);
                                cfs.add(getClassFileFor(ucf));
                                this.inputClassFilesBySource.put(bsf.binSrc.getPath(), cfs);
                                toWeave.put(bsf.binSrc.getPath(), ucfs);
@@ -1407,7 +1407,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
         * @param icr, the CompilationResult from compiling it
         */
        private void recordFQNsResultingFromCompilationUnit(File sourceFile, InterimCompilationResult icr) {
-               List<ClassFile> classFiles = new ArrayList<ClassFile>();
+               List<ClassFile> classFiles = new ArrayList<>();
                UnwovenClassFile[] types = icr.unwovenClassFiles();
                for (UnwovenClassFile type : types) {
                        classFiles.add(new ClassFile(type.getClassName(), new File(type.getFilename())));
@@ -2372,13 +2372,13 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
        }
 
        public void clearBinarySourceFiles() {
-               this.binarySourceFiles = new HashMap<String, List<UnwovenClassFile>>();
+               this.binarySourceFiles = new HashMap<>();
        }
 
        public void recordBinarySource(String fromPathName, List<UnwovenClassFile> unwovenClassFiles) {
                this.binarySourceFiles.put(fromPathName, unwovenClassFiles);
                if (this.maybeIncremental()) {
-                       List<ClassFile> simpleClassFiles = new LinkedList<ClassFile>();
+                       List<ClassFile> simpleClassFiles = new LinkedList<>();
                        for (UnwovenClassFile ucf : unwovenClassFiles) {
                                ClassFile cf = getClassFileFor(ucf);
                                simpleClassFiles.add(cf);
@@ -2489,7 +2489,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
        }
 
        public void initializeAspectNamesToFileNameMap() {
-               this.aspectsFromFileNames = new HashMap<String, char[]>();
+               this.aspectsFromFileNames = new HashMap<>();
        }
 
        // Will allow us to record decisions made during incremental processing, hopefully aid in debugging
index 776696aff45d2d52502f12b289930624bbb6359b..a89a6bd9318b635bdde5bf7516edd7792a228c69 100644 (file)
@@ -422,9 +422,9 @@ public class AsmElementFormatter {
                        pe.setParameterNames(Collections.<String>emptyList());
                        pe.setParameterSignatures(Collections.<char[]>emptyList(), Collections.<String>emptyList());
                } else {
-                       List<String> names = new ArrayList<String>();
-                       List<char[]> paramSigs = new ArrayList<char[]>();
-                       List<String> paramSourceRefs = new ArrayList<String>();
+                       List<String> names = new ArrayList<>();
+                       List<char[]> paramSigs = new ArrayList<>();
+                       List<String> paramSourceRefs = new ArrayList<>();
                        boolean problemWithSourceRefs = false;
                        for (Argument argument : argArray) {
                                String argName = new String(argument.name);
index 7ee6cf9e49a8f5a97830d59217cb5c1638bdd6d3..84319600cf39313db987859773abbd1b6bdf6477 100644 (file)
@@ -541,7 +541,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
                        Declare decl = dDeclaration.declareDecl;
                        if (decl instanceof DeclareParents) {
                                TypePatternList tpl = ((DeclareParents) decl).getParents();
-                               List<String> parents = new ArrayList<String>();
+                               List<String> parents = new ArrayList<>();
                                for (int i = 0; i < tpl.size(); i++) {
                                        parents.add(tpl.get(i).getExactType().getName().replaceAll("\\$", "."));
                                }
index aeac71571db9bf7bd1c183104585714a945182c2..f81d1d9371724153a6fc1ac72ab9d240d23f030d 100644 (file)
@@ -39,7 +39,7 @@ public class IncrementalStateManager {
        // SECRETAPI will consume more memory, so turn on at your own risk ;) Set to 'true' when memory usage is understood
        public static boolean recordIncrementalStates = false;
        public static boolean debugIncrementalStates = false;
-       private static Hashtable<String, AjState> incrementalStates = new Hashtable<String, AjState>();
+       private static Hashtable<String, AjState> incrementalStates = new Hashtable<>();
 
        public static void recordSuccessfulBuild(String buildConfig, AjState state) {
                if (!recordIncrementalStates) {
index 97284639af8d091a9f53dbd725f582538fff7052..8d49c31d16be287c8122e9e6b1aa6a4481f9546e 100644 (file)
@@ -39,10 +39,10 @@ public class StatefulNameEnvironment implements IModuleAwareNameEnvironment {
 
        public StatefulNameEnvironment(IModuleAwareNameEnvironment baseEnvironment, Map<String,File> classesFromName, AjState state) {
                this.classesFromName = classesFromName;
-               this.inflatedClassFilesCache = new HashMap<String,NameEnvironmentAnswer>();
+               this.inflatedClassFilesCache = new HashMap<>();
                this.baseEnvironment = baseEnvironment;
                this.state = state;
-               packageNames = new HashSet<String>();
+               packageNames = new HashSet<>();
                for (String className: classesFromName.keySet()) {
                        addAllPackageNames(className);
                }
index 53053d8b325a05469e926335a05e07019a19969d..1a3cc12b2622ecf990236e2bca6602dcdbc01b04 100644 (file)
@@ -62,7 +62,7 @@ public abstract class CommandTestCase extends TestCase {
        }
 
        public static void checkCompile(String source, String[] extraArgs, int[] expectedErrors, String sandboxName) {
-               List<String> args = new ArrayList<String>();
+               List<String> args = new ArrayList<>();
                args.add("-verbose");
 
                args.add("-d");
@@ -87,7 +87,7 @@ public abstract class CommandTestCase extends TestCase {
        }
 
        public void checkMultipleCompile(String source) throws InterruptedException {
-               List<String> args = new ArrayList<String>();
+               List<String> args = new ArrayList<>();
                args.add("-verbose");
 
                args.add("-d");
index 9f1162c9f9c2cef63aac1f50d0ff1f7a0753af14..355267b0fbf9c2bf139d3ccce6868dce21c422df 100644 (file)
@@ -236,7 +236,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests?
                                "-d",
                                classesDir.getAbsolutePath()};
                return Collections.unmodifiableList(
-                       new ArrayList<String>(Arrays.asList(input)));
+                               new ArrayList<>(Arrays.asList(input)));
        }
 
        protected File makeDir(
index a9ee51fe9b9bf1b10b98836b99ba938006453dbf..bea58ff7bc253e2d152234220077524b407a8ffd 100644 (file)
@@ -37,7 +37,7 @@ public class JavadocTest extends AjcTestCase {
        public void testMissingJavadoc() {
                String[] args = new String[] { "World.java", "-warn:allJavadoc", "-1.4" };
 
-               List<Message> warningMessages = new ArrayList<Message>();
+               List<Message> warningMessages = new ArrayList<>();
                // These warnings are against public textX() methods declared in the World.java
                // type. These test methods are spread between AJ constructs, meaning
                // if someone messes up and the javadoc is not associated with the aspectj
index 880d58f867868e9d5a3182a0a9c0d72bea28c3af..a8b2964c4ed2137283eba3da21d381bac8304b65 100644 (file)
@@ -166,7 +166,7 @@ public class AjBuildConfigTest extends TestCase {
 
        static class TestMessageHandler implements IMessageHandler {
 
-               List<IMessage> messages = new ArrayList<IMessage>();
+               List<IMessage> messages = new ArrayList<>();
 
                @Override
                public boolean isIgnoring(Kind kind) {
index 101fdade1fd6a28aa455f41d212685a7fd92f619..1cd4ade778749bcd183f956c4fd37e0483e2d0b1 100644 (file)
@@ -119,26 +119,26 @@ public class AjStateTest extends TestCase {
                });
                oldConfig = new AjBuildConfig(parser);
                newConfig = new AjBuildConfig(parser);
-               List<String> cp = new ArrayList<String>();
+               List<String> cp = new ArrayList<>();
                cp.add("adir");
                cp.add("ajar.jar");
                oldConfig.setClasspath(cp);
-               newConfig.setClasspath(new ArrayList<String>(cp));
-               List<File> ap = new ArrayList<File>();
+               newConfig.setClasspath(new ArrayList<>(cp));
+               List<File> ap = new ArrayList<>();
                ap.add(new File("aLib.jar"));
                ap.add(new File("anotherLib.jar"));
                oldConfig.setAspectpath(ap);
-               newConfig.setAspectpath(new ArrayList<File>(ap));
-               List<File> ip = new ArrayList<File>();
+               newConfig.setAspectpath(new ArrayList<>(ap));
+               List<File> ip = new ArrayList<>();
                ip.add(new File("adir"));
                ip.add(new File("ajar.jar"));
                oldConfig.setInPath(ip);
-               newConfig.setInPath(new ArrayList<File>(ip));
-               List<File> ij = new ArrayList<File>();
+               newConfig.setInPath(new ArrayList<>(ip));
+               List<File> ij = new ArrayList<>();
                ij.add(new File("aLib.jar"));
                ij.add(new File("anotherLib.jar"));
                oldConfig.setInJars(ij);
-               newConfig.setInJars(new ArrayList<File>(ij));
+               newConfig.setInJars(new ArrayList<>(ij));
                aRightState.prepareForNextBuild(oldConfig);
                aRightState.successfulCompile(oldConfig, true);
        }
index e63ecf15e457c0eb8d0b01b0e6ac26f58d3165b5..de8960e7341fe183c47863e4f0ef3eb8faa7d321 100644 (file)
@@ -421,7 +421,7 @@ public class ASTVisitorTest extends TestCase {
        
        private void checkJLS3(String source, String expectedOutput) {
                ASTParser parser = ASTParser.newParser(AST.JLS3);
-               HashMap<String,String> options = new HashMap<String,String>();
+               HashMap<String,String> options = new HashMap<>();
                options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
                parser.setCompilerOptions(options);
                parser.setSource(source.toCharArray());
index e4c49b48cad886dacfe4f525a8702a675d563299..721cb3e22c9485a982dd76b6d2811053bc8799e4 100644 (file)
@@ -1848,7 +1848,7 @@ class TypeCategoryTypeVisitor extends AjASTVisitor {
 }
 
 class TypePatternSourceRangeVisitor extends AjASTVisitor {
-       private List<SourceRange> sourceRanges = new ArrayList<SourceRange>();
+       private List<SourceRange> sourceRanges = new ArrayList<>();
 
        public List<SourceRange> getVisitedSourceRanges() {
                return sourceRanges;
index b3870c6e8f2ad7f1c166cd631ed3d0383cced380..304a7996bbe1517da4825458eb03ea6ac00434e5 100644 (file)
@@ -86,7 +86,7 @@ public abstract class AjASTTestCase extends TestCase {
 
 
        protected List<SourceRange> getSourceRanges(int[][] sourceRanges) {
-               List<SourceRange> convertedRanges = new ArrayList<SourceRange>();
+               List<SourceRange> convertedRanges = new ArrayList<>();
 
                for (int[] sourceRange : sourceRanges) {
                        convertedRanges.add(new SourceRange(sourceRange[0],
index 671b310cca1ddc2309630ef9dcced07b6c4d7d1f..088ff78f9a8825fa5b0b76e60053ffc0391521c0 100644 (file)
@@ -209,11 +209,11 @@ public class Ajc {
                System.setOut(pout);
                System.setErr(perr);
 
-               List<IMessage> fails = new ArrayList<IMessage>();
-               List<IMessage> errors = new ArrayList<IMessage>();
-               List<IMessage> warnings = new ArrayList<IMessage>();
-               List<IMessage> infos = new ArrayList<IMessage>();
-               List<IMessage> weaves = new ArrayList<IMessage>();
+               List<IMessage> fails = new ArrayList<>();
+               List<IMessage> errors = new ArrayList<>();
+               List<IMessage> warnings = new ArrayList<>();
+               List<IMessage> infos = new ArrayList<>();
+               List<IMessage> weaves = new ArrayList<>();
 
                try {
                        if (!isIncremental && shouldEmptySandbox) {
index 6bbc076b45f991fa5bd9eb464db0f05976a581b0..5488ab1b23df9201b9a89f1cd39d2d6e6b235532 100644 (file)
@@ -493,7 +493,7 @@ public abstract class AjcTestCase extends TestCase {
         * Helper method to build a new message list for passing to a MessageSpec.
         */
        protected List<Message> newMessageList(Message m1) {
-               List<Message> ret = new ArrayList<Message>();
+               List<Message> ret = new ArrayList<>();
                ret.add(m1);
                return ret;
        }
@@ -502,7 +502,7 @@ public abstract class AjcTestCase extends TestCase {
         * Helper method to build a new message list for passing to a MessageSpec.
         */
        protected List<Message> newMessageList(Message m1, Message m2) {
-               List<Message> ret = new ArrayList<Message>();
+               List<Message> ret = new ArrayList<>();
                ret.add(m1);
                ret.add(m2);
                return ret;
@@ -512,7 +512,7 @@ public abstract class AjcTestCase extends TestCase {
         * Helper method to build a new message list for passing to a MessageSpec.
         */
        protected List<Message> newMessageList(Message m1, Message m2, Message m3) {
-               List<Message> ret = new ArrayList<Message>();
+               List<Message> ret = new ArrayList<>();
                ret.add(m1);
                ret.add(m2);
                ret.add(m3);
@@ -785,7 +785,7 @@ public abstract class AjcTestCase extends TestCase {
 
        private List<String >tokenizeCommand(String command) {
                StringTokenizer st = new StringTokenizer(command," ", false);
-               ArrayList<String> arguments = new ArrayList<String>();
+               ArrayList<String> arguments = new ArrayList<>();
                while(st.hasMoreElements()){
                        String nextToken =st.nextToken();
                        arguments.add(nextToken);
@@ -959,7 +959,7 @@ public abstract class AjcTestCase extends TestCase {
                if (in == Collections.EMPTY_LIST)
                        return in;
 
-               List<T> out = new ArrayList<T>();
+               List<T> out = new ArrayList<>();
                for (T t : in) {
                        out.add(t);
                }
index 8d6f788d46150d68b6c682545c147a2b0dec099f..7da3aa6474c49a72aad3da873158986f3925ac18 100644 (file)
@@ -23,7 +23,7 @@ import org.aspectj.bridge.AbortException;
 public class MainTest extends AjcTestCase {
        
     public void testMainbare() {
-        ArrayList<String> list = new ArrayList<String>();
+        ArrayList<String> list = new ArrayList<>();
 // Usage now printed by Eclipse compiler so doesn't appear here in our message list
 //        Main.bareMain(new String[] {"-help"}, false, list, null, null, null);
 //        assertTrue(1 == list.size());
index ce3b6aa60796b49ae2cf52f951a22873066f0c54..2d969c2f83c7e51bb1c72320b599767d0a3c2034 100644 (file)
@@ -112,7 +112,7 @@ public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDele
        }
 
        protected GenericSignature.FormalTypeParameter[] getFormalTypeParametersFromOuterClass() {
-               List<GenericSignature.FormalTypeParameter> typeParameters = new ArrayList<GenericSignature.FormalTypeParameter>();
+               List<GenericSignature.FormalTypeParameter> typeParameters = new ArrayList<>();
                ResolvedType outerClassType = getOuterClass();
                if (!(outerClassType instanceof ReferenceType)) {
                        if (outerClassType == null) {
index b6ddd2e6e0c80dbd7b5558c5652aee9fad06692e..c3f22b0b14dd1e7308aa3c7cd3b5ce2520142274 100644 (file)
@@ -50,21 +50,21 @@ public class CrosscuttingMembers {
 
        private PerClause perClause;
 
-       private List<ShadowMunger> shadowMungers = new ArrayList<ShadowMunger>(4);
-       private List<ConcreteTypeMunger> typeMungers = new ArrayList<ConcreteTypeMunger>(4);
-       private List<ConcreteTypeMunger> lateTypeMungers = new ArrayList<ConcreteTypeMunger>(0);
+       private List<ShadowMunger> shadowMungers = new ArrayList<>(4);
+       private List<ConcreteTypeMunger> typeMungers = new ArrayList<>(4);
+       private List<ConcreteTypeMunger> lateTypeMungers = new ArrayList<>(0);
 
-       private Set<DeclareParents> declareParents = new HashSet<DeclareParents>();
-       private Set<DeclareSoft> declareSofts = new HashSet<DeclareSoft>();
-       private List<Declare> declareDominates = new ArrayList<Declare>(4);
+       private Set<DeclareParents> declareParents = new HashSet<>();
+       private Set<DeclareSoft> declareSofts = new HashSet<>();
+       private List<Declare> declareDominates = new ArrayList<>(4);
 
        // These are like declare parents type mungers
-       private Set<DeclareAnnotation> declareAnnotationsOnType = new LinkedHashSet<DeclareAnnotation>();
-       private Set<DeclareAnnotation> declareAnnotationsOnField = new LinkedHashSet<DeclareAnnotation>();
-       private Set<DeclareAnnotation> declareAnnotationsOnMethods = new LinkedHashSet<DeclareAnnotation>();
+       private Set<DeclareAnnotation> declareAnnotationsOnType = new LinkedHashSet<>();
+       private Set<DeclareAnnotation> declareAnnotationsOnField = new LinkedHashSet<>();
+       private Set<DeclareAnnotation> declareAnnotationsOnMethods = new LinkedHashSet<>();
        // declareAnnotationsOnMethods includes constructors too
 
-       private Set<DeclareTypeErrorOrWarning> declareTypeEow = new HashSet<DeclareTypeErrorOrWarning>();
+       private Set<DeclareTypeErrorOrWarning> declareTypeEow = new HashSet<>();
 
        private boolean shouldConcretizeIfNeeded = true;
 
@@ -74,8 +74,8 @@ public class CrosscuttingMembers {
                this.shouldConcretizeIfNeeded = shouldConcretizeIfNeeded;
        }
 
-       private final Hashtable<String, Object> cflowFields = new Hashtable<String, Object>();
-       private final Hashtable<String, Object> cflowBelowFields = new Hashtable<String, Object>();
+       private final Hashtable<String, Object> cflowFields = new Hashtable<>();
+       private final Hashtable<String, Object> cflowBelowFields = new Hashtable<>();
 
        // public void addConcreteShadowMungers(Collection c) {
        // shadowMungers.addAll(c);
@@ -237,7 +237,7 @@ public class CrosscuttingMembers {
        }
 
        public Collection<ShadowMunger> getCflowEntries() {
-               List<ShadowMunger> ret = new ArrayList<ShadowMunger>();
+               List<ShadowMunger> ret = new ArrayList<>();
                for (ShadowMunger m : shadowMungers) {
                        if (m instanceof Advice) {
                                Advice a = (Advice) m;
@@ -276,8 +276,8 @@ public class CrosscuttingMembers {
 
                if (careAboutShadowMungers) {
                        // bug 129163: use set equality rather than list equality
-                       Set<ShadowMunger> theseShadowMungers = new HashSet<ShadowMunger>();
-                       Set<ShadowMunger> theseInlinedAroundMungers = new HashSet<ShadowMunger>();
+                       Set<ShadowMunger> theseShadowMungers = new HashSet<>();
+                       Set<ShadowMunger> theseInlinedAroundMungers = new HashSet<>();
                        for (ShadowMunger munger : shadowMungers) {
                                if (munger instanceof Advice) {
                                        Advice adviceMunger = (Advice) munger;
@@ -293,10 +293,10 @@ public class CrosscuttingMembers {
                                        theseShadowMungers.add(munger);
                                }
                        }
-                       Set<ShadowMunger> tempSet = new HashSet<ShadowMunger>();
+                       Set<ShadowMunger> tempSet = new HashSet<>();
                        tempSet.addAll(other.shadowMungers);
-                       Set<ShadowMunger> otherShadowMungers = new HashSet<ShadowMunger>();
-                       Set<ShadowMunger> otherInlinedAroundMungers = new HashSet<ShadowMunger>();
+                       Set<ShadowMunger> otherShadowMungers = new HashSet<>();
+                       Set<ShadowMunger> otherInlinedAroundMungers = new HashSet<>();
                        for (ShadowMunger munger : tempSet) {
                                if (munger instanceof Advice) {
                                        Advice adviceMunger = (Advice) munger;
@@ -341,8 +341,8 @@ public class CrosscuttingMembers {
                // if we dont care about shadow mungers then ignore those
                // typeMungers which are created to help with the implementation
                // of shadowMungers
-               Set<Object> theseTypeMungers = new HashSet<Object>();
-               Set<Object> otherTypeMungers = new HashSet<Object>();
+               Set<Object> theseTypeMungers = new HashSet<>();
+               Set<Object> otherTypeMungers = new HashSet<>();
                if (!careAboutShadowMungers) {
                        for (Object o : typeMungers) {
                                if (o instanceof ConcreteTypeMunger) {
@@ -431,13 +431,13 @@ public class CrosscuttingMembers {
                        // the up front comparison
                        if (!careAboutShadowMungers) {
                                // this means we are in front end compilation and if the differences are purely mixin parents, we can continue OK
-                               Set<DeclareParents> trimmedThis = new HashSet<DeclareParents>();
+                               Set<DeclareParents> trimmedThis = new HashSet<>();
                                for (DeclareParents decp : declareParents) {
                                        if (!decp.isMixin()) {
                                                trimmedThis.add(decp);
                                        }
                                }
-                               Set<DeclareParents> trimmedOther = new HashSet<DeclareParents>();
+                               Set<DeclareParents> trimmedOther = new HashSet<>();
                                for (DeclareParents decp : other.declareParents) {
                                        if (!decp.isMixin()) {
                                                trimmedOther.add(decp);
index a3d97ea89f388aef21755860f65bda0b28e08bdf..79f96e8fa616d72b1c98bfc403b4dd747451b054 100644 (file)
@@ -43,7 +43,7 @@ public class CrosscuttingMembersSet {
        private transient World world;
 
        // FIXME AV - ? we may need a sequencedHashMap there to ensure source based precedence for @AJ advice
-       private final Map<ResolvedType, CrosscuttingMembers> members = new HashMap<ResolvedType, CrosscuttingMembers>();
+       private final Map<ResolvedType, CrosscuttingMembers> members = new HashMap<>();
 
        // List of things to be verified once the type system is 'complete'
        private transient List<IVerificationRequired> verificationList = null;
@@ -139,7 +139,7 @@ public class CrosscuttingMembersSet {
        private boolean addOrReplaceDescendantsOf(ResolvedType aspectType, boolean inWeavePhase) {
                // System.err.println("Looking at descendants of "+aspectType.getName());
                Set<ResolvedType> knownAspects = members.keySet();
-               Set<ResolvedType> toBeReplaced = new HashSet<ResolvedType>();
+               Set<ResolvedType> toBeReplaced = new HashSet<>();
                for (ResolvedType candidateDescendant : knownAspects) {
                        // allowMissing = true - if something is missing, it really probably is not a descendant
                        if ((candidateDescendant != aspectType) && (aspectType.isAssignableFrom(candidateDescendant, true))) {
@@ -192,7 +192,7 @@ public class CrosscuttingMembersSet {
 
        public List<ShadowMunger> getShadowMungers() {
                if (shadowMungers == null) {
-                       List<ShadowMunger> ret = new ArrayList<ShadowMunger>();
+                       List<ShadowMunger> ret = new ArrayList<>();
                        for (CrosscuttingMembers crosscuttingMembers : members.values()) {
                                ret.addAll(crosscuttingMembers.getShadowMungers());
                        }
@@ -203,7 +203,7 @@ public class CrosscuttingMembersSet {
 
        public List<ConcreteTypeMunger> getTypeMungers() {
                if (typeMungers == null) {
-                       List<ConcreteTypeMunger> ret = new ArrayList<ConcreteTypeMunger>();
+                       List<ConcreteTypeMunger> ret = new ArrayList<>();
                        for (CrosscuttingMembers xmembers : members.values()) {
                                // With 1.6.9 there is a change that enables use of more optimal accessors (accessors for private fields).
                                // Here is where we determine if two aspects are asking for access to the same field. If they are
@@ -252,7 +252,7 @@ public class CrosscuttingMembersSet {
                for (ConcreteTypeMunger typeMunger : typeMungers) {
                        if (typeMunger.getMunger() != null && typeMunger.getMunger().getKind() == kind) {
                                if (collected == null) {
-                                       collected = new ArrayList<ConcreteTypeMunger>();
+                                       collected = new ArrayList<>();
                                }
                                collected.add(typeMunger);
                        }
@@ -280,7 +280,7 @@ public class CrosscuttingMembersSet {
 
        public List<ConcreteTypeMunger> getLateTypeMungers() {
                if (lateTypeMungers == null) {
-                       List<ConcreteTypeMunger> ret = new ArrayList<ConcreteTypeMunger>();
+                       List<ConcreteTypeMunger> ret = new ArrayList<>();
                        for (CrosscuttingMembers crosscuttingMembers : members.values()) {
                                ret.addAll(crosscuttingMembers.getLateTypeMungers());
                        }
@@ -291,11 +291,11 @@ public class CrosscuttingMembersSet {
 
        public List<DeclareSoft> getDeclareSofts() {
                if (declareSofts == null) {
-                       Set<DeclareSoft> ret = new HashSet<DeclareSoft>();
+                       Set<DeclareSoft> ret = new HashSet<>();
                        for (CrosscuttingMembers crosscuttingMembers : members.values()) {
                                ret.addAll(crosscuttingMembers.getDeclareSofts());
                        }
-                       declareSofts = new ArrayList<DeclareSoft>();
+                       declareSofts = new ArrayList<>();
                        declareSofts.addAll(ret);
                }
                return declareSofts;
@@ -303,11 +303,11 @@ public class CrosscuttingMembersSet {
 
        public List<DeclareParents> getDeclareParents() {
                if (declareParents == null) {
-                       Set<DeclareParents> ret = new HashSet<DeclareParents>();
+                       Set<DeclareParents> ret = new HashSet<>();
                        for (CrosscuttingMembers crosscuttingMembers : members.values()) {
                                ret.addAll(crosscuttingMembers.getDeclareParents());
                        }
-                       declareParents = new ArrayList<DeclareParents>();
+                       declareParents = new ArrayList<>();
                        declareParents.addAll(ret);
                }
                return declareParents;
@@ -318,11 +318,11 @@ public class CrosscuttingMembersSet {
         */
        public List<DeclareAnnotation> getDeclareAnnotationOnTypes() {
                if (declareAnnotationOnTypes == null) {
-                       Set<DeclareAnnotation> ret = new LinkedHashSet<DeclareAnnotation>();
+                       Set<DeclareAnnotation> ret = new LinkedHashSet<>();
                        for (CrosscuttingMembers crosscuttingMembers : members.values()) {
                                ret.addAll(crosscuttingMembers.getDeclareAnnotationOnTypes());
                        }
-                       declareAnnotationOnTypes = new ArrayList<DeclareAnnotation>();
+                       declareAnnotationOnTypes = new ArrayList<>();
                        declareAnnotationOnTypes.addAll(ret);
                }
                return declareAnnotationOnTypes;
@@ -333,11 +333,11 @@ public class CrosscuttingMembersSet {
         */
        public List<DeclareAnnotation> getDeclareAnnotationOnFields() {
                if (declareAnnotationOnFields == null) {
-                       Set<DeclareAnnotation> ret = new LinkedHashSet<DeclareAnnotation>();
+                       Set<DeclareAnnotation> ret = new LinkedHashSet<>();
                        for (CrosscuttingMembers crosscuttingMembers : members.values()) {
                                ret.addAll(crosscuttingMembers.getDeclareAnnotationOnFields());
                        }
-                       declareAnnotationOnFields = new ArrayList<DeclareAnnotation>();
+                       declareAnnotationOnFields = new ArrayList<>();
                        declareAnnotationOnFields.addAll(ret);
                }
                return declareAnnotationOnFields;
@@ -348,11 +348,11 @@ public class CrosscuttingMembersSet {
         */
        public List<DeclareAnnotation> getDeclareAnnotationOnMethods() {
                if (declareAnnotationOnMethods == null) {
-                       Set<DeclareAnnotation> ret = new LinkedHashSet<DeclareAnnotation>();
+                       Set<DeclareAnnotation> ret = new LinkedHashSet<>();
                        for (CrosscuttingMembers crosscuttingMembers : members.values()) {
                                ret.addAll(crosscuttingMembers.getDeclareAnnotationOnMethods());
                        }
-                       declareAnnotationOnMethods = new ArrayList<DeclareAnnotation>();
+                       declareAnnotationOnMethods = new ArrayList<>();
                        declareAnnotationOnMethods.addAll(ret);
                        // world.sortDeclareAnnotations(declareAnnotationOnMethods);
                }
@@ -364,11 +364,11 @@ public class CrosscuttingMembersSet {
         */
        public List<DeclareTypeErrorOrWarning> getDeclareTypeEows() {
                if (declareTypeEows == null) {
-                       Set<DeclareTypeErrorOrWarning> ret = new HashSet<DeclareTypeErrorOrWarning>();
+                       Set<DeclareTypeErrorOrWarning> ret = new HashSet<>();
                        for (CrosscuttingMembers crosscuttingMembers : members.values()) {
                                ret.addAll(crosscuttingMembers.getDeclareTypeErrorOrWarning());
                        }
-                       declareTypeEows = new ArrayList<DeclareTypeErrorOrWarning>();
+                       declareTypeEows = new ArrayList<>();
                        declareTypeEows.addAll(ret);
                }
                return declareTypeEows;
@@ -376,7 +376,7 @@ public class CrosscuttingMembersSet {
 
        public List<Declare> getDeclareDominates() {
                if (declareDominates == null) {
-                       List<Declare> ret = new ArrayList<Declare>();
+                       List<Declare> ret = new ArrayList<>();
                        for (CrosscuttingMembers crosscuttingMembers : members.values()) {
                                ret.addAll(crosscuttingMembers.getDeclareDominates());
                        }
@@ -412,7 +412,7 @@ public class CrosscuttingMembersSet {
         */
        public void recordNecessaryCheck(IVerificationRequired verification) {
                if (verificationList == null) {
-                       verificationList = new ArrayList<IVerificationRequired>();
+                       verificationList = new ArrayList<>();
                }
                verificationList.add(verification);
        }
index c0af738ba38a223c5f6fbcdd9a79ecd84bbb2ac9..fb86ee4f05f24a3383689a5b3ebc1b9398b296eb 100644 (file)
@@ -24,7 +24,7 @@ public class IntMap {
        // XXX begin hack to avoid a signature refactoring in Pointcut
        private ResolvedType concreteAspect;
        private ShadowMunger enclosingAdvice;
-       private List<ResolvedPointcutDefinition> enclosingDefinition = new ArrayList<ResolvedPointcutDefinition>();
+       private List<ResolvedPointcutDefinition> enclosingDefinition = new ArrayList<>();
 
        public void pushEnclosingDefinition(ResolvedPointcutDefinition def) {
                enclosingDefinition.add(def);
index 1a2e820061a219c0ef65e036928b0c0bb771ea83..576ef9e34fea11a9c6cc6664104b9a45eaf75e63 100644 (file)
@@ -46,7 +46,7 @@ public final class Iterators {
         */
        public static <T> Filter<T> dupFilter() {
                return new Filter<T>() {
-                       final Set<T> seen = new HashSet<T>(); // should have weak ptrs?
+                       final Set<T> seen = new HashSet<>(); // should have weak ptrs?
 
                        public Iterator<T> filter(final Iterator<T> in) {
                                return new Iterator<T>() {
index 50332c1c01296a922e00354cc8ad20fb96929faf..639e4a080b759509a9daf4bae4c1ceffbdf59ee6 100644 (file)
@@ -31,12 +31,12 @@ public class JoinPointSignatureIterator implements Iterator<JoinPointSignature>
        private Member signaturesOfMember;
        private ResolvedMember firstDefiningMember;
        private World world;
-       private List<JoinPointSignature> discoveredSignatures = new ArrayList<JoinPointSignature>();
+       private List<JoinPointSignature> discoveredSignatures = new ArrayList<>();
        private List<JoinPointSignature> additionalSignatures = Collections.emptyList();
        private Iterator<JoinPointSignature> discoveredSignaturesIterator = null;
        private Iterator<ResolvedType> superTypeIterator = null;
        private boolean isProxy = false;
-       private Set<ResolvedType> visitedSuperTypes = new HashSet<ResolvedType>();
+       private Set<ResolvedType> visitedSuperTypes = new HashSet<>();
        private List<SearchPair> yetToBeProcessedSuperMembers = null;
 
        private boolean iteratingOverDiscoveredSignatures = true;
@@ -131,7 +131,7 @@ public class JoinPointSignatureIterator implements Iterator<JoinPointSignature>
                        // a common case
                        discoveredSignatures.add(new JoinPointSignature(firstDefiningMember, originalDeclaringType));
                } else {
-                       List<ResolvedType> declaringTypes = new ArrayList<ResolvedType>();
+                       List<ResolvedType> declaringTypes = new ArrayList<>();
                        accumulateTypesInBetween(originalDeclaringType, firstDefiningType, declaringTypes);
                        for (ResolvedType declaringType : declaringTypes) {
                                discoveredSignatures.add(new JoinPointSignature(firstDefiningMember, declaringType));
@@ -192,7 +192,7 @@ public class JoinPointSignatureIterator implements Iterator<JoinPointSignature>
                                ResolvedMemberImpl foundMember = (ResolvedMemberImpl) superType.lookupResolvedMember(firstDefiningMember, true,
                                                isProxy);
                                if (foundMember != null && isVisibleTo(firstDefiningMember, foundMember)) {
-                                       List<ResolvedType> declaringTypes = new ArrayList<ResolvedType>();
+                                       List<ResolvedType> declaringTypes = new ArrayList<>();
                                        // declaring type can be unresolved if the member can from an ITD...
                                        ResolvedType resolvedDeclaringType = foundMember.getDeclaringType().resolve(world);
                                        accumulateTypesInBetween(superType, resolvedDeclaringType, declaringTypes);
@@ -206,7 +206,7 @@ public class JoinPointSignatureIterator implements Iterator<JoinPointSignature>
                                                member = new JoinPointSignature(foundMember, declaringType);
                                                discoveredSignatures.add(member); // for next time we are reset
                                                if (additionalSignatures == Collections.EMPTY_LIST) {
-                                                       additionalSignatures = new ArrayList<JoinPointSignature>();
+                                                       additionalSignatures = new ArrayList<>();
                                                }
                                                additionalSignatures.add(member); // for this time
                                        }
@@ -216,12 +216,12 @@ public class JoinPointSignatureIterator implements Iterator<JoinPointSignature>
                                                                foundMember.declaringType.resolve(world));
                                                discoveredSignatures.add(member); // for next time we are reset
                                                if (additionalSignatures == Collections.EMPTY_LIST) {
-                                                       additionalSignatures = new ArrayList<JoinPointSignature>();
+                                                       additionalSignatures = new ArrayList<>();
                                                }
                                                additionalSignatures.add(member); // for this time
                                        }
                                        if (yetToBeProcessedSuperMembers == null) {
-                                               yetToBeProcessedSuperMembers = new ArrayList<SearchPair>();
+                                               yetToBeProcessedSuperMembers = new ArrayList<>();
                                        }
                                        yetToBeProcessedSuperMembers.add(new SearchPair(foundMember, superType));
                                        return true;
index 7307ab93c835f31cb62cfa81dde4448c9dc375cb..216186b26d2e5ac7b753c52514e4b3b12a18f284 100644 (file)
@@ -30,7 +30,7 @@ import org.aspectj.weaver.tools.Trace;
 import org.aspectj.weaver.tools.TraceFactory;
 
 public class Lint {
-       Map<String, Lint.Kind> kinds = new HashMap<String, Lint.Kind>();
+       Map<String, Lint.Kind> kinds = new HashMap<>();
        /* private */World world;
 
        public final Kind invalidAbsoluteTypeName = new Kind("invalidAbsoluteTypeName", "no match for this type name: {0}");
index 9e608c9adcc46756d777ca98d161d72f72265c5a..86caa48c5b8372fe9a21fbd8ed3bd0586ca96204 100644 (file)
@@ -155,7 +155,7 @@ public class MemberImpl implements Member {
        private static Object[] signatureToTypes(String sig) {
                boolean hasParameters = sig.charAt(1) != ')';
                if (hasParameters) {
-                       List<UnresolvedType> l = new ArrayList<UnresolvedType>();
+                       List<UnresolvedType> l = new ArrayList<>();
                        int i = 1;
                        boolean hasAnyAnglies = sig.indexOf('<') != -1;
                        while (true) {
@@ -442,7 +442,7 @@ public class MemberImpl implements Member {
 
        public Collection<ResolvedType> getDeclaringTypes(World world) {
                ResolvedType myType = getDeclaringType().resolve(world);
-               Collection<ResolvedType> ret = new HashSet<ResolvedType>();
+               Collection<ResolvedType> ret = new HashSet<>();
                if (kind == CONSTRUCTOR) {
                        // this is wrong if the member doesn't exist, but that doesn't
                        // matter
index aad9a1dbec65034cfcec4dea227817d9b1c5b4db..c40bf9f43a29b97b71bd8984ef79ac1e1b74f2e2 100644 (file)
@@ -42,7 +42,7 @@ public class ReferenceType extends ResolvedType {
         * swapped during incremental compilation, the delegate of the derivatives
         * is swapped also.
         */
-       private final List<WeakReference<ReferenceType>> derivativeTypes = new ArrayList<WeakReference<ReferenceType>>();
+       private final List<WeakReference<ReferenceType>> derivativeTypes = new ArrayList<>();
 
        /**
         * For parameterized types (or the raw type) - this field points to the
@@ -62,7 +62,7 @@ public class ReferenceType extends ResolvedType {
        ResolvedMember[] parameterizedMethods = null;
        ResolvedMember[] parameterizedFields = null;
        ResolvedMember[] parameterizedPointcuts = null;
-       WeakReference<ResolvedType[]> parameterizedInterfaces = new WeakReference<ResolvedType[]>(
+       WeakReference<ResolvedType[]> parameterizedInterfaces = new WeakReference<>(
                        null);
        Collection<Declare> parameterizedDeclares = null;
        // Collection parameterizedTypeMungers = null;
@@ -116,13 +116,13 @@ public class ReferenceType extends ResolvedType {
                // checkDuplicates(dependent);
                synchronized (derivativeTypes) {
                        this.derivativeTypes
-                                       .add(new WeakReference<ReferenceType>(dependent));
+                                       .add(new WeakReference<>(dependent));
                }
        }
 
        public void checkDuplicates(ReferenceType newRt) {
                synchronized (derivativeTypes) {
-                       List<WeakReference<ReferenceType>> forRemoval = new ArrayList<WeakReference<ReferenceType>>();
+                       List<WeakReference<ReferenceType>> forRemoval = new ArrayList<>();
                        for (WeakReference<ReferenceType> derivativeTypeReference : derivativeTypes) {
                                ReferenceType derivativeType = derivativeTypeReference.get();
                                if (derivativeType == null) {
@@ -756,7 +756,7 @@ public class ReferenceType extends ResolvedType {
                                        interfaces[i] = delegateInterfaces[i];
                                }
                        }
-                       parameterizedInterfaces = new WeakReference<ResolvedType[]>(
+                       parameterizedInterfaces = new WeakReference<>(
                                        interfaces);
                        return interfaces;
                } else if (isRawType()) {
@@ -778,12 +778,12 @@ public class ReferenceType extends ResolvedType {
                                                        .parameterizedWith(toUseForParameterization);
                                }
                        }
-                       parameterizedInterfaces = new WeakReference<ResolvedType[]>(
+                       parameterizedInterfaces = new WeakReference<>(
                                        interfaces);
                        return interfaces;
                }
                if (getDelegate().isCacheable()) {
-                       parameterizedInterfaces = new WeakReference<ResolvedType[]>(
+                       parameterizedInterfaces = new WeakReference<>(
                                        delegateInterfaces);
                }
                return delegateInterfaces;
@@ -937,7 +937,7 @@ public class ReferenceType extends ResolvedType {
                Collection<Declare> declares = null;
                if (ajMembersNeedParameterization()) {
                        Collection<Declare> genericDeclares = getDelegate().getDeclares();
-                       parameterizedDeclares = new ArrayList<Declare>();
+                       parameterizedDeclares = new ArrayList<>();
                        Map<String, UnresolvedType> parameterizationMap = getAjMemberParameterizationMap();
                        for (Declare declareStatement : genericDeclares) {
                                parameterizedDeclares.add(declareStatement.parameterizeWith(
@@ -968,7 +968,7 @@ public class ReferenceType extends ResolvedType {
                return getDelegate().getModifiers();
        }
 
-       WeakReference<ResolvedType> superclassReference = new WeakReference<ResolvedType>(
+       WeakReference<ResolvedType> superclassReference = new WeakReference<>(
                        null);
 
        @Override
@@ -984,7 +984,7 @@ public class ReferenceType extends ResolvedType {
                                                getMemberParameterizationMap()).resolve(getWorld());
                        }
                        if (getDelegate().isCacheable()) {
-                               superclassReference = new WeakReference<ResolvedType>(ret);
+                               superclassReference = new WeakReference<>(ret);
                        }
                        return newSuperclass;
                }
@@ -999,7 +999,7 @@ public class ReferenceType extends ResolvedType {
                                        getWorld());
                }
                if (getDelegate().isCacheable()) {
-                       superclassReference = new WeakReference<ResolvedType>(ret);
+                       superclassReference = new WeakReference<>(ret);
                }
                return ret;
        }
@@ -1019,7 +1019,7 @@ public class ReferenceType extends ResolvedType {
                }
                this.delegate = delegate;
                synchronized (derivativeTypes) {
-                       List<WeakReference<ReferenceType>> forRemoval = new ArrayList<WeakReference<ReferenceType>>();
+                       List<WeakReference<ReferenceType>> forRemoval = new ArrayList<>();
                        for (WeakReference<ReferenceType> derivativeRef : derivativeTypes) {
                                ReferenceType derivative = derivativeRef.get();
                                if (derivative != null) {
@@ -1048,7 +1048,7 @@ public class ReferenceType extends ResolvedType {
                parameterizedInterfaces.clear();
                parameterizedMethods = null;
                parameterizedPointcuts = null;
-               superclassReference = new WeakReference<ResolvedType>(null);
+               superclassReference = new WeakReference<>(null);
        }
 
        public int getEndPos() {
@@ -1171,7 +1171,7 @@ public class ReferenceType extends ResolvedType {
                newInterfaces = null;
                typeVariables = null;
                parameterizedInterfaces.clear();
-               superclassReference = new WeakReference<ResolvedType>(null);
+               superclassReference = new WeakReference<>(null);
                if (getDelegate() != null) {
                        delegate.ensureConsistent();
                }
@@ -1192,7 +1192,7 @@ public class ReferenceType extends ResolvedType {
                }
                if (newParent.isClass()) {
                        newSuperclass = newParent;
-                       superclassReference = new WeakReference<ResolvedType>(null);
+                       superclassReference = new WeakReference<>(null);
                } else {
                        if (newInterfaces == null) {
                                newInterfaces = new ResolvedType[1];
@@ -1253,7 +1253,7 @@ public class ReferenceType extends ResolvedType {
         */
        public ReferenceType findDerivativeType(ResolvedType[] typeParameters) {
                synchronized (derivativeTypes) {
-                       List<WeakReference<ReferenceType>> forRemoval = new ArrayList<WeakReference<ReferenceType>>();
+                       List<WeakReference<ReferenceType>> forRemoval = new ArrayList<>();
                        for (WeakReference<ReferenceType> derivativeTypeRef : derivativeTypes) {
                                ReferenceType derivativeType = derivativeTypeRef.get();
                                if (derivativeType == null) {
index bb609f104c506fea2e95a7a30880d67aa63edc3e..6a12cdd11246b6a61d3bcbf83dee3a198b0646ad 100644 (file)
@@ -123,9 +123,9 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Reso
                        // }
                }
 
-               List<ResolvedType> declaringTypes = new ArrayList<ResolvedType>();
+               List<ResolvedType> declaringTypes = new ArrayList<>();
                accumulateTypesInBetween(originalDeclaringType, firstDefiningType, declaringTypes);
-               Set<ResolvedMember> memberSignatures = new LinkedHashSet<ResolvedMember>();
+               Set<ResolvedMember> memberSignatures = new LinkedHashSet<>();
                for (ResolvedType declaringType : declaringTypes) {
                        memberSignatures.add(new JoinPointSignature(firstDefiningMember, declaringType));
                }
@@ -136,7 +136,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Reso
                        // every type between the firstDefiningMember and the root defining
                        // member.
                        Iterator<ResolvedType> superTypeIterator = firstDefiningType.getDirectSupertypes();
-                       List<ResolvedType> typesAlreadyVisited = new ArrayList<ResolvedType>();
+                       List<ResolvedType> typesAlreadyVisited = new ArrayList<>();
                        accumulateMembersMatching(firstDefiningMember, superTypeIterator, typesAlreadyVisited, memberSignatures, false);
                }
 
@@ -188,7 +188,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Reso
                                ResolvedMemberImpl foundMember = (ResolvedMemberImpl) toLookIn.lookupResolvedMember(memberToMatch, true,
                                                ignoreGenerics);
                                if (foundMember != null && isVisibleTo(memberToMatch, foundMember)) {
-                                       List<ResolvedType> declaringTypes = new ArrayList<ResolvedType>();
+                                       List<ResolvedType> declaringTypes = new ArrayList<>();
                                        // declaring type can be unresolved if the member can from
                                        // an ITD...
                                        ResolvedType resolvedDeclaringType = foundMember.getDeclaringType().resolve(toLookIn.getWorld());
@@ -763,7 +763,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Reso
                if (isParameterized && (typeVariables.length != typeParameters.length)) {
                        throw new IllegalStateException("Wrong number of type parameters supplied");
                }
-               Map<String, UnresolvedType> typeMap = new HashMap<String, UnresolvedType>();
+               Map<String, UnresolvedType> typeMap = new HashMap<>();
                boolean typeParametersSupplied = typeParameters != null && typeParameters.length > 0;
                if (typeVariables != null) {
                        // If no 'replacements' were supplied in the typeParameters array
@@ -1058,7 +1058,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Reso
                StringBuffer sig = new StringBuffer();
                UnresolvedType[] myParameterTypes = getGenericParameterTypes();
                for (UnresolvedType myParameterType : myParameterTypes) {
-                       appendSigWithTypeVarBoundsRemoved(myParameterType, sig, new HashSet<UnresolvedType>());
+                       appendSigWithTypeVarBoundsRemoved(myParameterType, sig, new HashSet<>());
                }
                myParameterSignatureWithBoundsRemoved = sig.toString();
                return myParameterSignatureWithBoundsRemoved;
index 8e48b02d467cf44aebcf36baa79d68edd2050641..3d88279af0b1b029dad74ad6043773894ea134bf 100644 (file)
@@ -156,7 +156,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
        // This set contains pairs of types whose signatures are concatenated
        // together, this means with a fast lookup we can tell if two types
        // are equivalent.
-       protected static Set<String> validBoxing = new HashSet<String>();
+       protected static Set<String> validBoxing = new HashSet<>();
 
        static {
                validBoxing.add("Ljava/lang/Byte;B");
@@ -327,7 +327,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
        public Iterator<ResolvedType> getHierarchy(final boolean wantGenerics, final boolean wantDeclaredParents) {
 
                final Iterators.Getter<ResolvedType, ResolvedType> interfaceGetter = new Iterators.Getter<ResolvedType, ResolvedType>() {
-                       List<String> alreadySeen = new ArrayList<String>(); // Strings are signatures (ResolvedType.getSignature())
+                       List<String> alreadySeen = new ArrayList<>(); // Strings are signatures (ResolvedType.getSignature())
 
                        @Override
                        public Iterator<ResolvedType> get(ResolvedType type) {
@@ -337,7 +337,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                                // relatively expensive but hopefully uncommon
                                if (!wantDeclaredParents && type.hasNewParentMungers()) {
                                        // Throw away interfaces from that array if they were decp'd onto here
-                                       List<Integer> forRemoval = new ArrayList<Integer>();
+                                       List<Integer> forRemoval = new ArrayList<>();
                                        for (ConcreteTypeMunger munger : type.interTypeMungers) {
                                                if (munger.getMunger() != null) {
                                                        ResolvedTypeMunger m = munger.getMunger();
@@ -391,8 +391,8 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
         * declared on the superinterfaces. This is expensive - use the getMethods() method if you can!
         */
        public List<ResolvedMember> getMethodsWithoutIterator(boolean includeITDs, boolean allowMissing, boolean genericsAware) {
-               List<ResolvedMember> methods = new ArrayList<ResolvedMember>();
-               Set<String> knowninterfaces = new HashSet<String>();
+               List<ResolvedMember> methods = new ArrayList<>();
+               Set<String> knowninterfaces = new HashSet<>();
                addAndRecurse(knowninterfaces, methods, this, includeITDs, allowMissing, genericsAware);
                return methods;
        }
@@ -405,8 +405,8 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
         * @return list of resolvedtypes in this types hierarchy, including this type first
         */
        public List<ResolvedType> getHierarchyWithoutIterator(boolean includeITDs, boolean allowMissing, boolean genericsAware) {
-               List<ResolvedType> types = new ArrayList<ResolvedType>();
-               Set<String> visited = new HashSet<String>();
+               List<ResolvedType> types = new ArrayList<>();
+               Set<String> visited = new HashSet<>();
                recurseHierarchy(visited, types, this, includeITDs, allowMissing, genericsAware);
                return types;
        }
@@ -554,7 +554,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
         * process interfaces multiple times.
         */
        public ResolvedMember lookupMethod(Member m) {
-               List<ResolvedType> typesTolookat = new ArrayList<ResolvedType>();
+               List<ResolvedType> typesTolookat = new ArrayList<>();
                typesTolookat.add(this);
                int pos = 0;
                while (pos < typesTolookat.size()) {
@@ -807,7 +807,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                        return Collections.emptyList();
                }
 
-               List<Declare> ret = new ArrayList<Declare>();
+               List<Declare> ret = new ArrayList<>();
                // if (this.isAbstract()) {
                // for (Iterator i = getDeclares().iterator(); i.hasNext();) {
                // Declare dec = (Declare) i.next();
@@ -850,7 +850,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                        return Collections.emptyList();
                }
 
-               List<ShadowMunger> acc = new ArrayList<ShadowMunger>();
+               List<ShadowMunger> acc = new ArrayList<>();
                final Iterators.Filter<ResolvedType> dupFilter = Iterators.dupFilter();
                Iterators.Getter<ResolvedType, ResolvedType> typeGetter = new Iterators.Getter<ResolvedType, ResolvedType>() {
                        @Override
@@ -987,7 +987,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                        return Collections.emptyMap();
                }
                TypeVariable[] tvs = getGenericType().getTypeVariables();
-               Map<String, UnresolvedType> parameterizationMap = new HashMap<String, UnresolvedType>();
+               Map<String, UnresolvedType> parameterizationMap = new HashMap<>();
                if (tvs.length != typeParameters.length) {
                        world.getMessageHandler()
                                        .handleMessage(
@@ -1021,7 +1021,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
        }
 
        public List<ShadowMunger> getDeclaredAdvice() {
-               List<ShadowMunger> l = new ArrayList<ShadowMunger>();
+               List<ShadowMunger> l = new ArrayList<>();
                ResolvedMember[] methods = getDeclaredMethods();
                if (isParameterizedType()) {
                        methods = getGenericType().getDeclaredMethods();
@@ -1076,7 +1076,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
        }
 
        private ResolvedMember[] filterInJavaVisible(ResolvedMember[] ms) {
-               List<ResolvedMember> l = new ArrayList<ResolvedMember>();
+               List<ResolvedMember> l = new ArrayList<>();
                for (ResolvedMember m : ms) {
                        if (!m.isAjSynthetic() && m.getAssociatedShadowMunger() == null) {
                                l.add(m);
@@ -1405,14 +1405,14 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                return ret;
        }
 
-       protected List<ConcreteTypeMunger> interTypeMungers = new ArrayList<ConcreteTypeMunger>();
+       protected List<ConcreteTypeMunger> interTypeMungers = new ArrayList<>();
 
        public List<ConcreteTypeMunger> getInterTypeMungers() {
                return interTypeMungers;
        }
 
        public List<ConcreteTypeMunger> getInterTypeParentMungers() {
-               List<ConcreteTypeMunger> l = new ArrayList<ConcreteTypeMunger>();
+               List<ConcreteTypeMunger> l = new ArrayList<>();
                for (ConcreteTypeMunger element : interTypeMungers) {
                        if (element.getMunger() instanceof NewParentTypeMunger) {
                                l.add(element);
@@ -1425,13 +1425,13 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
         * ??? This method is O(N*M) where N = number of methods and M is number of inter-type declarations in my super
         */
        public List<ConcreteTypeMunger> getInterTypeMungersIncludingSupers() {
-               ArrayList<ConcreteTypeMunger> ret = new ArrayList<ConcreteTypeMunger>();
+               ArrayList<ConcreteTypeMunger> ret = new ArrayList<>();
                collectInterTypeMungers(ret);
                return ret;
        }
 
        public List<ConcreteTypeMunger> getInterTypeParentMungersIncludingSupers() {
-               ArrayList<ConcreteTypeMunger> ret = new ArrayList<ConcreteTypeMunger>();
+               ArrayList<ConcreteTypeMunger> ret = new ArrayList<>();
                collectInterTypeParentMungers(ret);
                return ret;
        }
@@ -2311,8 +2311,8 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
 
                private Getter<ResolvedType, ResolvedType> ifaceGetter;
                Iterator<ResolvedType> delegate = null;
-               public Queue<ResolvedType> toPersue = new LinkedList<ResolvedType>();
-               public Set<ResolvedType> visited = new HashSet<ResolvedType>();
+               public Queue<ResolvedType> toPersue = new LinkedList<>();
+               public Set<ResolvedType> visited = new HashSet<>();
 
                SuperInterfaceWalker(Iterators.Getter<ResolvedType, ResolvedType> ifaceGetter) {
                        this.ifaceGetter = ifaceGetter;
@@ -2373,7 +2373,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                }
                // interTypeMungers.clear();
                // BUG? Why can't this be clear() instead: 293620 c6
-               interTypeMungers = new ArrayList<ConcreteTypeMunger>();
+               interTypeMungers = new ArrayList<>();
        }
 
        public boolean isTopmostImplementor(ResolvedType interfaceType) {
@@ -2410,7 +2410,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
        }
 
        public List<ResolvedMember> getExposedPointcuts() {
-               List<ResolvedMember> ret = new ArrayList<ResolvedMember>();
+               List<ResolvedMember> ret = new ArrayList<>();
                if (getSuperclass() != null) {
                        ret.addAll(getSuperclass().getExposedPointcuts());
                }
index 86e06e767ee7446a1a68a8d7bcf6d84aed3532a0..c5b5645fe7addd8ba1cddfd617fb48629df354c2 100644 (file)
@@ -168,7 +168,7 @@ public abstract class ResolvedTypeMunger {
        }
 
        protected static Set<ResolvedMember> readSuperMethodsCalled(VersionedDataInputStream s) throws IOException {
-               Set<ResolvedMember> ret = new HashSet<ResolvedMember>();
+               Set<ResolvedMember> ret = new HashSet<>();
                int n = -1;
                if (s.isAtLeast169()) {
                        n = s.readByte();
@@ -189,7 +189,7 @@ public abstract class ResolvedTypeMunger {
                        s.writeByte(0);
                        return;
                }
-               List<ResolvedMember> ret = new ArrayList<ResolvedMember>(superMethodsCalled);
+               List<ResolvedMember> ret = new ArrayList<>(superMethodsCalled);
                Collections.sort(ret);
                int n = ret.size();
                s.writeByte(n);
@@ -378,7 +378,7 @@ public abstract class ResolvedTypeMunger {
                                count = s.readInt();
                        }
                        if (count != 0) {
-                               List<String> aliases = new ArrayList<String>();
+                               List<String> aliases = new ArrayList<>();
                                for (int i = 0; i < count; i++) {
                                        aliases.add(s.readUTF());
                                }
index 1892e8940b1e9c4bed58828016d83dace6b7d8cf..b48b874897936587538f9261d5dc415fd68b535b 100644 (file)
@@ -533,7 +533,7 @@ public abstract class Shadow {
        public void addMunger(ShadowMunger munger) {
                if (checkMunger(munger)) {
                        if (mungers == Collections.EMPTY_LIST) {
-                               mungers = new ArrayList<ShadowMunger>();
+                               mungers = new ArrayList<>();
                        }
                        this.mungers.add(munger);
                }
@@ -571,7 +571,7 @@ public abstract class Shadow {
 
                        // Stores a set of strings of the form 'aspect1:aspect2' which indicates there is no
                        // precedence specified between the two aspects at this shadow.
-                       Set<String> clashingAspects = new HashSet<String>();
+                       Set<String> clashingAspects = new HashSet<>();
                        int max = mungers.size();
 
                        // Compare every pair of advice mungers
@@ -688,7 +688,7 @@ public abstract class Shadow {
         * manipulation!
         */
        public static Set<Kind> toSet(int i) {
-               Set<Kind> results = new HashSet<Kind>();
+               Set<Kind> results = new HashSet<>();
                for (int j = 0; j < Shadow.SHADOW_KINDS.length; j++) {
                        Kind k = Shadow.SHADOW_KINDS[j];
                        if (k.isSet(i)) {
index 809cc58de92fcda46791489323f3cfbd14358540..3a2a3a74071f41463a64bd60c8db03c80ef1613f 100644 (file)
@@ -93,7 +93,7 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH
                                                                                + "' due to scope exclusion in XML definition"));
                                        }
                                        if (excludedTypes == null) {
-                                               excludedTypes = new HashSet<ResolvedType>();
+                                               excludedTypes = new HashSet<>();
                                                excludedTypes.add(type);
                                                world.getExclusionMap().put(declaringType, excludedTypes);
                                        } else {
index 5c898552dfbf335c6739f5224ca9fb488b895d76..4ec4c14c3fd23f630dc84a709631b371a599b0b6 100644 (file)
@@ -116,7 +116,7 @@ public class StandardAnnotation extends AbstractAnnotationAJ {
                AnnotationNameValuePair nvp = nvPairs.get(0);
                ArrayAnnotationValue aav = (ArrayAnnotationValue) nvp.getValue();
                AnnotationValue[] avs = aav.getValues();
-               Set<String> targets = new HashSet<String>();
+               Set<String> targets = new HashSet<>();
                for (AnnotationValue av : avs) {
                        EnumAnnotationValue value = (EnumAnnotationValue) av;
                        targets.add(value.getValue());
@@ -134,7 +134,7 @@ public class StandardAnnotation extends AbstractAnnotationAJ {
 
        public void addNameValuePair(AnnotationNameValuePair pair) {
                if (nvPairs == null) {
-                       nvPairs = new ArrayList<AnnotationNameValuePair>();
+                       nvPairs = new ArrayList<>();
                }
                nvPairs.add(pair);
        }
index 2a578e392808e87af46637e929aebff1f45c4090..72163e024c60dfaf56c7733e7c3c8c5975aa97b2 100644 (file)
@@ -289,7 +289,7 @@ public class TypeFactory {
 
        private static UnresolvedType[] createTypeParams(String typeParameterSpecification) {
                String remainingToProcess = typeParameterSpecification;
-               List<UnresolvedType> types = new ArrayList<UnresolvedType>();
+               List<UnresolvedType> types = new ArrayList<>();
                while (remainingToProcess.length() != 0) {
                        int endOfSig = 0;
                        int anglies = 0;
index f0dcbf27028031ca2c3a9e86aa36fdd6f9bea4d0..62158cb9a5445f1dc6b12a3943a8129546b0b161 100644 (file)
@@ -89,7 +89,7 @@ public class WeaverStateInfo {
        }
 
        public WeaverStateInfo(boolean reweavable) {
-               this(new ArrayList<Entry>(), false, reweavable, reweavableCompressedModeDefault, reweavableDiffModeDefault);
+               this(new ArrayList<>(), false, reweavable, reweavableCompressedModeDefault, reweavableDiffModeDefault);
        }
 
        private WeaverStateInfo(List<Entry> typeMungers, boolean oldStyle, boolean reweavableMode, boolean reweavableCompressedMode,
@@ -99,7 +99,7 @@ public class WeaverStateInfo {
                this.reweavable = reweavableMode;
                this.reweavableCompressedMode = reweavableCompressedMode;
                this.reweavableDiffMode = reweavableMode ? reweavableDiffMode : false;
-               this.aspectsAffectingType = new HashSet<String>();
+               this.aspectsAffectingType = new HashSet<>();
                this.unwovenClassFile = null;
        }
 
@@ -147,7 +147,7 @@ public class WeaverStateInfo {
                        }
 
                        int n = s.readShort();
-                       List<Entry> l = new ArrayList<Entry>();
+                       List<Entry> l = new ArrayList<>();
                        for (int i = 0; i < n; i++) {
                                // conditional on version
                                UnresolvedType aspectType = null;
@@ -257,7 +257,7 @@ public class WeaverStateInfo {
 
        public List<ConcreteTypeMunger> getTypeMungers(ResolvedType onType) {
                World world = onType.getWorld();
-               List<ConcreteTypeMunger> ret = new ArrayList<ConcreteTypeMunger>();
+               List<ConcreteTypeMunger> ret = new ArrayList<>();
                for (Entry entry : typeMungers) {
                        ResolvedType aspectType = world.resolve(entry.aspectType, true);
                        if (aspectType.isMissing()) {
index b2af422ff082f6c2a283a6980a310772c2d1fcc8..671693e3067556f6daa23145009f05b9e628483b 100644 (file)
@@ -378,7 +378,7 @@ public abstract class World implements Dump.INode {
                // MessageUtil.error(messageHandler,
                // WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE,ty.getName()));
                if (dumpState_cantFindTypeExceptions == null) {
-                       dumpState_cantFindTypeExceptions = new ArrayList<RuntimeException>();
+                       dumpState_cantFindTypeExceptions = new ArrayList<>();
                }
                if (dumpState_cantFindTypeExceptions.size() < 100) { // limit growth
                        dumpState_cantFindTypeExceptions.add(new RuntimeException("Can't find type " + ty.getName()));
@@ -1045,11 +1045,11 @@ public abstract class World implements Dump.INode {
                public int policy = USE_WEAK_REFS;
 
                // Map of types that never get thrown away
-               final Map<String, ResolvedType> tMap = new HashMap<String, ResolvedType>();
+               final Map<String, ResolvedType> tMap = new HashMap<>();
 
                // Map of types that may be ejected from the cache if we need space
                final Map<String, Reference<ResolvedType>> expendableMap = Collections
-                               .synchronizedMap(new WeakHashMap<String, Reference<ResolvedType>>());
+                               .synchronizedMap(new WeakHashMap<>());
 
                private final World w;
 
@@ -1057,13 +1057,13 @@ public abstract class World implements Dump.INode {
                private boolean memoryProfiling = false;
                private int maxExpendableMapSize = -1;
                private int collectedTypes = 0;
-               private final ReferenceQueue<ResolvedType> rq = new ReferenceQueue<ResolvedType>();
+               private final ReferenceQueue<ResolvedType> rq = new ReferenceQueue<>();
 
                TypeMap(World w) {
                        // Demotion activated when switched on and loadtime weaving or in AJDT
                        demotionSystemActive = w.isDemotionActive() && (w.isLoadtimeWeaving() || w.couldIncrementalCompileFollow());
-                       addedSinceLastDemote = new ArrayList<String>();
-                       writtenClasses = new ArrayList<String>();
+                       addedSinceLastDemote = new ArrayList<>();
+                       writtenClasses = new ArrayList<>();
                        this.w = w;
                        memoryProfiling = false;// !w.getMessageHandler().isIgnoring(Message.INFO);
                }
@@ -1115,7 +1115,7 @@ public abstract class World implements Dump.INode {
                                addedSinceLastDemote.clear();
                        } else {
                                // Compile time demotion strategy
-                               List<String> forRemoval = new ArrayList<String>();
+                               List<String> forRemoval = new ArrayList<>();
                                for (String key : addedSinceLastDemote) {
                                        ResolvedType type = tMap.get(key);
                                        if (type == null) {
@@ -1189,9 +1189,9 @@ public abstract class World implements Dump.INode {
                                        // might be GC'd independently.
                                        expendableMap.remove(key);
                                        if (policy == USE_SOFT_REFS) {
-                                               expendableMap.put(key, new SoftReference<ResolvedType>(type));
+                                               expendableMap.put(key, new SoftReference<>(type));
                                        } else {
-                                               expendableMap.put(key, new WeakReference<ResolvedType>(type));
+                                               expendableMap.put(key, new WeakReference<>(type));
                                        }
                                }
                        }
@@ -1265,15 +1265,15 @@ public abstract class World implements Dump.INode {
                                        // Dont use reference queue for tracking if not profiling...
                                        if (policy == USE_WEAK_REFS) {
                                                if (memoryProfiling) {
-                                                       expendableMap.put(key, new WeakReference<ResolvedType>(type, rq));
+                                                       expendableMap.put(key, new WeakReference<>(type, rq));
                                                } else {
-                                                       expendableMap.put(key, new WeakReference<ResolvedType>(type));
+                                                       expendableMap.put(key, new WeakReference<>(type));
                                                }
                                        } else if (policy == USE_SOFT_REFS) {
                                                if (memoryProfiling) {
-                                                       expendableMap.put(key, new SoftReference<ResolvedType>(type, rq));
+                                                       expendableMap.put(key, new SoftReference<>(type, rq));
                                                } else {
-                                                       expendableMap.put(key, new SoftReference<ResolvedType>(type));
+                                                       expendableMap.put(key, new SoftReference<>(type));
                                                }
                                                // } else {
                                                // expendableMap.put(key, type);
@@ -1418,7 +1418,7 @@ public abstract class World implements Dump.INode {
 
                public AspectPrecedenceCalculator(World forSomeWorld) {
                        world = forSomeWorld;
-                       cachedResults = new HashMap<PrecedenceCacheKey, Integer>();
+                       cachedResults = new HashMap<>();
                }
 
                /**
@@ -1521,7 +1521,7 @@ public abstract class World implements Dump.INode {
        // --- I would rather stash this against a reference type - but we don't
        // guarantee referencetypes are unique for
        // so we can't :(
-       private final Map<Class<?>, TypeVariable[]> workInProgress1 = new HashMap<Class<?>, TypeVariable[]>();
+       private final Map<Class<?>, TypeVariable[]> workInProgress1 = new HashMap<>();
 
        public TypeVariable[] getTypeVariablesCurrentlyBeingProcessed(Class<?> baseClass) {
                return workInProgress1.get(baseClass);
@@ -1756,7 +1756,7 @@ public abstract class World implements Dump.INode {
         */
        public void registerPointcutHandler(PointcutDesignatorHandler designatorHandler) {
                if (pointcutDesignators == null) {
-                       pointcutDesignators = new HashSet<PointcutDesignatorHandler>();
+                       pointcutDesignators = new HashSet<>();
                }
                pointcutDesignators.add(designatorHandler);
        }
@@ -1841,7 +1841,7 @@ public abstract class World implements Dump.INode {
 
        // map from aspect > excluded types
        // memory issue here?
-       private Map<ResolvedType, Set<ResolvedType>> exclusionMap = new HashMap<ResolvedType, Set<ResolvedType>>();
+       private Map<ResolvedType, Set<ResolvedType>> exclusionMap = new HashMap<>();
 
        public Map<ResolvedType, Set<ResolvedType>> getExclusionMap() {
                return exclusionMap;
@@ -1886,10 +1886,10 @@ public abstract class World implements Dump.INode {
                long typeCount;
                long perJoinpointCount;
                long perTypes;
-               Map<String, Long> joinpointsPerPointcut = new HashMap<String, Long>();
-               Map<String, Long> timePerPointcut = new HashMap<String, Long>();
-               Map<String, Long> fastMatchTimesPerPointcut = new HashMap<String, Long>();
-               Map<String, Long> fastMatchTypesPerPointcut = new HashMap<String, Long>();
+               Map<String, Long> joinpointsPerPointcut = new HashMap<>();
+               Map<String, Long> timePerPointcut = new HashMap<>();
+               Map<String, Long> fastMatchTimesPerPointcut = new HashMap<>();
+               Map<String, Long> fastMatchTypesPerPointcut = new HashMap<>();
 
                TimeCollector(World world) {
                        this.perJoinpointCount = world.timersPerJoinpoint;
@@ -1897,8 +1897,8 @@ public abstract class World implements Dump.INode {
                        this.world = world;
                        this.joinpointCount = 0;
                        this.typeCount = 0;
-                       this.joinpointsPerPointcut = new HashMap<String, Long>();
-                       this.timePerPointcut = new HashMap<String, Long>();
+                       this.joinpointsPerPointcut = new HashMap<>();
+                       this.timePerPointcut = new HashMap<>();
                }
 
                public void report() {
index c059953776e9d94b4274ea538c9d3b975b92b083..b374eea5ad4281f663eba3cf2922a4d10a574b7a 100644 (file)
@@ -46,7 +46,7 @@ public class AndSignaturePattern extends AbstractSignaturePattern {
 
        public List<ExactTypePattern> getExactDeclaringTypes() {
                if (exactDeclaringTypes == null) {
-                       exactDeclaringTypes = new ArrayList<ExactTypePattern>();
+                       exactDeclaringTypes = new ArrayList<>();
                        exactDeclaringTypes.addAll(leftSp.getExactDeclaringTypes());
                        exactDeclaringTypes.addAll(rightSp.getExactDeclaringTypes());
                }
index 2f70523cd4d9fd2ee293aaf0fcd813a0876078b4..7f7abd1e93c0e04360a58d22ffa3de5e36e7c145 100644 (file)
@@ -263,7 +263,7 @@ public class AnnotationPointcut extends NameBindingPointcut {
        @Override
        public List<BindingPattern> getBindingAnnotationTypePatterns() {
                if (annotationTypePattern instanceof BindingPattern) { // BindingAnnotationTypePattern) {
-                       List<BindingPattern> l = new ArrayList<BindingPattern>();
+                       List<BindingPattern> l = new ArrayList<>();
                        l.add((BindingPattern)annotationTypePattern);
                        return l;
                } else {
index f7351b5d79dc0112d57293cbb443fb2e837e7ff2..349ebef79acb1fdeb069f30cad1a8fb07a2c7ee5 100644 (file)
@@ -180,7 +180,7 @@ public class ArgsAnnotationPointcut extends NameBindingPointcut {
        }
 
        public List<BindingPattern> getBindingAnnotationTypePatterns() {
-               List<BindingPattern> l = new ArrayList<BindingPattern>();
+               List<BindingPattern> l = new ArrayList<>();
                AnnotationTypePattern[] pats = arguments.getAnnotationPatterns();
                for (AnnotationTypePattern pat : pats) {
                        if (pat instanceof BindingAnnotationTypePattern) {
index 98c78d54d3a02c83a5eced3a62757360e5b50a1e..0522bb13c860f0e6f8a26665cddd21d3c77432dc 100644 (file)
@@ -122,7 +122,7 @@ public class ArgsPointcut extends NameBindingPointcut {
        }
 
        public List<BindingTypePattern> getBindingTypePatterns() {
-               List<BindingTypePattern> l = new ArrayList<BindingTypePattern>();
+               List<BindingTypePattern> l = new ArrayList<>();
                TypePattern[] pats = arguments.getTypePatterns();
                for (TypePattern pat : pats) {
                        if (pat instanceof BindingTypePattern) {
index 0a099529b699a20cf39a85d319e448e1e57f99e4..ef537d8072b43de75faccf3c7b1a6b614977bed0 100644 (file)
@@ -84,7 +84,7 @@ public class BasicTokenSource implements ITokenSource {
                char[] chars = input.toCharArray();
                
                int i = 0;
-               List<BasicToken> tokens = new ArrayList<BasicToken>();
+               List<BasicToken> tokens = new ArrayList<>();
                
                while (i < chars.length) {
                        char ch = chars[i++];                   
index a83236e5cdd5ca047bc8bc81af1540669fd41434..b283a845fac2fa9ee6e1ffea05597f3381efe6b5 100644 (file)
@@ -194,7 +194,7 @@ public class CflowPointcut extends Pointcut {
                        entryBindings.popEnclosingDefinitition();
                }
 
-               List<ShadowMunger> innerCflowEntries = new ArrayList<ShadowMunger>(xcut.getCflowEntries());
+               List<ShadowMunger> innerCflowEntries = new ArrayList<>(xcut.getCflowEntries());
                innerCflowEntries.removeAll(previousCflowEntries);
 
                // Four routes of interest through this code (did I hear someone say
@@ -248,7 +248,7 @@ public class CflowPointcut extends Pointcut {
                        return ret;
                } else {
 
-                       List<Slot> slots = new ArrayList<Slot>();
+                       List<Slot> slots = new ArrayList<>();
 
                        for (int i = 0, len = freeVars.length; i < len; i++) {
                                int freeVar = freeVars[i];
index ba1d2941513d078f3b03b7924ee55110d98bab04..8f7b266486c5efbf0e3161c8ede6b49b2bd02271 100644 (file)
@@ -77,9 +77,9 @@ public class DeclareAnnotation extends Declare {
        }
 
        private void init() {
-               this.annotationMethods = new ArrayList<String>();
+               this.annotationMethods = new ArrayList<>();
                annotationMethods.add("unknown");
-               this.annotationStrings = new ArrayList<String>();
+               this.annotationStrings = new ArrayList<>();
                annotationStrings.add("@<annotation>");
        }
 
index 53553afb35d6296db22e9040abad76c2b788369a..440a9ce5d774bb7c9fbeaed8359e8eca07538c32 100644 (file)
@@ -342,7 +342,7 @@ public class DeclareParents extends Declare {
                        return Collections.emptyList();
                }
 
-               List<ResolvedType> ret = new ArrayList<ResolvedType>();
+               List<ResolvedType> ret = new ArrayList<>();
                for (int i = 0; i < parents.size(); i++) {
                        ResolvedType t = maybeGetNewParent(onType, parents.get(i), onType.getWorld(), reportErrors);
                        if (t != null) {
index 8105a4f1d9b8715d5388c165b2cb963c47a74ac5..6903b9b83765727ffaaaa25ac449c6c56265d295 100644 (file)
@@ -411,7 +411,7 @@ public class ExactAnnotationTypePattern extends AnnotationTypePattern {
                if (s.getMajorVersion() >= WeaverVersionInfo.WEAVER_VERSION_MAJOR_AJ160M2) {
                        int annotationValueCount = s.readInt();
                        if (annotationValueCount > 0) {
-                               Map<String, String> aValues = new HashMap<String, String>();
+                               Map<String, String> aValues = new HashMap<>();
                                for (int i = 0; i < annotationValueCount; i++) {
                                        String key = s.readUTF();
                                        String val = s.readUTF();
index d54ad29abffa882ea2ae837ecaed978a5b8c7c0e..b439de2774b3efa4d9064d19b66787009300bd17 100644 (file)
@@ -40,7 +40,7 @@ public class ExactTypePattern extends TypePattern {
        private static final Map<String, Class<?>> boxedTypesMap;
 
        static {
-               primitiveTypesMap = new HashMap<String, Class<?>>();
+               primitiveTypesMap = new HashMap<>();
                primitiveTypesMap.put("int", int.class);
                primitiveTypesMap.put("short", short.class);
                primitiveTypesMap.put("long", long.class);
@@ -49,7 +49,7 @@ public class ExactTypePattern extends TypePattern {
                primitiveTypesMap.put("float", float.class);
                primitiveTypesMap.put("double", double.class);
 
-               boxedPrimitivesMap = new HashMap<String, Class<?>>();
+               boxedPrimitivesMap = new HashMap<>();
                boxedPrimitivesMap.put("java.lang.Integer", Integer.class);
                boxedPrimitivesMap.put("java.lang.Short", Short.class);
                boxedPrimitivesMap.put("java.lang.Long", Long.class);
@@ -58,7 +58,7 @@ public class ExactTypePattern extends TypePattern {
                boxedPrimitivesMap.put("java.lang.Float", Float.class);
                boxedPrimitivesMap.put("java.lang.Double", Double.class);
 
-               boxedTypesMap = new HashMap<String, Class<?>>();
+               boxedTypesMap = new HashMap<>();
                boxedTypesMap.put("int", Integer.class);
                boxedTypesMap.put("short", Short.class);
                boxedTypesMap.put("long", Long.class);
index a845153f98da1f0ec0cc8f5c195406bd84b5203c..8c2cb36b92d5538234893369c3c616f9b010e5fe 100644 (file)
@@ -191,7 +191,7 @@ public class IfPointcut extends Pointcut {
                        }
 
                        Test ret = Literal.TRUE;
-                       List<Var> args = new ArrayList<Var>();
+                       List<Var> args = new ArrayList<>();
 
                        // code style
                        if (extraParameterFlags >= 0) {
index d4b747af39b8af5598720d53a267796914bbd543..259edfab192c9bd61f232d80c255bc654b7431d3 100644 (file)
@@ -29,7 +29,7 @@ public class ModifiersPattern extends PatternNode {
        private static Map<String, Integer> modifierFlags = null;
 
        static {
-               modifierFlags = new HashMap<String, Integer>();
+               modifierFlags = new HashMap<>();
                int flag = 1;
                while (flag <= Modifier.STRICT) {
                        String flagName = Modifier.toString(flag);
index 67346f444e17e10c0b58b5b98c1162d3a5b703c0..13244f70e4f2613980864a3ac91b0c59b5b967c3 100644 (file)
@@ -46,7 +46,7 @@ public class OrSignaturePattern extends AbstractSignaturePattern {
 
        public List<ExactTypePattern> getExactDeclaringTypes() {
                if (exactDeclaringTypes == null) {
-                       exactDeclaringTypes = new ArrayList<ExactTypePattern>();
+                       exactDeclaringTypes = new ArrayList<>();
                        exactDeclaringTypes.addAll(leftSp.getExactDeclaringTypes());
                        exactDeclaringTypes.addAll(rightSp.getExactDeclaringTypes());
                }
index effecfeafc64fe901ad730bcba2b89cd51e546d5..c329ba88ef79338acbcd4631b9c483ce21ee419b 100644 (file)
@@ -259,7 +259,7 @@ public class PatternParser {
        }
 
        public DeclarePrecedence parseDominates() {
-               List<TypePattern> l = new ArrayList<TypePattern>();
+               List<TypePattern> l = new ArrayList<>();
                do {
                        l.add(parseTypePattern());
                } while (maybeEat(","));
@@ -282,7 +282,7 @@ public class PatternParser {
                }
                boolean isExtends = t.getString().equals("extends");
 
-               List<TypePattern> l = new ArrayList<TypePattern>();
+               List<TypePattern> l = new ArrayList<>();
                do {
                        l.add(parseTypePattern());
                } while (maybeEat(","));
@@ -679,7 +679,7 @@ public class PatternParser {
        }
 
        public List<String> parseDottedIdentifier() {
-               List<String> ret = new ArrayList<String>();
+               List<String> ret = new ArrayList<>();
                ret.add(parseIdentifier());
                while (maybeEat(".")) {
                        ret.add(parseIdentifier());
@@ -915,7 +915,7 @@ public class PatternParser {
        // Parse annotation values. In an expression in @A(a=b,c=d) this method will be
        // parsing the a=b,c=d.)
        public Map<String, String> parseAnnotationValues() {
-               Map<String, String> values = new HashMap<String, String>();
+               Map<String, String> values = new HashMap<>();
                boolean seenDefaultValue = false;
                do {
                        String possibleKeyString = parseAnnotationNameValuePattern();
@@ -1133,7 +1133,7 @@ public class PatternParser {
        }
 
        public TypePattern parseGenericsWildcardTypePattern() {
-               List<NamePattern> names = new ArrayList<NamePattern>();
+               List<NamePattern> names = new ArrayList<>();
                names.add(new NamePattern("?"));
                TypePattern upperBound = null;
                TypePattern[] additionalInterfaceBounds = new TypePattern[0];
@@ -1242,7 +1242,7 @@ public class PatternParser {
        // }
 
        public List<NamePattern> parseDottedNamePattern() {
-               List<NamePattern> names = new ArrayList<NamePattern>();
+               List<NamePattern> names = new ArrayList<>();
                StringBuffer buf = new StringBuffer();
                IToken previous = null;
                boolean justProcessedEllipsis = false; // Remember if we just dealt with an ellipsis (PR61536)
@@ -1464,7 +1464,7 @@ public class PatternParser {
        }
 
        public TypePatternList parseArgumentsPattern(boolean parameterAnnotationsPossible) {
-               List<TypePattern> patterns = new ArrayList<TypePattern>();
+               List<TypePattern> patterns = new ArrayList<>();
                eat("(");
 
                // ()
@@ -1485,7 +1485,7 @@ public class PatternParser {
        }
 
        public AnnotationPatternList parseArgumentsAnnotationPattern() {
-               List<AnnotationTypePattern> patterns = new ArrayList<AnnotationTypePattern>();
+               List<AnnotationTypePattern> patterns = new ArrayList<>();
                eat("(");
                if (maybeEat(")")) {
                        return new AnnotationPatternList();
@@ -1509,8 +1509,8 @@ public class PatternParser {
                IToken t = tokenSource.peek();
                if (t.isIdentifier() && t.getString().equals("throws")) {
                        tokenSource.next();
-                       List<TypePattern> required = new ArrayList<TypePattern>();
-                       List<TypePattern> forbidden = new ArrayList<TypePattern>();
+                       List<TypePattern> required = new ArrayList<>();
+                       List<TypePattern> forbidden = new ArrayList<>();
                        do {
                                boolean isForbidden = maybeEat("!");
                                // ???might want an error for a second ! without a paren
@@ -1694,7 +1694,7 @@ public class PatternParser {
                if (!maybeEat("<")) {
                        return null;
                }
-               List<TypeVariablePattern> typeVars = new ArrayList<TypeVariablePattern>();
+               List<TypeVariablePattern> typeVars = new ArrayList<>();
                TypeVariablePattern t = parseTypeVariable();
                typeVars.add(t);
                while (maybeEat(",")) {
@@ -1712,7 +1712,7 @@ public class PatternParser {
                if (!maybeEat("<")) {
                        return null;
                }
-               List<String> typeVarNames = new ArrayList<String>();
+               List<String> typeVarNames = new ArrayList<>();
                do {
                        typeVarNames.add(parseIdentifier());
                } while (maybeEat(","));
@@ -1726,7 +1726,7 @@ public class PatternParser {
                if (!maybeEat("<")) {
                        return null;
                }
-               List<TypePattern> typePats = new ArrayList<TypePattern>();
+               List<TypePattern> typePats = new ArrayList<>();
                do {
                        TypePattern tp = parseTypePattern(true, false);
                        typePats.add(tp);
@@ -1752,7 +1752,7 @@ public class PatternParser {
        }
 
        private TypePattern[] maybeParseAdditionalInterfaceBounds() {
-               List<TypePattern> boundsList = new ArrayList<TypePattern>();
+               List<TypePattern> boundsList = new ArrayList<>();
                while (maybeEat("&")) {
                        TypePattern tp = parseTypePattern();
                        boundsList.add(tp);
index 1ad834e060ed7dc8d83cb77bd3a90440a75bade9..31975df77ee8e2b9ded9b73e9a5393a851498c9a 100644 (file)
@@ -101,7 +101,7 @@ public class PerCflow extends PerClause {
                // EMPTY
                // )
                // ;
-               List<ShadowMunger> innerCflowEntries = new ArrayList<ShadowMunger>(xcut.getCflowEntries());
+               List<ShadowMunger> innerCflowEntries = new ArrayList<>(xcut.getCflowEntries());
                innerCflowEntries.removeAll(previousCflowEntries);
 
                xcut.addConcreteShadowMunger(Advice.makePerCflowEntry(world, concreteEntry, isBelow, cflowStackField, inAspect,
index 72e552ab4f808b89386ba9f49c7b933e64fff25c..4e1ef74dfa3d5b072f84c6a14e3cf9dd583804c8 100644 (file)
@@ -327,7 +327,7 @@ public class PointcutRewriter {
        }
 
        private Pointcut simplifyAnd(AndPointcut apc) {
-               SortedSet<Pointcut> nodes = new TreeSet<Pointcut>(new PointcutEvaluationExpenseComparator());
+               SortedSet<Pointcut> nodes = new TreeSet<>(new PointcutEvaluationExpenseComparator());
                collectAndNodes(apc, nodes);
                // look for A and !A, or IfFalse
                for (Pointcut element : nodes) {
@@ -361,7 +361,7 @@ public class PointcutRewriter {
        }
 
        private Pointcut sortOrs(Pointcut pc) {
-               SortedSet<Pointcut> nodes = new TreeSet<Pointcut>(new PointcutEvaluationExpenseComparator());
+               SortedSet<Pointcut> nodes = new TreeSet<>(new PointcutEvaluationExpenseComparator());
                collectOrNodes(pc, nodes);
                // write out with cheapest on left
                Iterator<Pointcut> iter = nodes.iterator();
index 6e74a1a2f1eec0afa5b6218e14f0edb2f70f56a6..6a234d04c76e7add602b038d11319f10f2f7cff7 100644 (file)
@@ -197,7 +197,7 @@ public class ReferencePointcut extends Pointcut {
                        if (onType.isParameterizedType()) {
                                // build a type map mapping type variable names in the generic type to
                                // the type parameters presented
-                               typeVariableMap = new HashMap<String, UnresolvedType>();
+                               typeVariableMap = new HashMap<>();
                                ResolvedType underlyingGenericType = ((ResolvedType) onType).getGenericType();
                                TypeVariable[] tVars = underlyingGenericType.getTypeVariables();
                                ResolvedType[] typeParams = ((ResolvedType) onType).getResolvedTypeParameters();
@@ -344,7 +344,7 @@ public class ReferencePointcut extends Pointcut {
                        if (searchStart.isParameterizedType()) {
                                // build a type map mapping type variable names in the generic type to
                                // the type parameters presented
-                               typeVariableMap = new HashMap<String, UnresolvedType>();
+                               typeVariableMap = new HashMap<>();
                                ResolvedType underlyingGenericType = searchStart.getGenericType();
                                TypeVariable[] tVars = underlyingGenericType.getTypeVariables();
                                ResolvedType[] typeParams = searchStart.getResolvedTypeParameters();
index 4541d1579dc0e0e6a8c6347e4c8a49bee5958555..e1a52f8c80a651dea357bef151a5d9e3ad7b6d33 100644 (file)
@@ -174,7 +174,7 @@ public class SignaturePattern extends PatternNode implements ISignaturePattern {
        private class TypePatternVisitor extends AbstractPatternNodeVisitor {
 
                private IScope scope;
-               private Map<ExactAnnotationTypePattern, AnnotationTargetKind[]> incorrectTargetKinds = new HashMap<ExactAnnotationTypePattern, AnnotationTargetKind[]>();
+               private Map<ExactAnnotationTypePattern, AnnotationTargetKind[]> incorrectTargetKinds = new HashMap<>();
                private boolean targetsOtherThanTypeAllowed;
                private boolean parameterTargettingAnnotationsAllowed;
 
@@ -206,7 +206,7 @@ public class SignaturePattern extends PatternNode implements ISignaturePattern {
                                if (targetKinds == null) {
                                        return data;
                                }
-                               List<AnnotationTargetKind> incorrectTargets = new ArrayList<AnnotationTargetKind>();
+                               List<AnnotationTargetKind> incorrectTargets = new ArrayList<>();
                                for (AnnotationTargetKind targetKind : targetKinds) {
                                        if (targetKind.getName().equals(kind.getName())
                                                        || (targetKind.getName().equals("PARAMETER") && node.isForParameterAnnotationMatch())) {
@@ -990,7 +990,7 @@ public class SignaturePattern extends PatternNode implements ISignaturePattern {
        @Override
        public List<ExactTypePattern> getExactDeclaringTypes() {
                if (declaringType instanceof ExactTypePattern) {
-                       List<ExactTypePattern> l = new ArrayList<ExactTypePattern>();
+                       List<ExactTypePattern> l = new ArrayList<>();
                        l.add((ExactTypePattern) declaringType);
                        return l;
                } else {
index dfb5091954e6773b18afb940defd3fb9d2adb0aa..17b511f714a39c247eceef28462db69f71ce4698 100644 (file)
@@ -248,7 +248,7 @@ public class ThisOrTargetAnnotationPointcut extends NameBindingPointcut {
        @Override
        public List<BindingPattern> getBindingAnnotationTypePatterns() {
                if (annotationTypePattern instanceof BindingAnnotationTypePattern) {
-                       List<BindingPattern> l = new ArrayList<BindingPattern>();
+                       List<BindingPattern> l = new ArrayList<>();
                        l.add((BindingPattern)annotationTypePattern);
                        return l;
                } else {
index a278e76c677ce8e13798b0ce80b6c2f3ea1afa24..b4950975f9009a5e569dbf4f3985203b115c71b7 100644 (file)
@@ -165,7 +165,7 @@ public class ThisOrTargetPointcut extends NameBindingPointcut {
        @Override
        public List<BindingTypePattern> getBindingTypePatterns() {
                if (typePattern instanceof BindingTypePattern) {
-                       List<BindingTypePattern> l = new ArrayList<BindingTypePattern>();
+                       List<BindingTypePattern> l = new ArrayList<>();
                        l.add((BindingTypePattern)typePattern);
                        return l;
                } else {
index 040d6dbe251f57d54bdfbcce9b642204502a6487..2b17520a2d11214c8175345dd31be11b45b2a683 100644 (file)
@@ -531,7 +531,7 @@ public class TypePatternList extends PatternNode {
        }
 
        public List<UnresolvedType> getExactTypes() {
-               List<UnresolvedType> ret = new ArrayList<UnresolvedType>();
+               List<UnresolvedType> ret = new ArrayList<>();
                for (TypePattern typePattern : typePatterns) {
                        UnresolvedType t = typePattern.getExactType();
                        if (!ResolvedType.isMissing(t)) {
index 8289d306e2275f50267a223468b065165c001479..162665c2c3bac13b2a8d02a4138e3b5fa8732403 100644 (file)
@@ -22,7 +22,7 @@ import org.aspectj.weaver.ResolvedType;
 
 
 public class TypePatternQuestions {
-       private Map<Question,FuzzyBoolean> questionsAndAnswers = new HashMap<Question,FuzzyBoolean>();
+       private Map<Question,FuzzyBoolean> questionsAndAnswers = new HashMap<>();
        
        public FuzzyBoolean askQuestion(TypePattern pattern, ResolvedType type,
                                                                        TypePattern.MatchKind kind)
index 531b3d09fd2232e7525d987e55edff298c9128c1..dd95d4c77e1932ff06695a194df0835ef615e219 100644 (file)
@@ -82,7 +82,7 @@ public class WildAnnotationTypePattern extends AnnotationTypePattern {
                // - the value names are for valid annotation fields
                // - the specified values are of the correct type
                // - for enums, check the specified values can be resolved in the specified scope
-               Map<String,String> replacementValues = new HashMap<String,String>();
+               Map<String,String> replacementValues = new HashMap<>();
                Set<String> keys = annotationValues.keySet();
                ResolvedMember[] ms = annotationType.getDeclaredMethods();
                for (String k: keys) {
@@ -391,7 +391,7 @@ public class WildAnnotationTypePattern extends AnnotationTypePattern {
                if (s.getMajorVersion() >= WeaverVersionInfo.WEAVER_VERSION_MAJOR_AJ160M2) {
                        int annotationValueCount = s.readInt();
                        if (annotationValueCount > 0) {
-                               Map<String, String> aValues = new HashMap<String, String>();
+                               Map<String, String> aValues = new HashMap<>();
                                for (int i = 0; i < annotationValueCount; i++) {
                                        String key = s.readUTF();
                                        String val = s.readUTF();
index c766d30bacc191f97885dc4093ff87c266e6115a..b8e58c3425d36dd73d214326c15d7dbefa6f91e0 100644 (file)
@@ -199,7 +199,7 @@ public class WildTypePattern extends TypePattern {
        // part of the declared type name (generated code often uses $s in type
        // names). More work required on our part to get this right...
        public static char[][] splitNames(String s, boolean convertDollar) {
-               List<char[]> ret = new ArrayList<char[]>();
+               List<char[]> ret = new ArrayList<>();
                int startIndex = 0;
                while (true) {
                        int breakIndex = s.indexOf('.', startIndex); // what about /
@@ -387,7 +387,7 @@ public class WildTypePattern extends TypePattern {
 
        private boolean innerMatchesExactly(String s, boolean isAnonymous, boolean convertDollar /* isNested */) {
 
-               List<char[]> ret = new ArrayList<char[]>();
+               List<char[]> ret = new ArrayList<>();
                int startIndex = 0;
                while (true) {
                        int breakIndex = s.indexOf('.', startIndex); // what about /
@@ -1157,7 +1157,7 @@ public class WildTypePattern extends TypePattern {
        private String[] preMatch(String[] possibleMatches) {
                // if (namePatterns.length != 1) return CollectionUtil.NO_STRINGS;
 
-               List<String> ret = new ArrayList<String>();
+               List<String> ret = new ArrayList<>();
                for (String possibleMatch : possibleMatches) {
                        char[][] names = splitNames(possibleMatch, true); // ??? not most efficient
                        if (namePatterns[0].matches(names[names.length - 1])) {
index 42ec11dc23c6740299a4da55f8c24b563890705b..777191f88b717b93f08fa777b376f9fa75cf44ad 100644 (file)
@@ -164,7 +164,7 @@ public class WithinAnnotationPointcut extends NameBindingPointcut {
        @Override
        public List<BindingPattern> getBindingAnnotationTypePatterns() {
                if (annotationTypePattern instanceof BindingAnnotationTypePattern) {
-                       List<BindingPattern> l = new ArrayList<BindingPattern>();
+                       List<BindingPattern> l = new ArrayList<>();
                        l.add((BindingPattern)annotationTypePattern);
                        return l;
                } else {
index 408c829f5e90f6f93d941918d94d040122a83e00..69cc9b7acabcb1c00f0a7e9d34c6e9aab6d5410c 100644 (file)
@@ -172,7 +172,7 @@ public class WithinCodeAnnotationPointcut extends NameBindingPointcut {
 
        public List<BindingPattern> getBindingAnnotationTypePatterns() {
                if (annotationTypePattern instanceof BindingAnnotationTypePattern) {
-                       List<BindingPattern> l = new ArrayList<BindingPattern>();
+                       List<BindingPattern> l = new ArrayList<>();
                        l.add((BindingPattern)annotationTypePattern);
                        return l;
                } else {
index c784ff288a0d2508ccf76273191047b3a61d4302..c4bcb3665293acc269fbe6a6d6db90abd2e593df 100644 (file)
@@ -35,12 +35,12 @@ import org.aspectj.weaver.World;
  */
 public class ReflectionWorld extends World implements IReflectionWorld {
 
-       private static Map<WeakClassLoaderReference, ReflectionWorld> rworlds = Collections.synchronizedMap(new HashMap<WeakClassLoaderReference, ReflectionWorld>());
+       private static Map<WeakClassLoaderReference, ReflectionWorld> rworlds = Collections.synchronizedMap(new HashMap<>());
 
        private WeakClassLoaderReference classLoaderReference;
        private AnnotationFinder annotationFinder;
        private boolean mustUseOneFourDelegates = false; // for testing
-       private Map<String,Class<?>> inProgressResolutionClasses = new HashMap<String,Class<?>>();
+       private Map<String,Class<?>> inProgressResolutionClasses = new HashMap<>();
        
        public static ReflectionWorld getReflectionWorldFor(WeakClassLoaderReference classLoaderReference) {
                
index ca0fa3aca77abdc8a4df43b8398830deb6ce135e..5c4a4d27d56840af41077daa3c6ac5b8e4e77dc9 100644 (file)
@@ -60,14 +60,14 @@ public class PointcutParser {
        private ReflectionWorld world;
        private WeakClassLoaderReference classLoaderReference;
        private final Set<PointcutPrimitive> supportedPrimitives;
-       private final Set<PointcutDesignatorHandler> pointcutDesignators = new HashSet<PointcutDesignatorHandler>();
+       private final Set<PointcutDesignatorHandler> pointcutDesignators = new HashSet<>();
 
        /**
         * @return a Set containing every PointcutPrimitive except if, cflow, and cflowbelow (useful for passing to PointcutParser
         *         constructor).
         */
        public static Set<PointcutPrimitive> getAllSupportedPointcutPrimitives() {
-               Set<PointcutPrimitive> primitives = new HashSet<PointcutPrimitive>();
+               Set<PointcutPrimitive> primitives = new HashSet<>();
                primitives.add(PointcutPrimitive.ADVICE_EXECUTION);
                primitives.add(PointcutPrimitive.ARGS);
                primitives.add(PointcutPrimitive.CALL);
index afc14188de0e9b6064955ab76081a382c2aaccbc..65de087597dfad7d6d2c4fc0b62297ed40b31749 100644 (file)
@@ -53,14 +53,14 @@ public class StandardPointcutParser {
 
        private World world;
        private final Set<PointcutPrimitive> supportedPrimitives;
-       private final Set<PointcutDesignatorHandler> pointcutDesignators = new HashSet<PointcutDesignatorHandler>();
+       private final Set<PointcutDesignatorHandler> pointcutDesignators = new HashSet<>();
 
        /**
         * @return a Set containing every PointcutPrimitive except if, cflow, and cflowbelow (useful for passing to PointcutParser
         *         constructor).
         */
        public static Set<PointcutPrimitive> getAllSupportedPointcutPrimitives() {
-               Set<PointcutPrimitive> primitives = new HashSet<PointcutPrimitive>();
+               Set<PointcutPrimitive> primitives = new HashSet<>();
                primitives.add(PointcutPrimitive.ADVICE_EXECUTION);
                primitives.add(PointcutPrimitive.ARGS);
                primitives.add(PointcutPrimitive.CALL);
index 8998904a6ed10e7e1b56b731a55fbebdecc7c046..9389fff8be8b91e1f3b3d27c8411f209b2cc746b 100644 (file)
@@ -92,10 +92,10 @@ public abstract class CommonWorldTests extends TestCase {
                ResolvedType ty = world.resolve(tx, true);
                assertTrue("Couldnt find type " + tx, !ty.isMissing());
                ResolvedType[] lowerTyArray = world.resolve(UnresolvedType.forSignatures(lowers));
-               List<ResolvedType> lowerTys = new ArrayList<ResolvedType>(Arrays.asList(lowerTyArray));
+               List<ResolvedType> lowerTys = new ArrayList<>(Arrays.asList(lowerTyArray));
                lowerTys.add(ty);
-               Set<ResolvedType> allLowerTys = new HashSet<ResolvedType>(lowerTys);
-               Set<ResolvedType> allUpperTys = new HashSet<ResolvedType>(Arrays.asList(primitives));
+               Set<ResolvedType> allLowerTys = new HashSet<>(lowerTys);
+               Set<ResolvedType> allUpperTys = new HashSet<>(Arrays.asList(primitives));
                allUpperTys.removeAll(allLowerTys);
 
                for (ResolvedType other : allLowerTys) {
index ac4c46cb7b50436f83f63b1287aa4f32d69e67d0..9f7daa756ff88b2c17adeacbfcc6cb4498987d89 100644 (file)
@@ -287,7 +287,7 @@ public class TestUtils {
        public static String[] parseIds(String str) {
                if (str.length() == 0)
                        return ZERO_STRINGS;
-               List<String> l = new ArrayList<String>();
+               List<String> l = new ArrayList<>();
                int start = 0;
                while (true) {
                        int i = str.indexOf(',', start);
index 57f971665499f1fb7dd38600a727ff596e22eaf4..1583900f472619c4ba0042ac8d3b46a5312e4deb 100644 (file)
@@ -17,7 +17,7 @@ import org.aspectj.weaver.ConstantPoolReader;
 import org.aspectj.weaver.ConstantPoolWriter;
 
 public class ConstantPoolSimulator implements ConstantPoolWriter, ConstantPoolReader {
-       List<String> list = new ArrayList<String>();
+       List<String> list = new ArrayList<>();
 
        public int writeUtf8(String string) {
                int i = list.indexOf(string);
index 7ffad81d53dcbaa8d95a0d5daec44739bee32254..9f524d83613eb35f2bd6f12f65327b879a12d846 100644 (file)
@@ -700,7 +700,7 @@ public class ParserTestCase extends PatternsTestCase {
                WildAnnotationTypePattern watp = (WildAnnotationTypePattern) atp;
                Map<String,String> m = watp.annotationValues;
                Set<String> keys = m.keySet();
-               List<String> orderedKeys = new ArrayList<String>();
+               List<String> orderedKeys = new ArrayList<>();
                orderedKeys.addAll(keys);
                Collections.sort(orderedKeys);
                StringBuffer sb = new StringBuffer();
index 542aeb18208745cd9a611e4ddb903b40008be377..2aacae7bfc6a1f7c4dc4250d36bdb7fa17aeb6e8 100644 (file)
@@ -270,7 +270,7 @@ public class AjTypeImpl<T> implements AjType<T> {
         */
        public Field[] getDeclaredFields() {
                Field[] fields = clazz.getDeclaredFields();
-               List<Field> filteredFields = new ArrayList<Field>();
+               List<Field> filteredFields = new ArrayList<>();
                for (Field field : fields) 
                        if (!field.getName().startsWith(ajcMagic) 
                                && !field.isAnnotationPresent(DeclareWarning.class)
@@ -296,7 +296,7 @@ public class AjTypeImpl<T> implements AjType<T> {
         */
        public Field[] getFields() {
                Field[] fields = clazz.getFields();
-               List<Field> filteredFields = new ArrayList<Field>();
+               List<Field> filteredFields = new ArrayList<>();
                for (Field field : fields)
                        if (!field.getName().startsWith(ajcMagic) 
                                        && !field.isAnnotationPresent(DeclareWarning.class)
@@ -331,7 +331,7 @@ public class AjTypeImpl<T> implements AjType<T> {
         */
        public Method[] getDeclaredMethods() {
                Method[] methods = clazz.getDeclaredMethods();
-               List<Method> filteredMethods = new ArrayList<Method>();
+               List<Method> filteredMethods = new ArrayList<>();
                for (Method method : methods) {
                        if (isReallyAMethod(method)) filteredMethods.add(method);
                }
@@ -345,7 +345,7 @@ public class AjTypeImpl<T> implements AjType<T> {
         */
        public Method[] getMethods() {
                Method[] methods = clazz.getMethods();
-               List<Method> filteredMethods = new ArrayList<Method>();
+               List<Method> filteredMethods = new ArrayList<>();
                for (Method method : methods) {
                        if (isReallyAMethod(method)) filteredMethods.add(method);
                }
@@ -391,7 +391,7 @@ public class AjTypeImpl<T> implements AjType<T> {
         */
        public Pointcut[] getDeclaredPointcuts() {
                if (declaredPointcuts != null) return declaredPointcuts;
-               List<Pointcut> pointcuts = new ArrayList<Pointcut>();
+               List<Pointcut> pointcuts = new ArrayList<>();
                Method[] methods = clazz.getDeclaredMethods();
                for (Method method : methods) {
                        Pointcut pc = asPointcut(method);
@@ -408,7 +408,7 @@ public class AjTypeImpl<T> implements AjType<T> {
         */
        public Pointcut[] getPointcuts() {
                if (pointcuts != null) return pointcuts;
-               List<Pointcut> pcuts = new ArrayList<Pointcut>();
+               List<Pointcut> pcuts = new ArrayList<>();
                Method[] methods = clazz.getMethods();
                for (Method method : methods) {
                        Pointcut pc = asPointcut(method);
@@ -465,7 +465,7 @@ public class AjTypeImpl<T> implements AjType<T> {
         */
        private Advice[] getDeclaredAdvice(Set ofAdviceTypes) {
                if (declaredAdvice == null) initDeclaredAdvice();
-               List<Advice> adviceList = new ArrayList<Advice>();
+               List<Advice> adviceList = new ArrayList<>();
                for (Advice a : declaredAdvice) {
                        if (ofAdviceTypes.contains(a.getKind())) adviceList.add(a);
                }
@@ -476,7 +476,7 @@ public class AjTypeImpl<T> implements AjType<T> {
 
        private void initDeclaredAdvice() {
                Method[] methods = clazz.getDeclaredMethods();
-               List<Advice> adviceList = new ArrayList<Advice>();
+               List<Advice> adviceList = new ArrayList<>();
                for (Method method : methods) {
                        Advice advice = asAdvice(method);
                        if (advice != null) adviceList.add(advice);
@@ -490,7 +490,7 @@ public class AjTypeImpl<T> implements AjType<T> {
         */
        private Advice[] getAdvice(Set ofAdviceTypes) {
                if (advice == null) initAdvice();
-               List<Advice> adviceList = new ArrayList<Advice>();
+               List<Advice> adviceList = new ArrayList<>();
                for (Advice a : advice) {
                        if (ofAdviceTypes.contains(a.getKind())) adviceList.add(a);
                }
@@ -501,7 +501,7 @@ public class AjTypeImpl<T> implements AjType<T> {
 
        private void initAdvice() {
                Method[] methods = clazz.getMethods();
-               List<Advice> adviceList = new ArrayList<Advice>();
+               List<Advice> adviceList = new ArrayList<>();
                for (Method method : methods) {
                        Advice advice = asAdvice(method);
                        if (advice != null) adviceList.add(advice);
@@ -584,7 +584,7 @@ public class AjTypeImpl<T> implements AjType<T> {
         */
        public InterTypeMethodDeclaration[] getDeclaredITDMethods() {
                if (this.declaredITDMethods == null) {
-                       List<InterTypeMethodDeclaration> itdms = new ArrayList<InterTypeMethodDeclaration>();
+                       List<InterTypeMethodDeclaration> itdms = new ArrayList<>();
                        Method[] baseMethods = clazz.getDeclaredMethods();
                        for (Method m : baseMethods) {
                                if (!m.getName().contains("ajc$interMethodDispatch1$")) continue;
@@ -631,7 +631,7 @@ public class AjTypeImpl<T> implements AjType<T> {
 
        public InterTypeMethodDeclaration[] getITDMethods() {
                if (this.itdMethods == null) {
-                       List<InterTypeMethodDeclaration> itdms = new ArrayList<InterTypeMethodDeclaration>();
+                       List<InterTypeMethodDeclaration> itdms = new ArrayList<>();
                        Method[] baseMethods = clazz.getDeclaredMethods();
                        for (Method m : baseMethods) {
                                if (!m.getName().contains("ajc$interMethod$")) continue;
@@ -704,7 +704,7 @@ public class AjTypeImpl<T> implements AjType<T> {
 
        public InterTypeConstructorDeclaration[] getDeclaredITDConstructors() {
                if (this.declaredITDCons == null) {
-                       List<InterTypeConstructorDeclaration> itdcs = new ArrayList<InterTypeConstructorDeclaration>();
+                       List<InterTypeConstructorDeclaration> itdcs = new ArrayList<>();
                        Method[] baseMethods = clazz.getDeclaredMethods();
                        for (Method m : baseMethods) {
                                if (!m.getName().contains("ajc$postInterConstructor")) continue;
@@ -746,7 +746,7 @@ public class AjTypeImpl<T> implements AjType<T> {
 
        public InterTypeConstructorDeclaration[] getITDConstructors() {
                if (this.itdCons == null) {
-                       List<InterTypeConstructorDeclaration> itdcs = new ArrayList<InterTypeConstructorDeclaration>();
+                       List<InterTypeConstructorDeclaration> itdcs = new ArrayList<>();
                        Method[] baseMethods = clazz.getMethods();
                        for (Method m : baseMethods) {
                                if (!m.getName().contains("ajc$postInterConstructor")) continue;
@@ -780,7 +780,7 @@ public class AjTypeImpl<T> implements AjType<T> {
        }
 
        public InterTypeFieldDeclaration[] getDeclaredITDFields() {
-               List<InterTypeFieldDeclaration> itdfs = new ArrayList<InterTypeFieldDeclaration>();
+               List<InterTypeFieldDeclaration> itdfs = new ArrayList<>();
                if (this.declaredITDFields == null) {
                        Method[] baseMethods = clazz.getDeclaredMethods();
                        for(Method m : baseMethods) {
@@ -826,7 +826,7 @@ public class AjTypeImpl<T> implements AjType<T> {
        }
 
        public InterTypeFieldDeclaration[] getITDFields() {
-               List<InterTypeFieldDeclaration> itdfs = new ArrayList<InterTypeFieldDeclaration>();
+               List<InterTypeFieldDeclaration> itdfs = new ArrayList<>();
                if (this.itdFields == null) {
                        Method[] baseMethods = clazz.getMethods();
                        for(Method m : baseMethods) {
@@ -857,7 +857,7 @@ public class AjTypeImpl<T> implements AjType<T> {
        }
 
        public DeclareErrorOrWarning[] getDeclareErrorOrWarnings() {
-               List<DeclareErrorOrWarning> deows = new ArrayList<DeclareErrorOrWarning>();
+               List<DeclareErrorOrWarning> deows = new ArrayList<>();
                for (Field field : clazz.getDeclaredFields()) {
                        try {
                                if (field.isAnnotationPresent(DeclareWarning.class)) {
@@ -894,7 +894,7 @@ public class AjTypeImpl<T> implements AjType<T> {
        }
 
        public DeclareParents[] getDeclareParents() {
-               List<DeclareParents> decps = new ArrayList<DeclareParents>();
+               List<DeclareParents> decps = new ArrayList<>();
                for (Method method : clazz.getDeclaredMethods()) {
                        if (method.isAnnotationPresent(ajcDeclareParents.class)) {
                                ajcDeclareParents decPAnn = method.getAnnotation(ajcDeclareParents.class);
@@ -934,7 +934,7 @@ public class AjTypeImpl<T> implements AjType<T> {
        }
 
        public DeclareSoft[] getDeclareSofts() {
-               List<DeclareSoft> decs = new ArrayList<DeclareSoft>();
+               List<DeclareSoft> decs = new ArrayList<>();
                for (Method method : clazz.getDeclaredMethods()) {
                        if (method.isAnnotationPresent(ajcDeclareSoft.class)) {
                                ajcDeclareSoft decSAnn = method.getAnnotation(ajcDeclareSoft.class);
@@ -955,7 +955,7 @@ public class AjTypeImpl<T> implements AjType<T> {
        }
 
        public DeclareAnnotation[] getDeclareAnnotations() {
-               List<DeclareAnnotation> decAs = new ArrayList<DeclareAnnotation>();
+               List<DeclareAnnotation> decAs = new ArrayList<>();
                for (Method method : clazz.getDeclaredMethods()) {
                        if (method.isAnnotationPresent(ajcDeclareAnnotation.class)) {
                                ajcDeclareAnnotation decAnn = method.getAnnotation(ajcDeclareAnnotation.class);
@@ -988,7 +988,7 @@ public class AjTypeImpl<T> implements AjType<T> {
        }
 
        public DeclarePrecedence[] getDeclarePrecedence() {
-               List<DeclarePrecedence> decps = new ArrayList<DeclarePrecedence>();
+               List<DeclarePrecedence> decps = new ArrayList<>();
                
                // @AspectJ Style
                if (clazz.isAnnotationPresent(org.aspectj.lang.annotation.DeclarePrecedence.class)) {
index 6e525dc0bd7f7394c172ca4fd0124294720db602..2f21ba2ffa53aefe932129abe7ce9e95b89c4f16 100644 (file)
@@ -26,7 +26,7 @@ import org.aspectj.internal.lang.reflect.AjTypeImpl;
 public class AjTypeSystem {
        
                private static Map<Class, WeakReference<AjType>> ajTypes = 
-                       Collections.synchronizedMap(new WeakHashMap<Class,WeakReference<AjType>>());
+                       Collections.synchronizedMap(new WeakHashMap<>());
 
                /**
                 * Return the AspectJ runtime type representation of the given Java type.
@@ -45,14 +45,14 @@ public class AjTypeSystem {
                                if (theAjType != null) {
                                        return theAjType;
                                } else {
-                                       theAjType = new AjTypeImpl<T>(fromClass);
-                                       ajTypes.put(fromClass, new WeakReference<AjType>(theAjType));
+                                       theAjType = new AjTypeImpl<>(fromClass);
+                                       ajTypes.put(fromClass, new WeakReference<>(theAjType));
                                        return theAjType;
                                }
                        }
                        // neither key nor value was found
-                       AjType<T> theAjType =  new AjTypeImpl<T>(fromClass);
-                       ajTypes.put(fromClass, new WeakReference<AjType>(theAjType));
+                       AjType<T> theAjType = new AjTypeImpl<>(fromClass);
+                       ajTypes.put(fromClass, new WeakReference<>(theAjType));
                        return theAjType;
                }
 }
index 0263ee84171f5c6584571e571fba549cc4cb666a..2183a57061e6a9ea421f822444fce4adad57d056 100644 (file)
@@ -149,7 +149,7 @@ class JoinPointImpl implements ProceedingJoinPoint {
        public void stack$AroundClosure(AroundClosure arc) {
                // If input parameter arc is null this is the 'unlink' call from AroundClosure
                if (arcs == null) {
-                       arcs = new Stack<AroundClosure>();
+                       arcs = new Stack<>();
                }
                if (arc==null) {
                        this.arcs.pop();
index 8a7c8a51133ddb09f5d795eefef07b0814cb07f1..83dcd9911ca2f11c36c9c6a93129ebfeddaa9bf4 100644 (file)
@@ -719,7 +719,7 @@ public class AjcTask extends MatchingTask {
        public CompilerArg createCompilerarg() {
                CompilerArg compilerArg = new CompilerArg();
                if (compilerArgs == null) {
-                       compilerArgs = new ArrayList<CompilerArg>();
+                       compilerArgs = new ArrayList<>();
                }
                compilerArgs.add(compilerArg);
                return compilerArg;
index 194efaf22fa369624d32e840a4cb83a4bae58c0f..8343027a781c1013f1ffec4a0dfcb63b6844835e 100644 (file)
@@ -74,7 +74,7 @@ public class Ajdoc extends MatchingTask {
     private boolean fork;
        private String source;
        private Html bottom;
-    private Vector<FileSet> fileSets = new Vector<FileSet>();
+    private Vector<FileSet> fileSets = new Vector<>();
     /** reset all to initial values - permit gc if Ajdoc is held */
     public Ajdoc() {
         reset();
@@ -94,8 +94,8 @@ public class Ajdoc extends MatchingTask {
         internalclasspath  = null;
         argfiles  = null;
         docletpath  = null;
-        links = new ArrayList<Link>();
-        groups = new ArrayList<Group>();
+        links = new ArrayList<>();
+        groups = new ArrayList<>();
         doclet  = null;
         failonerror  = false;
         fork = false;
@@ -165,7 +165,7 @@ public class Ajdoc extends MatchingTask {
     
     private void addFileSets() {
        if(sourcefiles == null)
-               sourcefiles = new ArrayList<String>();
+               sourcefiles = new ArrayList<>();
        
         Enumeration<FileSet> e = fileSets.elements();
         while (e.hasMoreElements()) {
@@ -186,7 +186,7 @@ public class Ajdoc extends MatchingTask {
     
     public void setPackagenames(String list) {
         (packagenames == null ?
-         packagenames = new ArrayList<String>() :
+         packagenames = new ArrayList<>() :
          packagenames).addAll(strings(list, true));
     }
     
@@ -264,7 +264,7 @@ public class Ajdoc extends MatchingTask {
 
     public List<File> createArgfiles() {
         return (argfiles == null ?
-                argfiles = new ArrayList<File>() :
+                argfiles = new ArrayList<>() :
                 argfiles);
     }
 
@@ -480,7 +480,7 @@ public class Ajdoc extends MatchingTask {
     public class Doclet {
         protected String name;
         protected Path path;
-        protected List<Param> params = new ArrayList<Param>();
+        protected List<Param> params = new ArrayList<>();
         public Doclet() {}
         public void setName(String name) {
             this.name = name;
@@ -617,7 +617,7 @@ public class Ajdoc extends MatchingTask {
                                }
                        }
         }
-        Map<String,List<String>> groupMap = new HashMap<String,List<String>>();
+        Map<String,List<String>> groupMap = new HashMap<>();
         for (Group group: groups) {
             if (group.title == null) {
                 throw new BuildException("Group names cannot be null!",
@@ -629,7 +629,7 @@ public class Ajdoc extends MatchingTask {
             }
             List<String> packages = groupMap.get(group.title);
             if (packages == null) {
-                packages = new ArrayList<String>();
+                packages = new ArrayList<>();
             }
             packages.addAll(group.packages);
             groupMap.put(group.title, packages);
@@ -719,7 +719,7 @@ public class Ajdoc extends MatchingTask {
 
     protected final <T> List<T> list(String str, Mapper<T> mapper) {
         if (str == null) return Collections.emptyList();
-        List<T> list = new ArrayList<T>();
+        List<T> list = new ArrayList<>();
         for (StringTokenizer t = new StringTokenizer(str, ",", false);
              t.hasMoreTokens();) {
             list.add(mapper.map(t.nextToken().trim()));
index 2516a2ac51ad2dbb3eeb82f6f9c6693ca7dab2be..022dcae22904f04453ceba5758186e2ab70a6313 100644 (file)
@@ -53,7 +53,7 @@ public class Ajc extends DefaultCompilerAdapter {
         "-encoding", "-target" });
 
     private static List<String> finalList(String[] args) {
-        List<String> result = new ArrayList<String>();
+        List<String> result = new ArrayList<>();
         result.addAll(Arrays.asList(args));
         return Collections.unmodifiableList(result);
     }
index bbe264846dbee278d0cdb9c6f5ea401ab8675ac2..546eadba357c5bccdb76f3fdb0282d19dd4b5af7 100644 (file)
@@ -1616,7 +1616,7 @@ public class Ajctest extends Task implements PropertyChangeListener {
 
     private List<List<Arg>> combinations(List<Argument> arglist) {
         List<List<Arg>> result = new Vector<>();
-        result.add(new Vector<Arg>());
+        result.add(new Vector<>());
                for (Argument arg : arglist) {
                        int N = result.size();
                        for (int i = 0; i < N; i++) {
index df460aea16ec4c4639e776177607b1beb9e60dd1..e8098ed090990b8fe8dfda6d2889b66c96992499 100644 (file)
@@ -47,7 +47,7 @@ public class AjcTest {
                is14VMOrGreater = LangUtil.is14VMOrGreater();
        }
 
-       private List<ITestStep> testSteps = new ArrayList<ITestStep>();
+       private List<ITestStep> testSteps = new ArrayList<>();
 
        private String dir;
        private String pr;
index 966166c33f05842c16061c2fe81f0fd47476f79c..2b7e4942f8d645efa4a21d7d224f723ce80ccd78 100644 (file)
@@ -35,7 +35,7 @@ import junit.framework.TestSuite;
  */
 public abstract class AutowiredXMLBasedAjcTestCase extends XMLBasedAjcTestCase {
 
-    private Map<String,AjcTest> testMap = new HashMap<String,AjcTest>();
+    private Map<String,AjcTest> testMap = new HashMap<>();
 
     public void addTest(AjcTest test) {
         testMap.put(test.getTitle(), test);
index e950ee1bacad204a181ef238d936a539e508031e..254f244a0c520729a5aa82c40532bf702745e88c 100644 (file)
@@ -26,7 +26,7 @@ import org.aspectj.tools.ajc.CompilationResult;
  */
 public class CompileSpec implements ITestStep {
 
-       private List<ExpectedMessageSpec> expected = new ArrayList<ExpectedMessageSpec>();
+       private List<ExpectedMessageSpec> expected = new ArrayList<>();
        
        private String files;
        private boolean includeClassesDir;
@@ -266,8 +266,8 @@ public class CompileSpec implements ITestStep {
                        args.append(getExtdirs());
                        args.append(" ");
                }
-               List<String> fileList = new ArrayList<String>();
-               List<String> jarList = new ArrayList<String>();
+               List<String> fileList = new ArrayList<>();
+               List<String> jarList = new ArrayList<>();
                // convention that any jar on file list should be added to inpath
                String files = getFiles();
            if (files == null) files = "";
@@ -310,14 +310,14 @@ public class CompileSpec implements ITestStep {
 
        protected AjcTestCase.MessageSpec buildMessageSpec() {
                List<AjcTestCase.Message> infos = null;
-               List<AjcTestCase.Message> warnings = new ArrayList<AjcTestCase.Message>();
-               List<AjcTestCase.Message> errors = new ArrayList<AjcTestCase.Message>();
-               List<AjcTestCase.Message> fails = new ArrayList<AjcTestCase.Message>();
-               List<AjcTestCase.Message> weaveInfos = new ArrayList<AjcTestCase.Message>();
+               List<AjcTestCase.Message> warnings = new ArrayList<>();
+               List<AjcTestCase.Message> errors = new ArrayList<>();
+               List<AjcTestCase.Message> fails = new ArrayList<>();
+               List<AjcTestCase.Message> weaveInfos = new ArrayList<>();
                for (ExpectedMessageSpec exMsg: expected) {
                        String kind = exMsg.getKind();
                        if (kind.equals("info")) {
-                               if (infos == null) infos = new ArrayList<AjcTestCase.Message>();
+                               if (infos == null) infos = new ArrayList<>();
                                infos.add(exMsg.toMessage());
                        } else if (kind.equals("warning")) {
                                warnings.add(exMsg.toMessage());
index 721cb623b6b3831831f65082d94eb303e6712ebf..840368c635205f97339e47c06cd53290c1f5ec1e 100644 (file)
@@ -60,7 +60,7 @@ public class MakeTestClass {
        private static final String FOOTER =
                "}\n";
        
-       private List<AjcTest> tests = new ArrayList<AjcTest>();
+       private List<AjcTest> tests = new ArrayList<>();
        private String className;
        private String suiteFile;
        
index d3b06490787ea324c4ec4207069e25f3f18b876b..62a22cb800e6a7a54f4ca9a0e45b2d1e0e5a3b12 100644 (file)
@@ -19,7 +19,7 @@ import org.aspectj.util.LangUtil;
 
 public class OutputSpec {
 
-       private List<String> expectedOutputLines = new ArrayList<String>();
+       private List<String> expectedOutputLines = new ArrayList<>();
 
        public void addLine(OutputLine line) {
                if (line.getVm() == null || matchesThisVm(line.getVm())) {
@@ -82,9 +82,9 @@ public class OutputSpec {
                        createFailureMessage(output, -1, outputFound.size());
                        return;
                }
-               List<String> expected = new ArrayList<String>();
+               List<String> expected = new ArrayList<>();
                expected.addAll(expectedOutputLines);
-               List<String> found = new ArrayList<String>();
+               List<String> found = new ArrayList<>();
                found.addAll(outputFound);
                for (String lineFound : outputFound) {
                        for (String lineExpected : expectedOutputLines) {
@@ -119,7 +119,7 @@ public class OutputSpec {
        }
 
        private List<String> getOutputFound(String output) {
-               List<String> found = new ArrayList<String>();
+               List<String> found = new ArrayList<>();
                StringTokenizer strTok = new StringTokenizer(output,"\n");
                while(strTok.hasMoreTokens()) {
                        String outputLine = strTok.nextToken().trim();
index 22aa0f7bca311b319ac3cf51cf747b3a4732e1ff..4f2b03cf8c31f33809202186e695dd6258bbb823 100644 (file)
@@ -27,7 +27,7 @@ import org.aspectj.util.FileUtil;
  */
 public class RunSpec implements ITestStep {
 
-       private List<ExpectedMessageSpec> expected = new ArrayList<ExpectedMessageSpec>();
+       private List<ExpectedMessageSpec> expected = new ArrayList<>();
        private String classToRun;
        private String moduleToRun;  // alternative to classToRun on JDK9+
        private String baseDir;
index b0907a3c1ac4a2b6108ff18a7ae6ad867642cbf1..9d95e79b5dbdb4bfb85bbfaf0c1fd9a85aa714b8 100644 (file)
@@ -45,7 +45,7 @@ public class WeaveSpec extends CompileSpec {
                String failMessage = "test \"" + getTest().getTitle() + "\" failed";
                try {
                        File base = new File(getBaseDir());
-                       classFilesFromClasses = new ArrayList<File>();
+                       classFilesFromClasses = new ArrayList<>();
                        setFiles(classesFiles);
                        String[] args = buildArgs();
                        CompilationResult result = inTestCase.ajc(base,args);
@@ -94,7 +94,7 @@ public class WeaveSpec extends CompileSpec {
                File outJar = new File(inDir,name);
                FileOutputStream fos = new FileOutputStream(outJar);
                JarOutputStream jarOut = new JarOutputStream(fos);
-               List<File> classFiles = new ArrayList<File>();
+               List<File> classFiles = new ArrayList<>();
                List<File> toExclude = isClasses ? Collections.<File>emptyList() : classFilesFromClasses;
                collectClassFiles(inDir,classFiles,toExclude);
                if (isClasses) classFilesFromClasses = classFiles;
index 38f85b2c90937c11175c9f38ddd0349357fe53d2..e5e2fcdb9166d5492d0ca44be5ab41294dd3b96b 100644 (file)
@@ -60,10 +60,10 @@ import junit.framework.TestSuite;
  */
 public abstract class XMLBasedAjcTestCase extends AjcTestCase {
 
-       private static Map<String,AjcTest> testMap = new HashMap<String,AjcTest>();
+       private static Map<String,AjcTest> testMap = new HashMap<>();
        private static boolean suiteLoaded = false;
        private AjcTest currentTest = null;
-       private Stack<Boolean> clearTestAfterRun = new Stack<Boolean>();
+       private Stack<Boolean> clearTestAfterRun = new Stack<>();
 
        public XMLBasedAjcTestCase() {
        }
@@ -284,7 +284,7 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase {
        protected void setUp() throws Exception {
                super.setUp();
                if (!suiteLoaded) {
-                       testMap = new HashMap<String,AjcTest>();
+                       testMap = new HashMap<>();
                        System.out.println("LOADING SUITE: " + getSpecFile().getPath());
                        Digester d = getDigester();
                        try {
@@ -413,7 +413,7 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase {
         * Sort it by name then start position
         */
        public List<LocalVariable> sortedLocalVariables(LocalVariableTable lvt) {
-               List<LocalVariable> l = new ArrayList<LocalVariable>();
+               List<LocalVariable> l = new ArrayList<>();
                LocalVariable lv[] = lvt.getLocalVariableTable();
                for (LocalVariable lvEntry : lv) {
                        l.add(lvEntry);
index 993d4f5454d23776405f994838d1b95379617344..cf615f6d1d33ce30c1b5e0911666ac976dce4d49 100644 (file)
@@ -109,11 +109,11 @@ abstract public class AbstractRunSpec implements IRunSpec {
                }
                this.xmlElementName = xmlElementName;
                messages = new MessageHandler(true);
-               options = new ArrayList<String>();
-               paths = new ArrayList<String>();
+               options = new ArrayList<>();
+               paths = new ArrayList<>();
                // XXXXXunused sourceLocations = new ArrayList();
-               keywords = new ArrayList<String>();
-               children = new ArrayList<IRunSpec>();
+               keywords = new ArrayList<>();
+               children = new ArrayList<>();
                dirChanges = new ArrayList<>();
                xmlNames = XMLNames.DEFAULT;
                runtime = new RT();
@@ -371,12 +371,12 @@ abstract public class AbstractRunSpec implements IRunSpec {
        /** @return copy of children list without children to skip */
        public ArrayList<IRunSpec> getWorkingChildren() {
                if (skipAll) {
-                       return new ArrayList<IRunSpec>();
+                       return new ArrayList<>();
                }
                if (null == skipSet) {
                        return getChildren();
                }
-               ArrayList<IRunSpec> result = new ArrayList<IRunSpec>();
+               ArrayList<IRunSpec> result = new ArrayList<>();
                int i = 0;
                for (Iterator<IRunSpec> iter = children.listIterator(); iter.hasNext(); i++) {
                        IRunSpec child = iter.next();
@@ -700,7 +700,7 @@ abstract public class AbstractRunSpec implements IRunSpec {
        }
 
        private <T> ArrayList<T> makeList(List<T> list) {
-               ArrayList<T> result = new ArrayList<T>();
+               ArrayList<T> result = new ArrayList<>();
                if (null != list) {
                        result.addAll(list);
                }
@@ -779,7 +779,7 @@ abstract public class AbstractRunSpec implements IRunSpec {
                final private ArrayList<String> parentOptions;
 
                public RT() {
-                       parentOptions = new ArrayList<String>();
+                       parentOptions = new ArrayList<>();
                }
 
                public boolean isVerbose() {
@@ -879,7 +879,7 @@ abstract public class AbstractRunSpec implements IRunSpec {
                        if (LangUtil.isEmpty(validOptions) || LangUtil.isEmpty(parentOptions)) {
                                return new String[0];
                        }
-                       ArrayList<String> result = new ArrayList<String>();
+                       ArrayList<String> result = new ArrayList<>();
                        // boolean haveOption = false;
                        for (String option : validOptions) {
                                if (LangUtil.isEmpty(option)) {
index 64588ba93b9516b51defd3597a96807b6587172b..7bbc50adf4fce76dc4cba785adf7282ae6a77688 100644 (file)
@@ -119,7 +119,7 @@ public class AjcTest extends RunSpecIterator {
                 REQUIRE_KEYWORDS, SKIP_KEYWORDS, PICK_PR }));
         
         /** Map String titlesName to List (String) of titles to accept */
-        private static final Map<String,List<String>> TITLES = new HashMap<String,List<String>>();
+        private static final Map<String,List<String>> TITLES = new HashMap<>();
         
         private static List<String> getTitles(String titlesName) {
             return getTitles(titlesName, false);
@@ -161,7 +161,7 @@ public class AjcTest extends RunSpecIterator {
          * @return the unmodifiable List of titles (maybe empty, never null)
          */
         private static List<String> parseTitlesList(String titlesList) {
-            ArrayList<String> result = new ArrayList<String>();
+            ArrayList<String> result = new ArrayList<>();
             String last = null;
             StringTokenizer st = new StringTokenizer(titlesList, ",");
             while (st.hasMoreTokens()) {
@@ -206,7 +206,7 @@ public class AjcTest extends RunSpecIterator {
          * @return the unmodifiable List of titles (maybe empty, never null)
          */
         private static List<String> readTitlesFile(File titlesFile, boolean fail) {
-            ArrayList<String> result = new ArrayList<String>();
+            ArrayList<String> result = new ArrayList<>();
             Reader reader = null;
             try {
                 reader = new FileReader(titlesFile);
index 869cb3c4c64c9a5fc564b679da98a91d3e99e652..3871ee74b3755ccb41cfba34064bfb107060591f 100644 (file)
@@ -33,7 +33,7 @@ import junit.framework.TestCase;
 public class AjcTaskCompileCommandTest extends TestCase {
     static boolean loggedWarning = false;
     static boolean runAllTests = true;
-    static ArrayList<File> tempFiles = new ArrayList<File>();
+    static ArrayList<File> tempFiles = new ArrayList<>();
     
     private static File getClassesDir() {
         File tempDir = FileUtil.getTempDir("AjcTaskCompileCommandTest-classes");
@@ -115,7 +115,7 @@ public class AjcTaskCompileCommandTest extends TestCase {
     void runSimpleTest(String path, int expectedErrors) {
         File file = new File(path);
         assertTrue(path, file.canRead());
-        ArrayList<String> list = new ArrayList<String>();
+        ArrayList<String> list = new ArrayList<>();
         addCommonArgs(list);
         if (path.endsWith(".lst")) {
             list.add("-argfile");
index 3ee387a7f7df2e9dbfd29d95b2b58b21486efd12..b4d7fbf38a276a5b7df18b2a771859427d5e7f1b 100644 (file)
@@ -22,7 +22,7 @@ import java.util.Vector;
  * accumulated.
  */
 public class AccumulatingFileFilter extends ValidFileFilter {
-    Vector<File> files = new Vector<File>();
+    Vector<File> files = new Vector<>();
     public final boolean accept(File f) {
         if (super.accept(f) && (accumulate(f))) {
             files.add(f);
index f42197873729bd33fa7107226b359241ae7c9288..c9a58e99f49838de2c2e76bebb6ad898fbb726ac 100644 (file)
@@ -445,7 +445,7 @@ public class Diffs {
        private static ArrayList getExcept(
                IMessage[] source,
                IMessage.Kind[] skip) {
-               ArrayList<IMessage> sink = new ArrayList<IMessage>();
+               ArrayList<IMessage> sink = new ArrayList<>();
                if (LangUtil.isEmpty(source)) {
                        return sink;
                }
index d7f6de21a0fa34fbb02b4ae651fefab25524b345..a576c4ae48e527f16e299fc2d49649012150a362 100644 (file)
@@ -186,10 +186,10 @@ public class LinkCheck {
         LangUtil.throwIaxIfNull(checkExists, "checkExists");
         LangUtil.throwIaxIfNull(checkContents, "checkContents");
         this.messages = new Messages(handler);
-        linksToCheck = new ArrayList<Link>();
-        checkedUrls = new ArrayList<String>();
-        refsToCheck = new ArrayList<String>();
-        validRefs = new ArrayList<String>();
+        linksToCheck = new ArrayList<>();
+        checkedUrls = new ArrayList<>();
+        refsToCheck = new ArrayList<>();
+        validRefs = new ArrayList<>();
         parser = new HTMLEditorKit() {
             public HTMLEditorKit.Parser getParser() {
                 return super.getParser();
@@ -221,7 +221,7 @@ public class LinkCheck {
     }
 
     public synchronized void run() {
-        ArrayList<Link> list = new ArrayList<Link>();
+        ArrayList<Link> list = new ArrayList<>();
         while (0 < linksToCheck.size()) {
             messages.checkingLinks(linksToCheck.size());
             list.clear();
index 1763e73dd0bcac1ce662d1b671b5ecc9e4a164fd..f49ba3b87b2b324a38306269a13d1d0dd4a76a42 100644 (file)
@@ -248,7 +248,7 @@ public class StructureModelUtil {
                } else {
                        packageContents = packageNode.getChildren();
                }
-               List<IProgramElement> files = new ArrayList<IProgramElement>();
+               List<IProgramElement> files = new ArrayList<>();
                for (IProgramElement packageItem : packageContents) {
                        if (packageItem.getKind() == IProgramElement.Kind.FILE_JAVA
                                        || packageItem.getKind() == IProgramElement.Kind.FILE_ASPECTJ) {
index 796bf03992bd2a9e997ed368d15660a54c5eb200..d6ebc774e8f3d8d3793e73c7739a98c80f744832 100644 (file)
@@ -35,7 +35,7 @@ import junit.framework.TestCase;
  */
 public class AjcSpecXmlReaderTest extends TestCase {
 
-       ArrayList<File> tempFiles = new ArrayList<File>();
+       ArrayList<File> tempFiles = new ArrayList<>();
        /**
         * Constructor for AjcSpecXmlReaderTest.
         * @param name
@@ -111,7 +111,7 @@ public class AjcSpecXmlReaderTest extends TestCase {
         String xml2Path = path + ".tmp.xml";
 
         final File file1 = new File(xmlPath);
-        final ArrayList<File> toDelete = new ArrayList<File>();
+        final ArrayList<File> toDelete = new ArrayList<>();
         final AjcSpecXmlReader writer = AjcSpecXmlReader.getReader();
 
         assertTrue("" + file1, file1.canRead());
@@ -154,7 +154,7 @@ public class AjcSpecXmlReaderTest extends TestCase {
         AjcSpecXmlReader writer = AjcSpecXmlReader.getReader();
         File file0 = new File(txtPath);
         File file1 = new File(xmlPath);
-        ArrayList<File> toDelete = new ArrayList<File>();
+        ArrayList<File> toDelete = new ArrayList<>();
         AjcTest.Suite.Spec suite0 = null;
         if (file0.canRead()) {
             System.out.println("reading " + file0);
index 6b1b8821c34f1a1a442b56118d11de19b563d556..4f50cefca86638cf761bc7b4fac866bab0926e9a 100644 (file)
@@ -69,11 +69,11 @@ public class CustomMungerExtensionTest extends AjdeInteractionTestbed {
        }
 
        class DumbCustomMungerFactory implements CustomMungerFactory {
-               Collection<ShadowMunger> allShadowMungers = new ArrayList<ShadowMunger>();
-               Collection<ConcreteTypeMunger> allTypeMungers = new ArrayList<ConcreteTypeMunger>();
+               Collection<ShadowMunger> allShadowMungers = new ArrayList<>();
+               Collection<ConcreteTypeMunger> allTypeMungers = new ArrayList<>();
 
                public Collection<ShadowMunger> createCustomShadowMungers(ResolvedType aspectType) {
-                       List<ShadowMunger> mungers = new ArrayList<ShadowMunger>();
+                       List<ShadowMunger> mungers = new ArrayList<>();
                        Pointcut pointcut = new IfPointcut("abc");
                        mungers.add(new DumbShadowMunger(new DeclareErrorOrWarning(false, pointcut, "")));
                        allShadowMungers.addAll(mungers);
@@ -81,7 +81,7 @@ public class CustomMungerExtensionTest extends AjdeInteractionTestbed {
                }
 
                public Collection<ConcreteTypeMunger> createCustomTypeMungers(ResolvedType aspectType) {
-                       List<ConcreteTypeMunger> mungers = new ArrayList<ConcreteTypeMunger>();
+                       List<ConcreteTypeMunger> mungers = new ArrayList<>();
                        mungers.add(new DumbTypeMunger(null, aspectType));
                        allTypeMungers.addAll(mungers);
                        return mungers;
index dd032b3a4342bd41035e13d27e633b2f88b03add..1b8e5c69a2442c8b120d3031ca343086cb8ea77e 100644 (file)
@@ -132,7 +132,7 @@ public class AbstractMultiProjectIncrementalAjdeInteractionTestbed extends AjdeI
        private void constructUpToDateLstFile(String pname, String configname) {
                File projectBase = new File(sandboxDir, pname);
                File toConstruct = new File(projectBase, configname);
-               List<String> filesForCompilation = new ArrayList<String>();
+               List<String> filesForCompilation = new ArrayList<>();
                collectUpFiles(projectBase, projectBase, filesForCompilation);
 
                try {
index ec1965ca539f1351d4f8d4ae3ed27b79c6f4534c..58ab1959d96b38dace4eb5edd08474e3b0b0e52c 100644 (file)
@@ -77,7 +77,7 @@ public class AjdeInteractionTestbed extends TestCase {
        }
 
        public void addXmlConfigFile(String projectName, String xmlfile) {
-               List<String> l = new ArrayList<String>();
+               List<String> l = new ArrayList<>();
                l.add(xmlfile);
                AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
                ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setProjectXmlConfigFiles(l);
@@ -116,7 +116,7 @@ public class AjdeInteractionTestbed extends TestCase {
 
        public void configureAspectPath(String projectName, File aspectpath) {
                AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
-               Set<File> s = new HashSet<File>();
+               Set<File> s = new HashSet<>();
                s.add(aspectpath);
                ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setAspectPath(s);
        }
@@ -137,7 +137,7 @@ public class AjdeInteractionTestbed extends TestCase {
        }
 
        public static void configureInPath(String projectName, File inpath) {
-               Set<File> s = new HashSet<File>();
+               Set<File> s = new HashSet<>();
                s.add(inpath);
                AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
                ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setInpath(s);
@@ -241,7 +241,7 @@ public class AjdeInteractionTestbed extends TestCase {
                File projectBase = new File(sandboxDir, pname);
                ICompilerConfiguration icc = compiler.getCompilerConfiguration();
                List<String> currentFiles = icc.getProjectSourceFiles();
-               List<String> filesForCompilation = new ArrayList<String>();
+               List<String> filesForCompilation = new ArrayList<>();
                collectUpFiles(projectBase, projectBase, filesForCompilation);
                boolean changed = false;
                for (String s : filesForCompilation) {
@@ -263,7 +263,7 @@ public class AjdeInteractionTestbed extends TestCase {
                File projectBase = new File(sandboxDir, pname);
                ICompilerConfiguration icc = compiler.getCompilerConfiguration();
                List<String> currentXmlFiles = icc.getProjectXmlConfigFiles();
-               List<String> collector = new ArrayList<String>();
+               List<String> collector = new ArrayList<>();
                collectUpXmlFiles(projectBase, projectBase, collector);
                boolean changed = false;
                for (String s : collector) {
@@ -501,7 +501,7 @@ public class AjdeInteractionTestbed extends TestCase {
 
                public static boolean informedAboutKindOfBuild;
                public static boolean fullBuildOccurred;
-               public static List<String> detectedDeletions = new ArrayList<String>();
+               public static List<String> detectedDeletions = new ArrayList<>();
                public static StringBuffer decisions = new StringBuffer();
 
                public static void reset() {
index 80434fa5c536be7d0229c3a2b8dd81b1e2457fdd..5e6708a2e51022dca8a82eac86070fef30cab36a 100644 (file)
@@ -42,7 +42,7 @@ public class AnnotationProcessingTests extends AbstractMultiProjectIncrementalAj
                configureProcessorOptions("ProcessorConsumer1","DemoProcessor");
                configureNonStandardCompileOptions("ProcessorConsumer1", "-showWeaveInfo");
 
-               Hashtable<String, String> javaOptions = new Hashtable<String, String>();
+               Hashtable<String, String> javaOptions = new Hashtable<>();
                javaOptions.put("org.eclipse.jdt.core.compiler.compliance", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.codegen.targetPlatform", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.source", "1.6");
@@ -70,7 +70,7 @@ public class AnnotationProcessingTests extends AbstractMultiProjectIncrementalAj
                configureProcessorPath("ProcessorConsumer2", getCompilerForProjectWithName("ProcessorProject2").getCompilerConfiguration().getOutputLocationManager().getDefaultOutputLocation().toString()+File.pathSeparator+
                                new File(testdataSrcDir + File.separatorChar + "ProcessorProject2" + File.separatorChar + "base"+File.separatorChar+"src").toString());
                
-               Hashtable<String, String> javaOptions = new Hashtable<String, String>();
+               Hashtable<String, String> javaOptions = new Hashtable<>();
                javaOptions.put("org.eclipse.jdt.core.compiler.compliance", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.codegen.targetPlatform", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.source", "1.6");
@@ -108,7 +108,7 @@ public class AnnotationProcessingTests extends AbstractMultiProjectIncrementalAj
 
                configureNonStandardCompileOptions("ProcessorConsumer1", "-showWeaveInfo");
 
-               Hashtable<String, String> javaOptions = new Hashtable<String, String>();
+               Hashtable<String, String> javaOptions = new Hashtable<>();
                javaOptions.put("org.eclipse.jdt.core.compiler.compliance", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.codegen.targetPlatform", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.source", "1.6");
@@ -144,7 +144,7 @@ public class AnnotationProcessingTests extends AbstractMultiProjectIncrementalAj
        }
        
        private void checkCompiledFiles(String projectName, String... expectedCompiledFiles) {
-               List<String> compiledFiles = new ArrayList<String>(getCompiledFiles(projectName));
+               List<String> compiledFiles = new ArrayList<>(getCompiledFiles(projectName));
                if (compiledFiles.size()!=expectedCompiledFiles.length) {
                        fail("Expected #"+expectedCompiledFiles.length+" files to be compiled but found that #"+compiledFiles.size()+" files were compiled.\nCompiled="+compiledFiles);
                }
index 6218ce3e4c3d6762195f28eb5248e5acfbfcb974..bbdb4a379d95382f9d006bd6112f08ce771fe207 100644 (file)
@@ -23,8 +23,8 @@ public class MultiProjTestBuildProgressMonitor implements IBuildProgressMonitor
 
        public boolean VERBOSE = false;
 
-       private List<String> compiledFiles = new ArrayList<String>();
-       private List<String> wovenClasses = new ArrayList<String>();
+       private List<String> compiledFiles = new ArrayList<>();
+       private List<String> wovenClasses = new ArrayList<>();
 
        private long starttime = 0;
        private long totaltimetaken = 0;
index e30c6f0eec6cd6b4449c786db3561d87631cc0fe..36be6773ed5c7be252e6d68431fffcbaaa0f7e07 100644 (file)
@@ -107,7 +107,7 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio
                if (javaOptionsMap != null && !javaOptionsMap.isEmpty())
                        return javaOptionsMap;
 
-               Hashtable<String, String> ht = new Hashtable<String, String>();
+               Hashtable<String, String> ht = new Hashtable<>();
                ht.put("org.eclipse.jdt.core.compiler.compliance", "1.5");
                ht.put("org.eclipse.jdt.core.compiler.codegen.targetPlatform", "1.5");
                ht.put("org.eclipse.jdt.core.compiler.source", "1.5");
@@ -158,7 +158,7 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio
 
        public void addDependancy(String projectItDependsOn) {
                if (dependants == null) {
-                       dependants = new ArrayList<String>();
+                       dependants = new ArrayList<>();
                }
                dependants.add(projectItDependsOn);
        }
@@ -211,7 +211,7 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio
 
        public void addProjectSourceFileChanged(File f) {
                if (this.modifiedFiles == null) {
-                       this.modifiedFiles = new ArrayList<File>();
+                       this.modifiedFiles = new ArrayList<>();
                }
                if (f != null) {
                        modifiedFiles.add(f);
@@ -220,7 +220,7 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio
 
        public void addClasspathEntryChanged(String f) {
                if (this.modifiedDirs == null) {
-                       this.modifiedDirs = new ArrayList<String>();
+                       this.modifiedDirs = new ArrayList<>();
                }
                if (f != null) {
                        modifiedDirs.add(f);
index fa66bede7f5026d959b17f10bf18af7130d78af0..24018e001a3c65a73e7c0d08fc5b48a928942644 100644 (file)
@@ -37,9 +37,9 @@ public class MultiProjTestMessageHandler implements IBuildMessageHandler {
 
        public MultiProjTestMessageHandler() {
                ignoring = new ArrayList<>();
-               errorMessages = new ArrayList<IMessage>();
-               warningMessages = new ArrayList<IMessage>();
-               weavingMessages = new ArrayList<IMessage>();
+               errorMessages = new ArrayList<>();
+               warningMessages = new ArrayList<>();
+               weavingMessages = new ArrayList<>();
                compilerErrors = new ArrayList<>();
                ignore(IMessage.INFO);
                ignore(IMessage.WEAVEINFO);
index c4ea8f120a5bff46310e4e244813a0d917802cfc..30793c396aea26b6de0507a962af2c0f8fab1682 100644 (file)
@@ -713,7 +713,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
        public void testOutputLocationCallbacks2() {
                String p = "pr268827_ol_res";
                initialiseProject(p);
-               Map<String,File> m = new HashMap<String,File>();
+               Map<String,File> m = new HashMap<>();
                m.put("a.txt", new File(getFile(p, "src/a.txt")));
                configureResourceMap(p, m);
                CustomOLM olm = new CustomOLM(getProjectRelativePath(p, ".").toString());
@@ -808,7 +808,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                String p = "pr266420";
                initialiseProject(p);
 
-               Hashtable<String,String> javaOptions = new Hashtable<String,String>();
+               Hashtable<String,String> javaOptions = new Hashtable<>();
                javaOptions.put("org.eclipse.jdt.core.compiler.compliance", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.codegen.targetPlatform", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.source", "1.6");
@@ -1635,7 +1635,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
        public void testInvalidAspectpath_pr121395() {
                initialiseProject("P1");
                File f = new File("foo.jar");
-               Set<File> s = new HashSet<File>();
+               Set<File> s = new HashSet<>();
                s.add(f);
                configureAspectPath("P1", s);
                build("P1"); // This first build will be batch
@@ -2188,7 +2188,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                List<String> viaIteratorList = exhaustTypeIterator(typeA.getHierarchy(wantGenerics, false));
                List<ResolvedType> typeDirectlyList = typeA.getHierarchyWithoutIterator(true, true, wantGenerics);
                assertFalse(viaIteratorList.isEmpty());
-               List<String> directlyList = new ArrayList<String>();
+               List<String> directlyList = new ArrayList<>();
                for (ResolvedType type : typeDirectlyList) {
                        String n = type.getName();
                        if (!directlyList.contains(n)) {
@@ -2252,7 +2252,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
        }
 
        private List<ResolvedMember> getThemAll(Iterator<ResolvedMember> methods) {
-               List<ResolvedMember> allOfThem = new ArrayList<ResolvedMember>();
+               List<ResolvedMember> allOfThem = new ArrayList<>();
                while (methods.hasNext()) {
                        allOfThem.add(methods.next());
                }
@@ -2260,7 +2260,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
        }
 
        private List<String> exhaustTypeIterator(Iterator<ResolvedType> types) {
-               List<String> allOfThem = new ArrayList<String>();
+               List<String> allOfThem = new ArrayList<>();
                while (types.hasNext()) {
                        allOfThem.add(types.next().getName());
                }
@@ -3614,7 +3614,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
        public void testPR164384_1() {
                initialiseProject("PR164384");
 
-               Hashtable<String, String> javaOptions = new Hashtable<String, String>();
+               Hashtable<String, String> javaOptions = new Hashtable<>();
                javaOptions.put("org.eclipse.jdt.core.compiler.compliance", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.codegen.targetPlatform", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.source", "1.6");
@@ -3646,7 +3646,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
        public void testPR164384_2() {
                initialiseProject("PR164384");
 
-               Hashtable<String, String> javaOptions = new Hashtable<String, String>();
+               Hashtable<String, String> javaOptions = new Hashtable<>();
                javaOptions.put("org.eclipse.jdt.core.compiler.compliance", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.codegen.targetPlatform", "1.5");
                javaOptions.put("org.eclipse.jdt.core.compiler.source", "1.5");
@@ -3676,7 +3676,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
        public void testPR164384_3() {
                initialiseProject("PR164384");
 
-               Hashtable<String, String> javaOptions = new Hashtable<String, String>();
+               Hashtable<String, String> javaOptions = new Hashtable<>();
                javaOptions.put("org.eclipse.jdt.core.compiler.compliance", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.codegen.targetPlatform", "1.6");
                javaOptions.put("org.eclipse.jdt.core.compiler.source", "1.5");
@@ -3709,7 +3709,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
 
                // set up the inpath to have the directory on it's path
                File f = new File(inpathDir);
-               Set<File> s = new HashSet<File>();
+               Set<File> s = new HashSet<>();
                s.add(f);
                configureInPath("inpathTesting", s);
                build("inpathTesting");
@@ -3744,7 +3744,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                // set up the inpath to have the directory on it's path
                System.out.println(inpathDir);
                File f = new File(inpathDir);
-               Set<File> s = new HashSet<File>();
+               Set<File> s = new HashSet<>();
                s.add(f);
                configureInPath(p, s);
                build(p);
@@ -3775,7 +3775,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
 
                // set up the inpath to have the directory on it's path
                File f = new File(inpathDir);
-               Set<File> s = new HashSet<File>();
+               Set<File> s = new HashSet<>();
                s.add(f);
                configureInPath(p, s);
 
@@ -3813,9 +3813,9 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                // set up the inpath to have the directory on it's path
                System.out.println(inpathDir);
                File f = new File(inpathDir);
-               Set<File> s = new HashSet<File>();
+               Set<File> s = new HashSet<>();
                s.add(f);
-               Map<File, String> m = new HashMap<File, String>();
+               Map<File, String> m = new HashMap<>();
                m.put(f, "wibble");
                configureOutputLocationManager(p, new TestOutputLocationManager(getProjectRelativePath(p, ".").toString(), m));
 
@@ -3934,7 +3934,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                for (IRelationship element : rels) {
                        List<String> targets = element.getTargets();
                        if (output == null) {
-                               output = new ArrayList<String>();
+                               output = new ArrayList<>();
                        }
                        output.addAll(targets);
                }
index b2c3ca6c9c8ab65edf522555fcb75f3558b975b6..c0cf11977b896eb09049441b5be7d5fc22b807cc 100644 (file)
@@ -133,7 +133,7 @@ public abstract class ModelTestCase extends XMLBasedAjcTestCase {
        private void compareModel(File expectedF) {
                if (debugTest)
                        System.out.println("comparing with model in file " + expectedF.getAbsolutePath());
-               List<String> fileContents = new ArrayList<String>();
+               List<String> fileContents = new ArrayList<>();
                try {
                        // String sandboxDir = ajc.getSandboxDirectory().getAbsolutePath();
                        String modelOutput = modelFilename;
@@ -144,13 +144,13 @@ public abstract class ModelTestCase extends XMLBasedAjcTestCase {
                        while ((expectedLine = expect.readLine()) != null) {
                                fileContents.add(expectedLine);
                        }
-                       List<String> expectedFileContents = new ArrayList<String>();
+                       List<String> expectedFileContents = new ArrayList<>();
                        expectedFileContents.addAll(fileContents);
 
                        // Load the file with the output from this test run
                        BufferedReader found = new BufferedReader(new FileReader(new File(modelOutput)));
                        String foundLine = null;
-                       List<String> foundFileContents = new ArrayList<String>();
+                       List<String> foundFileContents = new ArrayList<>();
                        while ((foundLine = found.readLine()) != null) {
                                // int i = foundLine.indexOf(sandboxDir);
                                // if (i == -1) {
index 1927f47a09fa1270579196665012699a31350d7c..976c3ccbcefe28381c7a97f8f2fb922cc26f62f5 100644 (file)
@@ -686,7 +686,7 @@ public class FileUtil {
         * @return ArrayList with String paths of File under srcDir (relative to srcDir)
         */
        public static String[] listFiles(File srcDir) {
-               ArrayList<String> result = new ArrayList<String>();
+               ArrayList<String> result = new ArrayList<>();
                if ((null != srcDir) && srcDir.canRead()) {
                        listFiles(srcDir, null, result);
                }
@@ -706,7 +706,7 @@ public class FileUtil {
         * @return ArrayList with String paths of File under srcDir (relative to srcDir)
         */
        public static File[] listFiles(File srcDir, FileFilter fileFilter) {
-               ArrayList<File> result = new ArrayList<File>();
+               ArrayList<File> result = new ArrayList<>();
                if ((null != srcDir) && srcDir.canRead()) {
                        listFiles(srcDir, result, fileFilter);
                }
@@ -719,7 +719,7 @@ public class FileUtil {
         * @return List of File objects
         */
        public static List<File> listClassFiles(File dir) {
-               ArrayList<File> result = new ArrayList<File>();
+               ArrayList<File> result = new ArrayList<>();
                if ((null != dir) && dir.canRead()) {
                        listClassFiles(dir, result);
                }
@@ -750,7 +750,7 @@ public class FileUtil {
                LangUtil.throwIaxIfNull(paths, "paths");
                File[] result = null;
                if (!LangUtil.isEmpty(suffixes)) {
-                       ArrayList<File> list = new ArrayList<File>();
+                       ArrayList<File> list = new ArrayList<>();
             for (String path : paths) {
                 for (String suffix : suffixes) {
                     if (path.endsWith(suffix)) {
@@ -1273,7 +1273,7 @@ public class FileUtil {
                if (LangUtil.isEmpty(sought) || LangUtil.isEmpty(sources)) {
                        return Collections.emptyList();
                }
-               ArrayList<String> result = new ArrayList<String>();
+               ArrayList<String> result = new ArrayList<>();
         for (String path : sources) {
             String error = lineSeek(sought, path, listAll, result);
             if ((null != error) && (null != errorSink)) {
@@ -1427,7 +1427,7 @@ public class FileUtil {
        }
 
        public static List<String> makeClasspath(URL[] urls) {
-               List<String> ret = new LinkedList<String>();
+               List<String> ret = new LinkedList<>();
                if (urls != null) {
             for (URL url : urls) {
                 ret.add(toPathString(url));
index 27670cc00d0ddbdcf86a4788cb7417b73b1542d9..3e1e0e7b3cf6632c95cdbf6acc25044281418161 100644 (file)
@@ -46,7 +46,7 @@ public class GenericSignatureParser {
                GenericSignature.ClassSignature classSig = new GenericSignature.ClassSignature();
                // FormalTypeParameters-opt
                if (maybeEat("<")) {
-                       List<FormalTypeParameter> formalTypeParametersList = new ArrayList<FormalTypeParameter>();
+                       List<FormalTypeParameter> formalTypeParametersList = new ArrayList<>();
                        do {
                                formalTypeParametersList.add(parseFormalTypeParameter());
                        } while (!maybeEat(">"));
@@ -54,7 +54,7 @@ public class GenericSignatureParser {
                        formalTypeParametersList.toArray(classSig.formalTypeParameters);
                }
                classSig.superclassSignature = parseClassTypeSignature();
-               List<ClassTypeSignature> superIntSigs = new ArrayList<ClassTypeSignature>();
+               List<ClassTypeSignature> superIntSigs = new ArrayList<>();
                while (tokenIndex < tokenStream.length) {
                        superIntSigs.add(parseClassTypeSignature());
                }
@@ -75,7 +75,7 @@ public class GenericSignatureParser {
                TypeSignature returnType = null;
                // FormalTypeParameters-opt
                if (maybeEat("<")) {
-                       List<FormalTypeParameter> formalTypeParametersList = new ArrayList<FormalTypeParameter>();
+                       List<FormalTypeParameter> formalTypeParametersList = new ArrayList<>();
                        do {
                                formalTypeParametersList.add(parseFormalTypeParameter());
                        } while (!maybeEat(">"));
@@ -84,7 +84,7 @@ public class GenericSignatureParser {
                }
                // Parameters
                eat("(");
-               List<TypeSignature> paramList = new ArrayList<TypeSignature>();
+               List<TypeSignature> paramList = new ArrayList<>();
                while (!maybeEat(")")) {
                        FieldTypeSignature fsig = parseFieldTypeSignature(true);
                        if (fsig != null) {
@@ -100,7 +100,7 @@ public class GenericSignatureParser {
                if (returnType == null)
                        returnType = new GenericSignature.BaseTypeSignature(eatIdentifier());
                // throws
-               List<FieldTypeSignature> throwsList = new ArrayList<FieldTypeSignature>();
+               List<FieldTypeSignature> throwsList = new ArrayList<>();
                while (maybeEat("^")) {
                        FieldTypeSignature fsig = parseFieldTypeSignature(false);
                        throwsList.add(fsig);
@@ -132,7 +132,7 @@ public class GenericSignatureParser {
                        ftp.classBound = new ClassTypeSignature("Ljava/lang/Object;", "Ljava/lang/Object");
                }
                // Optional InterfaceBounds
-               List<FieldTypeSignature> optionalBounds = new ArrayList<FieldTypeSignature>();
+               List<FieldTypeSignature> optionalBounds = new ArrayList<>();
                while (maybeEat(":")) {
                        optionalBounds.add(parseFieldTypeSignature(false));
                }
@@ -218,7 +218,7 @@ public class GenericSignatureParser {
        private SimpleClassTypeSignature[] parseNestedTypesHelper(StringBuffer ret) {
                boolean brokenSignature = false;
                SimpleClassTypeSignature[] nestedTypes;
-               List<SimpleClassTypeSignature> nestedTypeList = new ArrayList<SimpleClassTypeSignature>();
+               List<SimpleClassTypeSignature> nestedTypeList = new ArrayList<>();
                while (maybeEat(".")) {
                        ret.append(".");
                        SimpleClassTypeSignature sig = parseSimpleClassTypeSignature();
@@ -270,7 +270,7 @@ public class GenericSignatureParser {
 
        private TypeArgument[] maybeParseTypeArguments() {
                if (maybeEat("<")) {
-                       List<TypeArgument> typeArgs = new ArrayList<TypeArgument>();
+                       List<TypeArgument> typeArgs = new ArrayList<>();
                        do {
                                TypeArgument arg = parseTypeArgument();
                                typeArgs.add(arg);
@@ -317,7 +317,7 @@ public class GenericSignatureParser {
        public String[] tokenize(String signatureString) {
                char[] chars = signatureString.toCharArray();
                int index = 0;
-               List<String> tokens = new ArrayList<String>();
+               List<String> tokens = new ArrayList<>();
                StringBuffer identifier = new StringBuffer();
                boolean inParens = false;
                boolean inArray = false;
index ffdc0b66e6e2f558167cd70235ef0108dacd3414..5c656cd7ad3e209d2a280642b23ba71406b59850 100644 (file)
@@ -113,7 +113,7 @@ public class LangUtil {
        }
 
        private static List<Integer> getFirstNumbers(String vm) {
-               List<Integer> result = new ArrayList<Integer>();
+               List<Integer> result = new ArrayList<>();
                StringTokenizer st = new StringTokenizer(vm,".-_");
                try {
                        result.add(Integer.parseInt(st.nextToken()));
@@ -312,7 +312,7 @@ public class LangUtil {
                        return new String[0];
                }
                StringTokenizer st = new StringTokenizer(classpath, File.pathSeparator);
-               ArrayList<String> result = new ArrayList<String>(st.countTokens());
+               ArrayList<String> result = new ArrayList<>(st.countTokens());
                while (st.hasMoreTokens()) {
                        String entry = st.nextToken();
                        if (!LangUtil.isEmpty(entry)) {
@@ -354,7 +354,7 @@ public class LangUtil {
                if (null == input) {
                        return Collections.emptyList();
                }
-               ArrayList<String> result = new ArrayList<String>();
+               ArrayList<String> result = new ArrayList<>();
 
                if (LangUtil.isEmpty(delim) || (!input.contains(delim))) {
                        result.add(input.trim());
@@ -376,7 +376,7 @@ public class LangUtil {
                if (LangUtil.isEmpty(text)) {
                        return Collections.emptyList();
                }
-               List<String> strings = new ArrayList<String>();
+               List<String> strings = new ArrayList<>();
                StringTokenizer tok = new StringTokenizer(text);
                while (tok.hasMoreTokens()) {
                        strings.add(tok.nextToken());
@@ -740,7 +740,7 @@ public class LangUtil {
                if (0 == sourceLength) {
                        resultSize = 0;
                } else {
-                       result = new ArrayList<Object>(sourceLength);
+                       result = new ArrayList<>(sourceLength);
                        for (int i = 0; i < sourceLength; i++) {
                                if ((null != source[i]) && (sinkType.isAssignableFrom(source[i].getClass()))) {
                                        result.add(source[i]);
@@ -897,7 +897,7 @@ public class LangUtil {
                if (null == checker || (null == stack) || (0 == stack.length())) {
                        return;
                }
-               final LinkedList<String> lines = new LinkedList<String>();
+               final LinkedList<String> lines = new LinkedList<>();
                StringTokenizer st = new StringTokenizer(stack.toString(), "\n\r");
                while (st.hasMoreTokens() && (0 < --maxLines)) {
                        lines.add(st.nextToken());
@@ -995,7 +995,7 @@ public class LangUtil {
                if ((null == array) || (1 > array.length)) {
                        return Collections.emptyList();
                }
-               ArrayList<T> list = new ArrayList<T>();
+               ArrayList<T> list = new ArrayList<>();
                list.addAll(Arrays.asList(array));
                return list;
        }
@@ -1073,7 +1073,7 @@ public class LangUtil {
         */
        public static ProcessController makeProcess(ProcessController controller, String classpath, String mainClass, String[] args) {
                File java = LangUtil.getJavaExecutable();
-               ArrayList<String> cmd = new ArrayList<String>();
+               ArrayList<String> cmd = new ArrayList<>();
                cmd.add(java.getAbsolutePath());
                cmd.add("-classpath");
                cmd.add(classpath);
@@ -1262,7 +1262,7 @@ public class LangUtil {
                        LangUtil.throwIaxIfNull(java, "java");
                        LangUtil.throwIaxIfNull(mainClass, "mainClass");
                        LangUtil.throwIaxIfNull(args, "args");
-                       ArrayList<String> cmd = new ArrayList<String>();
+                       ArrayList<String> cmd = new ArrayList<>();
                        cmd.add(java.getAbsolutePath());
                        cmd.add("-classpath");
                        cmd.add(classpath);
index 14f23b0d6252dd2b01924f7f1533206ed5527ef3..be59104a0f2b89046ac04fedf68f25d37d4d7e4f 100644 (file)
@@ -51,8 +51,8 @@ public class PartialOrder {
 
        private static class SortObject<T extends PartialComparable> {
                T object;
-               List<SortObject<T>> smallerObjects = new LinkedList<SortObject<T>>();
-               List<SortObject<T>> biggerObjects = new LinkedList<SortObject<T>>();
+               List<SortObject<T>> smallerObjects = new LinkedList<>();
+               List<SortObject<T>> biggerObjects = new LinkedList<>();
 
                public SortObject(T o) {
                        object = o;
@@ -87,7 +87,7 @@ public class PartialOrder {
        }
 
        private static <T extends PartialComparable> void addNewPartialComparable(List<SortObject<T>> graph, T o) {
-               SortObject<T> so = new SortObject<T>(o);
+               SortObject<T> so = new SortObject<>(o);
                for (SortObject<T> other : graph) {
                        so.addDirectedLinks(other);
                }
@@ -123,7 +123,7 @@ public class PartialOrder {
 
                // ??? I don't like creating this data structure, but it does give good
                // ??? separation of concerns.
-               List<SortObject<T>> sortList = new LinkedList<SortObject<T>>();
+               List<SortObject<T>> sortList = new LinkedList<>();
                for (T object : objects) {
                        addNewPartialComparable(sortList, object);
                }
@@ -193,7 +193,7 @@ public class PartialOrder {
        }
 
        public static void main(String[] args) {
-               List<Token> l = new ArrayList<Token>();
+               List<Token> l = new ArrayList<>();
                l.add(new Token("a1"));
                l.add(new Token("c2"));
                l.add(new Token("b3"));
index d78f671012d0cb8df3ed028811f647d13c6e6d1c..614bb4b76cbacbaa213cc146fab976fb34f46108 100644 (file)
@@ -96,9 +96,9 @@ public class Reflection {
             runMainInSameVM(mainClass, args);
             return;            
         }
-        ArrayList<File> dirs = new ArrayList<File>();
-        ArrayList<File> libs = new ArrayList<File>();
-        ArrayList<URL> urls = new ArrayList<URL>();
+        ArrayList<File> dirs = new ArrayList<>();
+        ArrayList<File> libs = new ArrayList<>();
+        ArrayList<URL> urls = new ArrayList<>();
         String[] entries = LangUtil.splitClasspath(classpath);
                for (String entry : entries) {
                        URL url = makeURL(entry);
index 7660525d183bf4fb7b6be5ac30ceb1df6707fafe..8af2e63048d2932687d7035416ae2f4dd209303f 100644 (file)
@@ -19,7 +19,7 @@ public class SoftHashMap<K,V> extends AbstractMap<K,V> {
        private ReferenceQueue<? super V> rq = new ReferenceQueue();
 
        public SoftHashMap() {
-               this.map = new HashMap<K,SpecialValue>();
+               this.map = new HashMap<>();
        }
        
        class SpecialValue extends SoftReference<V> {
@@ -65,7 +65,7 @@ public class SoftHashMap<K,V> extends AbstractMap<K,V> {
        @Override
        public java.util.Set<Map.Entry<K,V>> entrySet() {
                if (map.isEmpty()) { return Collections.<K,V>emptyMap().entrySet(); }
-               Map<K,V> currentContents = new HashMap<K,V>();
+               Map<K,V> currentContents = new HashMap<>();
                for (Map.Entry<K,SpecialValue> entry: map.entrySet()) {
                        V currentValueForEntry = entry.getValue().get();
                        if (currentValueForEntry != null) {
index 4704bfcc93096c1dacbe61f25bdb0814487b3005..b4d09533f96ccd0f5563cbde04fa2325ea55729b 100644 (file)
@@ -40,7 +40,7 @@ public class UtilClassLoader extends URLClassLoader {
         super(urls);
         LangUtil.throwIaxIfNotAssignable(dirs, File.class, "dirs");
         this.urlsForDebugString = urls;
-        ArrayList<File> dcopy = new ArrayList<File>();
+        ArrayList<File> dcopy = new ArrayList<>();
         
         if (!LangUtil.isEmpty(dirs)) {
             dcopy.addAll(Arrays.asList(dirs));
index 663352be6cd8183d58345bf2f3833e43b66f70d3..7936914fb622349a0bb53eaf45227bac9e667a4c 100644 (file)
@@ -129,7 +129,7 @@ public class FileUtilTest extends TestCase {
         * @return sorted String[] of all paths to all files under dir ending with one of the listed suffixes but not starting with "."
         */
        public static String[] dirPaths(File dir, String[] suffixes) {
-               ArrayList<String> result = new ArrayList<String>();
+               ArrayList<String> result = new ArrayList<>();
                doDirPaths(dir, result);
                // if suffixes required, remove those without suffixes
                if (!LangUtil.isEmpty(suffixes)) {
@@ -192,7 +192,7 @@ public class FileUtilTest extends TestCase {
 
        public FileUtilTest(String s) {
                super(s);
-               tempFiles = new ArrayList<File>();
+               tempFiles = new ArrayList<>();
        }
 
        public void tearDown() {
@@ -459,10 +459,10 @@ public class FileUtilTest extends TestCase {
                contents += contents;
                FileUtil.writeAsString(file, contents);
                tempFiles.add(file);
-               List<String> sourceList = new ArrayList<String>();
+               List<String> sourceList = new ArrayList<>();
                sourceList.add(file.getPath());
 
-               final ArrayList<String> errors = new ArrayList<String>();
+               final ArrayList<String> errors = new ArrayList<>();
                final PrintStream errorSink = new PrintStream(System.err, true) {
                        public void println(String error) {
                                errors.add(error);
index 971ee314dda7149cc2532aec4e88167920be9644..b91496ea710f5403e4d4ce5a98f081e571baa2e3 100644 (file)
@@ -109,7 +109,7 @@ public class AtAjAttributes {
                /**
                 * The list of AjAttribute.XXX that we are populating from the @AJ read
                 */
-               List<AjAttribute> ajAttributes = new ArrayList<AjAttribute>();
+               List<AjAttribute> ajAttributes = new ArrayList<>();
 
                /**
                 * The resolved type (class) for which we are reading @AJ for (be it class, method, field annotations)
@@ -721,7 +721,7 @@ public class AtAjAttributes {
                                        FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0];
                                        IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings);
                                        // first add the declare implements like
-                                       List<TypePattern> parents = new ArrayList<TypePattern>(1);
+                                       List<TypePattern> parents = new ArrayList<>(1);
                                        parents.add(parent);
                                        DeclareParents dp = new DeclareParents(typePattern, parents, false);
                                        dp.resolve(binding); // resolves the parent and child parts of the decp
@@ -923,8 +923,8 @@ public class AtAjAttributes {
                // supplied as just the class return value of the annotated method
                NameValuePair interfaceListSpecified = getAnnotationElement(declareMixinAnnotation, "interfaces");
 
-               List<TypePattern> newParents = new ArrayList<TypePattern>(1);
-               List<ResolvedType> newInterfaceTypes = new ArrayList<ResolvedType>(1);
+               List<TypePattern> newParents = new ArrayList<>(1);
+               List<ResolvedType> newInterfaceTypes = new ArrayList<>(1);
                if (interfaceListSpecified != null) {
                        ArrayElementValue arrayOfInterfaceTypes = (ArrayElementValue) interfaceListSpecified.getValue();
                        int numberOfTypes = arrayOfInterfaceTypes.getElementValuesArraySize();
@@ -1558,7 +1558,7 @@ public class AtAjAttributes {
                        throw new UnreadableDebugInfoException();
                }
 
-               List<FormalBinding> bindings = new ArrayList<FormalBinding>();
+               List<FormalBinding> bindings = new ArrayList<>();
                for (int i = 0; i < argumentNames.length; i++) {
                        String argumentName = argumentNames[i];
                        UnresolvedType argumentType = UnresolvedType.forSignature(method.getArgumentTypes()[i].getSignature());
@@ -1726,7 +1726,7 @@ public class AtAjAttributes {
                }
 
                final int startAtStackIndex = method.isStatic() ? 0 : 1;
-               final List<MethodArgument> arguments = new ArrayList<MethodArgument>();
+               final List<MethodArgument> arguments = new ArrayList<>();
                LocalVariableTable lt = method.getLocalVariableTable();
                if (lt != null) {
                        LocalVariable[] lvt = lt.getLocalVariableTable();
@@ -1807,7 +1807,7 @@ public class AtAjAttributes {
        private static String[] extractArgNamesFromAnnotationValue(Method method, String argNamesFromAnnotation,
                        AjAttributeMethodStruct methodStruct) {
                StringTokenizer st = new StringTokenizer(argNamesFromAnnotation, " ,");
-               List<String> args = new ArrayList<String>();
+               List<String> args = new ArrayList<>();
                while (st.hasMoreTokens()) {
                        args.add(st.nextToken());
                }
@@ -1899,7 +1899,7 @@ public class AtAjAttributes {
        private static void setIgnoreUnboundBindingNames(Pointcut pointcut, FormalBinding[] bindings) {
                // register ImplicitBindings as to be ignored since unbound
                // TODO is it likely to fail in a bad way if f.e. this(jp) etc ?
-               List<String> ignores = new ArrayList<String>();
+               List<String> ignores = new ArrayList<>();
                for (FormalBinding formalBinding : bindings) {
                        if (formalBinding instanceof FormalBinding.ImplicitFormalBinding) {
                                ignores.add(formalBinding.getName());
index 8d2709966bd4902c80ac33f01f3a4827f14a0592..497df1a3a80b288adeb6181dc3422471f5775d4e 100644 (file)
@@ -72,8 +72,8 @@ public class BcelAccessForInlineMunger extends BcelTypeMunger {
        @Override
        public boolean munge(BcelClassWeaver weaver) {
                aspectGen = weaver.getLazyClassGen();
-               inlineAccessors = new HashMap<String, ResolvedMember>(0);
-               inlineAccessorMethodGens = new HashSet<LazyMethodGen>();
+               inlineAccessors = new HashMap<>(0);
+               inlineAccessorMethodGens = new HashSet<>();
 
                // look for all @Around advices
                for (LazyMethodGen methodGen : aspectGen.getMethodGens()) {
@@ -238,7 +238,7 @@ public class BcelAccessForInlineMunger extends BcelTypeMunger {
                        InstructionFactory factory = aspectGen.getFactory();
                        LazyMethodGen method = makeMethodGen(aspectGen, inlineAccessor);
                        method.makeSynthetic();
-                       List<AjAttribute> methodAttributes = new ArrayList<AjAttribute>();
+                       List<AjAttribute> methodAttributes = new ArrayList<>();
                        methodAttributes.add(new AjAttribute.AjSynthetic());
                        methodAttributes.add(new AjAttribute.EffectiveSignatureAttribute(resolvedMember, Shadow.MethodCall, false));
                        method.addAttribute(Utility.bcelAttribute(methodAttributes.get(0), aspectGen.getConstantPool()));
@@ -282,7 +282,7 @@ public class BcelAccessForInlineMunger extends BcelTypeMunger {
                        LazyMethodGen method = makeMethodGen(aspectGen, inlineAccessor);
                        // flag it synthetic, AjSynthetic
                        method.makeSynthetic();
-                       List<AjAttribute> methodAttributes = new ArrayList<AjAttribute>();
+                       List<AjAttribute> methodAttributes = new ArrayList<>();
                        methodAttributes.add(new AjAttribute.AjSynthetic());
                        methodAttributes.add(new AjAttribute.EffectiveSignatureAttribute(resolvedMember, Shadow.MethodCall, false));
                        method.addAttribute(Utility.bcelAttribute(methodAttributes.get(0), aspectGen.getConstantPool()));
@@ -326,7 +326,7 @@ public class BcelAccessForInlineMunger extends BcelTypeMunger {
                        LazyMethodGen method = makeMethodGen(aspectGen, inlineAccessor);
                        // flag it synthetic, AjSynthetic
                        method.makeSynthetic();
-                       List<AjAttribute> methodAttributes = new ArrayList<AjAttribute>();
+                       List<AjAttribute> methodAttributes = new ArrayList<>();
                        methodAttributes.add(new AjAttribute.AjSynthetic());
                        methodAttributes.add(new AjAttribute.EffectiveSignatureAttribute(resolvedMember, Shadow.FieldGet, false));
                        // flag the effective signature, so that we can deobfuscate the signature to apply method call pointcut
@@ -367,7 +367,7 @@ public class BcelAccessForInlineMunger extends BcelTypeMunger {
                        LazyMethodGen method = makeMethodGen(aspectGen, inlineAccessor);
                        // flag it synthetic, AjSynthetic
                        method.makeSynthetic();
-                       List<AjAttribute> methodAttributes = new ArrayList<AjAttribute>();
+                       List<AjAttribute> methodAttributes = new ArrayList<>();
                        methodAttributes.add(new AjAttribute.AjSynthetic());
                        methodAttributes.add(new AjAttribute.EffectiveSignatureAttribute(resolvedMember, Shadow.FieldSet, false));
                        method.addAttribute(Utility.bcelAttribute(methodAttributes.get(0), aspectGen.getConstantPool()));
index 7736addcd9e73ded3adfd20662c0e17bc1e9eadc..85cd66e540d8af620005a59c74e0d8666fc2a9ad 100644 (file)
@@ -423,7 +423,7 @@ class BcelAdvice extends Advice {
                        return Collections.emptyList();
                }
 
-               Collection<ResolvedType> ret = new ArrayList<ResolvedType>();
+               Collection<ResolvedType> ret = new ArrayList<>();
                World world = concreteAspect.getWorld();
                ResolvedType runtimeException = world.getCoreType(UnresolvedType.RUNTIME_EXCEPTION);
                ResolvedType error = world.getCoreType(UnresolvedType.ERROR);
index b11afc77d7c26636001f1ea693c801c6df83a3b7..73699f2a01a734fda8938f389d7ea452038eb169 100644 (file)
@@ -75,7 +75,7 @@ public class BcelAnnotation extends AbstractAnnotationAJ {
                NameValuePair envp = values.get(0);
                ArrayElementValue aev = (ArrayElementValue) envp.getValue();
                ElementValue[] evs = aev.getElementValuesArray();
-               Set<String> targets = new HashSet<String>();
+               Set<String> targets = new HashSet<>();
                for (ElementValue elementValue : evs) {
                        EnumElementValue ev = (EnumElementValue) elementValue;
                        targets.add(ev.getEnumValueString());
index 2e0b8e5f3b6b64fb60f5e745cd5cebd713338ca6..8bd4793321a303d418b3ff0941412589b7bdc47b 100644 (file)
@@ -119,17 +119,17 @@ class BcelClassWeaver implements IClassWeaver {
        private final ConstantPool cpg; // alias of clazz.getConstantPoolGen()
        private final InstructionFactory fact; // alias of clazz.getFactory();
 
-       private final List<LazyMethodGen> addedLazyMethodGens = new ArrayList<LazyMethodGen>();
-       private final Set<ResolvedMember> addedDispatchTargets = new HashSet<ResolvedMember>();
+       private final List<LazyMethodGen> addedLazyMethodGens = new ArrayList<>();
+       private final Set<ResolvedMember> addedDispatchTargets = new HashSet<>();
 
        private boolean inReweavableMode = false;
 
        private List<IfaceInitList> addedSuperInitializersAsList = null;
-       private final Map<ResolvedType, IfaceInitList> addedSuperInitializers = new HashMap<ResolvedType, IfaceInitList>();
-       private final List<ConcreteTypeMunger> addedThisInitializers = new ArrayList<ConcreteTypeMunger>();
-       private final List<ConcreteTypeMunger> addedClassInitializers = new ArrayList<ConcreteTypeMunger>();
+       private final Map<ResolvedType, IfaceInitList> addedSuperInitializers = new HashMap<>();
+       private final List<ConcreteTypeMunger> addedThisInitializers = new ArrayList<>();
+       private final List<ConcreteTypeMunger> addedClassInitializers = new ArrayList<>();
 
-       private final Map<ResolvedMember, ResolvedMember> mapToAnnotationHolder = new HashMap<ResolvedMember, ResolvedMember>();
+       private final Map<ResolvedMember, ResolvedMember> mapToAnnotationHolder = new HashMap<>();
 
        // private BcelShadow clinitShadow = null;
 
@@ -137,7 +137,7 @@ class BcelClassWeaver implements IClassWeaver {
         * This holds the initialization and pre-initialization shadows for this class that were actually matched by mungers (if no
         * match, then we don't even create the shadows really).
         */
-       private final List<BcelShadow> initializationShadows = new ArrayList<BcelShadow>();
+       private final List<BcelShadow> initializationShadows = new ArrayList<>();
 
        private BcelClassWeaver(BcelWorld world, LazyClassGen clazz, List<ShadowMunger> shadowMungers,
                        List<ConcreteTypeMunger> typeMungers, List<ConcreteTypeMunger> lateTypeMungers) {
@@ -209,7 +209,7 @@ class BcelClassWeaver implements IClassWeaver {
                                if (kind.isSet(couldMatchKinds)) {
                                        byte k = kind.getKey();
                                        if (indexedShadowMungers[k] == null) {
-                                               indexedShadowMungers[k] = new ArrayList<ShadowMunger>();
+                                               indexedShadowMungers[k] = new ArrayList<>();
                                                if (!kind.isEnclosingKind()) {
                                                        canMatchBodyShadows = true;
                                                }
@@ -254,7 +254,7 @@ class BcelClassWeaver implements IClassWeaver {
 
        private static class IfaceInitList implements PartialOrder.PartialComparable {
                final ResolvedType onType;
-               List<ConcreteTypeMunger> list = new ArrayList<ConcreteTypeMunger>();
+               List<ConcreteTypeMunger> list = new ArrayList<>();
 
                IfaceInitList(ResolvedType onType) {
                        this.onType = onType;
@@ -418,7 +418,7 @@ class BcelClassWeaver implements IClassWeaver {
 
                Set<String> aspectsAffectingType = null;
                if (inReweavableMode || clazz.getType().isAspect()) {
-                       aspectsAffectingType = new HashSet<String>();
+                       aspectsAffectingType = new HashSet<>();
                }
 
                boolean isChanged = false;
@@ -457,7 +457,7 @@ class BcelClassWeaver implements IClassWeaver {
                // sort according to: Major: type hierarchy
                // within each list: dominates
                // don't forget to sort addedThisInitialiers according to dominates
-               addedSuperInitializersAsList = new ArrayList<IfaceInitList>(addedSuperInitializers.values());
+               addedSuperInitializersAsList = new ArrayList<>(addedSuperInitializers.values());
                addedSuperInitializersAsList = PartialOrder.sort(addedSuperInitializersAsList);
                if (addedSuperInitializersAsList == null) {
                        throw new BCException("circularity in inter-types");
@@ -471,7 +471,7 @@ class BcelClassWeaver implements IClassWeaver {
                // now go through each method, and match against each method. This
                // sets up each method's {@link LazyMethodGen#matchedShadows} field,
                // and it also possibly adds to {@link #initializationShadows}.
-               List<LazyMethodGen> methodGens = new ArrayList<LazyMethodGen>(clazz.getMethodGens());
+               List<LazyMethodGen> methodGens = new ArrayList<>(clazz.getMethodGens());
                for (LazyMethodGen member : methodGens) {
                        if (!member.hasBody()) {
                                continue;
@@ -504,7 +504,7 @@ class BcelClassWeaver implements IClassWeaver {
                        // Repeat next step until nothing left to inline...cant go on
                        // infinetly as compiler will have detected and reported
                        // "Recursive constructor invocation"
-                       List<LazyMethodGen> recursiveCtors = new ArrayList<LazyMethodGen>();
+                       List<LazyMethodGen> recursiveCtors = new ArrayList<>();
                        while (inlineSelfConstructors(methodGens, recursiveCtors)) {
                        }
                        positionAndImplement(initializationShadows);
@@ -789,7 +789,7 @@ class BcelClassWeaver implements IClassWeaver {
 
                // Keep a set of all methods from this type - it'll help us to check if bridge methods
                // have already been created, we don't want to do it twice!
-               Set<String> methodsSet = new HashSet<String>();
+               Set<String> methodsSet = new HashSet<>();
                for (LazyMethodGen aMethod : methods) {
                        StringBuilder sb = new StringBuilder(aMethod.getName());
                        sb.append(aMethod.getSignature());
@@ -825,7 +825,7 @@ class BcelClassWeaver implements IClassWeaver {
                        }
                        String pkgName = clazz.getPackageName();
                        UnresolvedType[] bm = BcelWorld.fromBcel(bridgeToCandidate.getArgumentTypes());
-                       List<ResolvedMember> overriddenMethodsCollector = new ArrayList<ResolvedMember>();
+                       List<ResolvedMember> overriddenMethodsCollector = new ArrayList<>();
                        checkForOverride(theSuperclass, name, psig, rsig, bridgeToCandidate.getAccessFlags(), pkgName, bm, overriddenMethodsCollector);
                        if (overriddenMethodsCollector.size() != 0) {
                                for (ResolvedMember overriddenMethod : overriddenMethodsCollector) {
@@ -876,7 +876,7 @@ class BcelClassWeaver implements IClassWeaver {
         * Weave any declare @method/@ctor statements into the members of the supplied class
         */
        private boolean weaveDeclareAtMethodCtor(LazyClassGen clazz) {
-               List<Integer> reportedProblems = new ArrayList<Integer>();
+               List<Integer> reportedProblems = new ArrayList<>();
 
                List<DeclareAnnotation> allDecams = world.getDeclareAnnotationOnMethods();
                if (allDecams.isEmpty()) {
@@ -899,7 +899,7 @@ class BcelClassWeaver implements IClassWeaver {
                        return false; // nothing to do
                }
 
-               Set<DeclareAnnotation> unusedDecams = new HashSet<DeclareAnnotation>();
+               Set<DeclareAnnotation> unusedDecams = new HashSet<>();
                unusedDecams.addAll(decaMs);
 
                // These methods may have been targeted with declare annotation.  Example: ITD on an interface
@@ -915,7 +915,7 @@ class BcelClassWeaver implements IClassWeaver {
                                resolvedmember.setAnnotationTypes(method.getAnnotationTypes());
                                resolvedmember.setAnnotations(method.getAnnotations());
 
-                               List<DeclareAnnotation> worthRetrying = new ArrayList<DeclareAnnotation>();
+                               List<DeclareAnnotation> worthRetrying = new ArrayList<>();
                                boolean modificationOccured = false;
                                for (DeclareAnnotation decam: decaMs) {
                                        if (decam.matches(resolvedmember, world)) {
@@ -947,7 +947,7 @@ class BcelClassWeaver implements IClassWeaver {
                                while (!worthRetrying.isEmpty() && modificationOccured) {
                                        modificationOccured = false;
                                        // lets have another go
-                                       List<DeclareAnnotation> forRemoval = new ArrayList<DeclareAnnotation>();
+                                       List<DeclareAnnotation> forRemoval = new ArrayList<>();
                                        for (DeclareAnnotation decam : worthRetrying) {
                                                if (decam.matches(resolvedmember, world)) {
                                                        if (doesAlreadyHaveAnnotation(resolvedmember, decam, reportedProblems,false)) {
@@ -984,7 +984,7 @@ class BcelClassWeaver implements IClassWeaver {
                                if (!mg.getName().startsWith(NameMangler.PREFIX)) {
 
                                        // Single first pass
-                                       List<DeclareAnnotation> worthRetrying = new ArrayList<DeclareAnnotation>();
+                                       List<DeclareAnnotation> worthRetrying = new ArrayList<>();
                                        boolean modificationOccured = false;
                                        List<AnnotationGen> annotationsToAdd = null;
                                        for (DeclareAnnotation decaM : decaMs) {
@@ -998,7 +998,7 @@ class BcelClassWeaver implements IClassWeaver {
                                                        }
 
                                                        if (annotationsToAdd == null) {
-                                                               annotationsToAdd = new ArrayList<AnnotationGen>();
+                                                               annotationsToAdd = new ArrayList<>();
                                                        }
                                                        AnnotationGen a = ((BcelAnnotation) decaM.getAnnotation()).getBcelAnnotation();
                                                        AnnotationGen ag = new AnnotationGen(a, clazz.getConstantPool(), true);
@@ -1028,7 +1028,7 @@ class BcelClassWeaver implements IClassWeaver {
                                        while (!worthRetrying.isEmpty() && modificationOccured) {
                                                modificationOccured = false;
                                                // lets have another go
-                                               List<DeclareAnnotation> forRemoval = new ArrayList<DeclareAnnotation>();
+                                               List<DeclareAnnotation> forRemoval = new ArrayList<>();
                                                for (DeclareAnnotation decaM : worthRetrying) {
                                                        if (decaM.matches(mg.getMemberView(), world)) {
                                                                if (doesAlreadyHaveAnnotation(mg.getMemberView(), decaM, reportedProblems,true)) {
@@ -1040,7 +1040,7 @@ class BcelClassWeaver implements IClassWeaver {
                                                                }
 
                                                                if (annotationsToAdd == null) {
-                                                                       annotationsToAdd = new ArrayList<AnnotationGen>();
+                                                                       annotationsToAdd = new ArrayList<>();
                                                                }
                                                                AnnotationGen a = ((BcelAnnotation) decaM.getAnnotation()).getBcelAnnotation();
                                                                // create copy to get the annotation type into the right constant pool
@@ -1128,7 +1128,7 @@ class BcelClassWeaver implements IClassWeaver {
         * in type.
         */
        private List<DeclareAnnotation> getMatchingSubset(List<DeclareAnnotation> declareAnnotations, ResolvedType type) {
-               List<DeclareAnnotation> subset = new ArrayList<DeclareAnnotation>();
+               List<DeclareAnnotation> subset = new ArrayList<>();
                for (DeclareAnnotation da : declareAnnotations) {
                        if (da.couldEverMatch(type)) {
                                subset.add(da);
@@ -1141,7 +1141,7 @@ class BcelClassWeaver implements IClassWeaver {
         * Get a subset of all the type mungers defined on this aspect
         */
        private List<ConcreteTypeMunger> getITDSubset(LazyClassGen clazz, ResolvedTypeMunger.Kind wantedKind) {
-               List<ConcreteTypeMunger> subset = new ArrayList<ConcreteTypeMunger>();
+               List<ConcreteTypeMunger> subset = new ArrayList<>();
                for (ConcreteTypeMunger typeMunger : clazz.getBcelObjectType().getTypeMungers()) {
                        if (typeMunger.getMunger().getKind() == wantedKind) {
                                subset.add(typeMunger);
@@ -1196,7 +1196,7 @@ class BcelClassWeaver implements IClassWeaver {
                for (ConcreteTypeMunger itdField : itdFields) {
                        BcelTypeMunger fieldMunger = (BcelTypeMunger) itdField;
                        ResolvedMember itdIsActually = fieldMunger.getSignature();
-                       Set<DeclareAnnotation> worthRetrying = new LinkedHashSet<DeclareAnnotation>();
+                       Set<DeclareAnnotation> worthRetrying = new LinkedHashSet<>();
                        boolean modificationOccured = false;
 
                        for (DeclareAnnotation decaF : decaFs) {
@@ -1235,7 +1235,7 @@ class BcelClassWeaver implements IClassWeaver {
 
                        while (!worthRetrying.isEmpty() && modificationOccured) {
                                modificationOccured = false;
-                               List<DeclareAnnotation> forRemoval = new ArrayList<DeclareAnnotation>();
+                               List<DeclareAnnotation> forRemoval = new ArrayList<>();
                                for (DeclareAnnotation decaF : worthRetrying) {
                                        if (decaF.matches(itdIsActually, world)) {
                                                if (decaF.isRemover()) {
@@ -1280,7 +1280,7 @@ class BcelClassWeaver implements IClassWeaver {
                        // for (Iterator iter = itdsForMethodAndConstructor.iterator(); iter.hasNext();) {
                        // BcelTypeMunger methodctorMunger = (BcelTypeMunger) iter.next();
                        ResolvedMember unMangledInterMethod = methodctorMunger.getSignature();
-                       List<DeclareAnnotation> worthRetrying = new ArrayList<DeclareAnnotation>();
+                       List<DeclareAnnotation> worthRetrying = new ArrayList<>();
                        boolean modificationOccured = false;
 
                        for (DeclareAnnotation decaMC : decaMCs) {
@@ -1306,7 +1306,7 @@ class BcelClassWeaver implements IClassWeaver {
 
                        while (!worthRetrying.isEmpty() && modificationOccured) {
                                modificationOccured = false;
-                               List<DeclareAnnotation> forRemoval = new ArrayList<DeclareAnnotation>();
+                               List<DeclareAnnotation> forRemoval = new ArrayList<>();
                                for (DeclareAnnotation decaMC : worthRetrying) {
                                        if (decaMC.matches(unMangledInterMethod, world)) {
                                                LazyMethodGen annotationHolder = locateAnnotationHolderForFieldMunger(clazz, methodctorMunger);
@@ -1371,7 +1371,7 @@ class BcelClassWeaver implements IClassWeaver {
         * as well as on the interfieldinit method.
         */
        private boolean weaveDeclareAtField(LazyClassGen clazz) {
-               List<Integer> reportedProblems = new ArrayList<Integer>();
+               List<Integer> reportedProblems = new ArrayList<>();
                List<DeclareAnnotation> allDecafs = world.getDeclareAnnotationOnFields();
                if (allDecafs.isEmpty()) {
                        return false;
@@ -1389,12 +1389,12 @@ class BcelClassWeaver implements IClassWeaver {
 
                List<BcelField> fields = clazz.getFieldGens();
                if (fields != null) {
-                       Set<DeclareAnnotation> unusedDecafs = new HashSet<DeclareAnnotation>();
+                       Set<DeclareAnnotation> unusedDecafs = new HashSet<>();
                        unusedDecafs.addAll(decafs);
                        for (BcelField field : fields) {
                                if (!field.getName().startsWith(NameMangler.PREFIX)) {
                                        // Single first pass
-                                       Set<DeclareAnnotation> worthRetrying = new LinkedHashSet<DeclareAnnotation>();
+                                       Set<DeclareAnnotation> worthRetrying = new LinkedHashSet<>();
                                        boolean modificationOccured = false;
                                        AnnotationAJ[] dontAddMeTwice = field.getAnnotations();
 
@@ -1443,7 +1443,7 @@ class BcelClassWeaver implements IClassWeaver {
                                        while (!worthRetrying.isEmpty() && modificationOccured) {
                                                modificationOccured = false;
                                                // lets have another go with any remaining ones
-                                               List<DeclareAnnotation> forRemoval = new ArrayList<DeclareAnnotation>();
+                                               List<DeclareAnnotation> forRemoval = new ArrayList<>();
                                                for (DeclareAnnotation decaF : worthRetrying) {
                                                        if (decaF.matches(field, world)) {
                                                                if (decaF.isRemover()) {
@@ -1592,7 +1592,7 @@ class BcelClassWeaver implements IClassWeaver {
        }
 
        private Set<String> findAspectsForMungers(LazyMethodGen mg) {
-               Set<String> aspectsAffectingType = new HashSet<String>();
+               Set<String> aspectsAffectingType = new HashSet<>();
                for (BcelShadow shadow : mg.matchedShadows) {
                        for (ShadowMunger munger : shadow.getMungers()) {
                                if (munger instanceof BcelAdvice) {
@@ -1611,7 +1611,7 @@ class BcelClassWeaver implements IClassWeaver {
 
        private boolean inlineSelfConstructors(List<LazyMethodGen> methodGens, List<LazyMethodGen> recursiveCtors) {
                boolean inlinedSomething = false;
-               List<LazyMethodGen> newRecursiveCtors = new ArrayList<LazyMethodGen>();
+               List<LazyMethodGen> newRecursiveCtors = new ArrayList<>();
                for (LazyMethodGen methodGen : methodGens) {
                        if (!methodGen.getName().equals("<init>")) {
                                continue;
@@ -1783,7 +1783,7 @@ class BcelClassWeaver implements IClassWeaver {
                                // search for 'returns' and make them jump to the
                                // aload_<n>,monitorexit
                                InstructionHandle walker = body.getStart();
-                               List<InstructionHandle> rets = new ArrayList<InstructionHandle>();
+                               List<InstructionHandle> rets = new ArrayList<>();
                                while (walker != null) {
                                        if (walker.getInstruction().isReturnInstruction()) {
                                                rets.add(walker);
@@ -1984,7 +1984,7 @@ class BcelClassWeaver implements IClassWeaver {
                                // search for 'returns' and make them to the
                                // aload_<n>,monitorexit
                                InstructionHandle walker = body.getStart();
-                               List<InstructionHandle> rets = new ArrayList<InstructionHandle>();
+                               List<InstructionHandle> rets = new ArrayList<>();
                                while (walker != null) { // !walker.equals(body.getEnd())) {
                                        if (walker.getInstruction().isReturnInstruction()) {
                                                rets.add(walker);
@@ -2101,7 +2101,7 @@ class BcelClassWeaver implements IClassWeaver {
 
                        // search for 'returns' and make them to the aload_<n>,monitorexit
                        InstructionHandle walker = body.getStart();
-                       List<InstructionHandle> rets = new ArrayList<InstructionHandle>();
+                       List<InstructionHandle> rets = new ArrayList<>();
                        while (walker != null) { // !walker.equals(body.getEnd())) {
                                if (walker.getInstruction().isReturnInstruction()) {
                                        rets.add(walker);
@@ -2192,7 +2192,7 @@ class BcelClassWeaver implements IClassWeaver {
                InstructionList ret = new InstructionList();
                InstructionList sourceList = donor.getBody();
 
-               Map<InstructionHandle, InstructionHandle> srcToDest = new HashMap<InstructionHandle, InstructionHandle>();
+               Map<InstructionHandle, InstructionHandle> srcToDest = new HashMap<>();
                ConstantPool donorCpg = donor.getEnclosingClass().getConstantPool();
                ConstantPool recipientCpg = recipient.getEnclosingClass().getConstantPool();
 
@@ -2296,8 +2296,8 @@ class BcelClassWeaver implements IClassWeaver {
                }
 
                // second pass: retarget branch instructions, copy ranges and tags
-               Map<Tag, Tag> tagMap = new HashMap<Tag, Tag>();
-               Map<BcelShadow, BcelShadow> shadowMap = new HashMap<BcelShadow, BcelShadow>();
+               Map<Tag, Tag> tagMap = new HashMap<>();
+               Map<BcelShadow, BcelShadow> shadowMap = new HashMap<>();
                for (InstructionHandle dest = ret.getStart(), src = sourceList.getStart(); dest != null; dest = dest.getNext(), src = src
                                .getNext()) {
                        Instruction inst = dest.getInstruction();
@@ -2630,7 +2630,7 @@ class BcelClassWeaver implements IClassWeaver {
 
        private boolean match(LazyMethodGen mg) {
                BcelShadow enclosingShadow;
-               List<BcelShadow> shadowAccumulator = new ArrayList<BcelShadow>();
+               List<BcelShadow> shadowAccumulator = new ArrayList<>();
                boolean isOverweaving = world.isOverWeaving();
                boolean startsAngly = mg.getName().charAt(0) == '<';
                // we want to match ajsynthetic constructors...
@@ -3040,7 +3040,7 @@ class BcelClassWeaver implements IClassWeaver {
         */
        private ResolvedMember findResolvedMemberNamed(ResolvedType type, String methodName, UnresolvedType[] params) {
                ResolvedMember[] allMethods = type.getDeclaredMethods();
-               List<ResolvedMember> candidates = new ArrayList<ResolvedMember>();
+               List<ResolvedMember> candidates = new ArrayList<>();
                for (ResolvedMember candidate : allMethods) {
                        if (candidate.getName().equals(methodName)) {
                                if (candidate.getArity() == params.length) {
index 7f6c70d72612741b343c0695eda1887c984847a6..70ea191cbd25c4ed40c0fb9dbc99461f7c25379d 100644 (file)
@@ -37,7 +37,7 @@ public class BcelGenericSignatureToTypeXConverter {
 
        public static ResolvedType classTypeSignature2TypeX(GenericSignature.ClassTypeSignature aClassTypeSignature,
                        GenericSignature.FormalTypeParameter[] typeParams, World world) throws GenericSignatureFormatException {
-               Map<GenericSignature.FormalTypeParameter, ReferenceType> typeMap = new HashMap<GenericSignature.FormalTypeParameter, ReferenceType>();
+               Map<GenericSignature.FormalTypeParameter, ReferenceType> typeMap = new HashMap<>();
                ResolvedType ret = classTypeSignature2TypeX(aClassTypeSignature, typeParams, world, typeMap);
                fixUpCircularDependencies(ret, typeMap);
                return ret;
@@ -100,7 +100,7 @@ public class BcelGenericSignatureToTypeXConverter {
 
        public static ResolvedType fieldTypeSignature2TypeX(GenericSignature.FieldTypeSignature aFieldTypeSignature,
                        GenericSignature.FormalTypeParameter[] typeParams, World world) throws GenericSignatureFormatException {
-               Map<GenericSignature.FormalTypeParameter, ReferenceType> typeMap = new HashMap<GenericSignature.FormalTypeParameter, ReferenceType>();
+               Map<GenericSignature.FormalTypeParameter, ReferenceType> typeMap = new HashMap<>();
                ResolvedType ret = fieldTypeSignature2TypeX(aFieldTypeSignature, typeParams, world, typeMap);
                fixUpCircularDependencies(ret, typeMap);
                return ret;
@@ -133,7 +133,7 @@ public class BcelGenericSignatureToTypeXConverter {
 
        public static TypeVariable formalTypeParameter2TypeVariable(GenericSignature.FormalTypeParameter aFormalTypeParameter,
                        GenericSignature.FormalTypeParameter[] typeParams, World world) throws GenericSignatureFormatException {
-               Map<GenericSignature.FormalTypeParameter, ReferenceType> typeMap = new HashMap<GenericSignature.FormalTypeParameter, ReferenceType>();
+               Map<GenericSignature.FormalTypeParameter, ReferenceType> typeMap = new HashMap<>();
                return formalTypeParameter2TypeVariable(aFormalTypeParameter, typeParams, world, typeMap);
        }
 
@@ -185,7 +185,7 @@ public class BcelGenericSignatureToTypeXConverter {
 
        public static ResolvedType typeSignature2TypeX(GenericSignature.TypeSignature aTypeSig,
                        GenericSignature.FormalTypeParameter[] typeParams, World world) throws GenericSignatureFormatException {
-               Map<GenericSignature.FormalTypeParameter, ReferenceType> typeMap = new HashMap<GenericSignature.FormalTypeParameter, ReferenceType>();
+               Map<GenericSignature.FormalTypeParameter, ReferenceType> typeMap = new HashMap<>();
                ResolvedType ret = typeSignature2TypeX(aTypeSig, typeParams, world, typeMap);
                fixUpCircularDependencies(ret, typeMap);
                return ret;
index 6da16be277c2d4cd1d23c741b778cdd56917bcf0..08651412c3d06a866e2366ec46d58a3af7bba83d 100644 (file)
@@ -155,7 +155,7 @@ class BcelMethod extends ResolvedMemberImpl {
                                                                        if (nvPair.getNameString().equals("argNames")) {
                                                                                String argNames = nvPair.getValue().stringifyValue();
                                                                                StringTokenizer argNameTokenizer = new StringTokenizer(argNames, " ,");
-                                                                               List<String> argsList = new ArrayList<String>();
+                                                                               List<String> argsList = new ArrayList<>();
                                                                                while (argNameTokenizer.hasMoreTokens()) {
                                                                                        argsList.add(argNameTokenizer.nextToken());
                                                                                }
@@ -257,7 +257,7 @@ class BcelMethod extends ResolvedMemberImpl {
        // for testing - use with the method above
        public String[] getAttributeNames(boolean onlyIncludeAjOnes) {
                Attribute[] as = method.getAttributes();
-               List<String> names = new ArrayList<String>();
+               List<String> names = new ArrayList<>();
                // String[] strs = new String[as.length];
                for (Attribute a : as) {
                        if (!onlyIncludeAjOnes || a.getName().startsWith(AjAttribute.AttributePrefix)) {
index b7ce3f8422f9e1245951e4d8c902992a11c3dcf5..3e9ac1b756023f9c214ef999cb67d3f1d2c34faa 100644 (file)
@@ -113,8 +113,8 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
        private boolean isCodeStyleAspect = false; // not redundant with field
        // above!
 
-       private WeakReference<ResolvedType> superTypeReference = new WeakReference<ResolvedType>(null);
-       private WeakReference<ResolvedType[]> superInterfaceReferences = new WeakReference<ResolvedType[]>(null);
+       private WeakReference<ResolvedType> superTypeReference = new WeakReference<>(null);
+       private WeakReference<ResolvedType[]> superInterfaceReferences = new WeakReference<>(null);
 
        private int bitflag = 0x0000;
 
@@ -237,7 +237,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                        }
                        World world = getResolvedTypeX().getWorld();
                        supertype = world.resolve(UnresolvedType.forSignature(superclassSignature));
-                       superTypeReference = new WeakReference<ResolvedType>(supertype);
+                       superTypeReference = new WeakReference<>(supertype);
                }
                return supertype;
        }
@@ -275,7 +275,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                                        interfaceTypes[i] = getResolvedTypeX().getWorld().resolve(UnresolvedType.forSignature(interfaceSignatures[i]));
                                }
                        }
-                       superInterfaceReferences = new WeakReference<ResolvedType[]>(interfaceTypes);
+                       superInterfaceReferences = new WeakReference<>(interfaceTypes);
                        return interfaceTypes;
                } else {
                        return cachedInterfaceTypes;
@@ -386,9 +386,9 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                } catch (RuntimeException re) {
                        throw new RuntimeException("Problem processing attributes in " + javaClass.getFileName(), re);
                }
-               List<ResolvedPointcutDefinition> pointcuts = new ArrayList<ResolvedPointcutDefinition>();
-               typeMungers = new ArrayList<ConcreteTypeMunger>();
-               declares = new ArrayList<Declare>();
+               List<ResolvedPointcutDefinition> pointcuts = new ArrayList<>();
+               typeMungers = new ArrayList<>();
+               declares = new ArrayList<>();
                processAttributes(l, pointcuts, false);
                ReferenceType type = getResolvedTypeX();
                AsmManager asmManager = ((BcelWorld) type.getWorld()).getModelAsAsmManager();
@@ -671,7 +671,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                bitflag |= DISCOVERED_ANNOTATION_TARGET_KINDS;
                annotationTargetKinds = null; // null means we have no idea or the
                // @Target annotation hasn't been used
-               List<AnnotationTargetKind> targetKinds = new ArrayList<AnnotationTargetKind>();
+               List<AnnotationTargetKind> targetKinds = new ArrayList<>();
                if (isAnnotation()) {
                        AnnotationAJ[] annotationsOnThisType = getAnnotations();
                        for (AnnotationAJ a : annotationsOnThisType) {
@@ -770,7 +770,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                                // proceeding with resolution.
                                GenericSignature.FormalTypeParameter[] extraFormals = getFormalTypeParametersFromOuterClass();
                                if (extraFormals.length > 0) {
-                                       List<FormalTypeParameter> allFormals = new ArrayList<FormalTypeParameter>();
+                                       List<FormalTypeParameter> allFormals = new ArrayList<>();
                                        for (FormalTypeParameter formalTypeParameter : formalsForResolution) {
                                                allFormals.add(formalTypeParameter);
                                        }
index 362c8be9d45b4def546214c62997d41222a513f0..61b0bf7460a4ea02a30dc70e09aebfe681bc89b9 100644 (file)
@@ -154,7 +154,7 @@ public class BcelShadow extends Shadow {
                if (mungers.size() > 0) {
                        List<ShadowMunger> src = mungers;
                        if (s.mungers == Collections.EMPTY_LIST) {
-                               s.mungers = new ArrayList<ShadowMunger>();
+                               s.mungers = new ArrayList<>();
                        }
                        List<ShadowMunger> dest = s.mungers;
                        for (ShadowMunger shadowMunger : src) {
@@ -299,7 +299,7 @@ public class BcelShadow extends Shadow {
 
        public void addAdvicePreventingLazyTjp(BcelAdvice advice) {
                if (badAdvice == null) {
-                       badAdvice = new ArrayList<BcelAdvice>();
+                       badAdvice = new ArrayList<>();
                }
                badAdvice.add(advice);
        }
@@ -1431,7 +1431,7 @@ public class BcelShadow extends Shadow {
                if (thisAnnotationVars != null) {
                        return;
                }
-               thisAnnotationVars = new HashMap<ResolvedType, TypeAnnotationAccessVar>();
+               thisAnnotationVars = new HashMap<>();
                // populate..
        }
 
@@ -1445,7 +1445,7 @@ public class BcelShadow extends Shadow {
                        }
                        targetAnnotationVars = thisAnnotationVars;
                } else {
-                       targetAnnotationVars = new HashMap<ResolvedType, TypeAnnotationAccessVar>();
+                       targetAnnotationVars = new HashMap<>();
                        ResolvedType[] rtx = this.getTargetType().resolve(world).getAnnotationTypes(); // what about annotations we havent
                        // gotten yet but we will get in
                        // subclasses?
@@ -1549,7 +1549,7 @@ public class BcelShadow extends Shadow {
                if (kindedAnnotationVars != null) {
                        return;
                }
-               kindedAnnotationVars = new HashMap<ResolvedType, AnnotationAccessVar>();
+               kindedAnnotationVars = new HashMap<>();
 
                ResolvedType[] annotations = null;
                Member shadowSignature = getSignature();
@@ -1653,7 +1653,7 @@ public class BcelShadow extends Shadow {
                if (withinAnnotationVars != null) {
                        return;
                }
-               withinAnnotationVars = new HashMap<ResolvedType, AnnotationAccessVar>();
+               withinAnnotationVars = new HashMap<>();
 
                ResolvedType[] annotations = getEnclosingType().resolve(world).getAnnotationTypes();
                for (ResolvedType ann : annotations) {
@@ -1666,7 +1666,7 @@ public class BcelShadow extends Shadow {
                if (withincodeAnnotationVars != null) {
                        return;
                }
-               withincodeAnnotationVars = new HashMap<ResolvedType, AnnotationAccessVar>();
+               withincodeAnnotationVars = new HashMap<>();
 
                // For some shadow we are interested in annotations on the method containing that shadow.
                ResolvedType[] annotations = getEnclosingMethod().getMemberView().getAnnotationTypes();
@@ -1734,7 +1734,7 @@ public class BcelShadow extends Shadow {
         * @return a list of all the return instructions in the range of this shadow
         */
        private List<InstructionHandle> findReturnInstructions() {
-               List<InstructionHandle> returns = new ArrayList<InstructionHandle>();
+               List<InstructionHandle> returns = new ArrayList<>();
                for (InstructionHandle ih = range.getStart(); ih != range.getEnd(); ih = ih.getNext()) {
                        if (ih.getInstruction().isReturnInstruction()) {
                                returns.add(ih);
@@ -2187,14 +2187,14 @@ public class BcelShadow extends Shadow {
                // Parameters are: this if there is one, target if there is one and its different to this, then original arguments
                // at the shadow, then tjp
                String extractedShadowMethodName = NameMangler.aroundShadowMethodName(getSignature(), shadowClass.getNewGeneratedNameTag());
-               List<String> parameterNames = new ArrayList<String>();
+               List<String> parameterNames = new ArrayList<>();
                boolean shadowClassIsInterface = shadowClass.isInterface();
                LazyMethodGen extractedShadowMethod = extractShadowInstructionsIntoNewMethod(extractedShadowMethodName,
                                shadowClassIsInterface?Modifier.PUBLIC:Modifier.PRIVATE,
                                munger.getSourceLocation(), parameterNames,shadowClassIsInterface);
 
-               List<BcelVar> argsToCallLocalAdviceMethodWith = new ArrayList<BcelVar>();
-               List<BcelVar> proceedVarList = new ArrayList<BcelVar>();
+               List<BcelVar> argsToCallLocalAdviceMethodWith = new ArrayList<>();
+               List<BcelVar> proceedVarList = new ArrayList<>();
                int extraParamOffset = 0;
 
                // Create the extra parameters that are needed for passing to proceed
@@ -2845,7 +2845,7 @@ public class BcelShadow extends Shadow {
                boolean shadowClassIsInterface = getEnclosingClass().isInterface();
                LazyMethodGen callbackMethod = extractShadowInstructionsIntoNewMethod(
                                NameMangler.aroundShadowMethodName(getSignature(), getEnclosingClass().getNewGeneratedNameTag()), shadowClassIsInterface?Modifier.PUBLIC:0,
-                               munger.getSourceLocation(), new ArrayList<String>(),shadowClassIsInterface);
+                               munger.getSourceLocation(), new ArrayList<>(),shadowClassIsInterface);
 
                BcelVar[] adviceVars = munger.getExposedStateAsBcelVars(true);
 
index 60f366e5a4cf48d2b83ed75e29511a0d5fff0cce..1fb2812bb69c26e0af0527af99faed26898476d0 100644 (file)
@@ -162,14 +162,14 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                                                                thisAspect.getClassName());
                                                Map<String, List<String>> declareParentsMap = thisAspectNode.getDeclareParentsMap();
                                                if (declareParentsMap == null) {
-                                                       declareParentsMap = new HashMap<String, List<String>>();
+                                                       declareParentsMap = new HashMap<>();
                                                        thisAspectNode.setDeclareParentsMap(declareParentsMap);
                                                }
                                                String tname = target.getName();
                                                String pname = newParent.getName();
                                                List<String> newparents = declareParentsMap.get(tname);
                                                if (newparents == null) {
-                                                       newparents = new ArrayList<String>();
+                                                       newparents = new ArrayList<>();
                                                        declareParentsMap.put(tname, newparents);
                                                }
                                                newparents.add(pname);
@@ -933,7 +933,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                                } else {
                                        annotationsOnRealMember = realMember.getAnnotations();
                                }
-                               Set<ResolvedType> addedAnnotations = new HashSet<ResolvedType>();
+                               Set<ResolvedType> addedAnnotations = new HashSet<>();
                                if (annotationsOnRealMember != null) {
                                        for (AnnotationAJ anno : annotationsOnRealMember) {
                                                AnnotationGen a = ((BcelAnnotation) anno).getBcelAnnotation();
index 41cbf9a7aa09e4ca5c59ee156379122c8c8d39ba..a6809f26f821255e10adbbb3b298dbda5d2ae94e 100644 (file)
@@ -112,8 +112,8 @@ public class BcelWeaver {
 
        private boolean inReweavableMode = false;
 
-       private transient List<UnwovenClassFile> addedClasses = new ArrayList<UnwovenClassFile>();
-       private transient List<String> deletedTypenames = new ArrayList<String>();
+       private transient List<UnwovenClassFile> addedClasses = new ArrayList<>();
+       private transient List<String> deletedTypenames = new ArrayList<>();
 
        // These four are setup by prepareForWeave
        private transient List<ShadowMunger> shadowMungerList = null;
@@ -244,7 +244,7 @@ public class BcelWeaver {
 
        private List<ResolvedType> addAspectsFromJarFile(File inFile) throws FileNotFoundException, IOException {
                ZipInputStream inStream = new ZipInputStream(new FileInputStream(inFile)); // ??? buffered
-               List<ResolvedType> addedAspects = new ArrayList<ResolvedType>();
+               List<ResolvedType> addedAspects = new ArrayList<>();
                try {
                        while (true) {
                                ZipEntry entry = inStream.getNextEntry();
@@ -286,7 +286,7 @@ public class BcelWeaver {
         * @throws IOException
         */
        private List<ResolvedType> addAspectsFromDirectory(File directory) throws FileNotFoundException, IOException {
-               List<ResolvedType> addedAspects = new ArrayList<ResolvedType>();
+               List<ResolvedType> addedAspects = new ArrayList<>();
                File[] classFiles = FileUtil.listFiles(directory, new FileFilter() {
                        public boolean accept(File pathname) {
                                return pathname.getName().endsWith(".class");
@@ -350,7 +350,7 @@ public class BcelWeaver {
         * 
         */
        public List<UnwovenClassFile> addDirectoryContents(File inFile, File outDir) throws IOException {
-               List<UnwovenClassFile> addedClassFiles = new ArrayList<UnwovenClassFile>();
+               List<UnwovenClassFile> addedClassFiles = new ArrayList<>();
 
                // Get a list of all files (i.e. everything that isnt a directory)
                File[] files = FileUtil.listFiles(inFile, new FileFilter() {
@@ -373,7 +373,7 @@ public class BcelWeaver {
         */
        public List<UnwovenClassFile> addJarFile(File inFile, File outDir, boolean canBeDirectory) {
                // System.err.println("? addJarFile(" + inFile + ", " + outDir + ")");
-               List<UnwovenClassFile> addedClassFiles = new ArrayList<UnwovenClassFile>();
+               List<UnwovenClassFile> addedClassFiles = new ArrayList<>();
                needToReweaveWorld = true;
                JarFile inJar = null;
 
@@ -642,7 +642,7 @@ public class BcelWeaver {
                // across the set of pointcuts....
                // Use a map from key based on pc equality, to value based on
                // pc identity.
-               Map<Pointcut, Pointcut> pcMap = new HashMap<Pointcut, Pointcut>();
+               Map<Pointcut, Pointcut> pcMap = new HashMap<>();
                for (ShadowMunger munger: shadowMungers) {
                        Pointcut p = munger.getPointcut();
                        Pointcut newP = shareEntriesFromMap(p, pcMap);
@@ -736,7 +736,7 @@ public class BcelWeaver {
                if (kindsInCommon != Shadow.NO_SHADOW_KINDS_BITS && couldEverMatchSameJoinPoints(left, right)) {
                        // we know that every branch binds every formal, so there is no
                        // ambiguity if each branch binds it in exactly the same way...
-                       List<String> ambiguousNames = new ArrayList<String>();
+                       List<String> ambiguousNames = new ArrayList<>();
                        for (int i = 0; i < numFormals; i++) {
                                if (leftBindings[i] == null) {
                                        if (rightBindings[i] != null) {
@@ -1011,11 +1011,11 @@ public class BcelWeaver {
                        trace.enter("weave", this, input);
                }
                ContextToken weaveToken = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.WEAVING, "");
-               Collection<String> wovenClassNames = new ArrayList<String>();
+               Collection<String> wovenClassNames = new ArrayList<>();
                IWeaveRequestor requestor = input.getRequestor();
 
                if (world.getModel() != null && world.isMinimalModel()) {
-                       candidatesForRemoval = new HashSet<IProgramElement>();
+                       candidatesForRemoval = new HashSet<>();
                }
                if (world.getModel() != null && !isBatchWeave) {
                        AsmManager manager = world.getModelAsAsmManager();
@@ -1111,7 +1111,7 @@ public class BcelWeaver {
                // encountered).
                // For class A, the order is superclasses of A then superinterfaces of A
                // (and this mechanism is applied recursively)
-               List<String> typesToProcess = new ArrayList<String>();
+               List<String> typesToProcess = new ArrayList<>();
                for (Iterator<UnwovenClassFile> iter = input.getClassFileIterator(); iter.hasNext();) {
                        UnwovenClassFile clf = iter.next();
                        if (clf.shouldBeWoven()) {
@@ -1255,7 +1255,7 @@ public class BcelWeaver {
                // put out a warning
                if (world.isInJava5Mode() && world.getLint().adviceDidNotMatch.isEnabled()) {
                        List l = world.getCrosscuttingMembersSet().getShadowMungers();
-                       Set<AdviceLocation> alreadyWarnedLocations = new HashSet<AdviceLocation>();
+                       Set<AdviceLocation> alreadyWarnedLocations = new HashSet<>();
 
                        for (Object o : l) {
                                ShadowMunger element = (ShadowMunger) o;
@@ -1353,7 +1353,7 @@ public class BcelWeaver {
                        Set<String> aspectsPreviouslyInWorld = wsi.getAspectsAffectingType();
                        // keep track of them just to ensure unique missing aspect error
                        // reporting
-                       Set<String> alreadyConfirmedReweavableState = new HashSet<String>();
+                       Set<String> alreadyConfirmedReweavableState = new HashSet<>();
                        for (String requiredTypeSignature : aspectsPreviouslyInWorld) {
                                // for (Iterator iter = aspectsPreviouslyInWorld.iterator(); iter.hasNext();) {
                                // String requiredTypeName = (String) iter.next();
@@ -1480,7 +1480,7 @@ public class BcelWeaver {
                }
                onType.clearInterTypeMungers();
 
-               List<DeclareParents> decpToRepeat = new ArrayList<DeclareParents>();
+               List<DeclareParents> decpToRepeat = new ArrayList<>();
 
                boolean aParentChangeOccurred = false;
                boolean anAnnotationChangeOccurred = false;
@@ -1504,7 +1504,7 @@ public class BcelWeaver {
 
                while ((aParentChangeOccurred || anAnnotationChangeOccurred) && !decpToRepeat.isEmpty()) {
                        anAnnotationChangeOccurred = aParentChangeOccurred = false;
-                       List<DeclareParents> decpToRepeatNextTime = new ArrayList<DeclareParents>();
+                       List<DeclareParents> decpToRepeatNextTime = new ArrayList<>();
                        for (DeclareParents decp : decpToRepeat) {
                                boolean typeChanged = applyDeclareParents(decp, onType);
                                if (typeChanged) {
@@ -1962,7 +1962,7 @@ public class BcelWeaver {
                // weaving
                FastMatchInfo info = new FastMatchInfo(type, null, world);
 
-               List<ShadowMunger> result = new ArrayList<ShadowMunger>();
+               List<ShadowMunger> result = new ArrayList<>();
 
                if (world.areInfoMessagesEnabled() && world.isTimingEnabled()) {
                        for (ShadowMunger munger : list) {
index 5916e0117f55f457e50953b8373941f84978b2ec..65c3da11ae2705f39d1d26b63a393ba510abf029 100644 (file)
@@ -264,7 +264,7 @@ public class BcelWorld extends World implements Repository {
        }
 
        private static List<String> makeDefaultClasspath(String cp) {
-               List<String> classPath = new ArrayList<String>();
+               List<String> classPath = new ArrayList<>();
                classPath.addAll(getPathEntries(cp));
                classPath.addAll(getPathEntries(ClassPath.getClassPath()));
                return classPath;
@@ -272,7 +272,7 @@ public class BcelWorld extends World implements Repository {
        }
 
        private static List<String> getPathEntries(String s) {
-               List<String> ret = new ArrayList<String>();
+               List<String> ret = new ArrayList<>();
                StringTokenizer tok = new StringTokenizer(s, File.pathSeparator);
                while (tok.hasMoreTokens()) {
                        ret.add(tok.nextToken());
@@ -880,7 +880,7 @@ public class BcelWorld extends World implements Repository {
                }
                onType.clearInterTypeMungers();
 
-               List<DeclareParents> decpToRepeat = new ArrayList<DeclareParents>();
+               List<DeclareParents> decpToRepeat = new ArrayList<>();
 
                boolean aParentChangeOccurred = false;
                boolean anAnnotationChangeOccurred = false;
@@ -914,7 +914,7 @@ public class BcelWorld extends World implements Repository {
 
                while ((aParentChangeOccurred || anAnnotationChangeOccurred) && !decpToRepeat.isEmpty()) {
                        anAnnotationChangeOccurred = aParentChangeOccurred = false;
-                       List<DeclareParents> decpToRepeatNextTime = new ArrayList<DeclareParents>();
+                       List<DeclareParents> decpToRepeatNextTime = new ArrayList<>();
                        for (DeclareParents decp: decpToRepeat) {
                                if (applyDeclareParents(decp, onType)) {
                                        aParentChangeOccurred = true;
@@ -1063,7 +1063,7 @@ public class BcelWorld extends World implements Repository {
                                                                }
                                                                anythingMissing = true;
                                                                if (aspectRequiredTypes == null) {
-                                                                       aspectRequiredTypes = new HashMap<String,String>();
+                                                                       aspectRequiredTypes = new HashMap<>();
                                                                }
                                                                // Record that it has an invalid type reference
                                                                aspectRequiredTypes.put(aspectName,requiredTypeName);
@@ -1112,12 +1112,12 @@ public class BcelWorld extends World implements Repository {
                return aspectRequiredTypes.containsKey(aspectName);
        }
 
-       private List<String> aspectRequiredTypesProcessed = new ArrayList<String>();
+       private List<String> aspectRequiredTypesProcessed = new ArrayList<>();
        private Map<String, String> aspectRequiredTypes = null;
 
        public void addAspectRequires(String aspectClassName, String requiredType) {
                if (aspectRequiredTypes == null) {
-                       aspectRequiredTypes = new HashMap<String, String>();
+                       aspectRequiredTypes = new HashMap<>();
                }
                aspectRequiredTypes.put(aspectClassName,requiredType);
        }
@@ -1137,10 +1137,10 @@ public class BcelWorld extends World implements Repository {
                private int mode;
 
                private boolean initialized = false; // Lazily done
-               private List<Definition> definitions = new ArrayList<Definition>();
+               private List<Definition> definitions = new ArrayList<>();
 
-               private List<String> resolvedIncludedAspects = new ArrayList<String>();
-               private Map<String, TypePattern> scopes = new HashMap<String, TypePattern>();
+               private List<String> resolvedIncludedAspects = new ArrayList<>();
+               private Map<String, TypePattern> scopes = new HashMap<>();
 
                // these are not set for LTW mode (exclusion of these fast match patterns is handled before the weaver/world are used)
                private List<String> includedFastMatchPatterns = Collections.emptyList();
@@ -1180,7 +1180,7 @@ public class BcelWorld extends World implements Repository {
                public void ensureInitialized() {
                        if (!initialized) {
                                try {
-                                       resolvedIncludedAspects = new ArrayList<String>();
+                                       resolvedIncludedAspects = new ArrayList<>();
                                        // Process the definitions into something more optimal
                                        for (Definition definition : definitions) {
                                                List<String> aspectNames = definition.getAspectClassNames();
@@ -1217,8 +1217,8 @@ public class BcelWorld extends World implements Repository {
                                                try {
                                                        List<String> includePatterns = definition.getIncludePatterns();
                                                        if (includePatterns.size() > 0) {
-                                                               includedPatterns = new ArrayList<TypePattern>();
-                                                               includedFastMatchPatterns = new ArrayList<String>();
+                                                               includedPatterns = new ArrayList<>();
+                                                               includedFastMatchPatterns = new ArrayList<>();
                                                        }
                                                        for (String includePattern : includePatterns) {
                                                                if (includePattern.endsWith("..*")) {
@@ -1231,8 +1231,8 @@ public class BcelWorld extends World implements Repository {
                                                        }
                                                        List<String> excludePatterns = definition.getExcludePatterns();
                                                        if (excludePatterns.size() > 0) {
-                                                               excludedPatterns = new ArrayList<TypePattern>();
-                                                               excludedFastMatchPatterns = new ArrayList<String>();
+                                                               excludedPatterns = new ArrayList<>();
+                                                               excludedFastMatchPatterns = new ArrayList<>();
                                                        }
                                                        for (String excludePattern : excludePatterns) {
                                                                if (excludePattern.endsWith("..*")) {
@@ -1308,7 +1308,7 @@ public class BcelWorld extends World implements Repository {
 
        public void addTypeDelegateResolver(TypeDelegateResolver typeDelegateResolver) {
                if (typeDelegateResolvers == null) {
-                       typeDelegateResolvers = new ArrayList<TypeDelegateResolver>();
+                       typeDelegateResolvers = new ArrayList<>();
                }
                typeDelegateResolvers.add(typeDelegateResolver);
        }
index fa45b7df622bdcea27d4e79addfc64cbd5ccb9d9..81dde3f581788ff2ec29aab2eb0b69a71cdc3f7f 100644 (file)
@@ -67,7 +67,7 @@ public class ClassPathManager {
        // The max number is configured through the property:
        // org.aspectj.weaver.openarchives
        // and it defaults to 1000
-       private List<ZipFile> openArchives = new ArrayList<ZipFile>();
+       private List<ZipFile> openArchives = new ArrayList<>();
 
        static {
                String openzipsString = getSystemPropertyWithoutSecurityException("org.aspectj.weaver.openarchives",
@@ -82,7 +82,7 @@ public class ClassPathManager {
                if (trace.isTraceEnabled()) {
                        trace.enter("<init>", this, new Object[] { classpath==null?"null":classpath.toString(), handler });
                }
-               entries = new ArrayList<Entry>();
+               entries = new ArrayList<>();
                for (String classpathEntry: classpath) {
                        addPath(classpathEntry,handler);
                }
@@ -328,9 +328,9 @@ public class ClassPathManager {
                static class JImageState {
                        private final String jrtFsPath;
                        private final FileSystem fs;
-                       Map<String,Path> fileCache = new SoftHashMap<String, Path>();
+                       Map<String,Path> fileCache = new SoftHashMap<>();
                        boolean packageCacheInitialized = false;
-                       Map<String,Path> packageCache = new HashMap<String, Path>();
+                       Map<String,Path> packageCache = new HashMap<>();
 
                        public JImageState(String jrtFsPath, FileSystem fs) {
                                this.jrtFsPath = jrtFsPath;
@@ -516,7 +516,7 @@ public class ClassPathManager {
 
                public List<ZipEntryClassFile> getAllClassFiles() throws IOException {
                        ensureOpen();
-                       List<ZipEntryClassFile> ret = new ArrayList<ZipEntryClassFile>();
+                       List<ZipEntryClassFile> ret = new ArrayList<>();
                        for (Enumeration<? extends ZipEntry> e = zipFile.entries(); e.hasMoreElements();) {
                                ZipEntry entry = e.nextElement();
                                String name = entry.getName();
index c8185d1c2bf8ce4803d0a4f9cc927132a4adf0e4..0eb3cb2b2fdc5fbfe9f7a6b314aed2706a7eda95 100644 (file)
@@ -126,7 +126,7 @@ public final class LazyClassGen {
 
        int highestLineNumber = 0; // ---- JSR 45 info
 
-       private final SortedMap<String, InlinedSourceFileInfo> inlinedFiles = new TreeMap<String, InlinedSourceFileInfo>();
+       private final SortedMap<String, InlinedSourceFileInfo> inlinedFiles = new TreeMap<>();
 
        private boolean regenerateGenericSignatureAttribute = false;
 
@@ -136,10 +136,10 @@ public final class LazyClassGen {
        private final World world;
        private final String packageName = null;
 
-       private final List<BcelField> fields = new ArrayList<BcelField>();
-       private final List<LazyMethodGen> methodGens = new ArrayList<LazyMethodGen>();
-       private final List<LazyClassGen> classGens = new ArrayList<LazyClassGen>();
-       private final List<AnnotationGen> annotations = new ArrayList<AnnotationGen>();
+       private final List<BcelField> fields = new ArrayList<>();
+       private final List<LazyMethodGen> methodGens = new ArrayList<>();
+       private final List<LazyClassGen> classGens = new ArrayList<>();
+       private final List<AnnotationGen> annotations = new ArrayList<>();
        private int childCounter = 0;
 
        private final InstructionFactory fact;
@@ -818,7 +818,7 @@ public final class LazyClassGen {
 
        // non-recursive, may be a bug, ha ha.
        private List<LazyClassGen> getClassGens() {
-               List<LazyClassGen> ret = new ArrayList<LazyClassGen>();
+               List<LazyClassGen> ret = new ArrayList<>();
                ret.add(this);
                ret.addAll(classGens);
                return ret;
@@ -828,7 +828,7 @@ public final class LazyClassGen {
                if (classGens.isEmpty()) {
                        return Collections.emptyList();
                }
-               List<UnwovenClassFile.ChildClass> ret = new ArrayList<UnwovenClassFile.ChildClass>();
+               List<UnwovenClassFile.ChildClass> ret = new ArrayList<>();
                for (LazyClassGen clazz : classGens) {
                        byte[] bytes = clazz.getJavaClass(world).getBytes();
                        String name = clazz.getName();
@@ -1044,8 +1044,8 @@ public final class LazyClassGen {
        //
 
        // reflective thisJoinPoint support
-       private Map<BcelShadow, Field> tjpFields = new HashMap<BcelShadow, Field>();
-       Map<CacheKey, Field> annotationCachingFieldCache = new HashMap<CacheKey, Field>();
+       private Map<BcelShadow, Field> tjpFields = new HashMap<>();
+       Map<CacheKey, Field> annotationCachingFieldCache = new HashMap<>();
        private int tjpFieldsCounter = -1; // -1 means not yet initialized
        private int annoFieldsCounter = 0;
        public static final ObjectType proceedingTjpType = new ObjectType("org.aspectj.lang.ProceedingJoinPoint");
@@ -1254,12 +1254,12 @@ public final class LazyClassGen {
        }
 
        private InstructionList[] initializeAllTjps() {
-               Vector<InstructionList> lists = new Vector<InstructionList>();
+               Vector<InstructionList> lists = new Vector<>();
 
                InstructionList list = initInstructionList();
                lists.add(list);
 
-               List<Map.Entry<BcelShadow, Field>> entries = new ArrayList<Map.Entry<BcelShadow, Field>>(tjpFields.entrySet());
+               List<Map.Entry<BcelShadow, Field>> entries = new ArrayList<>(tjpFields.entrySet());
                Collections.sort(entries, new Comparator<Map.Entry<BcelShadow, Field>>() {
                        @Override
                        public int compare(Map.Entry<BcelShadow, Field> a, Map.Entry<BcelShadow, Field> b) {
index 97f805273b0b52d7fd3d8fc0418c302dcb653f17..3ab0c5daf51a149e742bf8a1bb85907be781fa0e 100644 (file)
@@ -155,7 +155,7 @@ public final class LazyMethodGen implements Traceable {
                } else {
                        body = null;
                }
-               this.attributes = new ArrayList<Attribute>();
+               this.attributes = new ArrayList<>();
                this.enclosingClass = enclosingClass;
                assertGoodBody();
                this.originalMethodHasLocalVariableTable = true; // it is a new method, we want an lvar table
@@ -272,7 +272,7 @@ public final class LazyMethodGen implements Traceable {
                if (memberView == null) {
                        // If member view is null, we manage them in newAnnotations
                        if (newAnnotations == null) {
-                               newAnnotations = new ArrayList<AnnotationAJ>();
+                               newAnnotations = new ArrayList<>();
                        }
                        newAnnotations.add(ax);
                } else {
@@ -285,7 +285,7 @@ public final class LazyMethodGen implements Traceable {
                if (memberView == null) {
                        // If member view is null, we manage them in newAnnotations
                        if (annotationsForRemoval == null) {
-                               annotationsForRemoval = new ArrayList<ResolvedType>();
+                               annotationsForRemoval = new ArrayList<>();
                        }
                        annotationsForRemoval.add(annotationType);
                } else {
@@ -627,7 +627,7 @@ public final class LazyMethodGen implements Traceable {
        }
 
        private class BodyPrinter {
-               Map<InstructionHandle, String> labelMap = new HashMap<InstructionHandle, String>();
+               Map<InstructionHandle, String> labelMap = new HashMap<>();
 
                InstructionList body;
                PrintStream out;
@@ -653,7 +653,7 @@ public final class LazyMethodGen implements Traceable {
 
                // label assignment
                void assignLabels() {
-                       LinkedList<ExceptionRange> exnTable = new LinkedList<ExceptionRange>();
+                       LinkedList<ExceptionRange> exnTable = new LinkedList<>();
                        String pendingLabel = null;
                        // boolean hasPendingTargeters = false;
                        int lcounter = 0;
@@ -1072,9 +1072,9 @@ public final class LazyMethodGen implements Traceable {
                 */
                InstructionHandle oldInstructionHandle = getBody().getStart();
                InstructionHandle newInstructionHandle = fresh.getStart();
-               LinkedList<ExceptionRange> exceptionList = new LinkedList<ExceptionRange>();
+               LinkedList<ExceptionRange> exceptionList = new LinkedList<>();
 
-               Map<LocalVariableTag, LVPosition> localVariables = new HashMap<LocalVariableTag, LVPosition>();
+               Map<LocalVariableTag, LVPosition> localVariables = new HashMap<>();
 
                int currLine = -1;
                int lineNumberOffset = (fromFilename == null) ? 0 : getEnclosingClass().getSourceDebugExtensionOffset(fromFilename);
@@ -1198,10 +1198,10 @@ public final class LazyMethodGen implements Traceable {
 
                int currLine = -1;
                int lineNumberOffset = (fromFilename == null) ? 0 : getEnclosingClass().getSourceDebugExtensionOffset(fromFilename);
-               Map<LocalVariableTag, LVPosition> localVariables = new HashMap<LocalVariableTag, LVPosition>();
-               LinkedList<ExceptionRange> exceptionList = new LinkedList<ExceptionRange>();
-               Set<InstructionHandle> forDeletion = new HashSet<InstructionHandle>();
-               Set<BranchHandle> branchInstructions = new HashSet<BranchHandle>();
+               Map<LocalVariableTag, LVPosition> localVariables = new HashMap<>();
+               LinkedList<ExceptionRange> exceptionList = new LinkedList<>();
+               Set<InstructionHandle> forDeletion = new HashSet<>();
+               Set<BranchHandle> branchInstructions = new HashSet<>();
                // OPTIMIZE sort out in here: getRange()/insertHandler() and type of
                // exceptionList
                while (iHandle != null) {
@@ -1333,7 +1333,7 @@ public final class LazyMethodGen implements Traceable {
                        paramSlots = -1;
                }
 
-               Map<InstructionHandle, Set<Integer>> duplicatedLocalMap = new HashMap<InstructionHandle, Set<Integer>>();
+               Map<InstructionHandle, Set<Integer>> duplicatedLocalMap = new HashMap<>();
                for (LocalVariableTag tag : localVariables.keySet()) {
                        // have we already added one with the same slot number and start
                        // location?
@@ -1343,7 +1343,7 @@ public final class LazyMethodGen implements Traceable {
                        InstructionHandle end = (tag.getSlot() < paramSlots ? methodEnd : lvpos.end);
                        Set<Integer> slots = duplicatedLocalMap.get(start);
                        if (slots == null) {
-                               slots = new HashSet<Integer>();
+                               slots = new HashSet<>();
                                duplicatedLocalMap.put(start, slots);
                        } else if (slots.contains(tag.getSlot())) {
                                // we already have a var starting at this tag with this slot
@@ -1461,7 +1461,7 @@ public final class LazyMethodGen implements Traceable {
         * i.e., a 1:1 mapping.
         */
        private Map<InstructionHandle, InstructionHandle> copyAllInstructionsExceptRangeInstructionsInto(InstructionList intoList) {
-               Map<InstructionHandle, InstructionHandle> map = new HashMap<InstructionHandle, InstructionHandle>();
+               Map<InstructionHandle, InstructionHandle> map = new HashMap<>();
                for (InstructionHandle ih = getBody().getStart(); ih != null; ih = ih.getNext()) {
                        if (Range.isRangeHandle(ih)) {
                                continue;
index c29721d4a061224a227a28e322e7b8375685186e..44ac48b9f4c92eebce445dca1ac808e77b953e87 100644 (file)
@@ -69,10 +69,10 @@ public class Utility {
 
        public static List<AjAttribute> readAjAttributes(String classname, Attribute[] as, ISourceContext context, World w,
                        AjAttribute.WeaverVersionInfo version, ConstantPoolReader dataDecompressor) {
-               List<AjAttribute> attributes = new ArrayList<AjAttribute>();
+               List<AjAttribute> attributes = new ArrayList<>();
 
                // first pass, look for version
-               List<Unknown> forSecondPass = new ArrayList<Unknown>();
+               List<Unknown> forSecondPass = new ArrayList<>();
                for (int i = as.length - 1; i >= 0; i--) {
                        Attribute a = as[i];
                        if (a instanceof Unknown) {
@@ -248,7 +248,7 @@ public class Utility {
 
        // Lookup table, for converting between pairs of types, it gives
        // us the method name in the Conversions class
-       private static Hashtable<String, String> validBoxing = new Hashtable<String, String>();
+       private static Hashtable<String, String> validBoxing = new Hashtable<>();
 
        static {
                validBoxing.put("Ljava/lang/Byte;B", "byteObject");
@@ -649,7 +649,7 @@ public class Utility {
                        return Collections.emptyList();
                }
                // Go through the annotation types
-               List<Lint.Kind> suppressedWarnings = new ArrayList<Lint.Kind>();
+               List<Lint.Kind> suppressedWarnings = new ArrayList<>();
                boolean found = false;
                for (int i = 0; !found && i < anns.length; i++) {
                        // Check for the SuppressAjWarnings annotation
index de780156efcbca86d4d2b38ae7703275f968cef2..81330ed362f6f0d635f585bae322463aeb8fba75 100644 (file)
@@ -48,15 +48,15 @@ public class Definition {
                weaverOptions = new StringBuffer();
                dumpBefore = false;
                perClassloaderDumpDir = false;
-               dumpPatterns = new ArrayList<String>();
-               includePatterns = new ArrayList<String>();
-               excludePatterns = new ArrayList<String>();
-               aspectClassNames = new ArrayList<String>();
-               aspectExcludePatterns = new ArrayList<String>();
-               aspectIncludePatterns = new ArrayList<String>();
-               concreteAspects = new ArrayList<Definition.ConcreteAspect>();
-               scopedAspects = new HashMap<String, String>();
-               requiredTypesForAspects = new HashMap<String, String>();
+               dumpPatterns = new ArrayList<>();
+               includePatterns = new ArrayList<>();
+               excludePatterns = new ArrayList<>();
+               aspectClassNames = new ArrayList<>();
+               aspectExcludePatterns = new ArrayList<>();
+               aspectIncludePatterns = new ArrayList<>();
+               concreteAspects = new ArrayList<>();
+               scopedAspects = new HashMap<>();
+               requiredTypesForAspects = new HashMap<>();
        }
 
        public String getWeaverOptions() {
@@ -135,10 +135,10 @@ public class Definition {
                                this.extend = extend;
                        }
                        this.precedence = precedence;
-                       this.pointcuts = new ArrayList<Definition.Pointcut>();
-                       this.declareAnnotations = new ArrayList<Definition.DeclareAnnotation>();
-                       this.pointcutsAndAdvice = new ArrayList<Definition.PointcutAndAdvice>();
-                       this.deows = new ArrayList<Definition.DeclareErrorOrWarning>();
+                       this.pointcuts = new ArrayList<>();
+                       this.declareAnnotations = new ArrayList<>();
+                       this.pointcutsAndAdvice = new ArrayList<>();
+                       this.deows = new ArrayList<>();
                        this.perclause = perclause;
                }
        }
index bfef1244b011469fb46965f2fe69a6a244ebbacd..cdecd6aaa81f2d274957914322fc6d759cc001fe 100644 (file)
@@ -83,7 +83,7 @@ public class DocumentParser extends DefaultHandler {
 
        private Definition.ConcreteAspect activeConcreteAspectDefinition;
 
-       private static Hashtable<String, Definition> parsedFiles = new Hashtable<String, Definition>();
+       private static Hashtable<String, Definition> parsedFiles = new Hashtable<>();
        private static boolean CACHE;
        private static final boolean LIGHTPARSER;
 
index 09a9df96fa365cbfab2f8d8a9e28692ad516a80f..e93bc896ce7ee52a1fc5e463200140145fd17851 100644 (file)
@@ -25,7 +25,7 @@ public class LightXMLParser {
        private char pushedBackChar;
        private Reader reader;
 
-       private static Map<String, char[]> entities = new HashMap<String, char[]>();
+       private static Map<String, char[]> entities = new HashMap<>();
 
        static {
                entities.put("amp", new char[] { '&' });
@@ -37,7 +37,7 @@ public class LightXMLParser {
 
        public LightXMLParser() {
                this.name = null;
-               this.attributes = new HashMap<String, Object>();
+               this.attributes = new HashMap<>();
                this.children = new ArrayList();
        }
 
@@ -51,7 +51,7 @@ public class LightXMLParser {
 
        public void parseFromReader(Reader reader) throws Exception {
                this.pushedBackChar = NULL_CHAR;
-               this.attributes = new HashMap<String, Object>();
+               this.attributes = new HashMap<>();
                this.name = null;
                this.children = new ArrayList();
                this.reader = reader;
index 7df7f438c2ac8b60655883a37f5d8efdb510dfec..80cfb6de773a263a5a9561e21776d28f57a81ec4 100644 (file)
@@ -404,7 +404,7 @@ public class AsmRelationshipProvider {
                IProgramElement root = model.getHierarchy().getRoot();
                IProgramElement binaries = model.getHierarchy().findElementForLabel(root, IProgramElement.Kind.SOURCE_FOLDER, "binaries");
                if (binaries == null) {
-                       binaries = new ProgramElement(model, "binaries", IProgramElement.Kind.SOURCE_FOLDER, new ArrayList<IProgramElement>());
+                       binaries = new ProgramElement(model, "binaries", IProgramElement.Kind.SOURCE_FOLDER, new ArrayList<>());
                        root.addChild(binaries);
                }
                // if (aspect.getPackageName() != null) {
@@ -413,7 +413,7 @@ public class AsmRelationshipProvider {
                IProgramElement pkgNode = model.getHierarchy().findElementForLabel(binaries, IProgramElement.Kind.PACKAGE, packagename);
                // note packages themselves have no source location
                if (pkgNode == null) {
-                       pkgNode = new ProgramElement(model, packagename, IProgramElement.Kind.PACKAGE, new ArrayList<IProgramElement>());
+                       pkgNode = new ProgramElement(model, packagename, IProgramElement.Kind.PACKAGE, new ArrayList<>());
                        binaries.addChild(pkgNode);
                        pkgNode.addChild(classFileNode);
                } else {
@@ -539,7 +539,7 @@ public class AsmRelationshipProvider {
                IProgramElement root = asm.getHierarchy().getRoot();
                IProgramElement binaries = asm.getHierarchy().findElementForLabel(root, IProgramElement.Kind.SOURCE_FOLDER, "binaries");
                if (binaries == null) {
-                       binaries = new ProgramElement(asm, "binaries", IProgramElement.Kind.SOURCE_FOLDER, new ArrayList<IProgramElement>());
+                       binaries = new ProgramElement(asm, "binaries", IProgramElement.Kind.SOURCE_FOLDER, new ArrayList<>());
                        root.addChild(binaries);
                }
                // if (aspect.getPackageName() != null) {
@@ -548,7 +548,7 @@ public class AsmRelationshipProvider {
                IProgramElement pkgNode = asm.getHierarchy().findElementForLabel(binaries, IProgramElement.Kind.PACKAGE, packagename);
                // note packages themselves have no source location
                if (pkgNode == null) {
-                       pkgNode = new ProgramElement(asm, packagename, IProgramElement.Kind.PACKAGE, new ArrayList<IProgramElement>());
+                       pkgNode = new ProgramElement(asm, packagename, IProgramElement.Kind.PACKAGE, new ArrayList<>());
                        binaries.addChild(pkgNode);
                        pkgNode.addChild(classFileNode);
                } else {
@@ -764,7 +764,7 @@ public class AsmRelationshipProvider {
                if (ts == null) {
                        pe.setParameterSignatures(Collections.<char[]>emptyList(), Collections.<String>emptyList());
                } else {
-                       List<char[]> paramSigs = new ArrayList<char[]>();
+                       List<char[]> paramSigs = new ArrayList<>();
                        for (UnresolvedType t : ts) {
                                paramSigs.add(t.getSignature().toCharArray());
                        }
@@ -783,7 +783,7 @@ public class AsmRelationshipProvider {
 
        private static void setParentTypesOnDeclareParentsNode(DeclareParents decp, IProgramElement decpElement) {
                TypePatternList tpl = decp.getParents();
-               List<String> parents = new ArrayList<String>();
+               List<String> parents = new ArrayList<>();
                for (int i = 0; i < tpl.size(); i++) {
                        parents.add(tpl.get(i).getExactType().getName().replaceAll("\\$", "."));
                }
index 30983e38f08055154bdad78fc120b7077e943efa..74477d143582a14efcb874da0cba738c88dea2e0 100644 (file)
@@ -32,7 +32,7 @@ import org.aspectj.weaver.World;
 public class JavaLangTypeToResolvedTypeConverter {
 
        // Used to prevent recursion - we record what we are working on and return it if asked again *whilst* working on it
-       private Map<Type, TypeVariableReferenceType> typeVariablesInProgress = new HashMap<Type, TypeVariableReferenceType>();
+       private Map<Type, TypeVariableReferenceType> typeVariablesInProgress = new HashMap<>();
        private final World world;
 
        public JavaLangTypeToResolvedTypeConverter(World aWorld) {
index 5bb0fd80dddb4e9c2702af061ba8ef1d7838dfe9..d3a194fccdfe833fe6b64ba276b223617cbd0663 100644 (file)
@@ -91,7 +91,7 @@ public class WeavingAdaptor implements IMessageContext {
        private WeavingAdaptorMessageHolder messageHolder;
        private boolean abortOnError = false;
        protected GeneratedClassHandler generatedClassHandler;
-       protected Map<String, IUnwovenClassFile> generatedClasses = new HashMap<String, IUnwovenClassFile>();
+       protected Map<String, IUnwovenClassFile> generatedClasses = new HashMap<>();
        public BcelObjectType delegateForCurrentClass; // lazily initialized, should be used to prevent parsing bytecode multiple
        // times
        protected ProtectionDomain activeProtectionDomain;
@@ -138,7 +138,7 @@ public class WeavingAdaptor implements IMessageContext {
        }
 
        protected List<String> getFullClassPath(ClassLoader loader) {
-               List<String> list = new LinkedList<String>();
+               List<String> list = new LinkedList<>();
                for (; loader != null; loader = loader.getParent()) {
                        if (loader instanceof URLClassLoader) {
                                URL[] urls = ((URLClassLoader) loader).getURLs();
@@ -165,7 +165,7 @@ public class WeavingAdaptor implements IMessageContext {
        }
 
        private List<String> getFullAspectPath(ClassLoader loader) {
-               List<String> list = new LinkedList<String>();
+               List<String> list = new LinkedList<>();
                for (; loader != null; loader = loader.getParent()) {
                        if (loader instanceof WeavingClassLoader) {
                                URL[] urls = ((WeavingClassLoader) loader).getAspectURLs();
@@ -602,7 +602,7 @@ public class WeavingAdaptor implements IMessageContext {
        }
 
        private static List<String> makeClasspath(String cp) {
-               List<String> ret = new ArrayList<String>();
+               List<String> ret = new ArrayList<>();
                if (cp != null) {
                        StringTokenizer tok = new StringTokenizer(cp, File.pathSeparator);
                        while (tok.hasMoreTokens()) {
@@ -723,7 +723,7 @@ public class WeavingAdaptor implements IMessageContext {
 
                public void flushMessages() {
                        if (savedMessages == null) {
-                               savedMessages = new ArrayList<IMessage>();
+                               savedMessages = new ArrayList<>();
                                savedMessages.addAll(super.getUnmodifiableListView());
                                clearMessages();
                                for (IMessage message : savedMessages) {
@@ -794,7 +794,7 @@ public class WeavingAdaptor implements IMessageContext {
                @Override
                public List<IMessage> getUnmodifiableListView() {
                        // System.err.println("? WeavingAdaptorMessageHolder.getUnmodifiableListView() savedMessages=" + savedMessages);
-                       List<IMessage> allMessages = new ArrayList<IMessage>();
+                       List<IMessage> allMessages = new ArrayList<>();
                        allMessages.addAll(savedMessages);
                        allMessages.addAll(super.getUnmodifiableListView());
                        return allMessages;
@@ -803,7 +803,7 @@ public class WeavingAdaptor implements IMessageContext {
 
        protected class WeavingAdaptorMessageWriter extends MessageWriter {
 
-               private final Set<IMessage.Kind> ignoring = new HashSet<IMessage.Kind>();
+               private final Set<IMessage.Kind> ignoring = new HashSet<>();
                private final IMessage.Kind failKind;
 
                public WeavingAdaptorMessageWriter(PrintWriter writer) {
@@ -859,7 +859,7 @@ public class WeavingAdaptor implements IMessageContext {
        private class WeavingClassFileProvider implements IClassFileProvider {
 
                private final UnwovenClassFile unwovenClass;
-               private final List<UnwovenClassFile> unwovenClasses = new ArrayList<UnwovenClassFile>();
+               private final List<UnwovenClassFile> unwovenClasses = new ArrayList<>();
                private IUnwovenClassFile wovenClass;
                private boolean isApplyAtAspectJMungersOnly = false;
 
index 1580277b1d9cce2522c4ea7eee660ec5b122bc6d..cb05b10e056ebe664789bd5178c720448a4faaed 100644 (file)
@@ -59,7 +59,7 @@ public abstract class AbstractIndexedFileCacheBacking extends AbstractFileCacheB
                return EMPTY_KEYS;
        }
 
-        Collection<String>  matches=new LinkedList<String>();
+        Collection<String>  matches= new LinkedList<>();
         synchronized(index) {
             for (String key : index.keySet()) {
                 if (key.matches(regex)) {
@@ -96,7 +96,7 @@ public abstract class AbstractIndexedFileCacheBacking extends AbstractFileCacheB
     protected abstract Map<String, IndexEntry> getIndex ();
 
     protected Map<String, IndexEntry> readIndex (File cacheDir, File cacheFile) {
-        Map<String, IndexEntry> indexMap=new TreeMap<String, IndexEntry>();
+        Map<String, IndexEntry> indexMap= new TreeMap<>();
         IndexEntry[]            idxValues=readIndex(cacheFile);
         if (LangUtil.isEmpty(idxValues)) {
                if ((logger != null) && logger.isTraceEnabled()) {
index 636a82a7a015db55c62ca46bb684b1d5c90cd844..bc0b678f48d3a4b79e560a66b4f85546f03b8b37 100644 (file)
@@ -50,7 +50,7 @@ import org.aspectj.weaver.tools.TraceFactory;
  * The actual persistence is implemented by the <U>concrete</U> classes
  */
 public abstract class AsynchronousFileCacheBacking extends AbstractIndexedFileCacheBacking {
-    private static final BlockingQueue<AsyncCommand>   commandsQ=new LinkedBlockingQueue<AsyncCommand>();
+    private static final BlockingQueue<AsyncCommand>   commandsQ= new LinkedBlockingQueue<>();
     private static final ExecutorService    execService=Executors.newSingleThreadExecutor();
     private static Future<?> commandsRunner;
 
@@ -180,7 +180,7 @@ public abstract class AsynchronousFileCacheBacking extends AbstractIndexedFileCa
             if (index.isEmpty()) {
                 return Collections.emptyList();
             } else {
-                return new ArrayList<IndexEntry>(index.values());
+                return new ArrayList<>(index.values());
             }
         }
     }
index 44728d041f83ca2d3e376b63c2841bbdbbb076f4..b9031cbaeb03ddd43e94f06d4436b87cc50a91bc 100644 (file)
@@ -49,7 +49,7 @@ public class DefaultCacheKeyResolver implements CacheKeyResolver {
        public String createClassLoaderScope(ClassLoader cl, List<String> aspects) {
                String name = cl != null ? cl.getClass().getSimpleName() : "unknown";
 
-               List<String> hashableStrings = new LinkedList<String>();
+               List<String> hashableStrings = new LinkedList<>();
                StringBuilder hashable = new StringBuilder(256);
 
                // Add the list of loader urls to the hash list
index 6de416a80e9718e89dcd6540cb2051e393b8de68..e5f45f92c354096b9ddb7bc1074b571ee94ade00 100644 (file)
@@ -57,7 +57,7 @@ public class FlatFileCacheBacking extends AsynchronousFileCacheBacking {
     }
 
     protected Map<String, byte[]> readClassBytes (Map<String,IndexEntry> indexMap, File[] files) {
-        Map<String, byte[]> result=new TreeMap<String, byte[]>();
+        Map<String, byte[]> result= new TreeMap<>();
         if (LangUtil.isEmpty(files)) {
             return result;
         }
index 8e18daddeed58d1b2fa70434bf236aa3fdfe438c..c5c079dcfc21a7bd00889c5bd68076981defe5c5 100644 (file)
@@ -78,7 +78,7 @@ public class WeavedClassCache {
        private final CacheKeyResolver resolver;
        private final String name;
 
-       private static final List<WeavedClassCache> cacheRegistry = new LinkedList<WeavedClassCache>();
+       private static final List<WeavedClassCache> cacheRegistry = new LinkedList<>();
 
        protected WeavedClassCache(GeneratedClassHandler existingClassHandler,
                                                           IMessageHandler messageHandler,
@@ -259,7 +259,7 @@ public class WeavedClassCache {
         */
        public static List<WeavedClassCache> getCaches() {
                synchronized (cacheRegistry) {
-                       return new LinkedList<WeavedClassCache>(cacheRegistry);
+                       return new LinkedList<>(cacheRegistry);
                }
        }
 
index 6ee8b728c27994b0a4442fac188fbeed3f45f20a..fa7fba0745220f79397c16a00cf78b950a050f0a 100644 (file)
@@ -156,7 +156,7 @@ public class ZippedFileCacheBacking extends AsynchronousFileCacheBacking {
                           e);
             }
 
-            entriesMap = new TreeMap<String,byte[]>();
+            entriesMap = new TreeMap<>();
             okEntries = false;
         }
 
@@ -196,7 +196,7 @@ public class ZippedFileCacheBacking extends AsynchronousFileCacheBacking {
             }
 
             if (toDelete == null) {
-                toDelete = new TreeSet<String>();
+                toDelete = new TreeSet<>();
             }
             toDelete.add(key);
         }
@@ -259,7 +259,7 @@ public class ZippedFileCacheBacking extends AsynchronousFileCacheBacking {
             return Collections.emptyMap();
         }
 
-        Map<String,byte[]>      result=new TreeMap<String,byte[]>();
+        Map<String,byte[]>      result= new TreeMap<>();
         byte[]                  copyBuf=new byte[4096];
         ByteArrayOutputStream   out=new ByteArrayOutputStream(copyBuf.length);
         ZipFile                 zipFile=new ZipFile(file);
index ad384fa49e65cb009445ff8c8a4aebfbeecb33f3..c4d8efa80cd0018d51f968e645be951b987253e0 100644 (file)
@@ -78,29 +78,29 @@ public class JoinPointSignatureIteratorTest extends TestCase {
        public static Map<String, List<String>> expectedResults = new HashMap<>();
 
        static {
-               List<String> sigs = new ArrayList<String>();
+               List<String> sigs = new ArrayList<>();
                sigs.add("java.lang.Object $Proxy1.get1(java.io.Serializable)");
                sigs.add("java.lang.Object MessageService.get1(java.io.Serializable)");
                sigs.add("java.lang.Object GenericService.get1(java.io.Serializable)");
                sigs.add("java.lang.Object GenericService.get1(java.io.Serializable)");
                expectedResults.put("java.lang.Object $Proxy1.get1(java.io.Serializable)", sigs);
 
-               sigs = new ArrayList<String>();
+               sigs = new ArrayList<>();
                sigs.add("java.lang.Object $Proxy1.get2(java.io.Serializable)");
                sigs.add("java.lang.Object MessageService.get2(java.io.Serializable)");
                sigs.add("java.lang.Object GenericService.get2(java.io.Serializable)");
                sigs.add("java.lang.Object GenericService.get2(java.io.Serializable)");
                expectedResults.put("java.lang.Object $Proxy1.get2(java.io.Serializable)", sigs);
 
-               sigs = new ArrayList<String>();
+               sigs = new ArrayList<>();
                sigs.add("java.lang.Object $Proxy1.get1(java.lang.Long)");
                expectedResults.put("java.lang.Object $Proxy1.get1(java.lang.Long)", sigs);
 
-               sigs = new ArrayList<String>();
+               sigs = new ArrayList<>();
                sigs.add("java.lang.Object GenericService.get1(java.io.Serializable)");
                expectedResults.put("java.lang.Object GenericService.get1(java.io.Serializable)", sigs);
 
-               sigs = new ArrayList<String>();
+               sigs = new ArrayList<>();
                sigs.add("java.lang.Object GenericService.get2(java.io.Serializable)");
                expectedResults.put("java.lang.Object GenericService.get2(java.io.Serializable)", sigs);
        }
index d4ed852d2ff16e4125cd28121245996b8c7e1cf3..2c99ee29f33225dcaa1fc642f07751490aa7614e 100644 (file)
@@ -83,7 +83,7 @@ public class ReferenceTypeTestCase extends TestCase {
 
        public void testAssignable01() {
                List list = new ArrayList();
-               List<String> listOfString = new ArrayList<String>();
+               List<String> listOfString = new ArrayList<>();
                List<?> listOfSomething = new ArrayList<Integer>();
                List<? extends Number> listOfSomethingNumberish = new ArrayList<Integer>();
                List<? super Double> listOfSomethingSuperDouble = new ArrayList<Number>();
@@ -192,7 +192,7 @@ public class ReferenceTypeTestCase extends TestCase {
        public void testAssignable02() {
                List list = new ArrayList();
                ArrayList arraylist = null;
-               List<String> listOfString = new ArrayList<String>();
+               List<String> listOfString = new ArrayList<>();
                List<?> listOfSomething = new ArrayList<Integer>();
                ArrayList<?> arrayListOfSomething = null;
                List<Number> listOfNumber = null;
@@ -200,7 +200,7 @@ public class ReferenceTypeTestCase extends TestCase {
                ArrayList<? extends Number> arrayListOfSomethingNumberish = null;
                List<? extends Number> listOfSomethingNumberish = new ArrayList<Integer>();
                List<? super Double> listOfSomethingSuperDouble = new ArrayList<Number>();
-               List<Integer> listOfInteger = new ArrayList<Integer>();
+               List<Integer> listOfInteger = new ArrayList<>();
                ArrayList<String> arrayListOfString;
                ArrayList<Integer> arraylistOfInteger;
                // interfaces too List<? extends A,B>
@@ -275,7 +275,7 @@ public class ReferenceTypeTestCase extends TestCase {
        public void testAssignable03_method_m2() {
                List list = new ArrayList();
                ArrayList arraylist = null;
-               List<String> listOfString = new ArrayList<String>();
+               List<String> listOfString = new ArrayList<>();
                List<?> listOfSomething = new ArrayList<Integer>();
                ArrayList<?> arrayListOfSomething = null;
                List<Number> listOfNumber = null;
@@ -284,7 +284,7 @@ public class ReferenceTypeTestCase extends TestCase {
                ArrayList<? extends Number> arrayListOfSomethingNumberish = null;
                List<? extends Number> listOfSomethingNumberish = new ArrayList<Integer>();
                List<? super Double> listOfSomethingSuperDouble = new ArrayList<Number>();
-               List<Integer> listOfInteger = new ArrayList<Integer>();
+               List<Integer> listOfInteger = new ArrayList<>();
                ArrayList<String> arrayListOfString;
                ArrayList<Integer> arraylistOfInteger;
                // interfaces too List<? extends A,B>
@@ -362,7 +362,7 @@ public class ReferenceTypeTestCase extends TestCase {
        public void testAssignable04_method_m3() {
                List list = new ArrayList();
                ArrayList arraylist = null;
-               List<String> listOfString = new ArrayList<String>();
+               List<String> listOfString = new ArrayList<>();
                List<?> listOfSomething = new ArrayList<Integer>();
                ArrayList<?> arrayListOfSomething = null;
                List<Number> listOfNumber = null;
@@ -371,7 +371,7 @@ public class ReferenceTypeTestCase extends TestCase {
                ArrayList<? extends Number> arrayListOfSomethingNumberish = null;
                List<? extends Number> listOfSomethingNumberish = new ArrayList<Integer>();
                List<? super Double> listOfSomethingSuperDouble = new ArrayList<Number>();
-               List<Integer> listOfInteger = new ArrayList<Integer>();
+               List<Integer> listOfInteger = new ArrayList<>();
                ArrayList arrayList = null;
                ArrayList<String> arrayListOfString;
                ArrayList<Integer> arraylistOfInteger;
@@ -478,7 +478,7 @@ public class ReferenceTypeTestCase extends TestCase {
        public void testAssignable03_method_m4() {
                List list = new ArrayList();
                ArrayList arraylist = null;
-               List<String> listOfString = new ArrayList<String>();
+               List<String> listOfString = new ArrayList<>();
                List<?> listOfSomething = new ArrayList<Integer>();
                ArrayList<?> arrayListOfSomething = null;
                List<Number> listOfNumber = null;
@@ -486,7 +486,7 @@ public class ReferenceTypeTestCase extends TestCase {
                ArrayList<? extends Number> arrayListOfSomethingNumberish = null;
                List<? extends Number> listOfSomethingNumberish = new ArrayList<Integer>();
                List<? super Double> listOfSomethingSuperDouble = new ArrayList<Number>();
-               List<Integer> listOfInteger = new ArrayList<Integer>();
+               List<Integer> listOfInteger = new ArrayList<>();
                ArrayList<String> arrayListOfString;
                ArrayList<Integer> arraylistOfInteger;
                // interfaces too List<? extends A,B>
@@ -564,7 +564,7 @@ public class ReferenceTypeTestCase extends TestCase {
        // copy of the real one in BcelClassWeaver
        public static class IfaceInitList implements PartialOrder.PartialComparable {
                final ResolvedType onType;
-               List<ConcreteTypeMunger> list = new ArrayList<ConcreteTypeMunger>();
+               List<ConcreteTypeMunger> list = new ArrayList<>();
 
                IfaceInitList(ResolvedType onType) {
                        this.onType = onType;
index eddcd146d4f255feeb6597cd9522de778e012fdd..f8eaa4c9dfc78a42a14bf3cfbd88d99077617c73 100644 (file)
@@ -26,7 +26,7 @@ public class WeaverMessagesTestCase extends TestCase {
                
                Class<?> wmClass = WeaverMessages.class;
                Field[] fields = wmClass.getDeclaredFields();
-               List<String> fieldList = new ArrayList<String>();
+               List<String> fieldList = new ArrayList<>();
                for (Field f : fields) {
                        if (f.getType() == String.class) {
                                try {
index 4e24bb555d69ae27d359b58342c1aff719badad9..a5684db187f5a04cd92425d4b79f052ff86882c3 100644 (file)
@@ -60,7 +60,7 @@ public class MegaZipTestCase extends WeaveTestCase {
        }
 
        public List<ShadowMunger> getShadowMungers() {
-               List<ShadowMunger> ret = new ArrayList<ShadowMunger>();
+               List<ShadowMunger> ret = new ArrayList<>();
                ret.add(makeConcreteAdvice("before" + "(): call(* *.println(..)) -> static void fluffy.Aspect.before_method_call()"));
                ret.add(makeConcreteAdvice("afterReturning"
                                + "(): call(* *.println(..)) -> static void fluffy.Aspect.afterReturning_method_call()"));
index 6e69e2c0f4838869985ae9bcb80b0e55edc0fe12..f547d6afd907bd4e0f5c7b2f24209ca77c8a714e 100644 (file)
@@ -84,7 +84,7 @@ public abstract class WeaveTestCase extends TestCase {
        }
 
        public void weaveTest(String name, String outName, ShadowMunger planner) throws IOException {
-               List<ShadowMunger> l = new ArrayList<ShadowMunger>(1);
+               List<ShadowMunger> l = new ArrayList<>(1);
                l.add(planner);
                weaveTest(name, outName, l);
        }
@@ -215,7 +215,7 @@ public abstract class WeaveTestCase extends TestCase {
        }
 
        public List<ShadowMunger> makeAdviceAll(String kind, boolean matchOnlyPrintln) {
-               List<ShadowMunger> ret = new ArrayList<ShadowMunger>();
+               List<ShadowMunger> ret = new ArrayList<>();
                if (matchOnlyPrintln) {
                        ret.add(makeConcreteAdvice(kind + "(): call(* *.println(..)) -> static void Aspect.ajc_" + kind + "_method_execution()"));
                } else {
index 8e84a71e51bc488ef6b1ef5cef4dc0c1674e39ee..eb5c509484546bcb318cdd0485c31d081eb02356 100644 (file)
@@ -93,7 +93,7 @@ public class AnnotationPatternMatchingTestCase extends TestCase {
        }
 
        static class MyMessageHandler implements IMessageHandler {
-               public List<IMessage> messages = new ArrayList<IMessage>();
+               public List<IMessage> messages = new ArrayList<>();
 
                public boolean handleMessage(IMessage message) throws AbortException {
                        messages.add(message);
index f65053f7ea1270c19cf76c117576837bb2841161..5181efcf67711869fb3612fb463429a1dc61ab52 100644 (file)
@@ -140,7 +140,7 @@ public class Java15PointcutExpressionTest extends TestCase {
 
        }
        
-       private static final Set<PointcutPrimitive> DEFAULT_SUPPORTED_PRIMITIVES = new HashSet<PointcutPrimitive>();
+       private static final Set<PointcutPrimitive> DEFAULT_SUPPORTED_PRIMITIVES = new HashSet<>();
 
         static {
          DEFAULT_SUPPORTED_PRIMITIVES.add(PointcutPrimitive.EXECUTION);
@@ -286,7 +286,7 @@ public class Java15PointcutExpressionTest extends TestCase {
          tps[parameterNumber].getAnnotationPattern().toString();
          
          // parameter type annotation checking
-         Set<String> expected = new HashSet<String>();
+         Set<String> expected = new HashSet<>();
          expected.addAll(mpnv.getParameterTypeAnnotations());
          
          StringTokenizer st = new StringTokenizer(expectedParameterTypeAnnotations==null?"":expectedParameterTypeAnnotations);
@@ -305,7 +305,7 @@ public class Java15PointcutExpressionTest extends TestCase {
          }
          
          // parameter annotation checking
-         expected = new HashSet<String>();
+         expected = new HashSet<>();
          expected.addAll(mpnv.getParameterAnnotations());
          
          st = new StringTokenizer(expectedParameterAnnotations==null?"":expectedParameterAnnotations);
@@ -327,8 +327,8 @@ public class Java15PointcutExpressionTest extends TestCase {
        
        static class MyPatternNodeVisitor extends AbstractPatternNodeVisitor {
                private StringBuffer stringRep = new StringBuffer();
-               private List<String> parameterAnnotations = new ArrayList<String>();
-               private List<String> parameterTypeAnnotations = new ArrayList<String>();
+               private List<String> parameterAnnotations = new ArrayList<>();
+               private List<String> parameterTypeAnnotations = new ArrayList<>();
                
                public String getStringRepresentation() { return stringRep.toString(); }
                public List<String> getParameterAnnotations() { return parameterAnnotations; }
index fbf4d3068b45b57e43f1233ae5c2d0206b69c3a8..46f841666dc0233eb552044c8c8875e938616761 100644 (file)
@@ -87,7 +87,7 @@ public class PointcutParserTest extends TestCase {
                                .getPointcutParserSupportingSpecifiedPrimitivesAndUsingSpecifiedClassLoaderForResolution(p, this.getClass()
                                                .getClassLoader());
                assertEquals("Should use the set we pass in", p, parser.getSupportedPrimitives());
-               Set<PointcutPrimitive> q = new HashSet<PointcutPrimitive>();
+               Set<PointcutPrimitive> q = new HashSet<>();
                q.add(PointcutPrimitive.ARGS);
                parser = PointcutParser.getPointcutParserSupportingSpecifiedPrimitivesAndUsingSpecifiedClassLoaderForResolution(q, this
                                .getClass().getClassLoader());
index 7d1b664079ffb6a7ccd646b077867388a48f20ef..a6445057b5cd66b95e161ba7cf27e38acb207937 100644 (file)
@@ -137,7 +137,7 @@ public abstract class AsynchronousFileCacheBackingTestSupport
             return Collections.emptyMap();
         }
 
-        Map<String, File>  files=new TreeMap<String, File>();
+        Map<String, File>  files= new TreeMap<>();
         for (IndexEntry entry : entries) {
             File    file=createDataFile(entry);
             if (file != null) {
index 87daff7967220fe4d2644cf8090cb0bf7309e807..3271a1ffafc3d967d19d2c971d6ce25cb134930b 100644 (file)
@@ -74,7 +74,7 @@ public class FlatFileCacheBackingTest extends AsynchronousFileCacheBackingTestSu
                long newCrc = generateNewBytes();
                assertTrue("Bad new CRC", newCrc != (-1L));
 
-               Map<String, File> badFiles = new TreeMap<String, File>();
+               Map<String, File> badFiles = new TreeMap<>();
                for (IndexEntry entry : entries) {
                        String key = entry.key;
                        if (key.startsWith("badData")) {
@@ -116,7 +116,7 @@ public class FlatFileCacheBackingTest extends AsynchronousFileCacheBackingTestSu
                File indexFile = getIndexFile();
                writeIndex(indexFile, entries);
 
-               Map<String, File> dataFiles = new TreeMap<String, File>();
+               Map<String, File> dataFiles = new TreeMap<>();
                for (IndexEntry entry : entries) {
                        String key = entry.key;
                        if (key.startsWith("withData")) {
index a02400eb8724d572c18ea31243af13d8e538235d..9d256d576c19e4d287dc3d8bdc813bd94d0be4ae 100644 (file)
@@ -33,11 +33,11 @@ public class WeavedClassCacheTest extends AbstractCacheBackingTestSupport {
        }
 
        public class MemoryCacheBacking implements CacheBacking {
-               HashMap<String, CachedClassEntry> cache = new HashMap<String, CachedClassEntry>();
+               HashMap<String, CachedClassEntry> cache = new HashMap<>();
 
                public String[] getKeys(String regex) {
                        Set<String> keys = cache.keySet();
-                       List<String> matches = new LinkedList<String>();
+                       List<String> matches = new LinkedList<>();
                        for (String key : keys) {
                                if (key.matches(regex)) {
                                        matches.add(key);
@@ -86,7 +86,7 @@ public class WeavedClassCacheTest extends AbstractCacheBackingTestSupport {
 
        public class TestGeneratedClassHandler implements GeneratedClassHandler {
                public int accepts = 0;
-               public List<String> classesISaw = new LinkedList<String>();
+               public List<String> classesISaw = new LinkedList<>();
 
                public void acceptClass (String name, byte[] originalBytes, byte[] wovenBytes) {
                        accepts++;
index 4c41c1807ceb152bb0d890772ab39abb1d1dc25d..eee9aa32b0979f8abd35afdb1604f266ec4eb332 100644 (file)
@@ -40,7 +40,7 @@ public class ZippedFileCacheBackingTest extends AsynchronousFileCacheBackingTest
         File   indexFile=getIndexFile();
         writeIndex(indexFile, entries);
 
-        Map<String,byte[]>  entriesMap=new TreeMap<String,byte[]>();
+        Map<String,byte[]>  entriesMap= new TreeMap<>();
         for (IndexEntry ie : entries) {
             if (ie.ignored) {
                 continue;
@@ -73,7 +73,7 @@ public class ZippedFileCacheBackingTest extends AsynchronousFileCacheBackingTest
     }
 
     public void testReadWriteZipClassBytes () throws IOException {
-        Map<String,byte[]>  entriesMap=new TreeMap<String,byte[]>();
+        Map<String,byte[]>  entriesMap= new TreeMap<>();
         for (int    index=0; index < Byte.SIZE; index++) {
             String  name="classBytes#" + index;
             random.nextBytes(bytes);
@@ -104,7 +104,7 @@ public class ZippedFileCacheBackingTest extends AsynchronousFileCacheBackingTest
         long newCrc=generateNewBytes();
         assertTrue("Bad new CRC", newCrc != (-1L));
 
-        Map<String,byte[]>  entriesMap=new TreeMap<String,byte[]>();
+        Map<String,byte[]>  entriesMap= new TreeMap<>();
         for (IndexEntry ie : entries) {
             if (ie.ignored) {
                 continue;