You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:03:43 UTC

[sling-org-apache-sling-scripting-java] 09/41: SLING-825 : Return the resource name as source file name.

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit b12c7b4902e1e00228d95a699f73541662d437db
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jan 19 07:24:08 2009 +0000

    SLING-825 : Return the resource name as source file name.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java@735622 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/scripting/java/jdt/CompilationUnit.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java b/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
index 80459f4..c6a9de8 100644
--- a/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
+++ b/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
@@ -66,7 +66,11 @@ public class CompilationUnit
      * @see org.eclipse.jdt.internal.compiler.env.IDependent#getFileName()
      */
     public char[] getFileName() {
-        return className.concat(".java").toCharArray();
+        int slash = sourceFile.lastIndexOf('/');
+        if (slash > 0) {
+            return sourceFile.substring(slash + 1).toCharArray();
+        }
+        return sourceFile.toCharArray();
     }
 
     /**

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.