diff options
author | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-13 01:01:58 +0200 |
---|---|---|
committer | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-13 01:01:58 +0200 |
commit | e1bff9a5703baf17ec650b173bdfe776bf87125f (patch) | |
tree | 8b4443759c231a6c46cb70c755fe554a4b621e11 /bridge | |
parent | b6eee2e1052116aa22ebbd3c2baf05c2b709bee5 (diff) | |
download | aspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.tar.gz aspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.zip |
Use the diamond operator where possible
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'bridge')
5 files changed, 13 insertions, 13 deletions
diff --git a/bridge/src/main/java/org/aspectj/bridge/AbortException.java b/bridge/src/main/java/org/aspectj/bridge/AbortException.java index acde7cd28..6dac2005e 100644 --- a/bridge/src/main/java/org/aspectj/bridge/AbortException.java +++ b/bridge/src/main/java/org/aspectj/bridge/AbortException.java @@ -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 diff --git a/bridge/src/main/java/org/aspectj/bridge/CountingMessageHandler.java b/bridge/src/main/java/org/aspectj/bridge/CountingMessageHandler.java index 4ce550876..1a1e8f014 100644 --- a/bridge/src/main/java/org/aspectj/bridge/CountingMessageHandler.java +++ b/bridge/src/main/java/org/aspectj/bridge/CountingMessageHandler.java @@ -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); } diff --git a/bridge/src/main/java/org/aspectj/bridge/MessageHandler.java b/bridge/src/main/java/org/aspectj/bridge/MessageHandler.java index 6fd8539cc..23c2ef3b2 100644 --- a/bridge/src/main/java/org/aspectj/bridge/MessageHandler.java +++ b/bridge/src/main/java/org/aspectj/bridge/MessageHandler.java @@ -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()) { diff --git a/bridge/src/main/java/org/aspectj/bridge/MessageUtil.java b/bridge/src/main/java/org/aspectj/bridge/MessageUtil.java index 77f9c90a8..d55ac3c3b 100644 --- a/bridge/src/main/java/org/aspectj/bridge/MessageUtil.java +++ b/bridge/src/main/java/org/aspectj/bridge/MessageUtil.java @@ -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) { diff --git a/bridge/src/main/java/org/aspectj/bridge/context/CompilationAndWeavingContext.java b/bridge/src/main/java/org/aspectj/bridge/context/CompilationAndWeavingContext.java index 6117b96a9..2ae13a279 100644 --- a/bridge/src/main/java/org/aspectj/bridge/context/CompilationAndWeavingContext.java +++ b/bridge/src/main/java/org/aspectj/bridge/context/CompilationAndWeavingContext.java @@ -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; |