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 2018/04/24 05:38:50 UTC

[GitHub] vikasprabhakar commented on a change in pull request #519: Netbeans-481[JDK10-LVTI]:Added new ErrorRule to fix compiler error on initialization of var type variable with array

vikasprabhakar commented on a change in pull request #519: Netbeans-481[JDK10-LVTI]:Added new ErrorRule to fix compiler error on initialization of var type variable with array
URL: https://github.com/apache/incubator-netbeans/pull/519#discussion_r183609714
 
 

 ##########
 File path: java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ConvertInvalidVarToExplicitArrayTypeTest.java
 ##########
 @@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.java.hints.errors;
+
+import com.sun.source.util.TreePath;
+import java.util.LinkedList;
+import java.util.List;
+import org.netbeans.modules.java.hints.infrastructure.ErrorHintsTestBase;
+import org.netbeans.spi.editor.hints.Fix;
+import org.openide.util.NbBundle;
+import org.netbeans.modules.java.source.parsing.JavacParser;
+import org.netbeans.api.java.source.CompilationInfo;
+
+/**
+ *
+ * @author arusinha
+ */
+public class ConvertInvalidVarToExplicitArrayTypeTest extends ErrorHintsTestBase {
+
+    public ConvertInvalidVarToExplicitArrayTypeTest(String name) throws Exception {
+        super(name, ConvertInvalidVarToExplicitArrayType.class);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = false;
+        super.tearDown();
+    }
+
+    public void testArrayHetrogeneousElements() throws Exception {
+        sourceLevel = "1.10";
 
 Review comment:
   You can use setup() method to avoid duplicate code  of sourceLevel = "1.10"; JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = true;
   
   @Override
       protected void setUp() throws Exception {
           super.setUp();
           sourceLevel = "1.10";
           JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = true;
       }

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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