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/10/18 23:18:31 UTC

[sling-org-apache-sling-commons-compiler] branch master created (now 874b1ae)

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

rombert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git.


      at 874b1ae  SLING-7167 Adjust READMEs

This branch includes the following new commits:

     new 1b9b142  Move commons compiler to bundles
     new 564f3dc  [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.2.0
     new c2ed9ad  [maven-release-plugin] rollback the release of org.apache.sling.commons.compiler-2.2.0
     new e781593  Correct scm info after move from contrib to here
     new b94a300  [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.2.0
     new 267c509  [maven-release-plugin] prepare for next development iteration
     new fc9401f  Updated to parent version 20
     new 08f2201  Update to Sling Parent POM 22 with baselining enabled
     new 38ff4a1  SLING-4698 - Set parent.relativePath to empty for all modules
     new 5e10194  Update to Sling Parent 23
     new 4030112  Remove superflous sling.java.version=6 as it's the default now
     new 3aecbbf  set parent version to 24 and add empty relativePath where missing
     new 1b1747a  Update the main reactor to parent 25
     new 3dc36d2  Switch to parent pom 26
     new 7b02670  SLING-5574 : Update Eclipse compiler to version 4.5.1
     new 22d4bde  SLING-5574 : Update Eclipse compiler to version 4.5.1
     new fa782a4  [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.3.0
     new 6d4ea86  [maven-release-plugin] prepare for next development iteration
     new 2277578  fix typo
     new 56c6c92  Fix javadocs
     new f3eb4b8  Update to parent pom 27
     new 46a0e67  fix typo
     new 07aec52  switch parent pom reference everywhere to 28 where it was 27 before this can be safely done because the only difference between 27 and 28 is an updated maven-source-plugin (fix heap space error)
     new d040060  Update to parent pom 29
     new f4f3118  use Sling Parent 30
     new 61572b9  Move to OSGi R6 annotations
     new 55bbee3  SLING-7111 : Compiler creates class files even if compilation fails
     new 8a74a4d  [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.3.2
     new ee27159  [maven-release-plugin] prepare for next development iteration
     new 9a9e535  Add test case for SLING-7111
     new 249c187  SLING-7105 - Some JSP tests fail under Java 9 - parameterized types are only available if source level is 1.5 or greater
     new e3096d8  [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.3.4
     new f1fb812  [maven-release-plugin] prepare for next development iteration
     new c0ed8ce  SLING-7167 Adjust READMEs
     new bb1dd5c  SLING-7167 Adjust READMEs
     new 874b1ae  SLING-7167 Adjust READMEs

The 36 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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

[sling-org-apache-sling-commons-compiler] 33/36: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit f1fb812ce650bf879e45bee761ccc557c32299c8
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Sep 12 19:58:28 2017 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1808154 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6b1af20..1e6f437 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.commons.compiler</artifactId>
-    <version>2.3.4</version>
+    <version>2.3.5-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Commons Java Compiler</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.4</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.4</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.commons.compiler-2.3.4</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/compiler</url>
     </scm>
 
     <properties>

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

[sling-org-apache-sling-commons-compiler] 16/36: SLING-5574 : Update Eclipse compiler to version 4.5.1

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 22d4bde763f6528af8141bfb932c1a800abc0dc4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Mar 1 13:56:19 2016 +0000

    SLING-5574 : Update Eclipse compiler to version 4.5.1
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1733069 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt | 10 +++++-----
 pom.xml    |  4 ++++
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/README.txt b/README.txt
index b76d37e..dfd1414 100644
--- a/README.txt
+++ b/README.txt
@@ -6,16 +6,16 @@ support using the Eclipse Java Compiler (org.eclipse.jdt).
 Getting Started
 ===============
 
-This component uses a Maven 2 (http://maven.apache.org/) build
-environment. It requires a Java 5 JDK (or higher) and Maven (http://maven.apache.org/)
-2.0.7 or later. We recommend to use the latest Maven version.
+This component uses a Maven 3 (http://maven.apache.org/) build
+environment. It requires a Java 7 JDK (or higher) and Maven (http://maven.apache.org/)
+3.1.0 or later. We recommend to use the latest Maven version.
 
-If you have Maven 2 installed, you can compile and
+If you have Maven 3 installed, you can compile and
 package the jar using the following command:
 
     mvn package
 
-See the Maven 2 documentation for other build features.
+See the Maven 3 documentation for other build features.
 
 The latest source code for this component is available in the
 Subversion (http://subversion.tigris.org/) source repository of
diff --git a/pom.xml b/pom.xml
index e6bdc02..4e1f9e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,6 +43,10 @@
         <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/compiler</url>
     </scm>
 
+    <properties>
+        <sling.java.version>7</sling.java.version>
+    </properties>
+
     <build>
         <plugins>
             <plugin>

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

[sling-org-apache-sling-commons-compiler] 05/36: [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.2.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit b94a3007be57c8611b4c54a849a218989ce1570e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu May 15 11:59:19 2014 +0000

    [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.2.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1594880 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index b8ff281..5fe7a2f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.commons.compiler</artifactId>
-    <version>2.1.1-SNAPSHOT</version>
+    <version>2.2.0</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Commons Java Compiler</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/compiler</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.2.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.2.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.commons.compiler-2.2.0</url>
     </scm>
 
     <properties>

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

[sling-org-apache-sling-commons-compiler] 08/36: Update to Sling Parent POM 22 with baselining enabled

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 08f2201c0e3f6cbb2cff06c091bc7f7583b80915
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 1 06:57:44 2014 +0000

    Update to Sling Parent POM 22 with baselining enabled
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1628622 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 69ad4e9..fb2c7be 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>20</version>
+        <version>22</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

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

[sling-org-apache-sling-commons-compiler] 30/36: Add test case for SLING-7111

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 9a9e535ddff62c96312b5bf2bebc5c4dd7fb52e1
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Sep 6 17:37:30 2017 +0000

    Add test case for SLING-7111
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1807508 13f79535-47bb-0310-9956-ffa450edef68
---
 .../commons/compiler/impl/CompilerJava5Test.java   | 47 +++++++++++++++++++++-
 src/test/resources/JavaFailure                     | 26 ++++++++++++
 2 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/src/test/java/org/apache/sling/commons/compiler/impl/CompilerJava5Test.java b/src/test/java/org/apache/sling/commons/compiler/impl/CompilerJava5Test.java
index ac5f0b5..5540ce9 100644
--- a/src/test/java/org/apache/sling/commons/compiler/impl/CompilerJava5Test.java
+++ b/src/test/java/org/apache/sling/commons/compiler/impl/CompilerJava5Test.java
@@ -22,21 +22,29 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.io.Reader;
-
-import junit.framework.TestCase;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.sling.commons.classloader.ClassLoaderWriter;
 import org.apache.sling.commons.compiler.CompilationResult;
 import org.apache.sling.commons.compiler.CompilationUnit;
 import org.apache.sling.commons.compiler.Options;
 
+import junit.framework.TestCase;
+
 /**
  * Test case for java 5 support
  */
 public class CompilerJava5Test extends TestCase
         implements ClassLoaderWriter {
 
+    private final List<String> deletedPath = new ArrayList<>();
+
+    private final List<String> outputPath = new ArrayList<>();
+
     public void testJava5Support() throws Exception {
+        deletedPath.clear();
+        outputPath.clear();
         String sourceFile = "Java5Test";
 
         CompilationUnit unit = createCompileUnit(sourceFile);
@@ -48,6 +56,30 @@ public class CompilerJava5Test extends TestCase
         final CompilationResult result = new EclipseJavaCompiler().compile(new CompilationUnit[]{unit}, options);
         assertNotNull(result);
         assertNull(result.getErrors());
+        assertEquals(1, deletedPath.size());
+        assertEquals(1, outputPath.size());
+        assertEquals("/org/apache/sling/commons/compiler/test/Java5Test.class", deletedPath.get(0));
+        assertEquals("/org/apache/sling/commons/compiler/test/Java5Test.class", outputPath.get(0));
+    }
+
+    public void testFailedCompilation() throws Exception {
+        deletedPath.clear();
+        outputPath.clear();
+
+        String sourceFile = "JavaFailure";
+
+        CompilationUnit unit = createCompileUnit(sourceFile);
+        final Options options = new Options();
+        options.put(Options.KEY_SOURCE_VERSION, Options.VERSION_1_5);
+        options.put(Options.KEY_CLASS_LOADER_WRITER, this);
+        options.put(Options.KEY_CLASS_LOADER, this.getClass().getClassLoader());
+
+        final CompilationResult result = new EclipseJavaCompiler().compile(new CompilationUnit[]{unit}, options);
+        assertNotNull(result);
+        assertNotNull(result.getErrors());
+        assertEquals(1, deletedPath.size());
+        assertEquals("/org/apache/sling/commons/compiler/test/JavaFailure.class", deletedPath.get(0));
+        assertEquals(0, outputPath.size());
     }
 
     //--------------------------------------------------------< misc. helpers >
@@ -58,6 +90,7 @@ public class CompilerJava5Test extends TestCase
             /**
              * @see org.apache.sling.commons.compiler.CompilationUnit#getMainClassName()
              */
+            @Override
             public String getMainClassName() {
                 return "org.apache.sling.commons.compiler.test." + sourceFile;
             }
@@ -65,6 +98,7 @@ public class CompilerJava5Test extends TestCase
             /**
              * @see org.apache.sling.commons.compiler.CompilationUnit#getSource()
              */
+            @Override
             public Reader getSource() throws IOException {
                 InputStream in = getClass().getClassLoader().getResourceAsStream(sourceFile);
                 return new InputStreamReader(in, "UTF-8");
@@ -73,6 +107,7 @@ public class CompilerJava5Test extends TestCase
             /**
              * @see org.apache.sling.commons.compiler.CompilationUnit#getLastModified()
              */
+            @Override
             public long getLastModified() {
                 return 0;
             }
@@ -82,13 +117,16 @@ public class CompilerJava5Test extends TestCase
     /**
      * @see org.apache.sling.commons.classloader.ClassLoaderWriter#delete(java.lang.String)
      */
+    @Override
     public boolean delete(String path) {
+        deletedPath.add(path);
         return false;
     }
 
     /**
      * @see org.apache.sling.commons.classloader.ClassLoaderWriter#getInputStream(java.lang.String)
      */
+    @Override
     public InputStream getInputStream(String path) throws IOException {
         return null;
     }
@@ -96,6 +134,7 @@ public class CompilerJava5Test extends TestCase
     /**
      * @see org.apache.sling.commons.classloader.ClassLoaderWriter#getLastModified(java.lang.String)
      */
+    @Override
     public long getLastModified(String path) {
         return -1;
     }
@@ -103,13 +142,16 @@ public class CompilerJava5Test extends TestCase
     /**
      * @see org.apache.sling.commons.classloader.ClassLoaderWriter#getOutputStream(java.lang.String)
      */
+    @Override
     public OutputStream getOutputStream(String path) {
+        outputPath.add(path);
         return new ByteArrayOutputStream();
     }
 
     /**
      * @see org.apache.sling.commons.classloader.ClassLoaderWriter#rename(java.lang.String, java.lang.String)
      */
+    @Override
     public boolean rename(String oldPath, String newPath) {
         return false;
     }
@@ -117,6 +159,7 @@ public class CompilerJava5Test extends TestCase
     /**
      * @see org.apache.sling.commons.classloader.ClassLoaderWriter#getClassLoader()
      */
+    @Override
     public ClassLoader getClassLoader() {
         return null;
     }
diff --git a/src/test/resources/JavaFailure b/src/test/resources/JavaFailure
new file mode 100644
index 0000000..cd4045c
--- /dev/null
+++ b/src/test/resources/JavaFailure
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.commons.compiler.test;
+
+import java.util.List;
+
+/**
+ * Class to test compilation failure
+ */
+public class Java5Test {
+     xyz
+}

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

[sling-org-apache-sling-commons-compiler] 31/36: SLING-7105 - Some JSP tests fail under Java 9 - parameterized types are only available if source level is 1.5 or greater

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 249c18712ec647f4e91d98b96fe5e3bb4f38d4ba
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Sep 12 19:50:07 2017 +0000

    SLING-7105 - Some JSP tests fail under Java 9 - parameterized types are
    only available if source level is 1.5 or greater
    
    - pass Java version as 1.9 instead of 9, as Eclipse expects that
    - update to ecj 4.6.1
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1808147 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                      |  2 +-
 .../sling/commons/compiler/impl/EclipseJavaCompiler.java     | 12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index d1bd3de..5de2242 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,7 @@
         <dependency>
             <groupId>org.eclipse.jdt.core.compiler</groupId>
             <artifactId>ecj</artifactId>
-            <version>4.5.1</version>
+            <version>4.6.1</version>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
diff --git a/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
index 49d4a5e..160bb6b 100644
--- a/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
+++ b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
@@ -198,11 +198,11 @@ public class EclipseJavaCompiler implements JavaCompiler {
             props.put(CompilerOptions.OPTION_SourceFileAttribute, "generate");
         }
         if (options.getSourceVersion() != null) {
-            props.put(CompilerOptions.OPTION_Source, options.getSourceVersion());
-            props.put(CompilerOptions.OPTION_Compliance, options.getSourceVersion());
+            props.put(CompilerOptions.OPTION_Source, adjustJavaVersion(options.getSourceVersion()));
+            props.put(CompilerOptions.OPTION_Compliance, adjustJavaVersion(options.getSourceVersion()));
         }
         if (options.getTargetVersion() != null) {
-            props.put(CompilerOptions.OPTION_TargetPlatform, options.getTargetVersion());
+            props.put(CompilerOptions.OPTION_TargetPlatform, adjustJavaVersion(options.getTargetVersion()));
         }
         props.put(CompilerOptions.OPTION_Encoding, "UTF8");
 
@@ -232,6 +232,12 @@ public class EclipseJavaCompiler implements JavaCompiler {
         return result;
     }
 
+    private String adjustJavaVersion(String javaVersion) {
+
+        // ECJ 4.6.1 expects Java version 1.9, not 9
+        return "9".equals(javaVersion) ? "1.9" : javaVersion;
+    }
+
     //--------------------------------------------------------< inner classes >
 
     private class CompileContext implements ICompilerRequestor, INameEnvironment {

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

[sling-org-apache-sling-commons-compiler] 03/36: [maven-release-plugin] rollback the release of org.apache.sling.commons.compiler-2.2.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit c2ed9ad0deb70bfe3581d6cc080c6465366ed495
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu May 15 11:48:39 2014 +0000

    [maven-release-plugin] rollback the release of org.apache.sling.commons.compiler-2.2.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1594876 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5fe7a2f..7638c28 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.commons.compiler</artifactId>
-    <version>2.2.0</version>
+    <version>2.1.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Commons Java Compiler</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.2.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.2.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.commons.compiler-2.2.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/commons/compiler</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/commons/compiler</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/commons/compiler</url>
     </scm>
 
     <properties>

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

[sling-org-apache-sling-commons-compiler] 19/36: fix typo

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 2277578acd73d99fb4e21aa9ff13bd7ca50a37f9
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue May 3 09:10:32 2016 +0000

    fix typo
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1742074 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
index b969f26..646882d 100644
--- a/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
+++ b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
@@ -53,7 +53,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * The <code>EclipseJavaCompiler</code> provides platform independant
+ * The <code>EclipseJavaCompiler</code> provides platform independent
  * Java compilation support using the Eclipse Java Compiler (org.eclipse.jdt).
  *
  */

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

[sling-org-apache-sling-commons-compiler] 09/36: SLING-4698 - Set parent.relativePath to empty for all modules

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 38ff4a1bd74c823a537b491b0d4782cdb91122c4
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu May 7 10:14:40 2015 +0000

    SLING-4698 - Set parent.relativePath to empty for all modules
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1678154 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index fb2c7be..184ccc0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>22</version>
-        <relativePath>../../../parent/pom.xml</relativePath>
+        <relativePath/>
     </parent>
 
     <artifactId>org.apache.sling.commons.compiler</artifactId>

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

[sling-org-apache-sling-commons-compiler] 24/36: Update to parent pom 29

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit d04006031e337121ce057bacc86d28f5461c6e30
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Oct 21 06:10:37 2016 +0000

    Update to parent pom 29
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1765922 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 5d81150..e5ca716 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>28</version>
+        <version>29</version>
         <relativePath />
     </parent>
 

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

[sling-org-apache-sling-commons-compiler] 25/36: use Sling Parent 30

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit f4f3118bfdaa7c89c2108e04b69897825f688fb5
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Mar 6 10:22:30 2017 +0000

    use Sling Parent 30
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1785621 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index e5ca716..dbc8ac7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>29</version>
+        <version>30</version>
         <relativePath />
     </parent>
 

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

[sling-org-apache-sling-commons-compiler] 23/36: switch parent pom reference everywhere to 28 where it was 27 before this can be safely done because the only difference between 27 and 28 is an updated maven-source-plugin (fix heap space error)

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 07aec52cc232917fd23845031e9709f57a3bf0c4
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Fri Aug 19 21:15:35 2016 +0000

    switch parent pom reference everywhere to 28 where it was 27 before
    this can be safely done because the only difference between 27 and 28 is an updated maven-source-plugin (fix heap space error)
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1756968 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index c2f01aa..5d81150 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>27</version>
+        <version>28</version>
         <relativePath />
     </parent>
 

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

[sling-org-apache-sling-commons-compiler] 36/36: SLING-7167 Adjust READMEs

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 874b1ae57f33efd464cd2b64e5ee987869f303b0
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Oct 3 09:49:15 2017 +0000

    SLING-7167 Adjust READMEs
    
    add uniform header linking to Sling project
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810816 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index ddc886c..b9ee772 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,6 @@
-Apache Sling Commons Java Compiler
+# Apache Sling Commons Java Compiler
+
+This module is part of the [Apache Sling](https://sling.apache.org) project.
 
 The Sling Commons Java Compiler bundle provides platform independant Java Compilation 
 support using the Eclipse Java Compiler (org.eclipse.jdt).

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

[sling-org-apache-sling-commons-compiler] 13/36: Update the main reactor to parent 25

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 1b1747a2db4dc84524b6e554d49fd0b7170f2ecc
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Oct 5 10:03:45 2015 +0000

    Update the main reactor to parent 25
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1706780 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index be4688b..e255651 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>24</version>
+        <version>25</version>
         <relativePath/>
     </parent>
 

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

[sling-org-apache-sling-commons-compiler] 26/36: Move to OSGi R6 annotations

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 61572b94d3746be90df9920c947d89435ba53f31
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Mar 30 12:38:50 2017 +0000

    Move to OSGi R6 annotations
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1789515 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  8 --------
 .../commons/compiler/impl/EclipseJavaCompiler.java | 23 +++++++++++++++-------
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/pom.xml b/pom.xml
index dbc8ac7..f0989c5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,10 +51,6 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
                 <configuration>
@@ -87,10 +83,6 @@
             <artifactId>osgi.core</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.classloader</artifactId>
             <version>1.3.0</version>
diff --git a/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
index 646882d..67f60bb 100644
--- a/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
+++ b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
@@ -27,9 +27,6 @@ import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.commons.classloader.ClassLoaderWriter;
 import org.apache.sling.commons.compiler.CompilationResult;
 import org.apache.sling.commons.compiler.CompilationUnit;
@@ -49,6 +46,8 @@ import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
 import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
 import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
 import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -57,8 +56,7 @@ import org.slf4j.LoggerFactory;
  * Java compilation support using the Eclipse Java Compiler (org.eclipse.jdt).
  *
  */
-@Component
-@Service(value=JavaCompiler.class)
+@Component(service = JavaCompiler.class)
 public class EclipseJavaCompiler implements JavaCompiler {
 
     /** Logger instance */
@@ -155,6 +153,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
     /**
      * @see org.apache.sling.commons.compiler.JavaCompiler#compile(org.apache.sling.commons.compiler.CompilationUnit[], org.apache.sling.commons.compiler.Options)
      */
+    @Override
     public CompilationResult compile(final CompilationUnit[] units,
                                      final Options compileOptions) {
         // make sure we have an options object (to avoid null checks all over the place)
@@ -192,7 +191,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
         }
 
         // create properties for the settings object
-        final Map<String, String> props = new HashMap<String, String>();
+        final Map<String, String> props = new HashMap<>();
         if (options.isGenerateDebugInfo()) {
             props.put(CompilerOptions.OPTION_LocalVariableAttribute, "generate");
             props.put(CompilerOptions.OPTION_LineNumberAttribute, "generate");
@@ -247,7 +246,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
          		              final CompilationResultImpl errorHandler,
         		              final ClassLoaderWriter classWriter,
         		              final ClassLoader classLoader) {
-        	this.compUnits = new HashMap<String,ICompilationUnit>();
+        	this.compUnits = new HashMap<>();
             for (int i = 0; i < units.length; i++) {
                 CompilationUnitAdapter cua = new CompilationUnitAdapter(units[i], errorHandler);
                 char[][] compoundName = CharOperation.arrayConcat(cua.getPackageName(), cua.getMainTypeName());
@@ -267,6 +266,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
         /**
          * @see org.eclipse.jdt.internal.compiler.ICompilerRequestor#acceptResult(org.eclipse.jdt.internal.compiler.CompilationResult)
          */
+        @Override
         public void acceptResult(org.eclipse.jdt.internal.compiler.CompilationResult result) {
             if (result.hasProblems()) {
                 CategorizedProblem[] problems = result.getProblems();
@@ -301,6 +301,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
         /**
          * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#findType(char[][])
          */
+        @Override
         public NameEnvironmentAnswer findType(char[][] compoundTypeName) {
             // check 1st if type corresponds with any of current compilation units
             String fqn = CharOperation.toString(compoundTypeName);
@@ -326,6 +327,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
         /**
          * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#findType(char[], char[][])
          */
+        @Override
         public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) {
             return findType(CharOperation.arrayConcat(packageName, typeName));
         }
@@ -333,6 +335,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
         /**
          * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#isPackage(char[][], char[])
          */
+        @Override
         public boolean isPackage(char[][] parentPackageName, char[] packageName) {
             String fqn = CharOperation.toString(
                     CharOperation.arrayConcat(parentPackageName, packageName));
@@ -342,6 +345,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
         /**
          * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#cleanup()
          */
+        @Override
         public void cleanup() {
             // nothing to do
         }
@@ -415,6 +419,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
         /**
          * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getContents()
          */
+        @Override
         public char[] getContents() {
             Reader fr = null;
             try {
@@ -447,6 +452,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
         /**
          * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getMainTypeName()
          */
+        @Override
         public char[] getMainTypeName() {
             return this.mainTypeName.toCharArray();
         }
@@ -454,6 +460,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
         /**
          * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getPackageName()
          */
+        @Override
         public char[][] getPackageName() {
             return CharOperation.splitOn('.', this.packageName.toCharArray());
         }
@@ -461,6 +468,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
         /**
          * @see org.eclipse.jdt.internal.compiler.env.IDependent#getFileName()
          */
+        @Override
         public char[] getFileName() {
             if (compUnit instanceof CompilationUnitWithSource) {
                 return ((CompilationUnitWithSource)compUnit).getFileName().toCharArray();
@@ -472,6 +480,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
         /**
          * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#ignoreOptionalProblems()
          */
+        @Override
         public boolean ignoreOptionalProblems() {
             return false;
         }

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

[sling-org-apache-sling-commons-compiler] 18/36: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 6d4ea86d59d5f0eeb42efe0a9934358828e85fba
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Mar 1 13:58:06 2016 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1733072 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index bd031de..c5e1500 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.commons.compiler</artifactId>
-    <version>2.3.0</version>
+    <version>2.3.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Commons Java Compiler</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.commons.compiler-2.3.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/compiler</url>
     </scm>
 
     <properties>

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

[sling-org-apache-sling-commons-compiler] 15/36: SLING-5574 : Update Eclipse compiler to version 4.5.1

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 7b02670c85794a32c9fc9cd9c45a70df464946d3
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Mar 1 09:34:24 2016 +0000

    SLING-5574 : Update Eclipse compiler to version 4.5.1
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1733016 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 73a8aae..e6bdc02 100644
--- a/pom.xml
+++ b/pom.xml
@@ -105,7 +105,7 @@
         <dependency>
             <groupId>org.eclipse.jdt.core.compiler</groupId>
             <artifactId>ecj</artifactId>
-            <version>P20140317-1600</version>
+            <version>4.5.1</version>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>

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

[sling-org-apache-sling-commons-compiler] 07/36: Updated to parent version 20

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit fc9401f490235ad4bc11743def95fbcc718c8373
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Aug 1 19:16:26 2014 +0000

    Updated to parent version 20
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1615208 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 645e87e..69ad4e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>19</version>
+        <version>20</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

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

[sling-org-apache-sling-commons-compiler] 14/36: Switch to parent pom 26

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 3dc36d2e16eed5da99d198a071e9f5f8bf3a529a
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Jan 3 14:07:46 2016 +0000

    Switch to parent pom 26
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1722720 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index e255651..73a8aae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>25</version>
+        <version>26</version>
         <relativePath/>
     </parent>
 

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

[sling-org-apache-sling-commons-compiler] 12/36: set parent version to 24 and add empty relativePath where missing

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 3aecbbf603237d0af5c70d606d297cd8aca80e19
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Jul 7 08:09:17 2015 +0000

    set parent version to 24 and add empty relativePath where missing
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1689593 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index ea9ba94..be4688b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>23</version>
+        <version>24</version>
         <relativePath/>
     </parent>
 

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

[sling-org-apache-sling-commons-compiler] 02/36: [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.2.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 564f3dcd9410d8040d2862afd7a6075024e04235
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu May 15 11:47:13 2014 +0000

    [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.2.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1594875 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7638c28..5fe7a2f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.commons.compiler</artifactId>
-    <version>2.1.1-SNAPSHOT</version>
+    <version>2.2.0</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Commons Java Compiler</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/commons/compiler</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/commons/compiler</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/commons/compiler</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.2.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.2.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.commons.compiler-2.2.0</url>
     </scm>
 
     <properties>

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

[sling-org-apache-sling-commons-compiler] 34/36: SLING-7167 Adjust READMEs

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit c0ed8ce329ead248bce5600d8a78df94bdcbcf19
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Oct 2 14:52:38 2017 +0000

    SLING-7167 Adjust READMEs
    
    remove outdated information
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810370 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/README.txt b/README.txt
index dfd1414..ddc886c 100644
--- a/README.txt
+++ b/README.txt
@@ -2,26 +2,3 @@ Apache Sling Commons Java Compiler
 
 The Sling Commons Java Compiler bundle provides platform independant Java Compilation 
 support using the Eclipse Java Compiler (org.eclipse.jdt).
-
-Getting Started
-===============
-
-This component uses a Maven 3 (http://maven.apache.org/) build
-environment. It requires a Java 7 JDK (or higher) and Maven (http://maven.apache.org/)
-3.1.0 or later. We recommend to use the latest Maven version.
-
-If you have Maven 3 installed, you can compile and
-package the jar using the following command:
-
-    mvn package
-
-See the Maven 3 documentation for other build features.
-
-The latest source code for this component is available in the
-Subversion (http://subversion.tigris.org/) source repository of
-the Apache Software Foundation. If you have Subversion installed,
-you can checkout the latest source using the following command:
-
-    svn checkout http://svn.apache.org/repos/asf/sling/trunk/contrib/commons/compiler
-
-See the Subversion documentation for other source control features.

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

[sling-org-apache-sling-commons-compiler] 10/36: Update to Sling Parent 23

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 5e10194e1243a7b49953d54fad0076b4da2340ad
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 13:08:16 2015 +0000

    Update to Sling Parent 23
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1687500 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 184ccc0..edcc187 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>22</version>
+        <version>23</version>
         <relativePath/>
     </parent>
 

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

[sling-org-apache-sling-commons-compiler] 22/36: fix typo

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 46a0e67876788c8481a0aa359f81c7e70a1c5024
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Fri Aug 12 20:20:48 2016 +0000

    fix typo
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1756223 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 419d875..c2f01aa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,9 +7,9 @@
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at
-    
+
     http://www.apache.org/licenses/LICENSE-2.0
-    
+
     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -33,7 +33,7 @@
 
     <name>Apache Sling Commons Java Compiler</name>
     <description>
-        The Sling Commons Java Compiler bundle provides platform independant Java Compilation 
+        The Sling Commons Java Compiler bundle provides platform independent Java Compilation
         support using the Eclipse Java Compiler (org.eclipse.jdt).
     </description>
 

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

[sling-org-apache-sling-commons-compiler] 06/36: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 267c5096f24a4a36278e40a444e0724a1b4e8e42
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu May 15 12:01:30 2014 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1594882 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5fe7a2f..645e87e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.commons.compiler</artifactId>
-    <version>2.2.0</version>
+    <version>2.2.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Commons Java Compiler</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.2.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.2.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.commons.compiler-2.2.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/compiler</url>
     </scm>
 
     <properties>

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

[sling-org-apache-sling-commons-compiler] 29/36: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit ee27159c4dc9c4ffb25d520b08fea05ab80a7e1e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Sep 6 13:49:34 2017 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1807486 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index fe1c5eb..d1bd3de 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.commons.compiler</artifactId>
-    <version>2.3.2</version>
+    <version>2.3.3-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Commons Java Compiler</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.2</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.2</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.commons.compiler-2.3.2</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/compiler</url>
     </scm>
 
     <properties>

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

[sling-org-apache-sling-commons-compiler] 32/36: [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.3.4

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit e3096d849605a4be1f1dcb2dde437a63bdc611e2
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Sep 12 19:58:12 2017 +0000

    [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.3.4
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1808152 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5de2242..6b1af20 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.commons.compiler</artifactId>
-    <version>2.3.3-SNAPSHOT</version>
+    <version>2.3.4</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Commons Java Compiler</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/compiler</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.4</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.4</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.commons.compiler-2.3.4</url>
     </scm>
 
     <properties>

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

[sling-org-apache-sling-commons-compiler] 11/36: Remove superflous sling.java.version=6 as it's the default now

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 403011218a6c7c49115aa57a8cd53f12535411a1
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 13:14:53 2015 +0000

    Remove superflous sling.java.version=6 as it's the default now
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1687505 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index edcc187..ea9ba94 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,10 +43,6 @@
         <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/compiler</url>
     </scm>
 
-    <properties>
-        <sling.java.version>6</sling.java.version>
-    </properties>
-
     <build>
         <plugins>
             <plugin>

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

[sling-org-apache-sling-commons-compiler] 28/36: [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.3.2

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 8a74a4d44fa231039dba46ae0372a55f353d5c03
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Sep 6 13:49:19 2017 +0000

    [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.3.2
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1807484 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index f0989c5..fe1c5eb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.commons.compiler</artifactId>
-    <version>2.3.1-SNAPSHOT</version>
+    <version>2.3.2</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Commons Java Compiler</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/compiler</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.2</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.2</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.commons.compiler-2.3.2</url>
     </scm>
 
     <properties>

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

[sling-org-apache-sling-commons-compiler] 17/36: [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.3.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit fa782a494c79d67183a2c7fa201811674ad69788
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Mar 1 13:57:50 2016 +0000

    [maven-release-plugin] prepare release org.apache.sling.commons.compiler-2.3.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1733070 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4e1f9e9..bd031de 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,11 +24,11 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>26</version>
-        <relativePath/>
+        <relativePath />
     </parent>
 
     <artifactId>org.apache.sling.commons.compiler</artifactId>
-    <version>2.2.1-SNAPSHOT</version>
+    <version>2.3.0</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Commons Java Compiler</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/compiler</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.commons.compiler-2.3.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.commons.compiler-2.3.0</url>
     </scm>
 
     <properties>

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

[sling-org-apache-sling-commons-compiler] 27/36: SLING-7111 : Compiler creates class files even if compilation fails

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 55bbee38963d023c4e7031d90ae71318cb48811c
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Sep 6 13:48:17 2017 +0000

    SLING-7111 : Compiler creates class files even if compilation fails
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1807483 13f79535-47bb-0310-9956-ffa450edef68
---
 .../commons/compiler/impl/EclipseJavaCompiler.java   | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
index 67f60bb..49d4a5e 100644
--- a/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
+++ b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
@@ -69,7 +69,7 @@ public class EclipseJavaCompiler implements JavaCompiler {
     private IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());
 
     /** the static policy. */
-    private final IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems();
+    private final IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.exitAfterAllProblems();
 
     /**
      * Get the classloader for the compilation.
@@ -286,14 +286,16 @@ public class EclipseJavaCompiler implements JavaCompiler {
                     }
                 }
             }
-            ClassFile[] classFiles = result.getClassFiles();
-            for (int i = 0; i < classFiles.length; i++) {
-                ClassFile classFile = classFiles[i];
-                String className = CharOperation.toString(classFile.getCompoundName());
-                try {
-                    this.write(className, classFile.getBytes());
-                } catch (IOException e) {
-                    this.errorHandler.onError("Unable to write class file: " + e.getMessage(), className, 0, 0);
+            if ( this.errorHandler.getErrors() == null ) {
+                ClassFile[] classFiles = result.getClassFiles();
+                for (int i = 0; i < classFiles.length; i++) {
+                    ClassFile classFile = classFiles[i];
+                    String className = CharOperation.toString(classFile.getCompoundName());
+                    try {
+                        this.write(className, classFile.getBytes());
+                    } catch (IOException e) {
+                        this.errorHandler.onError("Unable to write class file: " + e.getMessage(), className, 0, 0);
+                    }
                 }
             }
         }

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

[sling-org-apache-sling-commons-compiler] 21/36: Update to parent pom 27

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit f3eb4b8e43c6691dfea1fbc280c3c23f20d4d475
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Jul 24 10:54:18 2016 +0000

    Update to parent pom 27
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1753902 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 10 ++-------
 .../sling/commons/compiler/CompilationResult.java  |  3 +++
 .../sling/commons/compiler/CompilationUnit.java    |  3 +++
 .../compiler/CompilationUnitWithSource.java        |  7 +++++--
 .../sling/commons/compiler/CompilerMessage.java    |  3 +++
 .../sling/commons/compiler/JavaCompiler.java       |  3 +++
 .../sling/commons/compiler/package-info.java       | 24 ++++++++++++++++++++++
 7 files changed, 43 insertions(+), 10 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3ffc2e3..419d875 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>26</version>
+        <version>27</version>
         <relativePath />
     </parent>
 
@@ -63,12 +63,6 @@
                             !org.eclipse.*,
                             !org.apache.tools.*,*
                         </Import-Package>
-                        <Export-Package>
-                            org.apache.sling.commons.compiler;version=2.1.0
-                        </Export-Package>
-                        <Private-Package>
-                            org.apache.sling.commons.compiler.impl
-                        </Private-Package>
                         <Embed-Dependency>
                             ecj
                         </Embed-Dependency>
@@ -90,7 +84,7 @@
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
+            <artifactId>osgi.core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
diff --git a/src/main/java/org/apache/sling/commons/compiler/CompilationResult.java b/src/main/java/org/apache/sling/commons/compiler/CompilationResult.java
index 6011cbd..447d7c6 100644
--- a/src/main/java/org/apache/sling/commons/compiler/CompilationResult.java
+++ b/src/main/java/org/apache/sling/commons/compiler/CompilationResult.java
@@ -18,12 +18,15 @@ package org.apache.sling.commons.compiler;
 
 import java.util.List;
 
+import org.osgi.annotation.versioning.ProviderType;
+
 /**
  * The compilation result allows clients of the java compiler
  * to check for error messages, warnings (if not disabled by
  * the options) and allows to access the compiled classes.
  * @since 2.0
  */
+@ProviderType
 public interface CompilationResult {
 
     /**
diff --git a/src/main/java/org/apache/sling/commons/compiler/CompilationUnit.java b/src/main/java/org/apache/sling/commons/compiler/CompilationUnit.java
index 289d791..3b5ae2c 100644
--- a/src/main/java/org/apache/sling/commons/compiler/CompilationUnit.java
+++ b/src/main/java/org/apache/sling/commons/compiler/CompilationUnit.java
@@ -19,10 +19,13 @@ package org.apache.sling.commons.compiler;
 import java.io.IOException;
 import java.io.Reader;
 
+import org.osgi.annotation.versioning.ConsumerType;
+
 /**
  * This interface describes a compilation unit - usually a java class.
  * @since 2.0
  */
+@ConsumerType
 public interface CompilationUnit {
 
     /**
diff --git a/src/main/java/org/apache/sling/commons/compiler/CompilationUnitWithSource.java b/src/main/java/org/apache/sling/commons/compiler/CompilationUnitWithSource.java
index 9a4921b..df9a6e0 100644
--- a/src/main/java/org/apache/sling/commons/compiler/CompilationUnitWithSource.java
+++ b/src/main/java/org/apache/sling/commons/compiler/CompilationUnitWithSource.java
@@ -5,9 +5,9 @@
  * licenses this file to You under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -16,11 +16,14 @@
  */
 package org.apache.sling.commons.compiler;
 
+import org.osgi.annotation.versioning.ConsumerType;
+
 /**
  * Extension of the CompilationUnit interface which allows for the explicit
  * declaration of the source file name.
  * @since 2.1
  */
+@ConsumerType
 public interface CompilationUnitWithSource extends CompilationUnit {
 
     String getFileName();
diff --git a/src/main/java/org/apache/sling/commons/compiler/CompilerMessage.java b/src/main/java/org/apache/sling/commons/compiler/CompilerMessage.java
index fd98d7a..aa28642 100644
--- a/src/main/java/org/apache/sling/commons/compiler/CompilerMessage.java
+++ b/src/main/java/org/apache/sling/commons/compiler/CompilerMessage.java
@@ -16,6 +16,8 @@
  */
 package org.apache.sling.commons.compiler;
 
+import org.osgi.annotation.versioning.ProviderType;
+
 /**
  * This class encapsulates a message produced the compiler.
  * A message is either a warning or an error.
@@ -23,6 +25,7 @@ package org.apache.sling.commons.compiler;
  *
  * @since 2.0
  */
+@ProviderType
 public class CompilerMessage {
 
     /**
diff --git a/src/main/java/org/apache/sling/commons/compiler/JavaCompiler.java b/src/main/java/org/apache/sling/commons/compiler/JavaCompiler.java
index 8d2d629..351da45 100644
--- a/src/main/java/org/apache/sling/commons/compiler/JavaCompiler.java
+++ b/src/main/java/org/apache/sling/commons/compiler/JavaCompiler.java
@@ -16,10 +16,13 @@
  */
 package org.apache.sling.commons.compiler;
 
+import org.osgi.annotation.versioning.ProviderType;
+
 /**
  * The <code>JavaCompiler</code> provides platform independant Java
  * compilation support.
  */
+@ProviderType
 public interface JavaCompiler {
 
     /**
diff --git a/src/main/java/org/apache/sling/commons/compiler/package-info.java b/src/main/java/org/apache/sling/commons/compiler/package-info.java
new file mode 100644
index 0000000..5045562
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/compiler/package-info.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+@Version("2.1.1")
+package org.apache.sling.commons.compiler;
+
+import org.osgi.annotation.versioning.Version;
+

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

[sling-org-apache-sling-commons-compiler] 04/36: Correct scm info after move from contrib to here

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit e781593b984a93274b1a4859c70ce669f0cebb15
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu May 15 11:49:18 2014 +0000

    Correct scm info after move from contrib to here
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1594877 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7638c28..b8ff281 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/commons/compiler</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/commons/compiler</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/commons/compiler</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/compiler</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/compiler</url>
     </scm>
 
     <properties>

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

[sling-org-apache-sling-commons-compiler] 20/36: Fix javadocs

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 56c6c925643c5ccd81bf921b98a13ee7f0d534de
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Jul 8 05:42:12 2016 +0000

    Fix javadocs
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1751856 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                       |  6 +-----
 .../org/apache/sling/commons/compiler/CompilationResult.java  |  3 ++-
 .../org/apache/sling/commons/compiler/CompilationUnit.java    |  6 ++++--
 src/main/java/org/apache/sling/commons/compiler/Options.java  | 11 +++++++++++
 4 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/pom.xml b/pom.xml
index c5e1500..3ffc2e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -75,10 +75,6 @@
                     </instructions>
                 </configuration>
             </plugin>
-        </plugins>
-    </build>
-    <reporting>
-        <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
@@ -89,7 +85,7 @@
                 </configuration>
             </plugin>
         </plugins>
-    </reporting>
+    </build>
 
     <dependencies>
         <dependency>
diff --git a/src/main/java/org/apache/sling/commons/compiler/CompilationResult.java b/src/main/java/org/apache/sling/commons/compiler/CompilationResult.java
index 4a72cbd..6011cbd 100644
--- a/src/main/java/org/apache/sling/commons/compiler/CompilationResult.java
+++ b/src/main/java/org/apache/sling/commons/compiler/CompilationResult.java
@@ -44,7 +44,7 @@ public interface CompilationResult {
 
     /**
      * Was a compilation required or were all classes recent?
-     * @return <code>true>/code> if classes were compiled.
+     * @return {@code true} if classes were compiled.
      */
     boolean didCompile();
 
@@ -55,6 +55,7 @@ public interface CompilationResult {
      * or if a class loader writer has been used in combination
      * with a class loader that is not able to load the classes
      * written by the class loader writer.
+     * @param className The class name of the compiled class.
      * @return The compiled class
      * @throws ClassNotFoundException If the class could not be found
      *         or compilation failed.
diff --git a/src/main/java/org/apache/sling/commons/compiler/CompilationUnit.java b/src/main/java/org/apache/sling/commons/compiler/CompilationUnit.java
index 415c237..289d791 100644
--- a/src/main/java/org/apache/sling/commons/compiler/CompilationUnit.java
+++ b/src/main/java/org/apache/sling/commons/compiler/CompilationUnit.java
@@ -26,8 +26,10 @@ import java.io.Reader;
 public interface CompilationUnit {
 
     /**
-     * Return an input stream for the contents.
-     * The compiler will close this stream in all cases!
+     * Return a reader for the contents.
+     * The compiler will close this reader in all cases!
+     * @return The reader.
+     * @throws IOException If the source can't be read.
      */
     Reader getSource()
     throws IOException;
diff --git a/src/main/java/org/apache/sling/commons/compiler/Options.java b/src/main/java/org/apache/sling/commons/compiler/Options.java
index 302c8c2..ee6048a 100644
--- a/src/main/java/org/apache/sling/commons/compiler/Options.java
+++ b/src/main/java/org/apache/sling/commons/compiler/Options.java
@@ -86,22 +86,33 @@ public class Options extends HashMap<String, Object> {
 
     /**
      * Create a new options object based on an existing one.
+     * @param options The base options.
      */
     public Options(final Options options) {
         super(options);
     }
 
+    /**
+     * Get the source version.
+     * @return The source version.
+     */
     public String getSourceVersion() {
         return (String) this.get(KEY_SOURCE_VERSION);
     }
 
     /**
+     * Get the target version.
+     * @return The target version
      * @since 2.0
      */
     public String getTargetVersion() {
         return (String) this.get(KEY_TARGET_VERSION);
     }
 
+     /**
+      * Should debug info be generated?
+      * @return {@code true} if debug info should be generated.
+      */
     public boolean isGenerateDebugInfo() {
         if ( this.get(KEY_GENERATE_DEBUG_INFO) != null ) {
             return (Boolean) this.get(KEY_GENERATE_DEBUG_INFO);

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

[sling-org-apache-sling-commons-compiler] 01/36: Move commons compiler to bundles

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit 1b9b14237c28ae43b9a9f83895b9d9e908e9e7dd
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 13 05:48:03 2014 +0000

    Move commons compiler to bundles
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1594135 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt                                         |  27 ++
 pom.xml                                            | 129 ++++++
 .../sling/commons/compiler/CompilationResult.java  |  64 +++
 .../sling/commons/compiler/CompilationUnit.java    |  48 +++
 .../compiler/CompilationUnitWithSource.java        |  27 ++
 .../sling/commons/compiler/CompilerMessage.java    | 101 +++++
 .../sling/commons/compiler/JavaCompiler.java       |  40 ++
 .../org/apache/sling/commons/compiler/Options.java | 111 +++++
 .../compiler/impl/CompilationResultImpl.java       | 114 +++++
 .../commons/compiler/impl/EclipseJavaCompiler.java | 479 +++++++++++++++++++++
 .../commons/compiler/impl/IsolatedClassLoader.java | 162 +++++++
 .../commons/compiler/impl/CompilerJava5Test.java   | 123 ++++++
 src/test/resources/Java5Test                       |  31 ++
 13 files changed, 1456 insertions(+)

diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..b76d37e
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,27 @@
+Apache Sling Commons Java Compiler
+
+The Sling Commons Java Compiler bundle provides platform independant Java Compilation 
+support using the Eclipse Java Compiler (org.eclipse.jdt).
+
+Getting Started
+===============
+
+This component uses a Maven 2 (http://maven.apache.org/) build
+environment. It requires a Java 5 JDK (or higher) and Maven (http://maven.apache.org/)
+2.0.7 or later. We recommend to use the latest Maven version.
+
+If you have Maven 2 installed, you can compile and
+package the jar using the following command:
+
+    mvn package
+
+See the Maven 2 documentation for other build features.
+
+The latest source code for this component is available in the
+Subversion (http://subversion.tigris.org/) source repository of
+the Apache Software Foundation. If you have Subversion installed,
+you can checkout the latest source using the following command:
+
+    svn checkout http://svn.apache.org/repos/asf/sling/trunk/contrib/commons/compiler
+
+See the Subversion documentation for other source control features.
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..7638c28
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>19</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>org.apache.sling.commons.compiler</artifactId>
+    <version>2.1.1-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>Apache Sling Commons Java Compiler</name>
+    <description>
+        The Sling Commons Java Compiler bundle provides platform independant Java Compilation 
+        support using the Eclipse Java Compiler (org.eclipse.jdt).
+    </description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/commons/compiler</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/commons/compiler</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/commons/compiler</url>
+    </scm>
+
+    <properties>
+        <sling.java.version>6</sling.java.version>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Import-Package>
+                            !org.eclipse.*,
+                            !org.apache.tools.*,*
+                        </Import-Package>
+                        <Export-Package>
+                            org.apache.sling.commons.compiler;version=2.1.0
+                        </Export-Package>
+                        <Private-Package>
+                            org.apache.sling.commons.compiler.impl
+                        </Private-Package>
+                        <Embed-Dependency>
+                            ecj
+                        </Embed-Dependency>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <configuration>
+                    <excludePackageNames>
+                        org.apache.sling.commons.compiler.impl
+                    </excludePackageNames>
+                </configuration>
+            </plugin>
+        </plugins>
+    </reporting>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.classloader</artifactId>
+            <version>1.3.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jdt.core.compiler</groupId>
+            <artifactId>ecj</artifactId>
+            <version>P20140317-1600</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+        <!-- testing -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/src/main/java/org/apache/sling/commons/compiler/CompilationResult.java b/src/main/java/org/apache/sling/commons/compiler/CompilationResult.java
new file mode 100644
index 0000000..4a72cbd
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/compiler/CompilationResult.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.commons.compiler;
+
+import java.util.List;
+
+/**
+ * The compilation result allows clients of the java compiler
+ * to check for error messages, warnings (if not disabled by
+ * the options) and allows to access the compiled classes.
+ * @since 2.0
+ */
+public interface CompilationResult {
+
+    /**
+     * Return a list of error messages that occured during
+     * compilation. If no errors occured <code>null</code>
+     * is returned.
+     * @return A list of error messages or <code>null</code>.
+     */
+    List<CompilerMessage> getErrors();
+
+    /**
+     * Return a list of warnings that occured during
+     * compilation. If no warnings occured <code>null</code>
+     * is returned.
+     * @return A list of warnings or <code>null</code>.
+     */
+    List<CompilerMessage> getWarnings();
+
+    /**
+     * Was a compilation required or were all classes recent?
+     * @return <code>true>/code> if classes were compiled.
+     */
+    boolean didCompile();
+
+    /**
+     * Try to load the compiled class.
+     * The class loading might fail if the className is not
+     * one of the compiled sources, if the compilation failed
+     * or if a class loader writer has been used in combination
+     * with a class loader that is not able to load the classes
+     * written by the class loader writer.
+     * @return The compiled class
+     * @throws ClassNotFoundException If the class could not be found
+     *         or compilation failed.
+     */
+    Class<?> loadCompiledClass(final String className)
+    throws ClassNotFoundException;
+}
diff --git a/src/main/java/org/apache/sling/commons/compiler/CompilationUnit.java b/src/main/java/org/apache/sling/commons/compiler/CompilationUnit.java
new file mode 100644
index 0000000..415c237
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/compiler/CompilationUnit.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.commons.compiler;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * This interface describes a compilation unit - usually a java class.
+ * @since 2.0
+ */
+public interface CompilationUnit {
+
+    /**
+     * Return an input stream for the contents.
+     * The compiler will close this stream in all cases!
+     */
+    Reader getSource()
+    throws IOException;
+
+    /**
+     * Returns the name of the top level public type.
+     * This name includes the package.
+     * @return the name of the top level public type.
+     */
+    String getMainClassName();
+
+    /**
+     * Return the last modified for the compilation unit.
+     * @return The last modified information or <code>-1</code> if
+     *         the information can't be detected.
+     */
+    long getLastModified();
+}
diff --git a/src/main/java/org/apache/sling/commons/compiler/CompilationUnitWithSource.java b/src/main/java/org/apache/sling/commons/compiler/CompilationUnitWithSource.java
new file mode 100644
index 0000000..9a4921b
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/compiler/CompilationUnitWithSource.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.sling.commons.compiler;
+
+/**
+ * Extension of the CompilationUnit interface which allows for the explicit
+ * declaration of the source file name.
+ * @since 2.1
+ */
+public interface CompilationUnitWithSource extends CompilationUnit {
+
+    String getFileName();
+}
diff --git a/src/main/java/org/apache/sling/commons/compiler/CompilerMessage.java b/src/main/java/org/apache/sling/commons/compiler/CompilerMessage.java
new file mode 100644
index 0000000..fd98d7a
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/compiler/CompilerMessage.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.commons.compiler;
+
+/**
+ * This class encapsulates a message produced the compiler.
+ * A message is either a warning or an error.
+ * The messages are retrieved from the {@link CompilationResult}.
+ *
+ * @since 2.0
+ */
+public class CompilerMessage {
+
+    /**
+     * The line number of the offending program text
+     */
+    private final int line;
+
+    /**
+     * The column number of the offending program text
+     */
+    private final int column;
+
+    /**
+     * The name of the file containing the offending program text
+     */
+    private final String file;
+
+    /**
+     * The actual text
+     */
+    private final String message;
+
+    /**
+     * The error message constructor.
+     *
+     * @param file The name of the file containing the offending program text
+     * @param line The line number of the offending program text
+     * @param column The column number of the offending program text
+     * @param message The actual text
+     */
+    public CompilerMessage(final String file,
+                           final int line,
+                           final int column,
+                           final String message) {
+        this.file = file;
+        this.line = line;
+        this.column = column;
+        this.message = message;
+    }
+
+    /**
+     * Return the filename associated with this compiler message.
+     *
+     * @return The filename associated with this compiler message
+     */
+    public String getFile() {
+        return file;
+    }
+
+    /**
+     * Return the line number of the program text originating this message
+     *
+     * @return The line number of the program text originating this message
+     */
+    public int getLine() {
+        return this.line;
+    }
+
+    /**
+     * Return the column number of the program text originating this message
+     *
+     * @return The column number of the program text originating this message
+     */
+    public int getColumn() {
+        return this.column;
+    }
+
+    /**
+     * Return the message
+     *
+     * @return The message
+     */
+    public String getMessage() {
+        return message;
+    }
+}
diff --git a/src/main/java/org/apache/sling/commons/compiler/JavaCompiler.java b/src/main/java/org/apache/sling/commons/compiler/JavaCompiler.java
new file mode 100644
index 0000000..8d2d629
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/compiler/JavaCompiler.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.commons.compiler;
+
+/**
+ * The <code>JavaCompiler</code> provides platform independant Java
+ * compilation support.
+ */
+public interface JavaCompiler {
+
+    /**
+     * Compile the compilation units.
+     * This method checks if the compilation is necessary by using
+     * last modified check of the source to compile and the class
+     * file (if available).
+     * The compiler compiles all sources if at least one of the
+     * class files is out dated!
+     *
+     * @param units The compilation units.
+     * @param options The compilation options - this object is optional
+     * @return The compilation result with more information.
+     * @since 2.0
+     */
+    CompilationResult compile(CompilationUnit[] units,
+                              Options options);
+}
diff --git a/src/main/java/org/apache/sling/commons/compiler/Options.java b/src/main/java/org/apache/sling/commons/compiler/Options.java
new file mode 100644
index 0000000..302c8c2
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/compiler/Options.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.commons.compiler;
+
+import java.util.HashMap;
+
+/**
+ * Options for the compilation process.
+ */
+public class Options extends HashMap<String, Object> {
+
+    private static final long serialVersionUID = 1576005888428747431L;
+
+    /** The key for the source version. */
+    public static final String KEY_SOURCE_VERSION = "sourceVersion";
+
+    /** The key for the target version. */
+    public static final String KEY_TARGET_VERSION = "targetVersion";
+
+    /** The key for the generate debug info flag. */
+    public static final String KEY_GENERATE_DEBUG_INFO = "generateDebugInfo";
+
+    public static final String VERSION_RUNTIME = null;
+    public static final String VERSION_1_1 = "1.1";
+    public static final String VERSION_1_2 = "1.2";
+    public static final String VERSION_1_3 = "1.3";
+    public static final String VERSION_1_4 = "1.4";
+    public static final String VERSION_1_5 = "1.5";
+    public static final String VERSION_1_6 = "1.6";
+    public static final String VERSION_1_7 = "1.7";
+    public static final String VERSION_1_8 = "1.8";
+
+    /** The key for the class loader writer.
+     * By default the registered class loader writer service is used. */
+    public static final String KEY_CLASS_LOADER_WRITER = "classLoaderWriter";
+
+    /**
+     * The key for the class loader.
+     * By default the commons dynamic classloader is used.
+     * This property overrides the classloader and ignores the
+     * {@link #KEY_ADDITIONAL_CLASS_LOADER} completly!
+     */
+    public static final String KEY_CLASS_LOADER = "classLoader";
+
+    /**
+     * The key for the additional class loader.
+     * By default the commons dynamic classloader is used.
+     * If this property is used and the {@link #KEY_CLASS_LOADER}
+     * property is not defined, a classloader with the dynamic
+     * class loader (default) and the class loader specified here
+     * is used.
+     */
+    public static final String KEY_ADDITIONAL_CLASS_LOADER = "classLoader";
+
+    /** The key to force the compilation - even if the class files are more recent.
+     * The value should be of type Boolean. */
+    public static final String KEY_FORCE_COMPILATION = "forceCompilation";
+
+    /** The key to ignore warnings - if this option is turned on, the
+     * resulting compilation result does not get the warnings issued
+     * by the compiler.
+     * The value should be of type Boolean. */
+    public static final String KEY_IGNORE_WARNINGS = "ignoreWarnings";
+
+    /**
+     * Default options with the following presets:
+     * - generate debug info : true
+     */
+    public Options() {
+        this.put(KEY_GENERATE_DEBUG_INFO, true);
+    }
+
+    /**
+     * Create a new options object based on an existing one.
+     */
+    public Options(final Options options) {
+        super(options);
+    }
+
+    public String getSourceVersion() {
+        return (String) this.get(KEY_SOURCE_VERSION);
+    }
+
+    /**
+     * @since 2.0
+     */
+    public String getTargetVersion() {
+        return (String) this.get(KEY_TARGET_VERSION);
+    }
+
+    public boolean isGenerateDebugInfo() {
+        if ( this.get(KEY_GENERATE_DEBUG_INFO) != null ) {
+            return (Boolean) this.get(KEY_GENERATE_DEBUG_INFO);
+        }
+        return false;
+    }
+}
diff --git a/src/main/java/org/apache/sling/commons/compiler/impl/CompilationResultImpl.java b/src/main/java/org/apache/sling/commons/compiler/impl/CompilationResultImpl.java
new file mode 100644
index 0000000..5d878b2
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/compiler/impl/CompilationResultImpl.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.commons.compiler.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.sling.commons.classloader.ClassLoaderWriter;
+import org.apache.sling.commons.compiler.CompilationResult;
+import org.apache.sling.commons.compiler.CompilerMessage;
+
+/**
+ * Implementation of the compilation result
+ */
+public class CompilationResultImpl implements CompilationResult {
+
+    private List<CompilerMessage> errors;
+
+    private List<CompilerMessage> warnings;
+
+    private final boolean ignoreWarnings;
+
+    private final boolean compilationRequired;
+
+    private final ClassLoaderWriter classLoaderWriter;
+
+    public CompilationResultImpl(final String errorMessage) {
+        this.ignoreWarnings = true;
+        this.classLoaderWriter = null;
+        this.compilationRequired = false;
+        this.onError(errorMessage, "<General>", 0, 0);
+    }
+
+    public CompilationResultImpl(final ClassLoaderWriter writer) {
+        this.ignoreWarnings = true;
+        this.classLoaderWriter = writer;
+        this.compilationRequired = false;
+    }
+
+    public CompilationResultImpl(final boolean ignoreWarnings,
+                                 final ClassLoaderWriter writer) {
+        this.ignoreWarnings = ignoreWarnings;
+        this.classLoaderWriter = writer;
+        this.compilationRequired = true;
+    }
+
+    /**
+     * @see org.apache.sling.commons.compiler.CompilationResult#getErrors()
+     */
+    public List<CompilerMessage> getErrors() {
+        return this.errors;
+    }
+
+    /**
+     * @see org.apache.sling.commons.compiler.CompilationResult#getWarnings()
+     */
+    public List<CompilerMessage> getWarnings() {
+        return this.warnings;
+    }
+
+    /**
+     * @see org.apache.sling.commons.compiler.CompilationResult#loadCompiledClass(java.lang.String)
+     */
+    public Class<?> loadCompiledClass(final String className)
+    throws ClassNotFoundException {
+        if ( errors != null ) {
+            throw new ClassNotFoundException(className);
+        }
+        return this.classLoaderWriter.getClassLoader().loadClass(className);
+    }
+
+    /**
+     * @see org.apache.sling.commons.compiler.CompilationResult#didCompile()
+     */
+    public boolean didCompile() {
+        return this.compilationRequired;
+    }
+
+    /**
+     * Notification of an error
+     */
+    public void onError(String msg, String sourceFile, int line, int position) {
+        if ( errors == null ) {
+            errors = new ArrayList<CompilerMessage>();
+        }
+        errors.add(new CompilerMessage(sourceFile, line, position, msg));
+    }
+
+    /**
+     * Notification of a warning
+     */
+    public void onWarning(String msg, String sourceFile, int line, int position) {
+        if ( !this.ignoreWarnings ) {
+            if ( warnings == null ) {
+                warnings = new ArrayList<CompilerMessage>();
+            }
+            warnings.add(new CompilerMessage(sourceFile, line, position, msg));
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
new file mode 100644
index 0000000..b969f26
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
@@ -0,0 +1,479 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.commons.compiler.impl;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.commons.classloader.ClassLoaderWriter;
+import org.apache.sling.commons.compiler.CompilationResult;
+import org.apache.sling.commons.compiler.CompilationUnit;
+import org.apache.sling.commons.compiler.CompilationUnitWithSource;
+import org.apache.sling.commons.compiler.JavaCompiler;
+import org.apache.sling.commons.compiler.Options;
+import org.eclipse.jdt.core.compiler.CategorizedProblem;
+import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.internal.compiler.ClassFile;
+import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies;
+import org.eclipse.jdt.internal.compiler.ICompilerRequestor;
+import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy;
+import org.eclipse.jdt.internal.compiler.IProblemFactory;
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
+import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
+import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
+import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The <code>EclipseJavaCompiler</code> provides platform independant
+ * Java compilation support using the Eclipse Java Compiler (org.eclipse.jdt).
+ *
+ */
+@Component
+@Service(value=JavaCompiler.class)
+public class EclipseJavaCompiler implements JavaCompiler {
+
+    /** Logger instance */
+    private final Logger logger = LoggerFactory.getLogger(EclipseJavaCompiler.class);
+
+    @Reference
+    private ClassLoaderWriter classLoaderWriter;
+
+    /** the static problem factory */
+    private IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());
+
+    /** the static policy. */
+    private final IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems();
+
+    /**
+     * Get the classloader for the compilation.
+     */
+    private ClassLoader getClassLoader(final Options options, final ClassLoaderWriter classLoaderWriter) {
+        final ClassLoader loader;
+        if ( options.get(Options.KEY_CLASS_LOADER) != null ) {
+            loader = (ClassLoader)options.get(Options.KEY_CLASS_LOADER);
+        } else if ( options.get(Options.KEY_ADDITIONAL_CLASS_LOADER) != null ) {
+            final ClassLoader additionalClassLoader = (ClassLoader)options.get(Options.KEY_ADDITIONAL_CLASS_LOADER);
+            loader = new ClassLoader(classLoaderWriter.getClassLoader()) {
+                @Override
+                protected Class<?> findClass(String name)
+                throws ClassNotFoundException {
+                    return additionalClassLoader.loadClass(name);
+                }
+
+                @Override
+                protected URL findResource(String name) {
+                    return additionalClassLoader.getResource(name);
+                }
+            };
+        } else {
+            final ClassLoader cl = classLoaderWriter.getClassLoader();
+            if ( cl == null ) {
+                loader = this.classLoaderWriter.getClassLoader();
+            } else {
+                loader = cl;
+            }
+        }
+        return loader;
+    }
+
+    /**
+     * Get the class loader writer for the compilation.
+     */
+    private ClassLoaderWriter getClassLoaderWriter(final Options options) {
+        if (options.get(Options.KEY_CLASS_LOADER_WRITER) != null ) {
+            return (ClassLoaderWriter)options.get(Options.KEY_CLASS_LOADER_WRITER);
+        }
+        return this.classLoaderWriter;
+    }
+
+    /**
+     * Check if the compiled class file is older than the source file
+     */
+    private boolean isOutDated(final CompilationUnit unit,
+                               final ClassLoaderWriter writer) {
+        final long targetLastModified = writer.getLastModified('/' + unit.getMainClassName().replace('.', '/') + ".class");
+        if (targetLastModified < 0) {
+            return true;
+        }
+
+        return targetLastModified < unit.getLastModified();
+    }
+
+    /**
+     * Return the force compilation value
+     */
+    private boolean isForceCompilation(final Options options) {
+        final Boolean flag = (Boolean)options.get(Options.KEY_FORCE_COMPILATION);
+        if ( flag != null ) {
+            return flag;
+        }
+        return false;
+    }
+
+    /**
+     * Return the ignore warnings value
+     */
+    private boolean isIgnoreWarnings(final Options options) {
+        final Boolean flag = (Boolean)options.get(Options.KEY_IGNORE_WARNINGS);
+        if ( flag != null ) {
+            return flag;
+        }
+        return false;
+    }
+
+    private static final Options EMPTY_OPTIONS = new Options();
+
+    /**
+     * @see org.apache.sling.commons.compiler.JavaCompiler#compile(org.apache.sling.commons.compiler.CompilationUnit[], org.apache.sling.commons.compiler.Options)
+     */
+    public CompilationResult compile(final CompilationUnit[] units,
+                                     final Options compileOptions) {
+        // make sure we have an options object (to avoid null checks all over the place)
+        final Options options = (compileOptions != null ? compileOptions : EMPTY_OPTIONS);
+
+        // get classloader and classloader writer
+        final ClassLoaderWriter writer = this.getClassLoaderWriter(options);
+        if ( writer == null ) {
+            return new CompilationResultImpl("Class loader writer for compilation is not available.");
+        }
+        final ClassLoader loader = this.getClassLoader(options, writer);
+        if ( loader == null ) {
+            return new CompilationResultImpl("Class loader for compilation is not available.");
+        }
+
+        // check sources for compilation
+        boolean needsCompilation = isForceCompilation(options);
+        if ( !needsCompilation ) {
+            for(final CompilationUnit unit : units) {
+                if ( this.isOutDated(unit, writer) ) {
+                    needsCompilation = true;
+                    break;
+                }
+            }
+        }
+        if ( !needsCompilation ) {
+            logger.debug("All source files are recent - no compilation required.");
+            return new CompilationResultImpl(writer);
+        }
+
+        // delete old class files
+        for(final CompilationUnit unit : units) {
+            final String name = '/' + unit.getMainClassName().replace('.', '/') + ".class";
+            writer.delete(name);
+        }
+
+        // create properties for the settings object
+        final Map<String, String> props = new HashMap<String, String>();
+        if (options.isGenerateDebugInfo()) {
+            props.put(CompilerOptions.OPTION_LocalVariableAttribute, "generate");
+            props.put(CompilerOptions.OPTION_LineNumberAttribute, "generate");
+            props.put(CompilerOptions.OPTION_SourceFileAttribute, "generate");
+        }
+        if (options.getSourceVersion() != null) {
+            props.put(CompilerOptions.OPTION_Source, options.getSourceVersion());
+            props.put(CompilerOptions.OPTION_Compliance, options.getSourceVersion());
+        }
+        if (options.getTargetVersion() != null) {
+            props.put(CompilerOptions.OPTION_TargetPlatform, options.getTargetVersion());
+        }
+        props.put(CompilerOptions.OPTION_Encoding, "UTF8");
+
+        // create the settings
+        final CompilerOptions settings = new CompilerOptions(props);
+        logger.debug("Compiling with settings {}.", settings);
+
+        // create the result
+        final CompilationResultImpl result = new CompilationResultImpl(isIgnoreWarnings(options), writer);
+        // create the context
+        final CompileContext context = new CompileContext(units, result, writer, loader);
+
+        // create the compiler
+        final org.eclipse.jdt.internal.compiler.Compiler compiler =
+                new org.eclipse.jdt.internal.compiler.Compiler(
+                        context,
+                        this.policy,
+                        settings,
+                        context,
+                        this.problemFactory,
+                        null,
+                        null);
+
+        // compile
+        compiler.compile(context.getSourceUnits());
+
+        return result;
+    }
+
+    //--------------------------------------------------------< inner classes >
+
+    private class CompileContext implements ICompilerRequestor, INameEnvironment {
+
+        private final Map<String,ICompilationUnit> compUnits;
+
+        private final CompilationResultImpl errorHandler;
+        private final ClassLoaderWriter classLoaderWriter;
+        private final ClassLoader classLoader;
+
+        public CompileContext(final CompilationUnit[] units,
+         		              final CompilationResultImpl errorHandler,
+        		              final ClassLoaderWriter classWriter,
+        		              final ClassLoader classLoader) {
+        	this.compUnits = new HashMap<String,ICompilationUnit>();
+            for (int i = 0; i < units.length; i++) {
+                CompilationUnitAdapter cua = new CompilationUnitAdapter(units[i], errorHandler);
+                char[][] compoundName = CharOperation.arrayConcat(cua.getPackageName(), cua.getMainTypeName());
+                this.compUnits.put(CharOperation.toString(compoundName), new CompilationUnitAdapter(units[i], errorHandler));
+            }
+
+        	this.errorHandler = errorHandler;
+            this.classLoaderWriter = classWriter;
+            this.classLoader = classLoader;
+        }
+
+        public ICompilationUnit[] getSourceUnits() {
+        	return compUnits.values().toArray(
+        			new ICompilationUnit[compUnits.size()]);
+        }
+
+        /**
+         * @see org.eclipse.jdt.internal.compiler.ICompilerRequestor#acceptResult(org.eclipse.jdt.internal.compiler.CompilationResult)
+         */
+        public void acceptResult(org.eclipse.jdt.internal.compiler.CompilationResult result) {
+            if (result.hasProblems()) {
+                CategorizedProblem[] problems = result.getProblems();
+                for (int i = 0; i < problems.length; i++) {
+                    CategorizedProblem problem = problems[i];
+                    String msg = problem.getMessage();
+                    String fileName = CharOperation.charToString(problem.getOriginatingFileName());
+                    int line = problem.getSourceLineNumber();
+                    int pos = problem.getSourceStart();
+
+                    if (problem.isError()) {
+                        this.errorHandler.onError(msg, fileName, line, pos);
+                    } else if (problem.isWarning()) {
+                        this.errorHandler.onWarning(msg, fileName, line, pos);
+                    } else {
+                        logger.debug("unknown problem category: {}", problem);
+                    }
+                }
+            }
+            ClassFile[] classFiles = result.getClassFiles();
+            for (int i = 0; i < classFiles.length; i++) {
+                ClassFile classFile = classFiles[i];
+                String className = CharOperation.toString(classFile.getCompoundName());
+                try {
+                    this.write(className, classFile.getBytes());
+                } catch (IOException e) {
+                    this.errorHandler.onError("Unable to write class file: " + e.getMessage(), className, 0, 0);
+                }
+            }
+        }
+
+        /**
+         * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#findType(char[][])
+         */
+        public NameEnvironmentAnswer findType(char[][] compoundTypeName) {
+            // check 1st if type corresponds with any of current compilation units
+            String fqn = CharOperation.toString(compoundTypeName);
+            ICompilationUnit cu = compUnits.get(fqn);
+            if (cu != null) {
+                return new NameEnvironmentAnswer(cu, null);
+            }
+
+            // locate the class through the class loader
+            try {
+                byte[] bytes = this.findClass(CharOperation.toString(compoundTypeName));
+                if (bytes == null) {
+                    return null;
+                }
+                ClassFileReader classFileReader =
+                        new ClassFileReader(bytes, fqn.toCharArray(), true);
+                return new NameEnvironmentAnswer(classFileReader, null);
+            } catch (Exception e) {
+                return null;
+            }
+        }
+
+        /**
+         * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#findType(char[], char[][])
+         */
+        public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) {
+            return findType(CharOperation.arrayConcat(packageName, typeName));
+        }
+
+        /**
+         * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#isPackage(char[][], char[])
+         */
+        public boolean isPackage(char[][] parentPackageName, char[] packageName) {
+            String fqn = CharOperation.toString(
+                    CharOperation.arrayConcat(parentPackageName, packageName));
+            return compUnits.get(fqn) == null && this.isPackage(fqn);
+        }
+
+        /**
+         * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#cleanup()
+         */
+        public void cleanup() {
+            // nothing to do
+        }
+
+        /**
+         * Write the classfile
+         */
+        private void write(String name, byte[] data) throws IOException {
+            final OutputStream os = this.classLoaderWriter.getOutputStream('/' + name.replace('.', '/') + ".class");
+            os.write(data);
+            os.close();
+        }
+
+        private boolean isPackage(String result) {
+            String resourceName = result.replace('.', '/') + ".class";
+            if ( resourceName.startsWith("/") ) {
+                resourceName = resourceName.substring(1);
+            }
+            final InputStream is = this.classLoader.getResourceAsStream(resourceName);
+            if ( is != null ) {
+                try {
+                    is.close();
+                } catch (IOException ignore) {}
+            }
+            return is == null;
+        }
+
+        private byte[] findClass(String name) throws Exception {
+            final String resourceName = name.replace('.', '/') + ".class";
+            final InputStream is = this.classLoader.getResourceAsStream(resourceName);
+            if (is != null) {
+                try {
+                    byte[] buf = new byte[8192];
+                    ByteArrayOutputStream baos = new ByteArrayOutputStream(buf.length);
+                    int count;
+                    while ((count = is.read(buf, 0, buf.length)) > 0) {
+                        baos.write(buf, 0, count);
+                    }
+                    baos.flush();
+                    return baos.toByteArray();
+                } finally {
+                    try {
+                        is.close();
+                    } catch (IOException ignore) {}
+                }
+            }
+            return null;
+        }
+    }
+
+    private class CompilationUnitAdapter implements ICompilationUnit {
+
+        private final CompilationResultImpl errorHandler;
+        private final CompilationUnit compUnit;
+        private final String mainTypeName;
+        private final String packageName;
+
+        public CompilationUnitAdapter(final CompilationUnit compUnit, final CompilationResultImpl errorHandler) {
+            this.compUnit = compUnit;
+            this.errorHandler = errorHandler;
+            final int pos = compUnit.getMainClassName().lastIndexOf('.');
+            if ( pos == -1 ) {
+                this.packageName = "";
+                this.mainTypeName = compUnit.getMainClassName();
+            } else {
+                this.packageName = compUnit.getMainClassName().substring(0, pos);
+                this.mainTypeName = compUnit.getMainClassName().substring(pos + 1);
+            }
+        }
+
+        /**
+         * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getContents()
+         */
+        public char[] getContents() {
+            Reader fr = null;
+            try {
+                fr = this.compUnit.getSource();
+                final Reader reader = new BufferedReader(fr);
+                try {
+                    char[] chars = new char[8192];
+                    StringBuilder buf = new StringBuilder();
+                    int count;
+                    while ((count = reader.read(chars, 0, chars.length)) > 0) {
+                        buf.append(chars, 0, count);
+                    }
+                    final char[] result = new char[buf.length()];
+                    buf.getChars(0, result.length, result, 0);
+                    return result;
+                } finally {
+                    reader.close();
+                }
+            } catch (IOException e) {
+                this.errorHandler.onError("Unable to read source file " + this.compUnit.getMainClassName() + " : " + e.getMessage(),
+                        this.compUnit.getMainClassName(), 0, 0);
+                return null;
+            } finally {
+                if ( fr != null ) {
+                    try { fr.close(); } catch (IOException ignore) {}
+                }
+            }
+        }
+
+        /**
+         * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getMainTypeName()
+         */
+        public char[] getMainTypeName() {
+            return this.mainTypeName.toCharArray();
+        }
+
+        /**
+         * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getPackageName()
+         */
+        public char[][] getPackageName() {
+            return CharOperation.splitOn('.', this.packageName.toCharArray());
+        }
+
+        /**
+         * @see org.eclipse.jdt.internal.compiler.env.IDependent#getFileName()
+         */
+        public char[] getFileName() {
+            if (compUnit instanceof CompilationUnitWithSource) {
+                return ((CompilationUnitWithSource)compUnit).getFileName().toCharArray();
+            } else {
+                return (this.packageName.replace('.', '/') + '/' + this.mainTypeName + ".java").toCharArray();
+            }
+        }
+
+        /**
+         * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#ignoreOptionalProblems()
+         */
+        public boolean ignoreOptionalProblems() {
+            return false;
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/commons/compiler/impl/IsolatedClassLoader.java b/src/main/java/org/apache/sling/commons/compiler/impl/IsolatedClassLoader.java
new file mode 100644
index 0000000..ace970a
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/compiler/impl/IsolatedClassLoader.java
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.commons.compiler.impl;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
+import java.security.SecureClassLoader;
+
+import org.apache.sling.commons.classloader.ClassLoaderWriter;
+
+
+/**
+ * The <code>IsolatedClassLoader</code> class loads classes through
+ * the class loader writer
+ */
+public final class IsolatedClassLoader
+    extends SecureClassLoader {
+
+    private final ClassLoaderWriter classLoaderWriter;
+
+    public IsolatedClassLoader(final ClassLoader parent,
+            final ClassLoaderWriter classLoaderWriter) {
+        super(parent);
+        this.classLoaderWriter = classLoaderWriter;
+    }
+
+
+    //---------- Class loader overwrites -------------------------------------
+
+    /**
+     * Loads the class from this <code>ClassLoader</class>.  If the
+     * class does not exist in this one, we check the parent.  Please
+     * note that this is the exact opposite of the
+     * <code>ClassLoader</code> spec.  We use it to work around
+     * inconsistent class loaders from third party vendors.
+     *
+     * @param     name the name of the class
+     * @param     resolve if <code>true</code> then resolve the class
+     * @return    the resulting <code>Class</code> object
+     * @exception ClassNotFoundException if the class could not be found
+     */
+    public final Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+        // First check if it's already loaded
+        Class<?> clazz = findLoadedClass(name);
+
+        if (clazz == null) {
+
+            try {
+                clazz = findClass(name);
+            } catch (final ClassNotFoundException cnfe) {
+                final ClassLoader parent = getParent();
+                if (parent != null) {
+                    // Ask to parent ClassLoader (can also throw a CNFE).
+                    clazz = parent.loadClass(name);
+                } else {
+                    // Propagate exception
+                    throw cnfe;
+                }
+            }
+        }
+
+        if (resolve) {
+            resolveClass(clazz);
+        }
+
+        return clazz;
+    }
+
+    /**
+     * Finds and loads the class with the specified name from the class path.
+     *
+     * @param name the name of the class
+     * @return the resulting class
+     *
+     * @throws ClassNotFoundException If the named class could not be found or
+     *      if this class loader has already been destroyed.
+     */
+    protected Class<?> findClass(final String name) throws ClassNotFoundException {
+        try {
+            return AccessController.doPrivileged(
+                new PrivilegedExceptionAction<Class<?>>() {
+
+                    public Class<?> run() throws ClassNotFoundException {
+                        return findClassPrivileged(name);
+                    }
+                });
+        } catch (final java.security.PrivilegedActionException pae) {
+            throw (ClassNotFoundException) pae.getException();
+        }
+    }
+
+    /**
+     * Tries to find the class in the class path from within a
+     * <code>PrivilegedAction</code>. Throws <code>ClassNotFoundException</code>
+     * if no class can be found for the name.
+     *
+     * @param name the name of the class
+     *
+     * @return the resulting class
+     *
+     * @throws ClassNotFoundException if the class could not be found
+     * @throws NullPointerException If this class loader has already been
+     *      destroyed.
+     */
+    private Class<?> findClassPrivileged(final String name) throws ClassNotFoundException {
+        // prepare the name of the class
+        final String path = "/" + name.replace('.', '/') + ".class";
+        InputStream is = null;
+        try {
+            is = this.classLoaderWriter.getInputStream(path);
+            final Class<?> c = defineClass(name, is);
+            if (c == null) {
+                throw new ClassNotFoundException(name);
+            }
+            return c;
+        } catch ( final ClassNotFoundException cnfe) {
+            throw cnfe;
+        } catch (final Throwable t) {
+            throw new ClassNotFoundException(name, t);
+        }
+     }
+
+    /**
+     * Defines a class getting the bytes for the class from the resource
+     *
+     * @param name The fully qualified class name
+     * @param is The resource to obtain the class bytes from
+     *
+     * @throws IOException If a problem occurrs reading the class bytes from
+     *      the resource.
+     * @throws ClassFormatError If the class bytes read from the resource are
+     *      not a valid class.
+     */
+    private Class<?> defineClass(final String name, final InputStream is)
+    throws IOException {
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final byte[] buffer = new byte[2048];
+        int l;
+        while ( ( l = is.read(buffer)) >= 0 ) {
+            baos.write(buffer, 0, l);
+        }
+        final byte[] data = baos.toByteArray();
+        return defineClass(name, data, 0, data.length);
+    }
+}
diff --git a/src/test/java/org/apache/sling/commons/compiler/impl/CompilerJava5Test.java b/src/test/java/org/apache/sling/commons/compiler/impl/CompilerJava5Test.java
new file mode 100644
index 0000000..ac5f0b5
--- /dev/null
+++ b/src/test/java/org/apache/sling/commons/compiler/impl/CompilerJava5Test.java
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.commons.compiler.impl;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.Reader;
+
+import junit.framework.TestCase;
+
+import org.apache.sling.commons.classloader.ClassLoaderWriter;
+import org.apache.sling.commons.compiler.CompilationResult;
+import org.apache.sling.commons.compiler.CompilationUnit;
+import org.apache.sling.commons.compiler.Options;
+
+/**
+ * Test case for java 5 support
+ */
+public class CompilerJava5Test extends TestCase
+        implements ClassLoaderWriter {
+
+    public void testJava5Support() throws Exception {
+        String sourceFile = "Java5Test";
+
+        CompilationUnit unit = createCompileUnit(sourceFile);
+        final Options options = new Options();
+        options.put(Options.KEY_SOURCE_VERSION, Options.VERSION_1_5);
+        options.put(Options.KEY_CLASS_LOADER_WRITER, this);
+        options.put(Options.KEY_CLASS_LOADER, this.getClass().getClassLoader());
+
+        final CompilationResult result = new EclipseJavaCompiler().compile(new CompilationUnit[]{unit}, options);
+        assertNotNull(result);
+        assertNull(result.getErrors());
+    }
+
+    //--------------------------------------------------------< misc. helpers >
+
+    private CompilationUnit createCompileUnit(final String sourceFile) throws Exception {
+        return new CompilationUnit() {
+
+            /**
+             * @see org.apache.sling.commons.compiler.CompilationUnit#getMainClassName()
+             */
+            public String getMainClassName() {
+                return "org.apache.sling.commons.compiler.test." + sourceFile;
+            }
+
+            /**
+             * @see org.apache.sling.commons.compiler.CompilationUnit#getSource()
+             */
+            public Reader getSource() throws IOException {
+                InputStream in = getClass().getClassLoader().getResourceAsStream(sourceFile);
+                return new InputStreamReader(in, "UTF-8");
+            }
+
+            /**
+             * @see org.apache.sling.commons.compiler.CompilationUnit#getLastModified()
+             */
+            public long getLastModified() {
+                return 0;
+            }
+        };
+    }
+
+    /**
+     * @see org.apache.sling.commons.classloader.ClassLoaderWriter#delete(java.lang.String)
+     */
+    public boolean delete(String path) {
+        return false;
+    }
+
+    /**
+     * @see org.apache.sling.commons.classloader.ClassLoaderWriter#getInputStream(java.lang.String)
+     */
+    public InputStream getInputStream(String path) throws IOException {
+        return null;
+    }
+
+    /**
+     * @see org.apache.sling.commons.classloader.ClassLoaderWriter#getLastModified(java.lang.String)
+     */
+    public long getLastModified(String path) {
+        return -1;
+    }
+
+    /**
+     * @see org.apache.sling.commons.classloader.ClassLoaderWriter#getOutputStream(java.lang.String)
+     */
+    public OutputStream getOutputStream(String path) {
+        return new ByteArrayOutputStream();
+    }
+
+    /**
+     * @see org.apache.sling.commons.classloader.ClassLoaderWriter#rename(java.lang.String, java.lang.String)
+     */
+    public boolean rename(String oldPath, String newPath) {
+        return false;
+    }
+
+    /**
+     * @see org.apache.sling.commons.classloader.ClassLoaderWriter#getClassLoader()
+     */
+    public ClassLoader getClassLoader() {
+        return null;
+    }
+}
diff --git a/src/test/resources/Java5Test b/src/test/resources/Java5Test
new file mode 100644
index 0000000..44658bc
--- /dev/null
+++ b/src/test/resources/Java5Test
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.commons.compiler.test;
+
+import java.util.List;
+
+/**
+ * Class to test to compile Java 5 specific code
+ */
+public class Java5Test {
+    public int sum(List<Integer> intList) {
+	int result = 0;
+	for(int i=0;i<intList.size();i++)
+	    result += intList.get(i).intValue();
+	return result;
+    }
+}

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

[sling-org-apache-sling-commons-compiler] 35/36: SLING-7167 Adjust READMEs

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git

commit bb1dd5c3d50bedcfa1d0512495e8e16502cb22f6
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Oct 2 16:10:21 2017 +0000

    SLING-7167 Adjust READMEs
    
    switch from plain text to Markdown
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810457 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt => README.md | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/README.txt b/README.md
similarity index 100%
rename from README.txt
rename to README.md

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