This is an automated email from the ASF dual-hosted git repository.

jlahoda pushed a commit to branch release90
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git

commit 94be54c749ca5183acf0f973353f3ad567a6adba
Author: Arunava Sinha <[email protected]>
AuthorDate: Thu Apr 26 15:08:32 2018 +0530

    netbeans-481: Refactored code of ConvertInvalidVarToExplicitArrayType class
---
 .../java/hints/errors/ConvertInvalidVarToExplicitArrayType.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/java.hints/src/org/netbeans/modules/java/hints/errors/ConvertInvalidVarToExplicitArrayType.java
 
b/java.hints/src/org/netbeans/modules/java/hints/errors/ConvertInvalidVarToExplicitArrayType.java
index d8de06b..dda5c70 100644
--- 
a/java.hints/src/org/netbeans/modules/java/hints/errors/ConvertInvalidVarToExplicitArrayType.java
+++ 
b/java.hints/src/org/netbeans/modules/java/hints/errors/ConvertInvalidVarToExplicitArrayType.java
@@ -91,13 +91,13 @@ public class ConvertInvalidVarToExplicitArrayType 
implements ErrorRule<Void> {
             Integer maxTypePriority = -1;
 
             boolean isHomoGeneousArray = true;
-            for (ExpressionTree tree : currentValues) {
+            TreePath initArrayTreePath = new TreePath(treePath, arrayTree);
 
-                Scope s = compilationInfo.getTrees().getScope(treePath);
+            for (ExpressionTree tree : currentValues) {
 
-                arrayElementTypeMirror = 
compilationInfo.getTreeUtilities().attributeTree(tree, s);
+                arrayElementTypeMirror = 
compilationInfo.getTrees().getTypeMirror(new TreePath(initArrayTreePath, tree));
 
-                if (tree instanceof NewClassTree) {
+                if (tree.getKind() == Tree.Kind.NEW_CLASS) {
                     NewClassTree nct = (NewClassTree) tree;
                     if (nct.getIdentifier().getKind() == 
Tree.Kind.PARAMETERIZED_TYPE) {
 

-- 
To stop receiving notification emails like this one, please contact
[email protected].

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to