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/05/15 11:35:47 UTC

[GitHub] geertjanw closed pull request #468: nb-javac jars upgrade for NETBEANS-463 fix

geertjanw closed pull request #468: nb-javac jars upgrade for NETBEANS-463 fix 
URL: https://github.com/apache/incubator-netbeans/pull/468
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java b/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java
index 5467a5218..c835d33f6 100644
--- a/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java
+++ b/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java
@@ -29,8 +29,11 @@
 import java.security.Permission;
 import javax.lang.model.element.Element;
 import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
 import org.netbeans.api.java.source.JavaSource.Phase;
 import org.netbeans.junit.NbTestCase;
+import org.netbeans.modules.java.source.parsing.JavacParser;
+import org.netbeans.modules.java.source.usages.ClassFileUtil;
 import org.openide.filesystems.FileLock;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileUtil;
@@ -422,6 +425,33 @@ public void testLocVar() throws Exception {
         assertNotNull(handle.resolveElement(info));
     }
 
+    public void testVarInstanceMember() throws Exception {
+        JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = true;
+        FileObject file = FileUtil.createData(sourceRoot, "test/Test.java"); //NOI18N
+        String code = "package test; public class Test {var v1;\n var v2=()->{}; \n public Test() {}}"; //NOI18N
+
+        writeIntoFile(file, code);
+        SourceUtilsTestUtil.setSourceLevel(file, "1.10"); //NOI18N
+        JavaSource js = JavaSource.forFileObject(file);
+
+        CompilationInfo info = SourceUtilsTestUtil.getCompilationInfo(js, Phase.RESOLVED);
+        assertTrue(info.getDiagnostics().size() > 0);
+
+        TreePath tp = info.getTreeUtilities().pathFor(code.indexOf("var v1") + 1); //NOI18N
+        VariableElement elem = (VariableElement) info.getTrees().getElement(tp);
+        ClassFileUtil.createFieldDescriptor(elem);
+        TreePathHandle handle = TreePathHandle.create(tp, info);
+        assertNotNull(handle.getElementHandle());
+        
+        tp = info.getTreeUtilities().pathFor(code.indexOf("var v2") + 1); //NOI18N
+        elem = (VariableElement) info.getTrees().getElement(tp);
+        ClassFileUtil.createFieldDescriptor(elem);
+        
+        handle = TreePathHandle.create(tp, info);
+        assertNotNull(handle.getElementHandle());
+        JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = false;
+    }
+
     private static final class SecMan extends SecurityManager {
 
         @Override
diff --git a/libs.javacapi/external/binaries-list b/libs.javacapi/external/binaries-list
index 8f48fabb3..f191d048f 100644
--- a/libs.javacapi/external/binaries-list
+++ b/libs.javacapi/external/binaries-list
@@ -14,4 +14,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-1FD58C0401F7F012CE366CFE9E1BB9DA7AB7768F nb-javac-9-api.jar
+C118C62F36DEA3EDCBC53B95DDA3275B012B4DFC nb-javac-9-api.jar
diff --git a/libs.javacimpl/external/binaries-list b/libs.javacimpl/external/binaries-list
index 0a3d59014..c5db0c20e 100644
--- a/libs.javacimpl/external/binaries-list
+++ b/libs.javacimpl/external/binaries-list
@@ -14,4 +14,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-B0715954783E5F4909E329FA39E8BC50E161B1ED nb-javac-9-impl.jar
+58FB802FDDA63D542093356F44F6CC896AF109E1 nb-javac-9-impl.jar


 

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