Java Code Examples for sun.reflect.generics.parser.SignatureParser

The following examples show how to use sun.reflect.generics.parser.SignatureParser. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 2
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 3
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 4
Source Project: jdk8u60   Source File: TestBadSignatures.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 5
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 6
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 7
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 8
Source Project: jdk8u-jdk   Source File: TestBadSignatures.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 9
Source Project: hottub   Source File: TestBadSignatures.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 10
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 11
Source Project: openjdk-8   Source File: TestBadSignatures.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 12
Source Project: jdk8u_jdk   Source File: TestBadSignatures.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 13
Source Project: jdk8u-jdk   Source File: TestBadSignatures.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 14
public static void main(String[] args) {
    String[] badSignatures = {
        // Missing ":" after first type bound
        "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",

        // Arrays improperly indicated for exception information
        "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
    };

    for(String badSig : badSignatures) {
        try {
            SignatureParser.make().parseMethodSig(badSig);
            throw new RuntimeException("Expected GenericSignatureFormatError for " +
                                       badSig);
        } catch(GenericSignatureFormatError gsfe) {
            System.out.println(gsfe.toString()); // Expected
        }
    }
}
 
Example 15
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 16
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 17
Source Project: jdk8u60   Source File: AnnotationParser.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 18
Source Project: java-n-IDE-for-Android   Source File: AnnotationParser.java    License: Apache License 2.0 5 votes vote down vote up
private static Class<?> parseSig(String sig, Class container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 19
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 20
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 21
Source Project: javaide   Source File: AnnotationParser.java    License: GNU General Public License v3.0 5 votes vote down vote up
private static Class<?> parseSig(String sig, Class container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 22
Source Project: Bytecoder   Source File: AnnotationParser.java    License: Apache License 2.0 5 votes vote down vote up
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 23
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 24
Source Project: jdk8u-jdk   Source File: AnnotationParser.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 25
Source Project: hottub   Source File: AnnotationParser.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 26
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 27
Source Project: openjdk-8   Source File: AnnotationParser.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 28
Source Project: jdk8u_jdk   Source File: AnnotationParser.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 29
Source Project: jdk8u-jdk   Source File: AnnotationParser.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}
 
Example 30
private static Class<?> parseSig(String sig, Class<?> container) {
    if (sig.equals("V")) return void.class;
    SignatureParser parser = SignatureParser.make();
    TypeSignature typeSig = parser.parseTypeSig(sig);
    GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
    Reifier reify = Reifier.make(factory);
    typeSig.accept(reify);
    Type result = reify.getResult();
    return toClass(result);
}