-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use generics instead of raw types where possible #114
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge conflicts need be be resolved. All other comments are optional.
@@ -64,7 +64,7 @@ public ContainerNode(String name, int maxNodes) { | |||
this.name = name; | |||
this.maxNodes = maxNodes; | |||
|
|||
items = new ArrayList(); | |||
items = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialization could be moved to declaration, but is also fine to leave it here
|
||
//~ Constructors ------------------------------------------------------------------------------------------------------------- | ||
|
||
public SameNameClassGroup() { | ||
classes = new ArrayList(4); // Hope we are not going to have too many class versions... | ||
classes = new ArrayList<>(4); // Hope we are not going to have too many class versions... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialization could be moved to declaration, then the constructor could even be removed.
|
||
while (fIt.hasNext()) { | ||
Field field = (Field) fIt.next(); | ||
List<Field> fields = getFields(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fields
could be inlined into the for-loop below, but not required.
|
||
while (fIt.hasNext()) { | ||
FieldValue fieldValue = (FieldValue) fIt.next(); | ||
List<FieldValue> staticFieldValues = getStaticFieldValues(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
staticFieldValues
could be inlined into the for-loop below, but not required.
|
||
map.put(new Long(cls.getJavaClassId()),cls); | ||
Map<Long, ClassDump> getClassIdToClassMap() { | ||
Collection<ClassDump> allClasses = createClassCollection(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allClasses
could be inlined into the for-loop below, but not required.
@@ -76,7 +76,7 @@ public CodeRegionMethodInstrumentor(ProfilingSessionStatus status, SourceCodeSel | |||
super(status); | |||
sourceCodeSelection = codeSelection; | |||
className = sourceCodeSelection.getClassName().replace('.', '/').intern(); // NOI18N | |||
instrClasses = new ArrayList(); | |||
instrClasses = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialization could be moved to declaration.
parentStack = new Stack(); | ||
methodsOnStack = new HashSet(); | ||
parentStack = new Stack<>(); | ||
methodsOnStack = new HashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialization could be moved to decrlaration for both changed lines.
evaluators = new HashSet /*<Evaluator>*/(); | ||
passFlagStack = new Stack(); | ||
evaluators = new HashSet<>(); | ||
passFlagStack = new Stack<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialization could be moved to decrlaration for both changed lines.
parentStack = new Stack(); | ||
methodsOnStack = new HashSet(); | ||
parentStack = new Stack<>(); | ||
methodsOnStack = new HashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialization could be moved to decrlaration for both changed lines.
No description provided.