This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gcj trunk / gnu-classpath] String.format(...) undefined


On Sat, 3 Mar 2007 14:12:26 +0000
Andrew Haley <aph@redhat.com> wrote:

> I checked in a patch for this yestderday.  Let me know if it works for
> you.

Thank you! It fixed most types but long[] at runtime:

	$ /usr/lib/gcj/bin/gij Test
	Exception in thread "main" java.lang.InternalError: expected pool constant 6 but got 5
	   at java.lang.Class.getDeclaredAnnotations(libgcj.so.9)
	   at java.lang.Class.getAnnotations(libgcj.so.9)
	   at java.lang.Class.getAnnotation(libgcj.so.9)
	   at Test.main(Test.java:69)

I see another issue with float variables.
I'll open another thread for that.


Hanno
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Test.A1({4.7, 7.5, 2.0})
@Test.A2({4674, 73657, 24585})
public class Test {
	@Retention(RetentionPolicy.RUNTIME)
	@Target(ElementType.TYPE)
	public @interface A1 {
		public float[] value();
	}
	@Retention(RetentionPolicy.RUNTIME)
	@Target(ElementType.TYPE)
	public @interface A2 {
		public long[] value();
	}

	public static void main(String[] args) {
		A1 a1 = (Test.class).getAnnotation(A1.class);
		for ( float c : a1.value() )
			System.out.println(c);
		A2 a2 = (Test.class).getAnnotation(A2.class);
		for ( long c : a2.value() )
			System.out.println(c);
	}
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]