[jboss-cvs] JBossAS SVN: r104592 - in projects/jboss-jca/trunk: validator/src/main/java/org/jboss/jca/validator and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun May 9 21:50:04 EDT 2010


Author: jeff.zhang
Date: 2010-05-09 21:50:03 -0400 (Sun, 09 May 2010)
New Revision: 104592

Modified:
   projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java
   projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java
Log:
[JBJCA-322] fix wrong filename extract from url string

Modified: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java	2010-05-10 00:08:22 UTC (rev 104591)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java	2010-05-10 01:50:03 UTC (rev 104592)
@@ -699,8 +699,10 @@
          }
          if (reportDirectory.exists())
          {
+            int lastSlashIndex = urlFileName.lastIndexOf("/");
+            int lastSepaIndex = urlFileName.lastIndexOf(File.separator);
 
-            int lastIndex = urlFileName.lastIndexOf(File.separator);
+            int lastIndex = lastSlashIndex > lastSepaIndex ? lastSlashIndex : lastSepaIndex;
             if (lastIndex != -1)
                urlFileName = urlFileName.substring(lastIndex + 1);
             urlFileName += ".log";

Modified: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java	2010-05-10 00:08:22 UTC (rev 104591)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java	2010-05-10 01:50:03 UTC (rev 104592)
@@ -164,7 +164,11 @@
             }
 
             String reportName = url.getFile();
-            int lastIndex = reportName.lastIndexOf(File.separator);
+
+            int lastSlashIndex = reportName.lastIndexOf("/");
+            int lastSepaIndex = reportName.lastIndexOf(File.separator);
+
+            int lastIndex = lastSlashIndex > lastSepaIndex ? lastSlashIndex : lastSepaIndex;
             if (lastIndex != -1)
                reportName = reportName.substring(lastIndex + 1);
             reportName += ".log";




More information about the jboss-cvs-commits mailing list