|
Re: java.lang.String.replaceFirst from IBM VM throws NPE: msg#00892java.harmony.devel
Hi Alexey, ok, Ive recreated your problem using the latest snapshot and VME. Essentially the code at modules/kernel/src/main/java/java/lang/String.java is the same as that in the VME kernel.jar. Looking in there (these calls can also be seen if the test is run within a debugger), we see that the replaceFirst(String, String) implementation is: public String replaceFirst(String expr, String substitute) { return Pattern.compile(expr).matcher(this).replaceFirst(substitute); } Unfortunately the implementation of Pattern at modules/regex/src/main/java/java/util/regex/Pattern.java is only a stub (as HARMONY-39 has not yet been accepted into the Harmony SVN repository) and as such just returns null. Thus when we try to dereference the return from Pattern.compile(expr) we receive a NullPointerException. Once the regex in HARMONY-39 is moved into SVN this should go away. As a sideline, I think we should be able to move String.java out of kernel entirely anyway. We already have an implementation at modules/kernel/src/main/java/java/lang/String.java, and the only VM specific code in String is the intern() method. This method could simply be redirected to call VM.intern(String), a class which is within kernel, and then String.java can be moved into LUNI. It also means that the VM writer(s) need not implement the rest of the String class unnecessarily. Sound good? Alexey Petrenko wrote: We got problem with Harmony on IBM VM on Windows. -- Oliver Deakin IBM United Kingdom Limited
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Classpath on Cygwin: failed to open native library error, Archie Cobbs |
|---|---|
| Next by Date: | [jira] Commented: (HARMONY-101) NPE in java.util.regex.Pattern.compile(), Tim Ellison (JIRA) |
| Previous by Thread: | java.lang.String.replaceFirst from IBM VM throws NPE, Alexey Petrenko |
| Next by Thread: | Re: java.lang.String.replaceFirst from IBM VM throws NPE, Alexey Petrenko |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |