The code will fail to compile when u use a compound attribute.
The following code and the console which propts for the bug file request.
<console>
vishalb:/home/vv145429/tiger/src/metadata/bugs 4 % javac -source 1.5 Logger.java
Logger.java:15: cannot find symbol
symbol : class ExceptionLogger
location: class Logger
public abstract ExceptionLogger getExceptionHandler();
^
An exception has occurred in the compiler (1.5.0-beta). Please file a bug at the Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxy(ClassReader.java:991)
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:964)
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.visitCompoundAttributeProxy(ClassReader.java:1060)
at com.sun.tools.javac.jvm.ClassReader$CompoundAttributeProxy.accept(ClassReader.java:925)
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxy(ClassReader.java:990)
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:964)
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompoundList(ClassReader.java:952)
at com.sun.tools.javac.jvm.ClassReader$AnnotationCompleter.enterAnnotation(ClassReader.java:1086)
at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:85)
at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:732)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:349)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:609)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:411)
at com.sun.tools.javac.comp.Enter.main(Enter.java:390)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:379)
at com.sun.tools.javac.main.Main.compile(Main.java:584)
at com.sun.tools.javac.main.Main.compile(Main.java:536)
at com.sun.tools.javac.Main.compile(Main.java:41)
at com.sun.tools.javac.Main.main(Main.java:32)
vishalb:/home/vv145429/tiger/src/metadata/bugs 5 % javap attributes.ATTRDate
Compiled from "ATTRDate.java"
public interface attributes.ATTRDate extends java.lang.annotation.Annotation{
public abstract int day();
public abstract java.lang.String month();
public abstract long year();
}
vishalb:/home/vv145429/tiger/src/metadata/bugs 6 % javap attributes.ATTRMethod
Compiled from "ATTRMethod.java"
public interface attributes.ATTRMethod extends java.lang.annotation.Annotation{
public abstract java.lang.String methodName();
public abstract java.lang.Class inClass();
public abstract int parameters();
public abstract attributes.ATTRDate addedOn();
public abstract java.lang.String scope();
}
vishalb:/home/vv145429/tiger/src/metadata/bugs 7 %
</console>
<code>
import attributes.ATTRDate;
import attributes.ATTRMethod;
/**
*
*/
public abstract class Logger {
protected boolean file ;
public abstract void logMessage(String msg, int priority, int level);
public abstract ExceptionLogger getExceptionHandler();
public abstract void logMessage(String msg) ;
protected void addDefaultMessage() {
System.out.println(" message added defualt one");
}
// This method will add a message in side the logger with TimeStamp.
@ATTRMethod ( methodName="Logger.addWithDateTime",
inClass=testcases.logger.file.FileExceptionLogger.Class,
parameters=0,
addedOn=@ATTRDate(day=12,month="july",year=2003),
scope="public.void"
)
public void addWithDateTime(String message ) {
// This is just a dummy method intended to have
// different implementations ..
}
}
</code>
==============================
Date: Tue, 27 Jan 2004 05:03:24 -0500
From: <###@###.###>
Subject: Re: BugId 4974751 : (P3/S4) Has been Updated - by gafter
To: ###@###.###
Cc: ###@###.###, ###@###.###
Reply-to: ###@###.###
With this mail some part of test code is attached as code.jar
I got this exception with these steps as in console.
Hope this will help you in analyzing this bug.
<console>
vishalb:/home/vv145429 1 % cd tiger/src/code
vishalb:/home/vv145429/tiger/src/code 2 % setenv CLASSPATH
$CLASSPATH/home/vv145429/tiger/src/code/case1:
vishalb:/home/vv145429/tiger/src/code 3 % cd testcases/logger
vishalb:/home/vv145429/tiger/src/code/testcases/logger 4 % javac -source
1.5 Logger.java
An exception has occurred in the compiler (1.5.0-beta2). Please file a
bug at the Java Developer Connection
(http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug
Parade for duplicates. Include your program and the following diagnostic
in your report. Thank you.
java.lang.AssertionError
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxy(ClassReader.java:991)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:964)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.visitCompoundAttributeProxy(ClassReader.java:1060)
at
com.sun.tools.javac.jvm.ClassReader$CompoundAttributeProxy.accept(ClassReader.java:925)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxy(ClassReader.java:990)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:964)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompoundList(ClassReader.java:952)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationCompleter.enterAnnotation(ClassReader.java:1086)
at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:85)
at
com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:732)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:349)
at
com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:609)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:411)
at com.sun.tools.javac.comp.Enter.main(Enter.java:390)
at
com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:379)
at com.sun.tools.javac.main.Main.compile(Main.java:584)
at com.sun.tools.javac.main.Main.compile(Main.java:536)
at com.sun.tools.javac.Main.compile(Main.java:41)
at com.sun.tools.javac.Main.main(Main.java:32)
vishalb:/home/vv145429/tiger/src/code/testcases/logger 5 %
</console>
The following code and the console which propts for the bug file request.
<console>
vishalb:/home/vv145429/tiger/src/metadata/bugs 4 % javac -source 1.5 Logger.java
Logger.java:15: cannot find symbol
symbol : class ExceptionLogger
location: class Logger
public abstract ExceptionLogger getExceptionHandler();
^
An exception has occurred in the compiler (1.5.0-beta). Please file a bug at the Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxy(ClassReader.java:991)
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:964)
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.visitCompoundAttributeProxy(ClassReader.java:1060)
at com.sun.tools.javac.jvm.ClassReader$CompoundAttributeProxy.accept(ClassReader.java:925)
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxy(ClassReader.java:990)
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:964)
at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompoundList(ClassReader.java:952)
at com.sun.tools.javac.jvm.ClassReader$AnnotationCompleter.enterAnnotation(ClassReader.java:1086)
at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:85)
at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:732)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:349)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:609)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:411)
at com.sun.tools.javac.comp.Enter.main(Enter.java:390)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:379)
at com.sun.tools.javac.main.Main.compile(Main.java:584)
at com.sun.tools.javac.main.Main.compile(Main.java:536)
at com.sun.tools.javac.Main.compile(Main.java:41)
at com.sun.tools.javac.Main.main(Main.java:32)
vishalb:/home/vv145429/tiger/src/metadata/bugs 5 % javap attributes.ATTRDate
Compiled from "ATTRDate.java"
public interface attributes.ATTRDate extends java.lang.annotation.Annotation{
public abstract int day();
public abstract java.lang.String month();
public abstract long year();
}
vishalb:/home/vv145429/tiger/src/metadata/bugs 6 % javap attributes.ATTRMethod
Compiled from "ATTRMethod.java"
public interface attributes.ATTRMethod extends java.lang.annotation.Annotation{
public abstract java.lang.String methodName();
public abstract java.lang.Class inClass();
public abstract int parameters();
public abstract attributes.ATTRDate addedOn();
public abstract java.lang.String scope();
}
vishalb:/home/vv145429/tiger/src/metadata/bugs 7 %
</console>
<code>
import attributes.ATTRDate;
import attributes.ATTRMethod;
/**
*
*/
public abstract class Logger {
protected boolean file ;
public abstract void logMessage(String msg, int priority, int level);
public abstract ExceptionLogger getExceptionHandler();
public abstract void logMessage(String msg) ;
protected void addDefaultMessage() {
System.out.println(" message added defualt one");
}
// This method will add a message in side the logger with TimeStamp.
@ATTRMethod ( methodName="Logger.addWithDateTime",
inClass=testcases.logger.file.FileExceptionLogger.Class,
parameters=0,
addedOn=@ATTRDate(day=12,month="july",year=2003),
scope="public.void"
)
public void addWithDateTime(String message ) {
// This is just a dummy method intended to have
// different implementations ..
}
}
</code>
==============================
Date: Tue, 27 Jan 2004 05:03:24 -0500
From: <###@###.###>
Subject: Re: BugId 4974751 : (P3/S4) Has been Updated - by gafter
To: ###@###.###
Cc: ###@###.###, ###@###.###
Reply-to: ###@###.###
With this mail some part of test code is attached as code.jar
I got this exception with these steps as in console.
Hope this will help you in analyzing this bug.
<console>
vishalb:/home/vv145429 1 % cd tiger/src/code
vishalb:/home/vv145429/tiger/src/code 2 % setenv CLASSPATH
$CLASSPATH/home/vv145429/tiger/src/code/case1:
vishalb:/home/vv145429/tiger/src/code 3 % cd testcases/logger
vishalb:/home/vv145429/tiger/src/code/testcases/logger 4 % javac -source
1.5 Logger.java
An exception has occurred in the compiler (1.5.0-beta2). Please file a
bug at the Java Developer Connection
(http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug
Parade for duplicates. Include your program and the following diagnostic
in your report. Thank you.
java.lang.AssertionError
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxy(ClassReader.java:991)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:964)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.visitCompoundAttributeProxy(ClassReader.java:1060)
at
com.sun.tools.javac.jvm.ClassReader$CompoundAttributeProxy.accept(ClassReader.java:925)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxy(ClassReader.java:990)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:964)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompoundList(ClassReader.java:952)
at
com.sun.tools.javac.jvm.ClassReader$AnnotationCompleter.enterAnnotation(ClassReader.java:1086)
at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:85)
at
com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:732)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:349)
at
com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:609)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:411)
at com.sun.tools.javac.comp.Enter.main(Enter.java:390)
at
com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:379)
at com.sun.tools.javac.main.Main.compile(Main.java:584)
at com.sun.tools.javac.main.Main.compile(Main.java:536)
at com.sun.tools.javac.Main.compile(Main.java:41)
at com.sun.tools.javac.Main.main(Main.java:32)
vishalb:/home/vv145429/tiger/src/code/testcases/logger 5 %
</console>
- duplicates
-
JDK-4951298 compiler: crashes when attributes with same elements are used in place of other
- Resolved