/[classpath]/classpath/java/lang/Class.java
ViewVC logotype

Diff of /classpath/java/lang/Class.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22.2.11 by gnu_andrew, Mon Mar 21 12:10:17 2005 UTC revision 1.22.2.12 by gnu_andrew, Mon Apr 4 23:34:35 2005 UTC
# Line 1094  public final class Class<T> Line 1094  public final class Class<T>
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;
# Line 1151  public final class Class<T> Line 1151  public final class Class<T>
1151        }        }
1152      try      try
1153        {        {
1154          return constructor.newInstance(null);          return constructor.newInstance();
1155        }        }
1156      catch (InvocationTargetException e)      catch (InvocationTargetException e)
1157        {        {
# Line 1393  public final class Class<T> Line 1393  public final class Class<T>
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  }  }

Legend:
Removed from v.1.22.2.11  
changed lines
  Added in v.1.22.2.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26