Skip to content
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

Closed

Conversation

turbanoff
Copy link

No description provided.

Copy link

@Simulant87 Simulant87 left a 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<>();

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...

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();

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();

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();

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<>();

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<>();

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<>();

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<>();

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.

@turbanoff turbanoff closed this Aug 15, 2019
@turbanoff turbanoff deleted the use_generics_instead_of_raw branch August 15, 2019 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants