netbeans-no-javac-patch / type-annotations

# HG changeset patch
# Parent b9960fc6ca69f64400d0fdb6f072463388f2ad9a

diff -r b9960fc6ca69 java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java
--- a/java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java	Sat Oct 06 12:29:14 2012 -0700
+++ b/java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java	Sat Oct 06 18:47:28 2012 -0700
@@ -121,6 +121,13 @@
             lb.append((JCExpression)t);
         return make.at(NOPOS).Annotation((JCTree)type, lb.toList());
     }
+    
+    public AnnotatedTypeTree AnnotatedType(ExpressionTree type, List<? extends AnnotationTree> annotations, boolean underlyingType) {
+        ListBuffer<JCTypeAnnotation> lb = new ListBuffer<JCTypeAnnotation>();
+        for (AnnotationTree t : annotations)
+            lb.append((JCTypeAnnotation)t);
+        return make.at(NOPOS).AnnotatedType(lb.toList(), (JCExpression) type, underlyingType);
+    }
 
     public ArrayAccessTree ArrayAccess(ExpressionTree array, ExpressionTree index) {
         return make.at(NOPOS).Indexed((JCExpression)array, (JCExpression)index);
diff -r b9960fc6ca69 java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java
--- a/java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java	Sat Oct 06 12:29:14 2012 -0700
+++ b/java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java	Sat Oct 06 18:47:28 2012 -0700
@@ -52,6 +52,7 @@
 import com.sun.source.tree.Tree.Kind;
 import com.sun.tools.javac.code.Flags;
 import com.sun.tools.javac.model.JavacElements;
+import com.sun.tools.javac.tree.JCTree.JCAnnotatedType;
 import com.sun.tools.javac.tree.JCTree.JCModifiers;
 import com.sun.tools.javac.util.Context;
 import javax.lang.model.element.Element;
@@ -1210,5 +1211,21 @@
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
+    @Override
+    public Tree visitAnnotatedType(AnnotatedTypeTree node, Object p) {
+        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+    }
 
+    protected final AnnotatedTypeTree rewriteChildren(AnnotatedTypeTree tree) {
+	ExpressionTree type = translateStable(tree.getUnderlyingType());
+	List<? extends AnnotationTree> annotations = translateStable(tree.getAnnotations());
+	if (!annotations.equals(tree.getAnnotations()) || type != tree.getUnderlyingType()) {
+	    AnnotatedTypeTree n = make.AnnotatedType(type, annotations, /*XXX:*/((JCAnnotatedType) tree).onRightType);
+            model.setType(n, model.getType(tree));
+	    copyCommentTo(tree,n);
+            copyPosTo(tree,n);
+	    tree = n;
+	}
+	return tree;
+    }
 }
diff -r b9960fc6ca69 lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBTreeMaker.java
--- a/lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBTreeMaker.java	Sat Oct 06 12:29:14 2012 -0700
+++ b/lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBTreeMaker.java	Sat Oct 06 18:47:28 2012 -0700
@@ -110,10 +110,13 @@
 
     @Override
     public JCMethodDecl MethodDef(JCModifiers mods, Name name, JCExpression restype, List<JCTypeParameter> typarams, List<JCVariableDecl> params, List<JCExpression> thrown, JCBlock body, JCExpression defaultValue) {
-        return new MethodDecl(mods, name, restype, typarams, params, thrown, body, defaultValue, null);
+        return new MethodDecl(mods, name, restype, typarams, params, null, thrown, body, defaultValue, null);
     }
-    
-    
+
+    @Override
+    public JCMethodDecl MethodDef(JCModifiers mods, Name name, JCExpression restype, List<JCTypeParameter> typarams, List<JCVariableDecl> params, JCVariableDecl recvparam, List<JCExpression> thrown, JCBlock body, JCExpression defaultValue) {
+        return new MethodDecl(mods, name, restype, typarams, params, recvparam, thrown, body, defaultValue, null);
+    }
 
     public static class IndexedClassDecl extends JCClassDecl {
         public int index;
@@ -136,11 +139,12 @@
                             JCExpression restype,
                             List<JCTypeParameter> typarams,
                             List<JCVariableDecl> params,
+                            JCVariableDecl recvparam,
                             List<JCExpression> thrown,
                             JCBlock body,
                             JCExpression defaultValue,
                             MethodSymbol sym) {
-            super(mods, name, restype, typarams, params, thrown, body, defaultValue, sym);
+            super(mods, name, restype, typarams, params, recvparam, thrown, body, defaultValue, sym);
         }
         
     }
diff -r b9960fc6ca69 spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java
--- a/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java	Sat Oct 06 12:29:14 2012 -0700
+++ b/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java	Sat Oct 06 18:47:28 2012 -0700
@@ -1334,33 +1334,33 @@
             return super.checkExprStat(t);
         }
 
-        @Override
-        protected JCCase switchBlockStatementGroup() {
-            if (token.kind == TokenKind.CASE) {
-                Token peeked = S.token(1);
-
-                if (peeked.kind == TokenKind.IDENTIFIER) {
-                    String ident = peeked.name().toString();
-
-                    if (ident.startsWith("$") && ident.endsWith("$")) {
-                        nextToken();
-                        
-                        int pos = token.pos;
-                        com.sun.tools.javac.util.Name name = token.name();
-
-                        nextToken();
-
-                        if (token.kind == TokenKind.SEMI) {
-                            nextToken();
-                        }
-
-                        return new JackpotTrees.CaseWildcard(ctx, name, F.at(pos).Ident(name));
-                    }
-                }
-            }
-
-            return super.switchBlockStatementGroup();
-        }
+//        @Override
+//        protected JCCase switchBlockStatementGroup() {
+//            if (token.kind == TokenKind.CASE) {
+//                Token peeked = S.token(1);
+//
+//                if (peeked.kind == TokenKind.IDENTIFIER) {
+//                    String ident = peeked.name().toString();
+//
+//                    if (ident.startsWith("$") && ident.endsWith("$")) {
+//                        nextToken();
+//                        
+//                        int pos = token.pos;
+//                        com.sun.tools.javac.util.Name name = token.name();
+//
+//                        nextToken();
+//
+//                        if (token.kind == TokenKind.SEMI) {
+//                            nextToken();
+//                        }
+//
+//                        return new JackpotTrees.CaseWildcard(ctx, name, F.at(pos).Ident(name));
+//                    }
+//                }
+//            }
+//
+//            return super.switchBlockStatementGroup();
+//        }
 
 
         @Override
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.