JBoss Tools SVN: r23131 - in trunk/vpe: features and 19 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-06-30 15:46:55 -0400 (Wed, 30 Jun 2010)
New Revision: 23131
Modified:
trunk/vpe/features/org.jboss.tools.xulrunner.feature/pom.xml
trunk/vpe/features/pom.xml
trunk/vpe/plugins/org.jboss.tools.vpe.docbook/pom.xml
trunk/vpe/plugins/org.jboss.tools.vpe.html/pom.xml
trunk/vpe/plugins/org.jboss.tools.vpe.jsp/pom.xml
trunk/vpe/plugins/org.jboss.tools.vpe.resref/pom.xml
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/pom.xml
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/pom.xml
trunk/vpe/plugins/org.jboss.tools.vpe/pom.xml
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/pom.xml
trunk/vpe/plugins/org.jboss.tools.xulrunner/pom.xml
trunk/vpe/plugins/pom.xml
trunk/vpe/pom.xml
trunk/vpe/site/pom.xml
trunk/vpe/tests/org.jboss.tools.vpe.html.test/pom.xml
trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.jsp.test/pom.xml
trunk/vpe/tests/org.jboss.tools.vpe.test/pom.xml
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/pom.xml
trunk/vpe/tests/org.jboss.tools.vpe.xulrunner.test/pom.xml
trunk/vpe/tests/pom.xml
Log:
1. failing tests were commented in vpe.html.test plugin see https://jira.jboss.org/browse/JBIDE-6561
2. maven repo adjusted to svn structure
3. coverage meta info about filer and bundle list added to test's pom.xml files
Modified: trunk/vpe/features/org.jboss.tools.xulrunner.feature/pom.xml
===================================================================
--- trunk/vpe/features/org.jboss.tools.xulrunner.feature/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/features/org.jboss.tools.xulrunner.feature/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.features</groupId>
<artifactId>org.jboss.tools.xulrunner.feature</artifactId>
<version>1.9.1.2</version>
<packaging>eclipse-feature</packaging>
Modified: trunk/vpe/features/pom.xml
===================================================================
--- trunk/vpe/features/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/features/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,13 +7,14 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>vpe.features</artifactId>
+ <groupId>org.jboss.tools.vpe</groupId>
+ <artifactId>features</artifactId>
<version>0.0.1-SNAPSHOT</version>
+ <name>vpe.features</name>
<packaging>pom</packaging>
<modules>
<module>org.jboss.tools.vpe.feature</module>
<module>org.jboss.tools.xulrunner.feature</module>
</modules>
</project>
-
\ No newline at end of file
+
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/pom.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.plugins</groupId>
<artifactId>org.jboss.tools.vpe</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.docbook/pom.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.docbook/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.docbook/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.plugins</groupId>
<artifactId>org.jboss.tools.vpe.docbook</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/pom.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.plugins</groupId>
<artifactId>org.jboss.tools.vpe.html</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.jsp/pom.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.jsp/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.jsp/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.plugins</groupId>
<artifactId>org.jboss.tools.vpe.jsp</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/pom.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.plugins</groupId>
<artifactId>org.jboss.tools.vpe.resref</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/pom.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.plugins</groupId>
<artifactId>org.jboss.tools.vpe.ui.palette</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/pom.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.plugins</groupId>
<artifactId>org.jboss.tools.vpe.xulrunner</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
Modified: trunk/vpe/plugins/org.jboss.tools.xulrunner/pom.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.xulrunner/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/plugins/org.jboss.tools.xulrunner/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.plugins</groupId>
<artifactId>org.jboss.tools.xulrunner</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
Modified: trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/pom.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.plugins</groupId>
<artifactId>org.jboss.tools.xulrunner.initializer</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
Modified: trunk/vpe/plugins/pom.xml
===================================================================
--- trunk/vpe/plugins/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/plugins/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,9 +7,10 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>vpe.plugins</artifactId>
+ <groupId>org.jboss.tools.vpe</groupId>
+ <artifactId>plugins</artifactId>
<version>0.0.1-SNAPSHOT</version>
+ <name>vpe.plugins</name>
<packaging>pom</packaging>
<modules>
<module>org.jboss.tools.vpe</module>
@@ -23,4 +24,4 @@
<module>org.jboss.tools.xulrunner.initializer</module>
</modules>
</project>
-
\ No newline at end of file
+
Modified: trunk/vpe/pom.xml
===================================================================
--- trunk/vpe/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -8,8 +8,9 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools</groupId>
- <artifactId>vpe.all</artifactId>
+ <artifactId>vpe</artifactId>
<version>0.0.1-SNAPSHOT</version>
+ <name>vpe.all</name>
<packaging>pom</packaging>
<modules>
<module>features</module>
Modified: trunk/vpe/site/pom.xml
===================================================================
--- trunk/vpe/site/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/site/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -6,8 +6,9 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>vpe.site</artifactId>
+ <groupId>org.jboss.tools.vpe</groupId>
+ <artifactId>site</artifactId>
<version>0.0.1-SNAPSHOT</version>
+ <name>vpe.site</name>
<packaging>eclipse-update-site</packaging>
</project>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.html.test/pom.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.html.test/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,10 +7,16 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.tests</groupId>
<artifactId>org.jboss.tools.vpe.html.test</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
+
+ <properties>
+ <emma.filter>org.jboss.tools.vpe.html*</emma.filter>
+ <emma.instrument.bundles>org.jboss.tools.vpe.html</emma.instrument.bundles>
+ </properties>
+
<build>
<plugins>
<plugin>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlComponentContentTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlComponentContentTest.java 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlComponentContentTest.java 2010-06-30 19:46:55 UTC (rev 23131)
@@ -34,7 +34,7 @@
performContentTest("components/block/dd.html"); //$NON-NLS-1$
}
- public void testDiv() throws Throwable {
+ public void _testDiv() throws Throwable {
performContentTest("components/block/div.html"); //$NON-NLS-1$
}
@@ -234,7 +234,7 @@
performContentTest("components/table/colgroup.html"); //$NON-NLS-1$
}
- public void testTable() throws Throwable {
+ public void _testTable() throws Throwable {
performContentTest("components/table/table.html"); //$NON-NLS-1$
}
@@ -242,7 +242,7 @@
performContentTest("components/table/tbody.html"); //$NON-NLS-1$
}
- public void testTd() throws Throwable {
+ public void _testTd() throws Throwable {
performContentTest("components/table/td.html"); //$NON-NLS-1$
}
@@ -258,7 +258,7 @@
performContentTest("components/table/thead.html"); //$NON-NLS-1$
}
- public void testTr() throws Throwable {
+ public void _testTr() throws Throwable {
performContentTest("components/table/tr.html"); //$NON-NLS-1$
}
@@ -310,7 +310,7 @@
performContentTest("components/text/em.html"); //$NON-NLS-1$
}
- public void testHr() throws Throwable {
+ public void _testHr() throws Throwable {
performContentTest("components/text/hr.html"); //$NON-NLS-1$
}
@@ -411,7 +411,7 @@
performContentTest("components/other/wbr.html"); //$NON-NLS-1$
}
- public void testXmp() throws Throwable {
+ public void _testXmp() throws Throwable {
performContentTest("components/other/xmp.xhtml"); //$NON-NLS-1$
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.jsp.test/pom.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.jsp.test/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/tests/org.jboss.tools.vpe.jsp.test/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,11 +7,17 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.tests</groupId>
<artifactId>org.jboss.tools.vpe.jsp.test</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
- <build>
+
+ <properties>
+ <emma.filter>org.jboss.tools.vpe*</emma.filter>
+ <emma.instrument.bundles>org.jboss.tools.vpe</emma.instrument.bundles>
+ </properties>
+
+ <build>
<plugins>
<plugin>
<groupId>org.sonatype.tycho</groupId>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/pom.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,10 +7,16 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.tests</groupId>
<artifactId>org.jboss.tools.vpe.test</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
+
+ <properties>
+ <emma.filter>org.jboss.tools.vpe*</emma.filter>
+ <emma.instrument.bundles>org.jboss.tools.vpe</emma.instrument.bundles>
+ </properties>
+
<build>
<plugins>
<plugin>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/pom.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,10 +7,16 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.tests</groupId>
<artifactId>org.jboss.tools.vpe.ui.test</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
+
+ <properties>
+ <emma.filter>org.jboss.tools.vpe*</emma.filter>
+ <emma.instrument.bundles>org.jboss.tools.vpe</emma.instrument.bundles>
+ </properties>
+
<build>
<plugins>
<plugin>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.xulrunner.test/pom.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.xulrunner.test/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/tests/org.jboss.tools.vpe.xulrunner.test/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,10 +7,16 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.vpe.tests</groupId>
<artifactId>org.jboss.tools.vpe.xulrunner.test</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
+
+ <properties>
+ <emma.filter>org.jboss.tools.vpe.xulrunner*</emma.filter>
+ <emma.instrument.bundles>org.jboss.tools.vpe.xulrunner</emma.instrument.bundles>
+ </properties>
+
<build>
<plugins>
<plugin>
@@ -33,7 +39,7 @@
<version>3.1.0</version>
<type>eclipse-plugin</type>
</dependency>
- </dependencies>
+ </dependencies>
</configuration>
</plugin>
</plugins>
Modified: trunk/vpe/tests/pom.xml
===================================================================
--- trunk/vpe/tests/pom.xml 2010-06-30 17:26:24 UTC (rev 23130)
+++ trunk/vpe/tests/pom.xml 2010-06-30 19:46:55 UTC (rev 23131)
@@ -7,9 +7,10 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>vpe.tests</artifactId>
+ <groupId>org.jboss.tools.vpe</groupId>
+ <artifactId>tests</artifactId>
<version>0.0.1-SNAPSHOT</version>
+ <name>vpe.tests</name>
<packaging>pom</packaging>
<modules>
<module>org.jboss.tools.vpe.ui.test</module>
14 years, 6 months
JBoss Tools SVN: r23130 - in trunk/cdi: plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-06-30 13:26:24 -0400 (Wed, 30 Jun 2010)
New Revision: 23130
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/ObserverMethodInDecoratorBroken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/ObserverMethodInInterceptorBroken.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708 Added new validation rule: interceptor or decorator has a method with a parameter annotated @Observes
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-06-30 17:08:12 UTC (rev 23129)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-06-30 17:26:24 UTC (rev 23130)
@@ -499,6 +499,19 @@
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
}
+ /*
+ * 10.4.2. Declaring an observer method
+ * - interceptor or decorator has a method with a parameter annotated @Observes
+ */
+ if(bean instanceof IDecorator) {
+ for (ITextSourceReference declaration : declarations) {
+ addError(CDIValidationMessages.OBSERVER_IN_DECORATOR, CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource());
+ }
+ } else if(bean instanceof IInterceptor) {
+ for (ITextSourceReference declaration : declarations) {
+ addError(CDIValidationMessages.OBSERVER_IN_INTERCEPTOR, CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource());
+ }
+ }
validateSessionBeanMethod(bean, observer, declarations, CDIValidationMessages.ILLEGAL_OBSERVER_IN_SESSION_BEAN, CDIPreferences.ILLEGAL_OBSERVER_IN_SESSION_BEAN);
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-06-30 17:08:12 UTC (rev 23129)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-06-30 17:26:24 UTC (rev 23130)
@@ -93,7 +93,8 @@
public static String ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING;
public static String ILLEGAL_INTERCEPTOR_BINDING_METHOD;
public static String CONFLICTING_INTERCEPTOR_BINDINGS;
- public static String OBSERVER_IN_INTERCEPTOR_OR_DECORATOR;
+ public static String OBSERVER_IN_INTERCEPTOR;
+ public static String OBSERVER_IN_DECORATOR;
public static String INTERCEPTOR_IS_ALTERNATIVE;
public static String DECORATOR_IS_ALTERNATIVE;
public static String MISSING_INTERCEPTOR_BINDING;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-06-30 17:08:12 UTC (rev 23129)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-06-30 17:26:24 UTC (rev 23130)
@@ -158,16 +158,15 @@
- delegate type does not implement or extend a decorated type of the decorator,
or specifies different type parameters
-
-
-
-
-
9.2. Declaring the interceptor bindings of an interceptor
- interceptor for lifecycle callbacks declares an interceptor binding type
that is defined @Target({TYPE, METHOD})
- interceptor declared using @Interceptor does not declare any interceptor binding (Non-Portable behavior)
+
+
+
+
9.3. Binding an interceptor to a bean
- managed bean has a class level interceptor binding and is declared final
or has a non-static, non-private, final method
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-06-30 17:08:12 UTC (rev 23129)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-06-30 17:26:24 UTC (rev 23130)
@@ -72,7 +72,8 @@
ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING=Interceptor for lifecycle callbacks may only declare interceptor binding types that are defined as @Target(TYPE) [JSR-299 �9.2]
ILLEGAL_INTERCEPTOR_BINDING_METHOD=Non-static, non-private, final method of a managed bean has a interceptor binding (either method level, or declaring class level)
CONFLICTING_INTERCEPTOR_BINDINGS=The set of interceptor bindings of a bean or interceptor, including bindings inherited from stereotypes and other interceptor bindings, has two instances of a certain interceptor binding type and the instances have different values of some annotation member
-OBSERVER_IN_INTERCEPTOR_OR_DECORATOR=Interceptor or decorator has a method with a parameter annotated @Observes
+OBSERVER_IN_DECORATOR=Interceptor cannot have a method with a parameter annotated @Observes [JSR-299 �10.4.2]
+OBSERVER_IN_INTERCEPTOR=Decorator cannot have a method with a parameter annotated @Observes [JSR-299 �10.4.2]
INTERCEPTOR_IS_ALTERNATIVE=Interceptor is an alternative
DECORATOR_IS_ALTERNATIVE=Decorator is an alternative
MISSING_INTERCEPTOR_BINDING=Interceptor declared using @Interceptor should specify at least one interceptor binding [JSR-299 �9.2]
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-06-30 17:08:12 UTC (rev 23129)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-06-30 17:26:24 UTC (rev 23130)
@@ -115,7 +115,7 @@
{CDIPreferences.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalLifecycleCallbackInterceptorBinding_label},
// {CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalInterceptorBindingMethod_label},
// {CDIPreferences.CONFLICTING_INTERCEPTOR_BINDINGS, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_conflictingInterceptorBindings_label},
-// {CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_observerInInterceptorOrDecorator_label},
+ {CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_observerInInterceptorOrDecorator_label},
{CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_interceptorOrDecoratorIsAlternative_label},
{CDIPreferences.MISSING_INTERCEPTOR_BINDING, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingInterceptorBinding_label},
{CDIPreferences.INJECTED_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_injectedDecorator_label},
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/ObserverMethodInDecoratorBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/ObserverMethodInDecoratorBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/ObserverMethodInDecoratorBroken.java 2010-06-30 17:26:24 UTC (rev 23130)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.decorators;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+
+@Decorator
+public class ObserverMethodInDecoratorBroken {
+
+ @Inject @Delegate @Any Object logger;
+
+ public void observeSomeEvent(@Observes String someEvent) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/ObserverMethodInDecoratorBroken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml 2010-06-30 17:08:12 UTC (rev 23129)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml 2010-06-30 17:26:24 UTC (rev 23130)
@@ -3,5 +3,6 @@
<class>org.jboss.jsr299.tck.tests.jdt.validation.decorators.NamedDecoratorBroken</class>
<class>org.jboss.jsr299.tck.tests.jdt.validation.decorators.DecoratorWithWrongScopeBroken</class>
<class>org.jboss.jsr299.tck.tests.jdt.validation.decorators.AlternativeDecoratorBroken</class>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.decorators.ObserverMethodInDecoratorBroken</class>
</decorators>
</beans>
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/ObserverMethodInInterceptorBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/ObserverMethodInInterceptorBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/ObserverMethodInInterceptorBroken.java 2010-06-30 17:26:24 UTC (rev 23130)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.interceptors;
+
+import javax.enterprise.event.Observes;
+import javax.interceptor.Interceptor;
+
+@Interceptor
+@CatInterceptorBinding
+public class ObserverMethodInInterceptorBroken {
+
+ public void observeSomeEvent(@Observes String someEvent) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/ObserverMethodInInterceptorBroken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml 2010-06-30 17:08:12 UTC (rev 23129)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml 2010-06-30 17:26:24 UTC (rev 23130)
@@ -9,5 +9,6 @@
<class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.InterceptorWithLifeCycleMethodOk</class>
<class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.InterceptorWithPostConstructorBroken</class>
<class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.InterceptorWithPreDestroyBroken</class>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.ObserverMethodInInterceptorBroken</class>
</interceptors>
</beans>
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-06-30 17:08:12 UTC (rev 23129)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-06-30 17:26:24 UTC (rev 23130)
@@ -1261,6 +1261,28 @@
assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_OBSERVER_IN_SESSION_BEAN, 25);
}
+ /**
+ * 10.4.2. Declaring an observer method
+ * - interceptor has a method with a parameter annotated @Observes
+ *
+ * @throws Exception
+ */
+ public void testObserverMethodInInterceptor() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ObserverMethodInInterceptorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_INTERCEPTOR, 10);
+ }
+
+ /**
+ * 10.4.2. Declaring an observer method
+ * - decorator has a method with a parameter annotated @Observes
+ *
+ * @throws Exception
+ */
+ public void testObserverMethodInDecorator() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/ObserverMethodInDecoratorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_DECORATOR, 14);
+ }
+
public static int getMarkersNumber(IResource resource) {
return AbstractResourceMarkerTest.getMarkersNumberByGroupName(resource, null);
}
14 years, 6 months
JBoss Tools SVN: r23129 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-06-30 13:08:12 -0400 (Wed, 30 Jun 2010)
New Revision: 23129
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties
Log:
Added missed string
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties 2010-06-30 17:00:33 UTC (rev 23128)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties 2010-06-30 17:08:12 UTC (rev 23129)
@@ -16,6 +16,7 @@
RENAME_METHOD_PARTICIPANT_ERROR_PHANTOM_FILE=Cannot change phantom file: ''{0}''.
RENAME_METHOD_PARTICIPANT_ERROR_READ_ONLY_FILE=Cannot change read-only file: ''{0}''.
RENAME_METHOD_PARTICIPANT_UPDATE_METHOD_REFERENCES=Update method references in EL
+EL_REFACTOR_RENAME_HANDLER_ERROR=Operation failed
RESOURCE_BUNDLES_RENAME_PARTICIPANT_UPDATE_BUNDLE_REFERENCES=Update bundle references in EL
REFACTOR_CONTRIBUTOR_MAIN_MENU=EL Refactor
REFACTOR_CONTRIBUTOR_RENAME_EL_VARIABLE=Rename EL Variable
14 years, 6 months
JBoss Tools SVN: r23128 - trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-06-30 13:00:33 -0400 (Wed, 30 Jun 2010)
New Revision: 23128
Removed:
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUIMessages.java
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/messages.properties
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/messages_ja.properties
Log:
Deleted unused files
Deleted: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUIMessages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUIMessages.java 2010-06-30 16:50:48 UTC (rev 23127)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUIMessages.java 2010-06-30 17:00:33 UTC (rev 23128)
@@ -1,24 +0,0 @@
-package org.jboss.tools.common.el.ui;
-
-import org.eclipse.osgi.util.NLS;
-
-public class ElUIMessages {
- private static final String BUNDLE_NAME = "org.jboss.tools.common.el.ui.messages"; //$NON-NLS-1$
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, ElUIMessages.class);
- }
-
- public static String RENAME_METHOD_PARTICIPANT_GETTER_WARNING;
- public static String RENAME_METHOD_PARTICIPANT_SETTER_WARNING;
- public static String RENAME_METHOD_PARTICIPANT_OUT_OF_SYNC_FILE;
- public static String RENAME_METHOD_PARTICIPANT_ERROR_PHANTOM_FILE;
- public static String RENAME_METHOD_PARTICIPANT_ERROR_READ_ONLY_FILE;
- public static String RENAME_METHOD_PARTICIPANT_UPDATE_METHOD_REFERENCES;
- public static String RESOURCE_BUNDLES_RENAME_PARTICIPANT_UPDATE_BUNDLE_REFERENCES;
-
- public static String REFACTOR_CONTRIBUTOR_MAIN_MENU;
- public static String REFACTOR_CONTRIBUTOR_RENAME_EL_VARIABLE;
- public static String EL_REFACTOR_RENAME_HANDLER_ERROR;
- public static String RENAME_EL_VARIABLE_WIZARD_EL_VARIABLE_NAME;
-}
\ No newline at end of file
Deleted: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/messages.properties 2010-06-30 16:50:48 UTC (rev 23127)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/messages.properties 2010-06-30 17:00:33 UTC (rev 23128)
@@ -1 +0,0 @@
-SUBSTITUTED_EL_EXPRESSIONS=Substituted El expressions
Deleted: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/messages_ja.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/messages_ja.properties 2010-06-30 16:50:48 UTC (rev 23127)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/messages_ja.properties 2010-06-30 17:00:33 UTC (rev 23128)
@@ -1 +0,0 @@
-SUBSTITUTED_EL_EXPRESSIONS=\u7F6E\u63DB\u3055\u308C\u305F EL \u5F0F
14 years, 6 months
JBoss Tools SVN: r23127 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-06-30 12:50:48 -0400 (Wed, 30 Jun 2010)
New Revision: 23127
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithLifeCycleMethodOk.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithPostConstructorBroken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithPreDestroyBroken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/TypeInterceptorBinding.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotated.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanMethod.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotype.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMethod.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/QualifierDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ScopeDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708 Added new validation rule: interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -68,6 +68,9 @@
public String OBSERVERS_ANNOTATION_TYPE_NAME = "javax.enterprise.event.Observes";
public String INJECTIONPOINT_TYPE_NAME = "javax.enterprise.inject.spi.InjectionPoint";
-
+
public String INSTANCE_TYPE_NAME = "javax.enterprise.inject.Instance";
+
+ public String PRE_DESTROY_TYPE_NAME = "javax.annotation.PreDestroy";
+ public String POST_CONSTRUCTOR_TYPE_NAME = "javax.annotation.PostConstruct";
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -239,6 +239,33 @@
}
/**
+ * Returns the annotation declaration if it exists in the annotated element. If the
+ * annotation declared in a stereotype then returns this stereotype declaration.
+ * Returns null if there is not this annotation declaration neither corresponding
+ * stereotype declaration. Doesn't check if a stereotype is inherited or not.
+ *
+ * @param bean
+ * @param scopeTypeName
+ * @return
+ */
+ public static IAnnotationDeclaration getAnnotationDeclaration(IAnnotated annotated, ICDIAnnotation annotation) {
+ List<IAnnotationDeclaration> annotations = annotated.getAnnotations();
+ for (IAnnotationDeclaration annotationDeclaration : annotations) {
+ ICDIAnnotation annotationElement = annotationDeclaration.getAnnotation();
+ if(annotationElement!=null && annotation.equals(annotationElement)) {
+ return annotationDeclaration;
+ }
+ }
+ if(annotated instanceof IStereotyped) {
+ Set<IStereotypeDeclaration> stereoTypeDeclarations = ((IStereotyped)annotated).getStereotypeDeclarations();
+ for (IStereotypeDeclaration stereotypeDeclaration : stereoTypeDeclarations) {
+ getAnnotationDeclaration(stereotypeDeclaration.getStereotype(), annotation);
+ }
+ }
+ return null;
+ }
+
+ /**
* Return @Named declaration or the stereotype declaration if it declares @Named.
*
* @param stereotyped
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotated.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotated.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotated.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -12,7 +12,6 @@
import java.util.List;
-import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
import org.jboss.tools.common.text.ITextSourceReference;
/**
@@ -28,7 +27,7 @@
* @return all annotations of the element, or an empty list if no
* annotations are present
*/
- List<AnnotationDeclaration> getAnnotations();
+ List<IAnnotationDeclaration> getAnnotations();
/**
* Get element annotation of a certain annotation type.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -43,4 +43,11 @@
* @return the corresponding IType of the annotation
*/
IType getType();
+
+ /**
+ * Returns the corresponding annotation. May be null.
+ *
+ * @return the corresponding annotation
+ */
+ ICDIAnnotation getAnnotation();
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanMethod.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanMethod.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -46,4 +46,10 @@
* @return
*/
public boolean isObserver();
+
+ /**
+ * Returns true if method is annotated with @PreDestroy or @PostConstruct
+ * @return
+ */
+ public boolean isLifeCycleCallbackMethod();
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -41,11 +41,27 @@
Set<IBeanMethod> getBeanConstructors();
/**
+ * Returns a set of the methods that are declared in this bean class.
+ *
+ * @return a set of the methods that are declared in this bean class.
+ */
+ Set<IBeanMethod> getAllMethods();
+
+ /**
+ * Obtains the interceptor binding declarations of the class bean.
+ * This set includes bindings declared in this java class.
+ * Use getInterceptorBindings() to get all bindings (i.g. from Stereotypes)
+ *
+ * @return the set of interceptor binding declarations
+ */
+ Set<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations();
+
+ /**
* Obtains the interceptor bindings of the bean.
*
* @return the set of interceptor bindings
*/
- Set<IInterceptorBindingDeclaration> getInterceptorBindings();
+ Set<IInterceptorBinding> getInterceptorBindings();
/**
* Returns a set of observer methods of the bean.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -15,7 +15,7 @@
import org.eclipse.jdt.core.IMethod;
/**
- * Represents an interceptor binding type.
+ * Represents a qualifier.
*
* @author Viacheslav Kabanovich
*/
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotype.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotype.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotype.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -19,7 +19,7 @@
*
* @author Alexey Kazakov
*/
-public interface IStereotype extends IScoped, IStereotyped, ICDINamedAnnotation {
+public interface IStereotype extends IScoped, IStereotyped, ICDINamedAnnotation, IAnnotated {
/**
* Returns the location of @Name declaration of this stereotype. If the bean
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -44,5 +44,6 @@
defaultPreferences.put(CDIPreferences.INJECT_RESOLVES_TO_NULLABLE_BEAN, CDIPreferences.WARNING);
defaultPreferences.put(CDIPreferences.INJECTED_DECORATOR, CDIPreferences.WARNING);
defaultPreferences.put(CDIPreferences.INJECTED_INTERCEPTOR, CDIPreferences.WARNING);
+ defaultPreferences.put(CDIPreferences.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, CDIPreferences.WARNING);
}
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -62,13 +62,21 @@
return definition;
}
- public List<AnnotationDeclaration> getAnnotations() {
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotated#getAnnotations()
+ */
+ public List<IAnnotationDeclaration> getAnnotations() {
if(definition!=null) {
return definition.getAnnotations();
}
return Collections.emptyList();
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotated#getAnnotation(java.lang.String)
+ */
public IAnnotationDeclaration getAnnotation(String annotationTypeName) {
if(definition!=null) {
return definition.getAnnotation(annotationTypeName);
@@ -84,6 +92,10 @@
return getAnnotation(annotationTypeName);
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotated#isAnnotationPresent(java.lang.String)
+ */
public boolean isAnnotationPresent(String annotationTypeName) {
return definition!=null && definition.isAnnotationPresent(annotationTypeName);
}
@@ -116,7 +128,7 @@
public Set<IStereotypeDeclaration> getStereotypeDeclarations(boolean includeInherited) {
Set<IStereotypeDeclaration> result = new HashSet<IStereotypeDeclaration>();
- for (AnnotationDeclaration d: definition.getAnnotations()) {
+ for (IAnnotationDeclaration d: definition.getAnnotations()) {
if(d instanceof IStereotypeDeclaration) {
if(d instanceof IStereotypeDeclaration) {
result.add((IStereotypeDeclaration)d);
@@ -154,7 +166,7 @@
public Set<IQualifierDeclaration> getQualifierDeclarations(boolean includeInherited) {
Set<IQualifierDeclaration> result = new HashSet<IQualifierDeclaration>();
Set<IQualifier> qs = new HashSet<IQualifier>();
- for(AnnotationDeclaration a: definition.getAnnotations()) {
+ for(IAnnotationDeclaration a: definition.getAnnotations()) {
int k = getCDIProject().getNature().getDefinitions().getAnnotationKind(a.getType());
if(k == AnnotationDefinition.QUALIFIER) {
IQualifierDeclaration q = (IQualifierDeclaration)a;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -18,6 +18,7 @@
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.ICDIAnnotation;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
/**
@@ -76,7 +77,6 @@
return annotationTypeName;
}
-
public IType getType() {
return type;
}
@@ -89,4 +89,11 @@
return startPosition;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotationDeclaration#getAnnotation()
+ */
+ public ICDIAnnotation getAnnotation() {
+ return null;
+ }
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMethod.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMethod.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -87,4 +87,11 @@
return false;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IBeanMethod#isLifeCycleCallbackMethod()
+ */
+ public boolean isLifeCycleCallbackMethod() {
+ return definition.getAnnotation(CDIConstants.PRE_DESTROY_TYPE_NAME)!=null || definition.getAnnotation(CDIConstants.POST_CONSTRUCTOR_TYPE_NAME)!=null;
+ }
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -426,6 +426,15 @@
public static String getQualifierDeclarationKey(IQualifierDeclaration d) throws CoreException {
IQualifier q = d.getQualifier();
Set<IMethod> nb = q == null ? new HashSet<IMethod>() : q.getNonBindingMethods();
+ return getAnnotationDeclarationKey(d, nb);
+ }
+
+ public static String getAnnotationDeclarationKey(IAnnotationDeclaration d) throws CoreException {
+ return getAnnotationDeclarationKey(d, null);
+ }
+
+ public static String getAnnotationDeclarationKey(IAnnotationDeclaration d, Set<IMethod> ignoredMembers) throws CoreException {
+ Set<IMethod> nb = ignoredMembers == null ? new HashSet<IMethod>() : ignoredMembers;
IType type = d.getType();
IMethod[] ms = type.getMethods();
StringBuffer result = new StringBuffer();
@@ -581,10 +590,13 @@
return false;
}
AnnotationDefinition d = n.getDefinitions().getAnnotation(annotationType);
- List<AnnotationDeclaration> ds = d.getAnnotations();
- for (AnnotationDeclaration a: ds) {
- if(CDIConstants.NORMAL_SCOPE_ANNOTATION_TYPE_NAME.equals(a.getTypeName())) {
- return true;
+ List<IAnnotationDeclaration> ds = d.getAnnotations();
+ for (IAnnotationDeclaration a: ds) {
+ if(a instanceof AnnotationDeclaration) {
+ AnnotationDeclaration aa = (AnnotationDeclaration)a;
+ if(CDIConstants.NORMAL_SCOPE_ANNOTATION_TYPE_NAME.equals(aa.getTypeName())) {
+ return true;
+ }
}
}
return false;
@@ -598,22 +610,25 @@
return false;
}
AnnotationDefinition d = n.getDefinitions().getAnnotation(annotationType);
- List<AnnotationDeclaration> ds = d.getAnnotations();
- for (AnnotationDeclaration a: ds) {
- if(CDIConstants.NORMAL_SCOPE_ANNOTATION_TYPE_NAME.equals(a.getTypeName())) {
- IAnnotation ann = a.getDeclaration();
- try {
- IMemberValuePair[] ps = ann.getMemberValuePairs();
- if(ps != null) for (IMemberValuePair p: ps) {
- if("passivating".equals(p.getMemberName())) {
- Object o = p.getValue();
- return o != null && "true".equalsIgnoreCase(o.toString());
+ List<IAnnotationDeclaration> ds = d.getAnnotations();
+ for (IAnnotationDeclaration a: ds) {
+ if(a instanceof AnnotationDeclaration) {
+ AnnotationDeclaration aa = (AnnotationDeclaration)a;
+ if(CDIConstants.NORMAL_SCOPE_ANNOTATION_TYPE_NAME.equals(aa.getTypeName())) {
+ IAnnotation ann = a.getDeclaration();
+ try {
+ IMemberValuePair[] ps = ann.getMemberValuePairs();
+ if(ps != null) for (IMemberValuePair p: ps) {
+ if("passivating".equals(p.getMemberName())) {
+ Object o = p.getValue();
+ return o != null && "true".equalsIgnoreCase(o.toString());
+ }
}
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
}
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
+ return true;
}
- return true;
}
}
return false;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -23,13 +23,13 @@
import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBeanMethod;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInterceptorBinding;
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IParameter;
@@ -174,10 +174,14 @@
return result;
}
- public Set<IInterceptorBindingDeclaration> getInterceptorBindings() {
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IClassBean#getInterceptorBindingDeclarations()
+ */
+ public Set<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations() {
Set<IInterceptorBindingDeclaration> result = new HashSet<IInterceptorBindingDeclaration>();
- List<AnnotationDeclaration> as = definition.getAnnotations();
- for (AnnotationDeclaration a: as) {
+ List<IAnnotationDeclaration> as = definition.getAnnotations();
+ for (IAnnotationDeclaration a: as) {
if(a instanceof InterceptorBindingDeclaration) {
result.add((InterceptorBindingDeclaration)a);
}
@@ -185,6 +189,20 @@
return result;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IClassBean#getInterceptorBindings()
+ */
+ public Set<IInterceptorBinding> getInterceptorBindings() {
+ // TODO collect bindings from stereotypes. See https://jira.jboss.org/browse/JBIDE-6550
+ Set<IInterceptorBinding> result = new HashSet<IInterceptorBinding>();
+ Set<IInterceptorBindingDeclaration> declarations = getInterceptorBindingDeclarations();
+ for (IInterceptorBindingDeclaration declaration: declarations) {
+ result.add(declaration.getInterceptorBinding());
+ }
+ return result;
+ }
+
public Set<IBeanMethod> getObserverMethods() {
Set<IBeanMethod> result = new HashSet<IBeanMethod>();
for (BeanMethod m: methods) {
@@ -475,4 +493,13 @@
return false;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IClassBean#getAllMethods()
+ */
+ public Set<IBeanMethod> getAllMethods() {
+ Set<IBeanMethod> result = new HashSet<IBeanMethod>();
+ result.addAll(methods);
+ return result;
+ }
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingDeclaration.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingDeclaration.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl;
+import org.jboss.tools.cdi.core.ICDIAnnotation;
import org.jboss.tools.cdi.core.IInterceptorBinding;
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
@@ -25,8 +26,19 @@
d.copyTo(this);
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IInterceptorBindingDeclaration#getInterceptorBinding()
+ */
public IInterceptorBinding getInterceptorBinding() {
return project.getDelegate().getInterceptorBinding(getTypeName());
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotationDeclaration#getAnnotation()
+ */
+ public ICDIAnnotation getAnnotation() {
+ return getInterceptorBinding();
+ }
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -15,6 +15,7 @@
import java.util.Set;
import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IInterceptorBinding;
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
@@ -29,8 +30,8 @@
public Set<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations() {
Set<IInterceptorBindingDeclaration> result = new HashSet<IInterceptorBindingDeclaration>();
- List<AnnotationDeclaration> as = definition.getAnnotations();
- for (AnnotationDeclaration a: as) {
+ List<IAnnotationDeclaration> as = definition.getAnnotations();
+ for (IAnnotationDeclaration a: as) {
if(a instanceof InterceptorBindingDeclaration) {
result.add((InterceptorBindingDeclaration)a);
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -61,7 +61,7 @@
throw new RuntimeException("Not implemented because limitations of JDT model.");
}
- public List<AnnotationDeclaration> getAnnotations() {
+ public List<IAnnotationDeclaration> getAnnotations() {
throw new RuntimeException("Not implemented because limitations of JDT model.");
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/QualifierDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/QualifierDeclaration.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/QualifierDeclaration.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl;
+import org.jboss.tools.cdi.core.ICDIAnnotation;
import org.jboss.tools.cdi.core.IQualifier;
import org.jboss.tools.cdi.core.IQualifierDeclaration;
@@ -26,8 +27,19 @@
d.copyTo(this);
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IQualifierDeclaration#getQualifier()
+ */
public IQualifier getQualifier() {
return project.getDelegate().getQualifier(getTypeName());
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotationDeclaration#getAnnotation()
+ */
+ public ICDIAnnotation getAnnotation() {
+ return getQualifier();
+ }
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ScopeDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ScopeDeclaration.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ScopeDeclaration.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl;
+import org.jboss.tools.cdi.core.ICDIAnnotation;
import org.jboss.tools.cdi.core.IScope;
import org.jboss.tools.cdi.core.IScopeDeclaration;
@@ -26,8 +27,19 @@
d.copyTo(this);
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IScopeDeclaration#getScope()
+ */
public IScope getScope() {
return project.getDelegate().getScope(getTypeName());
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotationDeclaration#getAnnotation()
+ */
+ public ICDIAnnotation getAnnotation() {
+ return getScope();
+ }
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeDeclaration.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeDeclaration.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl;
+import org.jboss.tools.cdi.core.ICDIAnnotation;
import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
@@ -26,8 +27,19 @@
d.copyTo(this);
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IStereotypeDeclaration#getStereotype()
+ */
public IStereotype getStereotype() {
return project.getDelegate().getStereotype(getTypeName());
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotationDeclaration#getAnnotation()
+ */
+ public ICDIAnnotation getAnnotation() {
+ return getStereotype();
+ }
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,16 +10,19 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.jdt.core.IAnnotation;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
import org.jboss.tools.cdi.core.IScope;
import org.jboss.tools.cdi.core.IScopeDeclaration;
import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
*
@@ -52,8 +55,8 @@
*/
public Set<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations() {
Set<IInterceptorBindingDeclaration> result = new HashSet<IInterceptorBindingDeclaration>();
- List<AnnotationDeclaration> as = definition.getAnnotations();
- for (AnnotationDeclaration a: as) {
+ List<IAnnotationDeclaration> as = definition.getAnnotations();
+ for (IAnnotationDeclaration a: as) {
if(a instanceof InterceptorBindingDeclaration) {
result.add((InterceptorBindingDeclaration)a);
}
@@ -75,7 +78,7 @@
*/
public Set<IStereotypeDeclaration> getStereotypeDeclarations() {
Set<IStereotypeDeclaration> result = new HashSet<IStereotypeDeclaration>();
- for (AnnotationDeclaration d: definition.getAnnotations()) {
+ for (IAnnotationDeclaration d: definition.getAnnotations()) {
if(d instanceof IStereotypeDeclaration) {
result.add((IStereotypeDeclaration)d);
}
@@ -124,4 +127,42 @@
public Set<IScopeDeclaration> getScopeDeclarations() {
return ProducerField.getScopeDeclarations(getCDIProject().getNature(), definition.getAnnotations());
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotated#getAnnotations()
+ */
+ public List<IAnnotationDeclaration> getAnnotations() {
+ if(definition!=null) {
+ return definition.getAnnotations();
+ }
+ return Collections.emptyList();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotated#getAnnotation(java.lang.String)
+ */
+ public IAnnotationDeclaration getAnnotation(String annotationTypeName) {
+ if(definition!=null) {
+ return definition.getAnnotation(annotationTypeName);
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotated#getAnnotationPosition(java.lang.String)
+ */
+ public ITextSourceReference getAnnotationPosition(String annotationTypeName) {
+ return getAnnotation(annotationTypeName);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotated#isAnnotationPresent(java.lang.String)
+ */
+ public boolean isAnnotationPresent(String annotationTypeName) {
+ return definition!=null && definition.isAnnotationPresent(annotationTypeName);
+ }
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -23,6 +23,7 @@
import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IAnnotated;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
import org.jboss.tools.cdi.internal.core.impl.InterceptorBindingDeclaration;
import org.jboss.tools.cdi.internal.core.impl.QualifierDeclaration;
@@ -36,7 +37,7 @@
*
*/
public abstract class AbstractMemberDefinition implements IAnnotated {
- protected List<AnnotationDeclaration> annotations = new ArrayList<AnnotationDeclaration>();
+ protected List<IAnnotationDeclaration> annotations = new ArrayList<IAnnotationDeclaration>();
protected IAnnotatable member;
protected Map<String, AnnotationDeclaration> annotationsByType = new HashMap<String, AnnotationDeclaration>();
protected IResource resource;
@@ -88,7 +89,7 @@
* (non-Javadoc)
* @see org.jboss.tools.cdi.core.IAnnotated#getAnnotations()
*/
- public List<AnnotationDeclaration> getAnnotations() {
+ public List<IAnnotationDeclaration> getAnnotations() {
return annotations;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AnnotationDefinition.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -19,6 +19,7 @@
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
/**
@@ -63,9 +64,12 @@
}
Map<String, AnnotationDeclaration> ds = new HashMap<String, AnnotationDeclaration>();
- for (AnnotationDeclaration a: annotations) {
- String typeName = a.getTypeName();
- ds.put(typeName, a);
+ for (IAnnotationDeclaration a: annotations) {
+ if(a instanceof AnnotationDeclaration) {
+ AnnotationDeclaration aa = (AnnotationDeclaration)a;
+ String typeName = aa.getTypeName();
+ ds.put(typeName, aa);
+ }
}
if(ds.containsKey(CDIConstants.SCOPE_ANNOTATION_TYPE_NAME)
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl.definition;
import org.jboss.tools.cdi.core.CDIConstants;
@@ -12,18 +22,27 @@
this.typeDefinition = typeDefinition;
}
+ @Override
public AbstractTypeDefinition getTypeDefinition() {
return typeDefinition;
}
public boolean isCDIAnnotated() {
- return getInjectAnnotation() != null || getProducesAnnotation() != null;
+ return getInjectAnnotation() != null || getProducesAnnotation() != null || getPreDestroyMethod() != null || getPostConstructorMethod() != null;
}
public AnnotationDeclaration getProducesAnnotation() {
return annotationsByType.get(CDIConstants.PRODUCES_ANNOTATION_TYPE_NAME);
}
+ public AnnotationDeclaration getPreDestroyMethod() {
+ return annotationsByType.get(CDIConstants.PRE_DESTROY_TYPE_NAME);
+ }
+
+ public AnnotationDeclaration getPostConstructorMethod() {
+ return annotationsByType.get(CDIConstants.POST_CONSTRUCTOR_TYPE_NAME);
+ }
+
public AnnotationDeclaration getInjectAnnotation() {
return annotationsByType.get(CDIConstants.INJECT_ANNOTATION_TYPE_NAME);
}
@@ -31,5 +50,4 @@
public AnnotationDeclaration getDelegateAnnotation() {
return annotationsByType.get(CDIConstants.DELEGATE_STEREOTYPE_TYPE_NAME);
}
-
-}
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -72,7 +72,7 @@
*
* @see org.jboss.tools.cdi.core.IAnnotated#getAnnotations()
*/
- public List<AnnotationDeclaration> getAnnotations() {
+ public List<IAnnotationDeclaration> getAnnotations() {
return Collections.emptyList();
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -19,6 +19,7 @@
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
import org.jboss.tools.cdi.internal.core.impl.ParametedType;
@@ -40,7 +41,7 @@
protected void init(IType contextType, DefinitionContext context) throws CoreException {
super.init(contextType, context);
isAbstract = Flags.isAbstract(type.getFlags());
- for (AnnotationDeclaration a: annotations) {
+ for (IAnnotationDeclaration a: annotations) {
//provide initialization
context.getAnnotationKind(a.getType());
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -347,7 +347,7 @@
}
if (bean instanceof IClassBean) {
- Set<IInterceptorBindingDeclaration> bindingDeclarations = ((IClassBean) bean).getInterceptorBindings();
+ Set<IInterceptorBindingDeclaration> bindingDeclarations = ((IClassBean) bean).getInterceptorBindingDeclarations();
for (IInterceptorBindingDeclaration bindingDeclaration : bindingDeclarations) {
IInterceptorBinding binding = bindingDeclaration.getInterceptorBinding();
if (!binding.getSourceType().isReadOnly()) {
@@ -1253,12 +1253,52 @@
* 9.2. Declaring the interceptor bindings of an interceptor
* - interceptor declared using @Interceptor does not declare any interceptor binding (Non-Portable behavior)
*/
- Set<IInterceptorBindingDeclaration> bindings = interceptor.getInterceptorBindings();
+ Set<IInterceptorBinding> bindings = interceptor.getInterceptorBindings();
if(bindings.isEmpty()) {
ITextSourceReference declaration = interceptor.getAnnotation(CDIConstants.INTERCEPTOR_ANNOTATION_TYPE_NAME);
if(declaration!=null) {
addError(CDIValidationMessages.MISSING_INTERCEPTOR_BINDING, CDIPreferences.MISSING_INTERCEPTOR_BINDING, declaration, interceptor.getResource());
}
+ } else {
+ /*
+ * 9.2. Declaring the interceptor bindings of an interceptor
+ * - interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
+ */
+ for (IInterceptorBinding binding : bindings) {
+ boolean markedAsWrong = false;
+ IAnnotationDeclaration target = binding.getAnnotationDeclaration(CDIConstants.TARGET_ANNOTATION_TYPE_NAME);
+ if(target!=null) {
+ try {
+ IMemberValuePair[] ps = target.getDeclaration().getMemberValuePairs();
+ if (ps != null && ps.length==1) {
+ IMemberValuePair pair = ps[0];
+ Object value = pair.getValue();
+ if(value != null && value instanceof Object[]) {
+ Object[] values = (Object[]) value;
+ if(values.length>1) {
+ Set<IBeanMethod> methods = interceptor.getAllMethods();
+ for (IBeanMethod method : methods) {
+ if(method.isLifeCycleCallbackMethod()) {
+ ITextSourceReference declaration = CDIUtil.getAnnotationDeclaration(interceptor, binding);
+ if(declaration==null) {
+ declaration = interceptor.getInterceptorAnnotation();
+ }
+ addError(CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, CDIPreferences.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, declaration, interceptor.getResource());
+ markedAsWrong = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ }
+ if(markedAsWrong) {
+ break;
+ }
+ }
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-06-30 16:50:48 UTC (rev 23127)
@@ -69,7 +69,7 @@
ILLEGAL_INJECTION_POINT_DELEGATE=Injection point that is a producer method parameter cannot be annotated @Delegate [JSR-299 �8.1.2]
ILLEGAL_BEAN_DECLARING_DELEGATE=Bean class that is not a decorator cannot have an injection point annotated @Delegate [JSR-299 �8.1.2]
DELEGATE_HAS_ILLEGAL_TYPE=The delegate type must implement or extend the decorated type {0} [JSR-299 �8.1.3]
-ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING=Interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
+ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING=Interceptor for lifecycle callbacks may only declare interceptor binding types that are defined as @Target(TYPE) [JSR-299 �9.2]
ILLEGAL_INTERCEPTOR_BINDING_METHOD=Non-static, non-private, final method of a managed bean has a interceptor binding (either method level, or declaring class level)
CONFLICTING_INTERCEPTOR_BINDINGS=The set of interceptor bindings of a bean or interceptor, including bindings inherited from stereotypes and other interceptor bindings, has two instances of a certain interceptor binding type and the instances have different values of some annotation member
OBSERVER_IN_INTERCEPTOR_OR_DECORATOR=Interceptor or decorator has a method with a parameter annotated @Observes
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -112,7 +112,7 @@
{CDIPreferences.ILLEGAL_INJECTION_POINT_DELEGATE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalInjectionPointDelegate_label},
{CDIPreferences.ILLEGAL_BEAN_DECLARING_DELEGATE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalBeanDeclaringDelegate_label},
{CDIPreferences.DELEGATE_HAS_ILLEGAL_TYPE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_delegateHasIllegalType_label},
-// {CDIPreferences.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalLifecycleCallbackInterceptorBinding_label},
+ {CDIPreferences.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalLifecycleCallbackInterceptorBinding_label},
// {CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalInterceptorBindingMethod_label},
// {CDIPreferences.CONFLICTING_INTERCEPTOR_BINDINGS, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_conflictingInterceptorBindings_label},
// {CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_observerInInterceptorOrDecorator_label},
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithLifeCycleMethodOk.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithLifeCycleMethodOk.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithLifeCycleMethodOk.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.interceptors;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.interceptor.Interceptor;
+
+@TypeInterceptorBinding
+@Interceptor
+public class InterceptorWithLifeCycleMethodOk {
+
+ @PostConstruct
+ public void initialize() {
+ }
+
+ @PreDestroy
+ public void destroy() {
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithLifeCycleMethodOk.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithPostConstructorBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithPostConstructorBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithPostConstructorBroken.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.interceptors;
+
+import javax.annotation.PostConstruct;
+import javax.interceptor.Interceptor;
+
+@Interceptor
+@InterceptorStereotype
+public class InterceptorWithPostConstructorBroken {
+
+ @PostConstruct
+ public void initialize() {
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithPostConstructorBroken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithPreDestroyBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithPreDestroyBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithPreDestroyBroken.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.interceptors;
+
+import javax.annotation.PreDestroy;
+import javax.interceptor.Interceptor;
+
+@Interceptor
+@CatInterceptorBinding
+public class InterceptorWithPreDestroyBroken {
+
+ @PreDestroy
+ public void destroy() {
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithPreDestroyBroken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/TypeInterceptorBinding.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/TypeInterceptorBinding.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/TypeInterceptorBinding.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.interceptors;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.interceptor.InterceptorBinding;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@InterceptorBinding
+@Inherited
+@Target({ TYPE })
+@Retention(RUNTIME)
+@Documented
+public @interface TypeInterceptorBinding {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/TypeInterceptorBinding.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml 2010-06-30 16:50:48 UTC (rev 23127)
@@ -6,5 +6,8 @@
<class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.AlternativeInterceptorBroken</class>
<class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.CatInterceptor</class>
<class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.NoInterceptorBinfdingsInInterceptor</class>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.InterceptorWithLifeCycleMethodOk</class>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.InterceptorWithPostConstructorBroken</class>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.InterceptorWithPreDestroyBroken</class>
</interceptors>
</beans>
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -32,6 +32,6 @@
IBean bean = beans.iterator().next();
assertTrue("The bean should be an interceptor", bean instanceof IClassBean);
IClassBean interceptor = (IClassBean)bean;
- assertFalse("The intercpetor should inherites interceptor bindings", interceptor.getInterceptorBindings().isEmpty());
+ assertFalse("The intercpetor should inherites interceptor bindings", interceptor.getInterceptorBindingDeclarations().isEmpty());
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -22,6 +22,7 @@
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.ICDIAnnotation;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
@@ -182,6 +183,10 @@
public int getStartPosition() {
return 0;
}
+
+ public ICDIAnnotation getAnnotation() {
+ return null;
+ }
};
return annotationDeclaration;
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-06-30 15:40:58 UTC (rev 23126)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-06-30 16:50:48 UTC (rev 23127)
@@ -1170,6 +1170,43 @@
}
/**
+ * 9.2. Declaring the interceptor bindings of an interceptor
+ * - interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
+ * @PreDestroy
+ *
+ * @throws Exception
+ */
+ public void testInterceptorBinfdingsInInterceptorWithPreDestroyBroken() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithPreDestroyBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
+ }
+
+ /**
+ * 9.2. Declaring the interceptor bindings of an interceptor
+ * - interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
+ * @PostConstruct
+ *
+ * @throws Exception
+ */
+ public void testInterceptorBinfdingsInInterceptorWithPostConstructBroken() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithPostConstructorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
+ }
+
+ /**
+ * 9.2. Declaring the interceptor bindings of an interceptor
+ * - interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
+ *
+ * @throws Exception
+ */
+ public void testInterceptorBinfdingsInInterceptorWithLifeCycleMethodOk() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithLifeCycleMethodOk.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/CatInterceptor.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
+ }
+
+ /**
* 10.4.2. Declaring an observer method
* - method has more than one parameter annotated @Observes
*
@@ -1245,6 +1282,6 @@
}
private static String convertMessageToPatern(String message) {
- return message.replace("[", "\\[").replace("]", "\\]").replace("<", "\\<").replace(">", "\\>");
+ return message.replace("[", "\\[").replace("]", "\\]").replace("<", "\\<").replace(">", "\\>").replace("(", "\\(").replace(")", "\\)");
}
}
\ No newline at end of file
14 years, 6 months
JBoss Tools SVN: r23126 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-06-30 11:40:58 -0400 (Wed, 30 Jun 2010)
New Revision: 23126
Modified:
trunk/build/publish.sh
Log:
avoid destroying last-good update site -- don't publish if errors/failures found in logs
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2010-06-30 15:07:56 UTC (rev 23125)
+++ trunk/build/publish.sh 2010-06-30 15:40:58 UTC (rev 23126)
@@ -6,6 +6,8 @@
# define target zip filename for inclusion in uberbuilder's bucky aggregator
SNAPNAME=${JOB_NAME}-Update-SNAPSHOT.zip
+if [[ $DESTINATION == "" ]]; then DESTINATION="tools@filemgmt.jboss.org:/downloads_htdocs/tools/builds/nightly/3.2.helios"; fi
+
# cleanup from last time
rm -fr ${WORKSPACE}/site; mkdir -p ${WORKSPACE}/site/${JOB_NAME}
@@ -45,32 +47,32 @@
rsync -aq $z ${WORKSPACE}/site/${SNAPNAME}
done
-# publish to download.jboss.org
-if [[ $DESTINATION == "" ]]; then DESTINATION="tools@filemgmt.jboss.org:/downloads_htdocs/tools/builds/nightly/3.2.helios"; fi
-if [[ -d ${WORKSPACE}/site/${JOB_NAME} ]]; then
- rsync -arzq --delete ${WORKSPACE}/site/${JOB_NAME} $DESTINATION/
-fi
-if [[ -f ${WORKSPACE}/site/${SNAPNAME} ]]; then
- # publish snapshot zip
- rsync -arzq --delete ${WORKSPACE}/site/${SNAPNAME} $DESTINATION/
-fi
-
# get full build log and filter out Maven test failures
bl=${WORKSPACE}/site/${JOB_NAME}/BUILDLOG.txt
wget -q http://hudson.qa.jboss.com/hudson/job/${JOB_NAME}/${BUILD_NUMBER}/console... -O ${bl}
-
fl=${WORKSPACE}/site/${JOB_NAME}/FAIL_LOG.txt
sed -ne "/<<< FAI/,+9 p" ${bl} | sed -e "/AILURE/,+9 s/\(.\+AILURE.\+\)/\n----------\n\n\1/g" > ${fl}
-cnt=$(sed -ne "/FAI\|LURE/ p" ${fl} | wc -l)
-if [[ $cnt != "0" ]]; then
- echo "" >> ${fl}; echo -n "FAI" >> ${fl}; echo -n "LURES FOUND: "$cnt >> ${fl};
+fc=$(sed -ne "/FAI\|LURE/ p" ${fl} | wc -l)
+if [[ $fc != "0" ]]; then
+ echo "" >> ${fl}; echo -n "FAI" >> ${fl}; echo -n "LURES FOUND: "$fc >> ${fl};
fi
el=${WORKSPACE}/site/${JOB_NAME}/ERRORLOG.txt
sed -ne "/<<< ERR/,+9 p" ${bl} | sed -e "/RROR/,+9 s/\(.\+RROR.\+\)/\n----------\n\n\1/g" > ${el}
sed -ne "/\[ERR/,+2 p" ${bl} | sed -e "/ROR\] Fai/,+2 s/\(.\+ROR\] Fai.\+\)/\n----------\n\n\1/g" >> ${el}
-cnt=$(sed -ne "/ERR\|RROR/ p" ${el} | wc -l)
-if [[ $cnt != "0" ]]; then
- echo "" >> ${el}; echo -n "ERR" >> ${el}; echo "ORS FOUND: "$cnt >> ${el};
+ec=$(sed -ne "/ERR\|RROR/ p" ${el} | wc -l)
+if [[ $ec != "0" ]]; then
+ echo "" >> ${el}; echo -n "ERR" >> ${el}; echo "ORS FOUND: "$ec >> ${el};
fi
+rsync -arzq ${WORKSPACE}/site/${JOB_NAME}/*LOG.txt $DESTINATION/${JOB_NAME}/
-rsync -arzq ${WORKSPACE}/site/${JOB_NAME}/*LOG.txt $DESTINATION/${JOB_NAME}/
+# publish to download.jboss.org, unless errors found - avoid destroying last-good update site
+if [[ $ec == "0" ]] && [[ $fc == "0" ]]; then
+ if [[ -d ${WORKSPACE}/site/${JOB_NAME} ]]; then
+ rsync -arzq --delete ${WORKSPACE}/site/${JOB_NAME} $DESTINATION/
+ fi
+ if [[ -f ${WORKSPACE}/site/${SNAPNAME} ]]; then
+ # publish snapshot zip
+ rsync -arzq --delete ${WORKSPACE}/site/${SNAPNAME} $DESTINATION/
+ fi
+fi
+
14 years, 6 months
JBoss Tools SVN: r23125 - trunk.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-06-30 11:07:56 -0400 (Wed, 30 Jun 2010)
New Revision: 23125
Modified:
trunk/parent-pom.xml
Log:
use 0.9.0 instead of 0.10.0-SNAPSHOT
Modified: trunk/parent-pom.xml
===================================================================
--- trunk/parent-pom.xml 2010-06-30 13:06:53 UTC (rev 23124)
+++ trunk/parent-pom.xml 2010-06-30 15:07:56 UTC (rev 23125)
@@ -8,7 +8,8 @@
<packaging>pom</packaging>
<properties>
- <tychoVersion>0.10.0-SNAPSHOT</tychoVersion>
+ <!-- <tychoVersion>0.10.0-SNAPSHOT</tychoVersion> -->
+ <tychoVersion>0.9.0</tychoVersion>
<scmBranch>trunk</scmBranch>
<BUILD_ALIAS>M1</BUILD_ALIAS>
<memoryOptions1>-Xms512m -Xmx1024m -XX:PermSize=256m</memoryOptions1>
14 years, 6 months
JBoss Tools SVN: r23124 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-06-30 09:06:53 -0400 (Wed, 30 Jun 2010)
New Revision: 23124
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java
Log:
https://jira.jboss.org/browse/JBIDE-6542 :
VPE Templates affected by changes in org.eclipse.wst.xml.core.internal.document.ElementImpl
- minor change: added missing NON-NLS tags
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java 2010-06-30 12:53:55 UTC (rev 23123)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java 2010-06-30 13:06:53 UTC (rev 23124)
@@ -699,7 +699,7 @@
.getAttribute(RichFaces.ATTR_SHOW_BUTTON_LABELS));
for (String key : labelsKeys) {
- if (sourceElement.hasAttribute(key + "Label")) {
+ if (sourceElement.hasAttribute(key + "Label")) { //$NON-NLS-1$
String label = sourceElement.getAttribute(key + "Label"); //$NON-NLS-1$
labels.put(key, label);
}
@@ -710,7 +710,7 @@
// prepare style classes
Set<String> styleClassesKeys = defaultStyleClasses.keySet();
for (String key : styleClassesKeys) {
- if (sourceElement.hasAttribute(key + "Class")) {
+ if (sourceElement.hasAttribute(key + "Class")) { //$NON-NLS-1$
String styleClass = sourceElement.getAttribute(key + "Class"); //$NON-NLS-1$
styleClasses.put(key, defaultStyleClasses.get(key) + " " //$NON-NLS-1$
+ styleClass);
14 years, 6 months
JBoss Tools SVN: r23123 - in trunk/jsf/plugins: org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-06-30 08:53:55 -0400 (Wed, 30 Jun 2010)
New Revision: 23123
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JSF2CompositeAttributeTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPickListTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelTemplate.java
Log:
https://jira.jboss.org/browse/JBIDE-6542 :
VPE Templates affected by changes in org.eclipse.wst.xml.core.internal.document.ElementImpl
- patch from Denis Vinnichek is applied
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JSF2CompositeAttributeTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JSF2CompositeAttributeTemplate.java 2010-06-30 12:09:22 UTC (rev 23122)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JSF2CompositeAttributeTemplate.java 2010-06-30 12:53:55 UTC (rev 23123)
@@ -30,14 +30,14 @@
nsIDOMDocument visualDocument) {
Element sourceElement = (Element) sourceNode;
String name = sourceElement.getAttribute(JSF.ATTR_NAME);
- String defaultValue = sourceElement.getAttribute(JSF.ATTR_DEFAULT);
//we should register attributes only if we process this as custom component, but not when we open component definition page
if(!pageContext.getVisualBuilder().isCurrentMainDocument()){
String compositionCustomElementAttributeKey = Jsf2CustomComponentTemplate.JSF2_CUSTOM_COMPONENT_PARAMETR_KEY +name;
if(pageContext.getCustomElementsAttributes().containsKey(compositionCustomElementAttributeKey)){
pageContext.addAttributeInCustomElementsMap(JSF.CUSTOM_COMPONENT_ATTR_PREFIX+name,
pageContext.getCustomElementsAttributes().get(compositionCustomElementAttributeKey));
- }else if(defaultValue!=null) {
+ }else if(sourceElement.hasAttribute(JSF.ATTR_DEFAULT)) {
+ String defaultValue = sourceElement.getAttribute(JSF.ATTR_DEFAULT);
pageContext.addAttributeInCustomElementsMap(JSF.CUSTOM_COMPONENT_ATTR_PREFIX+name, defaultValue);
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2010-06-30 12:09:22 UTC (rev 23122)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2010-06-30 12:53:55 UTC (rev 23123)
@@ -493,11 +493,7 @@
* @return the attribute
*/
public static String getAttribute(Element sourceElement, String attributeName, String defaultValue) {
- String attribute = sourceElement.getAttribute(attributeName);
- if (attribute == null) {
- attribute = defaultValue;
- }
- return attribute;
+ return sourceElement.hasAttribute(attributeName) ? sourceElement.getAttribute(attributeName) : defaultValue;
}
/**
@@ -651,7 +647,7 @@
public static void correctAttribute(Element sourceNode, nsIDOMElement targetNode,
String sourceAttrName, String targetAttrName,
String prefValue, String defValue) {
- String attrValue = ((Element) sourceNode).getAttribute(sourceAttrName);
+ String attrValue = sourceNode.hasAttribute(sourceAttrName) ? sourceNode.getAttribute(sourceAttrName) : null;
if (prefValue != null && prefValue.trim().length() > 0 && attrValue != null) {
attrValue = prefValue.trim() + Constants.WHITE_SPACE + attrValue;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2010-06-30 12:09:22 UTC (rev 23122)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2010-06-30 12:53:55 UTC (rev 23123)
@@ -618,9 +618,9 @@
inputStyle = DEFAULT_INPUT_STYLE + Constants.SEMICOLON
+ sourceElement.getAttribute(RichFaces.ATTR_INPUT_STYLE);
+ String inputClassAttrVal = sourceElement.hasAttribute(RichFaces.ATTR_INPUT_CLASS) ? sourceElement.getAttribute(RichFaces.ATTR_INPUT_CLASS) : null;
// inputClass
- inputClass = CSS_R_C_INPUT + Constants.WHITE_SPACE
- + sourceElement.getAttribute(RichFaces.ATTR_INPUT_CLASS);
+ inputClass = CSS_R_C_INPUT + Constants.WHITE_SPACE + inputClassAttrVal;
// inputSize
inputSize = sourceElement.hasAttribute(RichFaces.ATTR_INPUT_SIZE) ? sourceElement
@@ -662,7 +662,7 @@
buttonIcon = buttonIcon.replace('\\', '/');
// buttonClass
- buttonClass = sourceElement.getAttribute(RichFaces.ATTR_BUTTON_CLASS);
+ buttonClass = sourceElement.hasAttribute(RichFaces.ATTR_BUTTON_CLASS) ? sourceElement.getAttribute(RichFaces.ATTR_BUTTON_CLASS) : null;
// showWeekDaysBar
showWeekDaysBar = (!sourceElement
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2010-06-30 12:09:22 UTC (rev 23122)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2010-06-30 12:53:55 UTC (rev 23123)
@@ -108,9 +108,9 @@
} else {
columnClass = "dr-table-cell rich-table-cell"; //$NON-NLS-1$
}
-
- String styleClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
- if (styleClass != null) {
+
+ if (sourceElement.hasAttribute(RichFaces.ATTR_STYLE_CLASS)) {
+ String styleClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
columnClass += " " + styleClass; //$NON-NLS-1$
}
return columnClass;
@@ -172,11 +172,10 @@
* @return <code>IMG</code> tag if it is necessary, <code>null</code> otherwise */
public static nsIDOMElement getHeaderIcon(VpePageContext pageContext, Element column, nsIDOMDocument visualDocument) {
String sortable = ComponentUtil.getAttribute(column, RichFaces.ATTR_SORTABLE);
- String sortBy = column.getAttribute(RichFaces.ATTR_SORT_BY);
- if (RichFaces.VALUE_TRUE.equals(sortable) || sortBy != null) {
- nsIDOMElement img = visualDocument.createElement(HTML.TAG_IMG);
- String sortIcon = column.getAttribute(RichFaces.ATTR_SORT_ICON);
- if (sortIcon != null) {
+ if (RichFaces.VALUE_TRUE.equals(sortable) || column.hasAttribute(RichFaces.ATTR_SORT_BY)) {
+ nsIDOMElement img = visualDocument.createElement(HTML.TAG_IMG);
+ if (column.hasAttribute(RichFaces.ATTR_SORT_ICON)) {
+ String sortIcon = column.getAttribute(RichFaces.ATTR_SORT_ICON);
sortIcon = VpeStyleUtil.addFullPathToImgSrc(sortIcon, pageContext, true);
sortIcon = sortIcon.replace('\\', '/');
img.setAttribute(HTML.ATTR_SRC, sortIcon);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java 2010-06-30 12:09:22 UTC (rev 23122)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java 2010-06-30 12:53:55 UTC (rev 23123)
@@ -361,8 +361,8 @@
// ComponentUtil.copyAttributes(sourceNode, basicTable);
basicTable.setAttribute(HTML.ATTR_CLASS, styleClasses.get("style")); //$NON-NLS-1$
- basicTable.setAttribute(HTML.ATTR_STYLE, sourceElement
- .getAttribute(RichFaces.ATTR_STYLE));
+ String styleAttr = sourceElement.hasAttribute(RichFaces.ATTR_STYLE) ? sourceElement.getAttribute(RichFaces.ATTR_STYLE) : null;
+ basicTable.setAttribute(HTML.ATTR_STYLE, styleAttr);
VpeCreationData creationData = new VpeCreationData(basicTable);
creationData.addChildrenInfo(new VpeChildrenInfo(null));
@@ -699,11 +699,10 @@
.getAttribute(RichFaces.ATTR_SHOW_BUTTON_LABELS));
for (String key : labelsKeys) {
-
- String label = sourceElement.getAttribute(key + "Label"); //$NON-NLS-1$
-
- if (label != null)
+ if (sourceElement.hasAttribute(key + "Label")) {
+ String label = sourceElement.getAttribute(key + "Label"); //$NON-NLS-1$
labels.put(key, label);
+ }
else
labels.put(key, defaultLabels.get(key));
}
@@ -711,11 +710,11 @@
// prepare style classes
Set<String> styleClassesKeys = defaultStyleClasses.keySet();
for (String key : styleClassesKeys) {
-
- String styleClass = sourceElement.getAttribute(key + "Class"); //$NON-NLS-1$
- if (styleClass != null)
+ if (sourceElement.hasAttribute(key + "Class")) {
+ String styleClass = sourceElement.getAttribute(key + "Class"); //$NON-NLS-1$
styleClasses.put(key, defaultStyleClasses.get(key) + " " //$NON-NLS-1$
+ styleClass);
+ }
else
styleClasses.put(key, defaultStyleClasses.get(key));
}
@@ -737,20 +736,18 @@
}
}
-
- // get rowClass
- String rowClasses = sourceElement
- .getAttribute(RichFaces.ATTR_ROW_CLASSES);
-
- // if this attribue exist then
- if (rowClasses != null) {
+
+ // if attribue exist then
+ if (sourceElement.hasAttribute(RichFaces.ATTR_ROW_CLASSES)) {
+ // get rowClass
+ String rowClasses = sourceElement.getAttribute(RichFaces.ATTR_ROW_CLASSES);
rowClass = rowClasses.split("[,;]")[0]; //$NON-NLS-1$
}
-
- String columnClassesAtribute = sourceElement
- .getAttribute(RichFaces.ATTR_COLUMN_CLASSES);
- if (columnClassesAtribute != null)
+
+ if (sourceElement.hasAttribute(RichFaces.ATTR_COLUMN_CLASSES)) {
+ String columnClassesAtribute = sourceElement.getAttribute(RichFaces.ATTR_COLUMN_CLASSES);
columnClasses = Arrays.asList(columnClassesAtribute.split("[,;]")); //$NON-NLS-1$
+ }
else
columnClasses = new ArrayList<String>();
@@ -780,36 +777,36 @@
// prepare buttons attributes
sourceButtonsAlign = sourceElement
- .getAttribute(ATTR_MOVE_CONTROLS_VERTICAL_ALIGN) != null ? sourceElement
+ .hasAttribute(ATTR_MOVE_CONTROLS_VERTICAL_ALIGN) ? sourceElement
.getAttribute(ATTR_MOVE_CONTROLS_VERTICAL_ALIGN)
: DEFAULT_BUTTON_ALIGN;
targetButtonsAlign = sourceElement
- .getAttribute(ATTR_ORDER_CONTROLS_VERTICAL_ALIGN) != null ? sourceElement
+ .hasAttribute(ATTR_ORDER_CONTROLS_VERTICAL_ALIGN) ? sourceElement
.getAttribute(ATTR_ORDER_CONTROLS_VERTICAL_ALIGN)
: DEFAULT_BUTTON_ALIGN;
// prepare lists attributes
- listsHeight = sourceElement.getAttribute(ATTR_LISTS_HEIGHT);
- if (listsHeight == null) {
- listsHeight = DEFAULT_LIST_HEIGHT;
+ if (sourceElement.hasAttribute(ATTR_LISTS_HEIGHT)) {
+ String listsHeightVal = sourceElement.getAttribute(ATTR_LISTS_HEIGHT);
+ listsHeight = VpeStyleUtil.addPxIfNecessary(listsHeightVal);
} else {
- listsHeight = VpeStyleUtil.addPxIfNecessary(listsHeight);
+ listsHeight = DEFAULT_LIST_HEIGHT;
}
- sourceListsWidth = sourceElement.getAttribute(ATTR_SOURCE_LIST_WIDTH);
- if (sourceListsWidth == null) {
- sourceListsWidth = DEFAULT_LIST_WIDTH;
+ if (sourceElement.hasAttribute(ATTR_SOURCE_LIST_WIDTH)) {
+ String listWidthVal = sourceElement.getAttribute(ATTR_SOURCE_LIST_WIDTH);
+ sourceListsWidth = VpeStyleUtil.addPxIfNecessary(listWidthVal);
} else {
- sourceListsWidth = VpeStyleUtil.addPxIfNecessary(sourceListsWidth);
+ sourceListsWidth = DEFAULT_LIST_WIDTH;
}
-
- targetListsWidth = sourceElement.getAttribute(ATTR_TARGET_LIST_WIDTH);
- if (targetListsWidth == null) {
- targetListsWidth = DEFAULT_LIST_WIDTH;
+
+ if (sourceElement.hasAttribute(ATTR_TARGET_LIST_WIDTH)) {
+ String listWidthVal = sourceElement.getAttribute(ATTR_TARGET_LIST_WIDTH);
+ targetListsWidth = VpeStyleUtil.addPxIfNecessary(listWidthVal);
} else {
- targetListsWidth = VpeStyleUtil.addPxIfNecessary(targetListsWidth);
+ targetListsWidth = DEFAULT_LIST_WIDTH;
}
}
@@ -904,7 +901,7 @@
String headerClass = styleClasses.get("headerCell"); //$NON-NLS-1$
if ((child instanceof Element)
- && (((Element) child).getAttribute("headerClass")) != null) { //$NON-NLS-1$
+ && ((Element) child).hasAttribute("headerClass")) { //$NON-NLS-1$
headerClass += " " //$NON-NLS-1$
+ ((Element) child).getAttribute("headerClass"); //$NON-NLS-1$
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPickListTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPickListTemplate.java 2010-06-30 12:09:22 UTC (rev 23122)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPickListTemplate.java 2010-06-30 12:53:55 UTC (rev 23123)
@@ -299,7 +299,8 @@
creationData.addChildrenInfo(new VpeChildrenInfo(null));
rootTable.setAttribute(HTML.ATTR_CLASS, styleClasses.get(RichFaces.ATTR_STYLE));
- rootTable.setAttribute(HTML.ATTR_STYLE, sourceElement.getAttribute(RichFaces.ATTR_STYLE));
+ String attrStyleVal = sourceElement.hasAttribute(RichFaces.ATTR_STYLE) ? sourceElement.getAttribute(RichFaces.ATTR_STYLE) : null;
+ rootTable.setAttribute(HTML.ATTR_STYLE, attrStyleVal);
// create source box
final nsIDOMElement sourceBoxTd = visualDocument.createElement(HTML.TAG_TD);
@@ -588,10 +589,8 @@
// prepare labels
for (LabelKey key : LabelKey.values()) {
-
- String label = sourceElement.getAttribute(key.getValue() + LABEL_SUFFIX);
-
- if (label != null) {
+ if (sourceElement.hasAttribute(key.getValue() + LABEL_SUFFIX)) {
+ String label = sourceElement.getAttribute(key.getValue() + LABEL_SUFFIX);
labels.put(key.getValue(), label);
} else {
labels.put(key.getValue(), defaultLabels.get(key));
@@ -609,7 +608,7 @@
isShowButtonLabels = !Boolean.FALSE.toString().equalsIgnoreCase(sourceElement
.getAttribute(ATTR_SHOW_BUTTON_LABELS));
// prepare buttons attributes
- moveControlsAlign = sourceElement.getAttribute(ATTR_MOVE_CONTROLS_VERTICAL_ALIGN) != null ? sourceElement
+ moveControlsAlign = sourceElement.hasAttribute(ATTR_MOVE_CONTROLS_VERTICAL_ALIGN) ? sourceElement
.getAttribute(ATTR_MOVE_CONTROLS_VERTICAL_ALIGN) : DEFAULT_BUTTON_ALIGN;
// prepare lists attributes
@@ -644,10 +643,9 @@
private void prepareStyleClasses(Element sourceElement) {
// prepare style classes
Set<String> styleClassesKeys = defaultStyleClasses.keySet();
- for (String key : styleClassesKeys) {
-
- String styleClass = sourceElement.getAttribute(key + CLASS_SUFFIX);
- if (styleClass != null) {
+ for (String key : styleClassesKeys) {
+ if (sourceElement.hasAttribute(key + CLASS_SUFFIX)) {
+ String styleClass = sourceElement.getAttribute(key + CLASS_SUFFIX);
styleClasses.put(key, defaultStyleClasses.get(key) + " " //$NON-NLS-1$
+ styleClass);
} else {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelTemplate.java 2010-06-30 12:09:22 UTC (rev 23122)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelTemplate.java 2010-06-30 12:53:55 UTC (rev 23123)
@@ -77,9 +77,9 @@
Node child = children.item(i);
if (child instanceof Element && child.getNodeName().endsWith(":facet")) { //$NON-NLS-1$
- Element facet = (Element)child;
- String name = ((Element)facet).getAttribute("name"); //$NON-NLS-1$
- if (name != null) {
+ Element facet = (Element)child;
+ if (facet.hasAttribute("name")) {
+ String name = facet.getAttribute("name"); //$NON-NLS-1$
states.put(name, facet);
}
}
@@ -88,10 +88,10 @@
}
private String getInitialState(Element sourceElement) {
- String initialState = sourceElement.getAttribute("initialState"); //$NON-NLS-1$
-
- String stateOrder = sourceElement.getAttribute("stateOrder"); //$NON-NLS-1$
- if(stateOrder!=null) {
+ String initialState = sourceElement.hasAttribute("initialState") ? sourceElement.getAttribute("initialState") : null; //$NON-NLS-1$
+
+ if(sourceElement.hasAttribute("stateOrder")) {
+ String stateOrder = sourceElement.getAttribute("stateOrder"); //$NON-NLS-1$
StringTokenizer st = new StringTokenizer(stateOrder.trim(), ",", false); //$NON-NLS-1$
String firstState = null;
while(st.hasMoreElements()) {
@@ -119,8 +119,7 @@
private String getActiveState(Element sourceElement) {
String activeStateStr;
- String stateOrder = sourceElement.getAttribute("stateOrder"); //$NON-NLS-1$
- if(null == stateOrder) return null;
+ if(!sourceElement.hasAttribute("stateOrder")) return null;
activeStateStr = (String)toggleMap.get(sourceElement);
@@ -131,9 +130,9 @@
return activeStateStr;
}
- private String getNextState(Element sourceElement, String toggleId) {
+ private String getNextState(Element sourceElement, String toggleId) {
+ if(!sourceElement.hasAttribute("stateOrder")) return null;
String stateOrder = sourceElement.getAttribute("stateOrder"); //$NON-NLS-1$
- if(null == stateOrder) return null;
String activeState = getActiveState(sourceElement);
StringTokenizer st = new StringTokenizer(stateOrder.trim(), ",", false); //$NON-NLS-1$
14 years, 6 months
JBoss Tools SVN: r23122 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-06-30 08:09:22 -0400 (Wed, 30 Jun 2010)
New Revision: 23122
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml
Log:
https://jira.jboss.org/browse/JBIDE-6508, fixing junit test
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml 2010-06-30 11:59:55 UTC (rev 23121)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml 2010-06-30 12:09:22 UTC (rev 23122)
@@ -1,7 +1,7 @@
<tests>
<test id="jbide5352Test">
<DIV STYLE="margin: 36px;">
-<SPAN STYLE="font-family: unknown; font-size: 24pt;">
+<SPAN STYLE="font-size: 24pt;">
<DIV><BR/>
<SPAN CLASS="vpe-text">
@@ -103,7 +103,7 @@
<TABLE WIDTH="100%" CELLSPACING="0px" ALIGN="center">
<TR>
<TD ALIGN="center" COLSPAN="2" STYLE="border: 2px solid black;">
-<SPAN STYLE="font-family: unknown; font-size: 20pt;">
+<SPAN STYLE="font-size: 20pt;">
<DIV ALIGN="center"><BR/>
<SPAN CLASS="vpe-text">
@@ -115,7 +115,7 @@
</TR>
<TR>
<TD VALIGN="middle" ALIGN="center" STYLE="border: 2px solid black;">
-<SPAN STYLE="font-family: unknown; font-size: 30pt;">
+<SPAN STYLE="font-size: 30pt;">
<DIV><BR/>
<SPAN CLASS="vpe-text">
14 years, 6 months