You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/07/05 04:14:51 UTC
[GitHub] [netbeans] BradWalker opened a new pull request, #4331: Cleanup warnings related to raw type List..
BradWalker opened a new pull request, #4331:
URL: https://github.com/apache/netbeans/pull/4331
This pull request attempts to cleanup a lot of the warnings related to raw type list..
[repeat] /home/bwalker/src/netbeans/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/DefaultTabDataModel.java:377: warning: [unchecked] unchecked call to <T>toArray(T[]) as a member of the raw type List
[repeat] lde.setAffectedItems((TabData[]) affected.toArray(new TabData[0]));
[repeat] ^
[repeat] where T is a type-variable:
[repeat] T extends Object declared in method <T>toArray(T[])
I was able to reduce the warnings in half. Of the remaining ones, the majority are related to a generated file. The few remaining ones are going to require some real work.
---
**^Add meaningful description above**
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
- are all your own work, and you have the right to contribute them.
- are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).
Please make sure (eg. `git log`) that all commits have a valid name and email address for you in the Author field.
If you're a first time contributor, see the Contributing guidelines for more information.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r913887571
##########
platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/DefaultTabDataModel.java:
##########
@@ -365,7 +365,7 @@ public void removeTab(int index) {
*/
@Override
public void removeTabs(int start, int end) {
- java.util.List affected = new ArrayList(list.subList(start, end));
+ List affected = new ArrayList(list.subList(start, end));
Review Comment:
done..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#issuecomment-1175215114
Hey @mbien , thanks for the sharp eyes on the code review..
I've made all the changes you requested..
We should be good to go now..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r914219199
##########
java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java:
##########
@@ -5512,7 +5512,7 @@ public Value getValue(Field field) {
@Override
public Map<Field, Value> getValues(List<? extends Field> list) {
- List[] listByTypes = new List[types.length];
+ List<Field>[] listByTypes = new List[types.length];
Review Comment:
you are right, my mistake. I somehow saw it as `List<Field[]>`. Generic arrays are not possible in java.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker merged pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker merged PR #4331:
URL: https://github.com/apache/netbeans/pull/4331
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r914243791
##########
enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java:
##########
@@ -151,9 +149,9 @@ public void run() {
/** Transforms ErrosInfo to Annotation
*/
- private Collection getAnnotations(ErrorInfo[] errors, StyledDocument document) {
+ private Collection<LineSetAnnotation> getAnnotations(ErrorInfo[] errors, StyledDocument document) {
BaseDocument doc = (BaseDocument) document;
- HashMap map = new HashMap(errors.length);
+ Map<Integer, LineSetAnnotation> map = new HashMap(errors.length);
Review Comment:
done..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r914278394
##########
enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java:
##########
@@ -128,16 +129,13 @@ public void annotate(ErrorInfo[] errors){
if (!added.isEmpty()) {
final List finalAdded = added;
final DataObject doJsp2 = doJsp;
- Runnable docRenderer = new Runnable() {
- @Override
- public void run() {
- LineCookie cookie = (LineCookie)doJsp2.getCookie(LineCookie.class);
- Line.Set lines = cookie.getLineSet();
-
- for (Iterator i=finalAdded.iterator();i.hasNext();) {
- LineSetAnnotation ann=(LineSetAnnotation)i.next();
- ann.attachToLineSet(lines);
- }
+ Runnable docRenderer = () -> {
+ LineCookie cookie = (LineCookie)doJsp2.getCookie(LineCookie.class);
+ Line.Set lines = cookie.getLineSet();
+
+ for (Iterator i=finalAdded.iterator();i.hasNext();) {
+ LineSetAnnotation ann=(LineSetAnnotation)i.next();
+ ann.attachToLineSet(lines);
}
};
Review Comment:
Agreed and done..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r913883172
##########
ide/versioning.util/src/org/netbeans/modules/turbo/Turbo.java:
##########
@@ -182,7 +182,7 @@ public Object readEntry(Object key, String name) {
private Iterator providers() {
if (customProviders == null) {
Collection plugins = providers.allInstances();
- List all = new ArrayList(plugins.size() +1);
+ List<TurboProvider> all = new ArrayList(plugins.size() + 1);
Review Comment:
done..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r913882513
##########
ide/api.debugger/src/org/netbeans/api/debugger/DebuggerManager.java:
##########
@@ -315,7 +315,7 @@ public DebuggerEngine[] startDebugging (DebuggerInfo info) {
}
// init DebuggerEngines
- ArrayList engineProviders = new ArrayList ();
+ List engineProviders = new ArrayList<>();
Review Comment:
done..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r913886027
##########
java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java:
##########
@@ -5512,7 +5512,7 @@ public Value getValue(Field field) {
@Override
public Map<Field, Value> getValues(List<? extends Field> list) {
- List[] listByTypes = new List[types.length];
+ List<Field>[] listByTypes = new List[types.length];
Review Comment:
Tried and was unable to make it work..
```
[nb-javac] Compiling 190 source files to /home/bwalker/src/netbeans/java/debugger.jpda/build/classes
[repeat] /home/bwalker/src/netbeans/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java:5515: error: cannot create array with '<>'
[repeat] List<Field>[] listByTypes = new List<>[types.length];
[repeat] ^
[repeat] 1 error
[nbmerge] Failed to build target: all-debugger.jpda
```
If I fill in the diamond operator with Field, I get a generic array creation error.
I tried..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r914227842
##########
enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java:
##########
@@ -151,9 +149,9 @@ public void run() {
/** Transforms ErrosInfo to Annotation
*/
- private Collection getAnnotations(ErrorInfo[] errors, StyledDocument document) {
+ private Collection<LineSetAnnotation> getAnnotations(ErrorInfo[] errors, StyledDocument document) {
BaseDocument doc = (BaseDocument) document;
- HashMap map = new HashMap(errors.length);
+ Map<Integer, LineSetAnnotation> map = new HashMap(errors.length);
Review Comment:
i overlooked this one first round. Diamond on the right.
##########
enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java:
##########
@@ -128,16 +129,13 @@ public void annotate(ErrorInfo[] errors){
if (!added.isEmpty()) {
final List finalAdded = added;
final DataObject doJsp2 = doJsp;
- Runnable docRenderer = new Runnable() {
- @Override
- public void run() {
- LineCookie cookie = (LineCookie)doJsp2.getCookie(LineCookie.class);
- Line.Set lines = cookie.getLineSet();
-
- for (Iterator i=finalAdded.iterator();i.hasNext();) {
- LineSetAnnotation ann=(LineSetAnnotation)i.next();
- ann.attachToLineSet(lines);
- }
+ Runnable docRenderer = () -> {
+ LineCookie cookie = (LineCookie)doJsp2.getCookie(LineCookie.class);
+ Line.Set lines = cookie.getLineSet();
+
+ for (Iterator i=finalAdded.iterator();i.hasNext();) {
+ LineSetAnnotation ann=(LineSetAnnotation)i.next();
+ ann.attachToLineSet(lines);
}
};
Review Comment:
`final List finalAdded = added;`
->
`final List<LineSetAnnotation> = added;`
after that you can change the for loop to:
```
for (LineSetAnnotation ann : finalAdded) {
ann.attachToLineSet(lines);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r913397719
##########
ide/versioning.util/src/org/netbeans/modules/turbo/Turbo.java:
##########
@@ -182,7 +182,7 @@ public Object readEntry(Object key, String name) {
private Iterator providers() {
if (customProviders == null) {
Collection plugins = providers.allInstances();
- List all = new ArrayList(plugins.size() +1);
+ List<TurboProvider> all = new ArrayList(plugins.size() + 1);
Review Comment:
`<>` missing on the right
##########
enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java:
##########
@@ -151,9 +149,9 @@ public void run() {
/** Transforms ErrosInfo to Annotation
*/
- private Collection getAnnotations(ErrorInfo[] errors, StyledDocument document) {
+ private Collection<LineSetAnnotation> getAnnotations(ErrorInfo[] errors, StyledDocument document) {
BaseDocument doc = (BaseDocument) document;
- HashMap map = new HashMap(errors.length);
+ Map map = new HashMap(errors.length);
Review Comment:
-> `Map<Integer, LineSetAnnotation> map = new HashMap<>(errors.length);`
##########
java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java:
##########
@@ -5512,7 +5512,7 @@ public Value getValue(Field field) {
@Override
public Map<Field, Value> getValues(List<? extends Field> list) {
- List[] listByTypes = new List[types.length];
+ List<Field>[] listByTypes = new List[types.length];
Review Comment:
diamond on the right missing
##########
java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java:
##########
@@ -4531,7 +4531,7 @@ private static ReferenceType getOrLoadClass(VirtualMachine vm, String name,
String message = Bundle.MSG_IncompatibleThreadStateMessage();
InvalidExpressionException ieex = new InvalidExpressionException(message, itsex);
throw new IllegalStateException(ieex);
- } catch (Exception ex) {
+ } catch (ClassNotLoadedException | InvalidTypeException | InvocationException ex) {
return null;
Review Comment:
this is risky. I probably would recommend to revert this. Unless we test this a bit more.
For example the line above throws `IllegalStateException`, which would have been caught before with `Exception` and null would have been returned, But now this wouldn't be caught, it would skip to the finally block and then just propagate the exception further.
I don't know what the original intention was. Maybe it was supposed to propagate, maybe not. So you either fixed a bug here or added one :) In any case it would be safer to not hide this in a cleanup commit. Someone familiar with the debugger should review this part.
##########
platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/DefaultTabDataModel.java:
##########
@@ -365,7 +365,7 @@ public void removeTab(int index) {
*/
@Override
public void removeTabs(int start, int end) {
- java.util.List affected = new ArrayList(list.subList(start, end));
+ List affected = new ArrayList(list.subList(start, end));
Review Comment:
`<TabData>` left and `<> `right
##########
ide/api.debugger/src/org/netbeans/api/debugger/DebuggerManager.java:
##########
@@ -315,7 +315,7 @@ public DebuggerEngine[] startDebugging (DebuggerInfo info) {
}
// init DebuggerEngines
- ArrayList engineProviders = new ArrayList ();
+ List engineProviders = new ArrayList<>();
Review Comment:
`List<Object>` on the left. Since that is unfortunately the common type the way this list is used.
##########
java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/DebuggingTreeModel.java:
##########
@@ -494,7 +492,7 @@ public void propertyChange (PropertyChangeEvent e) {
} else {
return ;
}
- List nodes = new ArrayList();
+ List nodes = new ArrayList<>();
Review Comment:
`<Object>` on the left
##########
enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/multiview/CmpFieldsNode.java:
##########
@@ -88,11 +88,11 @@ public SectionNode getNodeForElement(Object element) {
return this;
}
} else if (element instanceof CmpField[]) {
- final List list1 = Arrays.asList(cmpFields.getCmpFields());
- final List list2 = new LinkedList<>(Arrays.asList((CmpField[]) element));
+ final List<CmpField> list1 = Arrays.asList(cmpFields.getCmpFields());
+ final List<CmpField> list2 = new LinkedList<>(Arrays.<CmpField>asList((CmpField[]) element));
Review Comment:
second line could be simply
`final List<CmpField> list2 = new LinkedList<>(Arrays.asList((CmpField[]) element));`
analog to the first line (no generic type for `asList()`)
##########
java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/DebuggingTreeModel.java:
##########
@@ -293,8 +291,8 @@ private boolean containsThread(DVThreadGroup group, DVThread currentThread) {
}
private Object[] getTopLevelThreadsAndGroups() {
- List result = new LinkedList();
- Set groups = new HashSet();
+ List<JPDADVThread> result = new LinkedList<>();
+ Set groups = new HashSet<>();
Review Comment:
```java
List<Object> result = new LinkedList<>();
Set<JPDADVThreadGroup> groups = new HashSet<>();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r913891869
##########
enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/multiview/CmpFieldsNode.java:
##########
@@ -88,11 +88,11 @@ public SectionNode getNodeForElement(Object element) {
return this;
}
} else if (element instanceof CmpField[]) {
- final List list1 = Arrays.asList(cmpFields.getCmpFields());
- final List list2 = new LinkedList<>(Arrays.asList((CmpField[]) element));
+ final List<CmpField> list1 = Arrays.asList(cmpFields.getCmpFields());
+ final List<CmpField> list2 = new LinkedList<>(Arrays.<CmpField>asList((CmpField[]) element));
Review Comment:
done..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r913885076
##########
java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java:
##########
@@ -4531,7 +4531,7 @@ private static ReferenceType getOrLoadClass(VirtualMachine vm, String name,
String message = Bundle.MSG_IncompatibleThreadStateMessage();
InvalidExpressionException ieex = new InvalidExpressionException(message, itsex);
throw new IllegalStateException(ieex);
- } catch (Exception ex) {
+ } catch (ClassNotLoadedException | InvalidTypeException | InvocationException ex) {
return null;
Review Comment:
done..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r913889146
##########
java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/DebuggingTreeModel.java:
##########
@@ -293,8 +291,8 @@ private boolean containsThread(DVThreadGroup group, DVThread currentThread) {
}
private Object[] getTopLevelThreadsAndGroups() {
- List result = new LinkedList();
- Set groups = new HashSet();
+ List<JPDADVThread> result = new LinkedList<>();
+ Set groups = new HashSet<>();
Review Comment:
done..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r913890195
##########
java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/DebuggingTreeModel.java:
##########
@@ -494,7 +492,7 @@ public void propertyChange (PropertyChangeEvent e) {
} else {
return ;
}
- List nodes = new ArrayList();
+ List nodes = new ArrayList<>();
Review Comment:
done..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r914278303
##########
enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java:
##########
@@ -151,9 +149,9 @@ public void run() {
/** Transforms ErrosInfo to Annotation
*/
- private Collection getAnnotations(ErrorInfo[] errors, StyledDocument document) {
+ private Collection<LineSetAnnotation> getAnnotations(ErrorInfo[] errors, StyledDocument document) {
BaseDocument doc = (BaseDocument) document;
- HashMap map = new HashMap(errors.length);
+ Map<Integer, LineSetAnnotation> map = new HashMap(errors.length);
Review Comment:
fixed..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r913879687
##########
enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java:
##########
@@ -151,9 +149,9 @@ public void run() {
/** Transforms ErrosInfo to Annotation
*/
- private Collection getAnnotations(ErrorInfo[] errors, StyledDocument document) {
+ private Collection<LineSetAnnotation> getAnnotations(ErrorInfo[] errors, StyledDocument document) {
BaseDocument doc = (BaseDocument) document;
- HashMap map = new HashMap(errors.length);
+ Map map = new HashMap(errors.length);
Review Comment:
done..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r913886027
##########
java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java:
##########
@@ -5512,7 +5512,7 @@ public Value getValue(Field field) {
@Override
public Map<Field, Value> getValues(List<? extends Field> list) {
- List[] listByTypes = new List[types.length];
+ List<Field>[] listByTypes = new List[types.length];
Review Comment:
done..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] BradWalker commented on a diff in pull request #4331: Cleanup warnings related to raw type List..
Posted by GitBox <gi...@apache.org>.
BradWalker commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r914225224
##########
java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java:
##########
@@ -5512,7 +5512,7 @@ public Value getValue(Field field) {
@Override
public Map<Field, Value> getValues(List<? extends Field> list) {
- List[] listByTypes = new List[types.length];
+ List<Field>[] listByTypes = new List[types.length];
Review Comment:
> you are right, my mistake. I somehow saw it as `List<Field[]>`. Generic arrays are not possible in java.
Hey @mbien , trust me, my eyes start to glaze over doing this stuff! 8-) For some reason, I continue to do it.. hehehe..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists