1094 |
* @throws ExceptionInInitializerError if class initialization caused by |
* @throws ExceptionInInitializerError if class initialization caused by |
1095 |
* this call fails with an exception |
* this call fails with an exception |
1096 |
*/ |
*/ |
1097 |
public Object newInstance() |
public T newInstance() |
1098 |
throws InstantiationException, IllegalAccessException |
throws InstantiationException, IllegalAccessException |
1099 |
{ |
{ |
1100 |
memberAccessCheck(Member.PUBLIC); |
memberAccessCheck(Member.PUBLIC); |
1101 |
Constructor constructor; |
Constructor<T> constructor; |
1102 |
synchronized(this) |
synchronized(this) |
1103 |
{ |
{ |
1104 |
constructor = this.constructor; |
constructor = this.constructor; |
1151 |
} |
} |
1152 |
try |
try |
1153 |
{ |
{ |
1154 |
return constructor.newInstance(null); |
return constructor.newInstance(); |
1155 |
} |
} |
1156 |
catch (InvocationTargetException e) |
catch (InvocationTargetException e) |
1157 |
{ |
{ |
1393 |
*/ |
*/ |
1394 |
public boolean isEnum() |
public boolean isEnum() |
1395 |
{ |
{ |
1396 |
return getSuperclass() == Enum.class; |
return VMClass.isEnum(this); |
1397 |
|
} |
1398 |
|
|
1399 |
|
/** |
1400 |
|
* Returns true if this class is a synthetic class, generated by |
1401 |
|
* the compiler. |
1402 |
|
* |
1403 |
|
* @return true if this is a synthetic class. |
1404 |
|
*/ |
1405 |
|
public boolean isSynthetic() |
1406 |
|
{ |
1407 |
|
return VMClass.isSynthetic(this); |
1408 |
|
} |
1409 |
|
|
1410 |
|
/** |
1411 |
|
* Returns true if this class is an <code>Annotation</code>. |
1412 |
|
* |
1413 |
|
* @return true if this is an annotation class. |
1414 |
|
*/ |
1415 |
|
public boolean isAnnotation() |
1416 |
|
{ |
1417 |
|
return VMClass.isAnnotation(this); |
1418 |
} |
} |
1419 |
|
|
1420 |
} |
} |