This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 200237
Collapse All | Expand All

(-)a/java.source/apichanges.xml (+13 lines)
Lines 108-113 Link Here
108
    <!-- ACTUAL CHANGES BEGIN HERE: -->
108
    <!-- ACTUAL CHANGES BEGIN HERE: -->
109
109
110
    <changes>
110
    <changes>
111
        <change id="ElementHandle-jvm-signature">
112
             <api name="general"/>
113
             <summary>Added SourceUtils.getJVMSignature to obtain the JVM signature for an ElementHandle</summary>
114
             <version major="0" minor="84"/>
115
             <date day="22" month="7" year="2011"/>
116
             <author login="tzezula"/>
117
             <compatibility addition="yes" binary="compatible" deletion="no" deprecation="no" modification="no" semantic="compatible" source="compatible"/>
118
             <description>
119
                 Added a method <code>SourceUtils.getJVMSignature</code> to obtain the JVM signature for an <code>ElementHandle</code>.
120
             </description>
121
             <class package="org.netbeans.api.java.source" name="SourceUtils"/>
122
             <issue number="200237"/>
123
        </change>
111
        <change id="comments-reformat">
124
        <change id="comments-reformat">
112
             <api name="general"/>
125
             <api name="general"/>
113
             <summary>Added several methods to <code>CodeStyle</code> to support reformatting of comments.</summary>
126
             <summary>Added several methods to <code>CodeStyle</code> to support reformatting of comments.</summary>
(-)a/java.source/nbproject/project.properties (-1 / +1 lines)
Lines 46-52 Link Here
46
javadoc.title=Java Source
46
javadoc.title=Java Source
47
javadoc.arch=${basedir}/arch.xml
47
javadoc.arch=${basedir}/arch.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
49
spec.version.base=0.83.0
49
spec.version.base=0.84.0
50
test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/javac-api-nb-7.0-b07.jar
50
test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/javac-api-nb-7.0-b07.jar
51
test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\
51
test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\
52
    ${o.n.core.dir}/lib/boot.jar:\
52
    ${o.n.core.dir}/lib/boot.jar:\
(-)a/java.source/src/org/netbeans/api/java/source/ElementHandle.java (+8 lines)
Lines 49-54 Link Here
49
import com.sun.tools.javac.code.Symtab;
49
import com.sun.tools.javac.code.Symtab;
50
import com.sun.tools.javac.jvm.Target;
50
import com.sun.tools.javac.jvm.Target;
51
import com.sun.tools.javac.model.JavacElements;
51
import com.sun.tools.javac.model.JavacElements;
52
import java.util.Arrays;
52
import java.util.List;
53
import java.util.List;
53
import java.util.logging.Logger;
54
import java.util.logging.Logger;
54
import java.util.logging.Level;
55
import java.util.logging.Level;
Lines 554-559 Link Here
554
        public <T extends Element> T resolve(ElementHandle<T> handle, JavacTaskImpl jti) {
555
        public <T extends Element> T resolve(ElementHandle<T> handle, JavacTaskImpl jti) {
555
            return handle.resolveImpl (jti);
556
            return handle.resolveImpl (jti);
556
        }
557
        }
558
559
        @Override
560
        @NonNull
561
        public String[] getJVMSignature(@NonNull final ElementHandle<?> handle) {
562
            return Arrays.copyOf(handle.signatures, handle.signatures.length);
563
        }
564
557
    }
565
    }
558
    
566
    
559
    private static Element getTypeElementByBinaryName (final String signature, final JavacTaskImpl jt) {
567
    private static Element getTypeElementByBinaryName (final String signature, final JavacTaskImpl jt) {
(-)a/java.source/src/org/netbeans/api/java/source/SourceUtils.java (-1 / +20 lines)
Lines 98-103 Link Here
98
import org.netbeans.api.lexer.TokenHierarchy;
98
import org.netbeans.api.lexer.TokenHierarchy;
99
import org.netbeans.api.lexer.TokenSequence;
99
import org.netbeans.api.lexer.TokenSequence;
100
import org.netbeans.modules.java.JavaDataLoader;
100
import org.netbeans.modules.java.JavaDataLoader;
101
import org.netbeans.modules.java.source.ElementHandleAccessor;
101
import org.netbeans.modules.java.source.JavadocHelper;
102
import org.netbeans.modules.java.source.JavadocHelper;
102
import org.netbeans.modules.java.source.indexing.JavaCustomIndexer;
103
import org.netbeans.modules.java.source.indexing.JavaCustomIndexer;
103
import org.netbeans.modules.java.source.parsing.ClasspathInfoProvider;
104
import org.netbeans.modules.java.source.parsing.ClasspathInfoProvider;
Lines 245-251 Link Here
245
		
246
		
246
	return (TypeElement)ec;
247
	return (TypeElement)ec;
247
    }
248
    }
248
    
249
250
    /**
251
     * Returns an array containing the JVM signature of the {@link ElementHandle}.
252
     * @param handle to obtain the JVM signature for.
253
     * @return an array containing the JVM signature. The signature depends on
254
     * the {@link ElementHandle}'s {@link ElementKind}. For class or package
255
     * it returns a single element array containing the class (package) binary
256
     * name (JLS section 13.1). For field (method) it returns three element array
257
     * containing owner class binary name (JLS section 13.1) in the first element,
258
     * field (method) name in the second element and JVM type (JVM method formal
259
     * parameters (JVMS section 2.10.1)) in the third element.
260
     */
261
    @NonNull
262
    public static String[] getJVMSignature(@NonNull final ElementHandle<?> handle) {
263
        Parameters.notNull("handle", handle);   //NOI18N
264
        return ElementHandleAccessor.INSTANCE.getJVMSignature(handle);
265
    }
266
267
249
    /**Resolve full qualified name in the given context. Adds import statement as necessary.
268
    /**Resolve full qualified name in the given context. Adds import statement as necessary.
250
     * Returns name that resolved to a given FQN in given context (either simple name
269
     * Returns name that resolved to a given FQN in given context (either simple name
251
     * or full qualified name). Handles import conflicts.
270
     * or full qualified name). Handles import conflicts.
(-)a/java.source/src/org/netbeans/modules/java/source/ElementHandleAccessor.java (-2 / +5 lines)
Lines 47-52 Link Here
47
import com.sun.tools.javac.api.JavacTaskImpl;
47
import com.sun.tools.javac.api.JavacTaskImpl;
48
import javax.lang.model.element.Element;
48
import javax.lang.model.element.Element;
49
import javax.lang.model.element.ElementKind;
49
import javax.lang.model.element.ElementKind;
50
import org.netbeans.api.annotations.common.NonNull;
50
import org.netbeans.api.java.source.ElementHandle;
51
import org.netbeans.api.java.source.ElementHandle;
51
52
52
/**
53
/**
Lines 74-79 Link Here
74
    public abstract ElementHandle create (ElementKind kind, String... descriptors);
75
    public abstract ElementHandle create (ElementKind kind, String... descriptors);
75
    
76
    
76
    public abstract <T extends Element> T resolve (ElementHandle<T> handle, JavacTaskImpl jti);
77
    public abstract <T extends Element> T resolve (ElementHandle<T> handle, JavacTaskImpl jti);
77
        
78
78
    
79
    @NonNull
80
    public abstract String[] getJVMSignature(@NonNull ElementHandle<?> handle);
81
79
}
82
}

Return to bug 200237