You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.VerifyError:classArrayBuffer$$$$anon$$1 overrides final method initialSize.()I
at java.lang.ClassLoader.defineClass1(NativeMethod)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$$000(URLClassLoader.java:56)
at java.net.URLClassLoader$$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(NativeMethod)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at Test$$.<init>(t.scala:10)
at Test$$.<clinit>(t.scala)
at Test.main(t.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at scala.tools.nsc.ObjectRunner$$$$anonfun$$run$$1.apply(ObjectRunner.scala:75)
at scala.tools.nsc.ObjectRunner$$.withContextClassLoader(ObjectRunner.scala:49)
at scala.tools.nsc.ObjectRunner$$.run(ObjectRunner.scala:74)
at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:161)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
The compiler should not generate code that generates a java.lang.VerifyError.
I'm was surpised to see that initialSize is not declared final in the
Scala library source code anywhere but the Java class file has it as final:
$$ javap -classpath scala-library.jar scala.collection.mutable.ArrayBuffer| grep initial
public final void initialSize_$$eq(int);
public final int initialSize();
So I guess the two choices are, disallow overriding initialSize or make
the initialSize() method non-final, I would prefer the later, otherwise
I have no way of creating an ArrayBuffer that is sized to what will be
added into it. If I can't do this, then ArrayBuffer will reallocate
quite often for any decently sized inputs.
The text was updated successfully, but these errors were encountered:
All with 2.7.1.final.
The following code generates the below stack trace at run time:
The compiler should not generate code that generates a java.lang.VerifyError.
I'm was surpised to see that initialSize is not declared final in the
Scala library source code anywhere but the Java class file has it as final:
So I guess the two choices are, disallow overriding initialSize or make
the initialSize() method non-final, I would prefer the later, otherwise
I have no way of creating an ArrayBuffer that is sized to what will be
added into it. If I can't do this, then ArrayBuffer will reallocate
quite often for any decently sized inputs.
The text was updated successfully, but these errors were encountered: