Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Machine > Re: modifying j...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 9 Topic 764 of 833
Post > Topic >>

Re: modifying java.lang.String.java

by Tom Hawtin <usenet@[EMAIL PROTECTED] > Mar 26, 2007 at 09:30 AM

danwichs@[EMAIL PROTECTED]
 wrote:
>  I'm trying to modify java.lang.String.java and add the modified
> String.class to
> rt.jar [THIS IS FOR MYSELF ONLY AND WILL NOT BE DEPLOYED].
> I cannot add "private final boolean tainted[] = new

Wouldn't it be easier to use WeakHashMap<String,boolean[]> (or something 
similar with the map value as a meaningful class type)?

> boolean[5];" to String.java. If I do, it still compiles and I can add
> it to rt.jar and compile a test program against it. However, the JVM
> crashes with a strange message:
> 
>  java.lang.IllegalArgumentException: name can't be empty
>        at java.security.BasicPermission.init(Unknown Source)
>        at java.security.BasicPermission.<init>(Unknown Source)
>        at java.lang.RuntimePermission.<init>(Unknown Source)
>        at java.lang.Thread.<clinit>(Unknown Source)

So if you look at the source, it appears that the literal string
"enableContextClassLoaderOverride" has a length of zero.

As someone else mentioned it will be in the native code loading strings 
from class files. The exact details I don't know. Moving your field 
after the existing fields might help. It might be that reference fields 
are treated differently to primitive fields for object layout.

I suggest your approach is probably poor.

Tom Hawtin
 




 9 Posts in Topic:
modifying java.lang.String.java
"danwichs@[EMAIL PRO  2007-03-25 15:00:27 
Re: modifying java.lang.String.java
"Ralf Ullrich"   2007-03-25 23:06:17 
Re: modifying java.lang.String.java
"danwichs@[EMAIL PRO  2007-03-25 17:58:40 
Re: modifying java.lang.String.java
"Ralf Ullrich"   2007-03-26 01:21:15 
Re: modifying java.lang.String.java
"danwichs@[EMAIL PRO  2007-03-25 18:34:14 
Re: modifying java.lang.String.java
"danwichs@[EMAIL PRO  2007-03-25 19:10:28 
Re: modifying java.lang.String.java
Tom Hawtin <usenet@[EM  2007-03-26 09:30:37 
Re: modifying java.lang.String.java
Moritz Hammer <newsgro  2007-03-26 11:43:56 
Re: modifying java.lang.String.java
"danwichs@[EMAIL PRO  2007-03-26 06:49:45 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 14:59:39 CDT 2008.