+1. Maybe we can make this stuff plugable. The whole ScannerService can already be changed, but we might introduce an own lookup for various OS/JVMs.
LieGrue, stru ----- Original Message ----- > From: Gerhard Petracek <[email protected]> > To: [email protected] > Cc: > Sent: Thursday, May 10, 2012 12:17 AM > Subject: Re: OWB bug in AnnotationDB.java > > hi jian, > > we need a better approach because e.g. solaris uses a different format > - there are a lot of different constellations... > > regards, > gerhard > > > > 2012/5/9 Jian Ouyang <[email protected]> > >> Update on the bug: >> (the following fix works for both linux and windows) >> >> >> private String ensureCorrectUrlFormat(String url) >> { >> //fix for wls >> if(!url.startsWith("file:/")) >> { >> if(isWindows()) >> { >> url = "file:/" + url; >> } >> else >> { >> url = "file://" + url; >> } >> } >> return url; >> } >> >> private boolean isWindows() { >> >> String os = > System.getProperty("os.name").toLowerCase(); >> // windows >> return (os.indexOf("win") >= 0); >> } >> >> >> From: Jian Ouyang >> Sent: Tuesday, May 08, 2012 5:24 PM >> To: '[email protected]' >> Subject: OWB bug in AnnotationDB.java >> >> OWB developers, >> >> For class AnnotationDB in package org.apache.webbeans.corespi.scanner: >> The following method implementation >> >> private String ensureCorrectUrlFormat(String url) >> { >> //fix for wls >> if(!url.startsWith("file:/")) >> { >> url = "file:/" + url; >> } >> return url; >> } >> >> should be updated to (double forward slash instead single forward slash): >> private String ensureCorrectUrlFormat(String url) >> { >> //fix for wls >> if(!url.startsWith("file:/")) >> { >> url = "file://" + url; >> } >> return url; >> } >> >> Jian >> >> >> >
