You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by jl...@apache.org on 2018/06/18 04:38:58 UTC

[incubator-netbeans] 06/20: netbeans-481: Refactored code of ConvertInvalidVarToExplicitArrayType class

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 <ar...@oracle.com>
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
jlahoda@apache.org.

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

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