Re: Type of Class

2014-02-21 Thread Stephen Colebourne
But is javax.lang.model a plan for JDK 9? To give some idea of the pain in this area, here is the code I ended up with: if (type.isInterface() || type.isAnnotation() || type.isPrimitive() || type.isArray() || type.isEnum() || type.isSynthetic() || Modifier.isAbstract(type.getModifiers()) || type.

Re: Type of Class

2014-02-21 Thread Joe Darcy
On 02/21/2014 07:40 AM, Brian Goetz wrote: I understand why you want this, though I think you’ll find that there are still thousands of other things “missing” from reflection. In the Java 1.0 days, the difference between the Java language and the class file was pretty small. So reflection ser

Re: Type of Class

2014-02-21 Thread Brian Goetz
I understand why you want this, though I think you’ll find that there are still thousands of other things “missing” from reflection. In the Java 1.0 days, the difference between the Java language and the class file was pretty small. So reflection served as both the class file (VM) reflection

Re: Type of Class

2014-02-21 Thread Stephen Colebourne
On 21 February 2014 08:14, David Holmes wrote: >> Would it be reasonable to add the following methods: >> - isNestedClass() > This would be !isTopLevelClass() but otherwise > isAnonymousClass() || isLocalClass() || isMemberClass() >> - isInnerClass() > isAnonymousClass() || isLocalClass() || (isMe

Re: Type of Class

2014-02-21 Thread David Holmes
absence of an isNormalClass() - probably a better name for this. Currently, you can determine if a class is an interface, annotation, primitive or array, leaving the "normal" case as a quadruple negative. This leaves such a user-written method vulnerable to any new type of class that gets

Type of Class

2014-02-20 Thread Stephen Colebourne
absence of an isNormalClass() - probably a better name for this. Currently, you can determine if a class is an interface, annotation, primitive or array, leaving the "normal" case as a quadruple negative. This leaves such a user-written method vulnerable to any new type of class th