Author: nbelaevski
Date: 2009-12-29 11:51:45 -0500 (Tue, 29 Dec 2009)
New Revision: 16219
Modified:
root/cdk/trunk/plugins/generator/pom.xml
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/types/TypesFactory.java
root/cdk/trunk/plugins/generator/src/main/script/SchemaAttributesParserTask.groovy
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
root/cdk/trunk/pom.xml
Log:
CDK:
- Added comments to TypesFactory
- Build failures due to missing com.sun.*jaxb dependencies and checkstyle errors fixed
Modified: root/cdk/trunk/plugins/generator/pom.xml
===================================================================
--- root/cdk/trunk/plugins/generator/pom.xml 2009-12-29 13:00:55 UTC (rev 16218)
+++ root/cdk/trunk/plugins/generator/pom.xml 2009-12-29 16:51:45 UTC (rev 16219)
@@ -120,17 +120,17 @@
<artifactId>xinclude</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.2</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.2</version>
- </dependency>
<dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.2</version>
+ </dependency>
+ <dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.2-SNAPSHOT</version>
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/types/TypesFactory.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/types/TypesFactory.java 2009-12-29
13:00:55 UTC (rev 16218)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/types/TypesFactory.java 2009-12-29
16:51:45 UTC (rev 16219)
@@ -135,7 +135,11 @@
for (String guessPackage : GUESS_PACKAGES) {
String guessTypeName = guessPackage + "." + className;
try {
- return Class.forName(guessTypeName, true, classLoader);
+ //while by default initialize = true for Class.forName(String)
method
+ //initialize = false used here prevents loading of dependencies that
+ //are accessible only in runtime, e.g. static log initializer from
API
+ //depends on the concrete logger implementation provided in runtime
only
+ return Class.forName(guessTypeName, false, classLoader);
} catch (ClassNotFoundException e) {
// ignore
} catch (LinkageError e) {
@@ -150,7 +154,8 @@
Class<?> result = PRIMITIVE_CLASSES_MAP.get(className);
if (result == null) {
try {
- result = Class.forName(className, true, classLoader);
+ //initialize = false here for the same reason as already mentioned for
the previous load block
+ result = Class.forName(className, false, classLoader);
} catch (LinkageError e) {
String errorMessage = MessageFormat.format("Class {0}
couldn''t be loaded because of: {1}", className,
e.getMessage());
Modified:
root/cdk/trunk/plugins/generator/src/main/script/SchemaAttributesParserTask.groovy
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/script/SchemaAttributesParserTask.groovy 2009-12-29
13:00:55 UTC (rev 16218)
+++
root/cdk/trunk/plugins/generator/src/main/script/SchemaAttributesParserTask.groovy 2009-12-29
16:51:45 UTC (rev 16219)
@@ -57,6 +57,11 @@
outputFile.createNewFile();
XSSchemaSet schemaSet = parse(sourceSchemaFileName);
+
+ if (schemaSet == null) {
+ fail("Unknown error parsing schema file");
+ }
+
SchemaProcessor schemaProcessor = new SchemaProcessor(schemaSet, targetNamespaceParam);
schemaProcessor.buildModel();
schemaProcessor.serializeModel(new FileOutputStream(outputFileName));
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java 2009-12-29
13:00:55 UTC (rev 16218)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java 2009-12-29
16:51:45 UTC (rev 16219)
@@ -274,7 +274,7 @@
assertEquals(1, processor.numOfComponents);
}
- private static abstract class TestProcessor extends CdkProcessor {
+ private abstract static class TestProcessor extends CdkProcessor {
protected int numOfComponents;
public TestProcessor() {
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-12-29
13:00:55 UTC (rev 16218)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-12-29
16:51:45 UTC (rev 16219)
@@ -35,7 +35,6 @@
import org.richfaces.cdk.CdkContextBase;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWorker;
-import org.richfaces.cdk.LibraryBuilder;
import org.richfaces.cdk.LoggerFactory;
import org.richfaces.cdk.ModelBuilder;
import org.richfaces.cdk.ModelValidator;
Modified: root/cdk/trunk/pom.xml
===================================================================
--- root/cdk/trunk/pom.xml 2009-12-29 13:00:55 UTC (rev 16218)
+++ root/cdk/trunk/pom.xml 2009-12-29 16:51:45 UTC (rev 16219)
@@ -38,7 +38,9 @@
<repositories>
<repository>
- <releases/>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
Show replies by date