You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by gp...@apache.org on 2011/03/23 19:09:17 UTC
svn commit: r1084657 -
/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java
Author: gpetracek
Date: Wed Mar 23 18:09:17 2011
New Revision: 1084657
URL: http://svn.apache.org/viewvc?rev=1084657&view=rev
Log:
OWB-519 fix for refactored annotation scanner
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java?rev=1084657&r1=1084656&r2=1084657&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java Wed Mar 23 18:09:17 2011
@@ -294,18 +294,18 @@ public class AnnotationDB implements Ser
String jarUrlPath = isJarUrl(urlPath);
if (jarUrlPath != null)
{
- it = new JarIterator((new URL(jarUrlPath)).openStream(), filter);
+ it = new JarIterator((new URL(ensureCorrectUrlFormat(jarUrlPath))).openStream(), filter);
}
else
{
- File f = new File( (new URL(urlPath)).getFile() );
+ File f = new File( (new URL(ensureCorrectUrlFormat(urlPath))).getFile() );
if (!f.exists())
{
// try a fallback if the URL contains %20 -> spaces
if (urlPath.contains("%20"))
{
urlPath = urlPath.replaceAll("%20", " ");
- f = new File( (new URL(urlPath)).getFile() );
+ f = new File( (new URL(ensureCorrectUrlFormat(urlPath))).getFile() );
}
}
@@ -527,4 +527,13 @@ public class AnnotationDB implements Ser
}
}
+ private String ensureCorrectUrlFormat(String url)
+ {
+ //fix for wls
+ if(!url.startsWith("file:/"))
+ {
+ url = "file:/" + url;
+ }
+ return url;
+ }
}