JBoss Tools SVN: r24779 - in branches/jbosstools-3.2.0.M2/xulrunner/features: org.mozilla.xulrunner.feature and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-09-07 14:00:05 -0400 (Tue, 07 Sep 2010)
New Revision: 24779
Modified:
branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xpcom.feature/feature.xml
branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xpcom.feature/pom.xml
branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xulrunner.feature/feature.xml
branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml
Log:
upversion features from 1.9.1.2(a) to 1.9.12.qualifier / 1.9.12-SNAPSHOT so that these will be installed as update for older version
Modified: branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xpcom.feature/feature.xml
===================================================================
--- branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xpcom.feature/feature.xml 2010-09-07 17:58:24 UTC (rev 24778)
+++ branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xpcom.feature/feature.xml 2010-09-07 18:00:05 UTC (rev 24779)
@@ -2,7 +2,7 @@
<feature
id="org.mozilla.xpcom.feature"
label="XPCOM Feature"
- version="1.9.1.2a"
+ version="1.9.12.qualifier"
provider-name="JBoss by Red Hat">
<description>
Modified: branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xpcom.feature/pom.xml
===================================================================
--- branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xpcom.feature/pom.xml 2010-09-07 17:58:24 UTC (rev 24778)
+++ branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xpcom.feature/pom.xml 2010-09-07 18:00:05 UTC (rev 24779)
@@ -8,6 +8,6 @@
</parent>
<groupId>org.jboss.tools.xulrunner.features</groupId>
<artifactId>org.mozilla.xpcom.feature</artifactId>
- <version>1.9.1.2a</version>
+ <version>1.9.12-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
Modified: branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xulrunner.feature/feature.xml
===================================================================
--- branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xulrunner.feature/feature.xml 2010-09-07 17:58:24 UTC (rev 24778)
+++ branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xulrunner.feature/feature.xml 2010-09-07 18:00:05 UTC (rev 24779)
@@ -2,7 +2,7 @@
<feature
id="org.mozilla.xulrunner.feature"
label="XulRunner Feature"
- version="1.9.1.2"
+ version="1.9.12.qualifier"
provider-name="JBoss by Red Hat"
os="linux,macosx,win32"
ws="carbon,cocoa,gtk,win32"
Modified: branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml
===================================================================
--- branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml 2010-09-07 17:58:24 UTC (rev 24778)
+++ branches/jbosstools-3.2.0.M2/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml 2010-09-07 18:00:05 UTC (rev 24779)
@@ -8,6 +8,6 @@
</parent>
<groupId>org.jboss.tools.xulrunner.features</groupId>
<artifactId>org.mozilla.xulrunner.feature</artifactId>
- <version>1.9.1.2</version>
+ <version>1.9.12-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
15 years, 7 months
JBoss Tools SVN: r24778 - in trunk/xulrunner/features: org.mozilla.xulrunner.feature and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-09-07 13:58:24 -0400 (Tue, 07 Sep 2010)
New Revision: 24778
Modified:
trunk/xulrunner/features/org.mozilla.xpcom.feature/feature.xml
trunk/xulrunner/features/org.mozilla.xpcom.feature/pom.xml
trunk/xulrunner/features/org.mozilla.xulrunner.feature/feature.xml
trunk/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml
Log:
upversion features from 1.9.1.2(a) to 1.9.12.qualifier / 1.9.12-SNAPSHOT so that these will be installed as update for older version
Modified: trunk/xulrunner/features/org.mozilla.xpcom.feature/feature.xml
===================================================================
--- trunk/xulrunner/features/org.mozilla.xpcom.feature/feature.xml 2010-09-07 17:35:16 UTC (rev 24777)
+++ trunk/xulrunner/features/org.mozilla.xpcom.feature/feature.xml 2010-09-07 17:58:24 UTC (rev 24778)
@@ -2,7 +2,7 @@
<feature
id="org.mozilla.xpcom.feature"
label="XPCOM Feature"
- version="1.9.1.2a"
+ version="1.9.12.qualifier"
provider-name="JBoss by Red Hat">
<description>
Modified: trunk/xulrunner/features/org.mozilla.xpcom.feature/pom.xml
===================================================================
--- trunk/xulrunner/features/org.mozilla.xpcom.feature/pom.xml 2010-09-07 17:35:16 UTC (rev 24777)
+++ trunk/xulrunner/features/org.mozilla.xpcom.feature/pom.xml 2010-09-07 17:58:24 UTC (rev 24778)
@@ -8,6 +8,6 @@
</parent>
<groupId>org.jboss.tools.xulrunner.features</groupId>
<artifactId>org.mozilla.xpcom.feature</artifactId>
- <version>1.9.1.2a</version>
+ <version>1.9.12-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
Modified: trunk/xulrunner/features/org.mozilla.xulrunner.feature/feature.xml
===================================================================
--- trunk/xulrunner/features/org.mozilla.xulrunner.feature/feature.xml 2010-09-07 17:35:16 UTC (rev 24777)
+++ trunk/xulrunner/features/org.mozilla.xulrunner.feature/feature.xml 2010-09-07 17:58:24 UTC (rev 24778)
@@ -2,7 +2,7 @@
<feature
id="org.mozilla.xulrunner.feature"
label="XulRunner Feature"
- version="1.9.1.2"
+ version="1.9.12.qualifier"
provider-name="JBoss by Red Hat"
os="linux,macosx,win32"
ws="carbon,cocoa,gtk,win32"
Modified: trunk/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml
===================================================================
--- trunk/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml 2010-09-07 17:35:16 UTC (rev 24777)
+++ trunk/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml 2010-09-07 17:58:24 UTC (rev 24778)
@@ -8,6 +8,6 @@
</parent>
<groupId>org.jboss.tools.xulrunner.features</groupId>
<artifactId>org.mozilla.xulrunner.feature</artifactId>
- <version>1.9.1.2</version>
+ <version>1.9.12-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
15 years, 7 months
JBoss Tools SVN: r24777 - trunk/gwt/plugins/org.jboss.tools.gwt.core/META-INF.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-09-07 13:35:16 -0400 (Tue, 07 Sep 2010)
New Revision: 24777
Modified:
trunk/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF
Log:
mark feature and plugin as Experimental
Modified: trunk/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF 2010-09-07 17:33:11 UTC (rev 24776)
+++ trunk/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF 2010-09-07 17:35:16 UTC (rev 24777)
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: JBoss Tools GWT (experimental)
+Bundle-Name: JBoss Tools GWT (Experimental)
Bundle-SymbolicName: org.jboss.tools.gwt.core;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.tools.gwt.core.internal.GWTCoreActivator
15 years, 7 months
JBoss Tools SVN: r24776 - in branches/jbosstools-3.2.0.M2/gwt: plugins/org.jboss.tools.gwt.core/META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-09-07 13:33:11 -0400 (Tue, 07 Sep 2010)
New Revision: 24776
Modified:
branches/jbosstools-3.2.0.M2/gwt/features/org.jboss.tools.gwt.feature/feature.properties
branches/jbosstools-3.2.0.M2/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF
Log:
mark feature and plugin as Experimental
Modified: branches/jbosstools-3.2.0.M2/gwt/features/org.jboss.tools.gwt.feature/feature.properties
===================================================================
--- branches/jbosstools-3.2.0.M2/gwt/features/org.jboss.tools.gwt.feature/feature.properties 2010-09-07 17:30:18 UTC (rev 24775)
+++ branches/jbosstools-3.2.0.M2/gwt/features/org.jboss.tools.gwt.feature/feature.properties 2010-09-07 17:33:11 UTC (rev 24776)
@@ -15,7 +15,7 @@
# This file should be translated.
# "featureName" property - name of the feature
-featureName=JBoss GWT Integration
+featureName=JBoss GWT Integration (Experimental)
# "providerName" property - name of the company that provides the feature
providerName=JBoss by Red Hat
@@ -24,7 +24,7 @@
updateSiteName=JBossTools Update Site
# "description" property - description of the feature
-description=JBoss GWT Integration
+description=JBoss GWT Integration (Experimental)
# "copyright" property - text of the "Feature Update Copyright"
copyright=Copyright (c) 2010 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n\
Modified: branches/jbosstools-3.2.0.M2/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.2.0.M2/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF 2010-09-07 17:30:18 UTC (rev 24775)
+++ branches/jbosstools-3.2.0.M2/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF 2010-09-07 17:33:11 UTC (rev 24776)
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: JBoss Tools GWT (experimental)
+Bundle-Name: JBoss Tools GWT (Experimental)
Bundle-SymbolicName: org.jboss.tools.gwt.core;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.tools.gwt.core.internal.GWTCoreActivator
15 years, 7 months
JBoss Tools SVN: r24775 - in trunk: cdi/plugins/org.jboss.tools.cdi.ui/META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-09-07 13:30:18 -0400 (Tue, 07 Sep 2010)
New Revision: 24775
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/BeansXmlCompletionProposalComputer.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbQuery.java
Log:
JBIDE-2704: Code completion of annotations in beans.xml
CDI Class computer is created.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2010-09-07 16:57:00 UTC (rev 24774)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2010-09-07 17:30:18 UTC (rev 24775)
@@ -27,7 +27,8 @@
org.jboss.tools.common.model.ui;bundle-version="2.0.0",
org.jboss.tools.jst.web.ui;bundle-version="2.0.0",
org.eclipse.core.expressions;bundle-version="3.4.100",
- org.eclipse.ltk.core.refactoring;bundle-version="3.5.0"
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.0",
+ org.jboss.tools.jst.jsp;bundle-version="3.2.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor.0
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2010-09-07 16:57:00 UTC (rev 24774)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2010-09-07 17:30:18 UTC (rev 24775)
@@ -7,4 +7,6 @@
PreferencePage_CDI=CDI
Bundle-Vendor.0 = JBoss by Red Hat
-Bundle-Name.0 = Context and Dependency Injection UI
\ No newline at end of file
+Bundle-Name.0 = Context and Dependency Injection UI
+
+proposalCategory.cdiClass= JBoss CDI Class Proposals
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-09-07 16:57:00 UTC (rev 24774)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-09-07 17:30:18 UTC (rev 24775)
@@ -205,4 +205,28 @@
</extension>
+ <extension
+ point="org.eclipse.wst.sse.ui.completionProposal">
+ <proposalCategory
+ icon="icons/cdi16.png"
+ id="org.jboss.tools.cdi.ui.proposalCategory.cdiClass"
+ name="%proposalCategory.cdiClass">
+ </proposalCategory>
+ <proposalComputer
+ activate="true"
+ categoryId="org.jboss.tools.cdi.ui.proposalCategory.cdiClass"
+ class="org.jboss.tools.cdi.ui.ca.BeansXmlCompletionProposalComputer"
+ id="org.jboss.tools.cdi.ui.proposalComputer.cdiClass">
+ <contentType id="org.eclipse.core.runtime.xml">
+ <partitionType id="org.eclipse.wst.xml.XML_DEFAULT" />
+ </contentType>
+ <contentType id="org.eclipse.wst.xml.core.xmlsource">
+ <partitionType id="org.eclipse.wst.xml.XML_DEFAULT" />
+ </contentType>
+ <contentType id="org.jboss.tools.common.model.ui.xml">
+ <partitionType id="org.eclipse.wst.xml.XML_DEFAULT" />
+ </contentType>
+ </proposalComputer>
+ </extension>
+
</plugin>
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/BeansXmlCompletionProposalComputer.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/BeansXmlCompletionProposalComputer.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/BeansXmlCompletionProposalComputer.java 2010-09-07 17:30:18 UTC (rev 24775)
@@ -0,0 +1,136 @@
+package org.jboss.tools.cdi.ui.ca;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
+import org.jboss.tools.cdi.internal.core.ca.BeansXmlProcessor;
+import org.jboss.tools.common.el.core.resolver.ELContext;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
+import org.jboss.tools.jst.jsp.contentassist.computers.XmlTagCompletionProposalComputer;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.PageProcessor;
+import org.jboss.tools.jst.web.kb.KbQuery.Type;
+
+
+public class BeansXmlCompletionProposalComputer extends XmlTagCompletionProposalComputer {
+
+ @Override
+ protected void addTagInsertionProposals(
+ ContentAssistRequest contentAssistRequest, int childPosition,
+ CompletionProposalInvocationContext context) {
+ // TODO Auto-generated method stub
+ System.out.println("addTagInsertionProposals: CDI Beans.xml proposals are to be placed here!");
+
+ String prefix = getTagPrefix();
+ String uri = getTagUri();
+
+ String query = contentAssistRequest.getMatchString();
+
+ if (query == null)
+ query = ""; //$NON-NLS-1$
+ String stringQuery = query; //$NON-NLS-1$
+
+ ELContext elContext = getContext();
+ IProject project = elContext == null || elContext.getResource() == null ? null :
+ elContext.getResource().getProject();
+
+ if (project == null)
+ return;
+
+ KbQuery kbQuery = createKbQuery(Type.TAG_BODY, query, stringQuery, prefix, uri);
+ TextProposal[] proposals = BeansXmlProcessor.getInstance().getProposals(kbQuery, project);
+
+ for (int i = 0; proposals != null && i < proposals.length; i++) {
+ TextProposal textProposal = proposals[i];
+ boolean useAutoActivation = true;
+
+ String replacementString = textProposal.getReplacementString();
+ String closingTag = textProposal.getLabel();
+// if (closingTag != null && closingTag.startsWith("<")) { //$NON-NLS-1$
+// closingTag = closingTag.substring(1);
+// }
+
+// if (!insertTagOpenningCharacter && replacementString.startsWith("<")) { //$NON-NLS-1$
+ // Because the tag starting char is already in the text
+// replacementString = replacementString.substring(1);
+// }
+// if (!replacementString.endsWith("/>")) { //$NON-NLS-1$
+// replacementString += "</" + closingTag + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+// useAutoActivation = false; // JBIDE-6285: Don't invoke code assist automaticly if user inserts <tag></tag>.
+// }
+
+
+ int replacementOffset = contentAssistRequest.getReplacementBeginPosition();
+ int replacementLength = contentAssistRequest.getReplacementLength();
+ int cursorPosition = getCursorPositionForProposedText(replacementString);
+ Image image = textProposal.getImage();
+ if (image == null) {
+ image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
+ }
+
+ String displayString = closingTag;
+ IContextInformation contextInformation = null;
+ String additionalProposalInfo = textProposal.getContextInfo();
+ int relevance = textProposal.getRelevance();
+ if (relevance == TextProposal.R_NONE) {
+// relevance = defaultRelevance == TextProposal.R_NONE? TextProposal.R_TAG_INSERTION : defaultRelevance;
+ }
+
+ AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(useAutoActivation, replacementString,
+ replacementOffset, replacementLength, cursorPosition, image, displayString,
+ contextInformation, additionalProposalInfo, relevance);
+
+ contentAssistRequest.addProposal(proposal);
+ }
+
+ }
+
+ @Override
+ protected void addAttributeNameProposals(
+ ContentAssistRequest contentAssistRequest,
+ CompletionProposalInvocationContext context) {
+ // No actions required
+ }
+
+ @Override
+ protected void addAttributeValueProposals(
+ ContentAssistRequest contentAssistRequest,
+ CompletionProposalInvocationContext context) {
+ // No actions required
+ }
+
+ @Override
+ protected void addTagNameProposals(
+ ContentAssistRequest contentAssistRequest, int childPosition,
+ CompletionProposalInvocationContext context) {
+ // No actions required
+ }
+
+ @Override
+ protected void addTagNameProposals(
+ ContentAssistRequest contentAssistRequest, int childPosition,
+ boolean insertTagOpenningCharacter,
+ CompletionProposalInvocationContext context) {
+ // No actions required
+ }
+
+ @Override
+ protected void addAttributeValueELProposals(
+ ContentAssistRequest contentAssistRequest,
+ CompletionProposalInvocationContext context) {
+ // No actions required
+ }
+
+ @Override
+ protected void addTextELProposals(
+ ContentAssistRequest contentAssistRequest,
+ CompletionProposalInvocationContext context) {
+ // No actions required
+ }
+}
+
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/BeansXmlCompletionProposalComputer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbQuery.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbQuery.java 2010-09-07 16:57:00 UTC (rev 24774)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbQuery.java 2010-09-07 17:30:18 UTC (rev 24775)
@@ -36,7 +36,8 @@
TEXT,
TAG_NAME,
ATTRIBUTE_NAME,
- ATTRIBUTE_VALUE
+ ATTRIBUTE_VALUE,
+ TAG_BODY
}
public KbQuery() {
15 years, 7 months
JBoss Tools SVN: r24774 - in trunk/documentation/whatsnew: modeshape and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-09-07 12:57:00 -0400 (Tue, 07 Sep 2010)
New Revision: 24774
Modified:
trunk/documentation/whatsnew/index.html
trunk/documentation/whatsnew/modeshape/modeshape-news-7.1.0.M2.html
trunk/documentation/whatsnew/usage/usage-news-3.2.0.M2.html
Log:
https://jira.jboss.org/browse/JBIDE-6887 Usage Reporting description in N&N
index updated to have "Usage Reporting" link
crossreferences updated
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2010-09-07 16:31:23 UTC (rev 24773)
+++ trunk/documentation/whatsnew/index.html 2010-09-07 16:57:00 UTC (rev 24774)
@@ -42,6 +42,7 @@
<p><a href="gwt/gwt-news-1.0.0.M2.html">GWT Integration</a></p>
<p><a href="teiid/teiid-news-7.1.0.M2.html">Teiid Tools</a></p>
<p><a href="modeshape/modeshape-news-7.1.0.M2.html">Modeshape</a></p>
+ <p><a href="usage/usage-news-3.2.0.M2.html">Usage Reporting</a></p>
</td>
</tr>
Modified: trunk/documentation/whatsnew/modeshape/modeshape-news-7.1.0.M2.html
===================================================================
--- trunk/documentation/whatsnew/modeshape/modeshape-news-7.1.0.M2.html 2010-09-07 16:31:23 UTC (rev 24773)
+++ trunk/documentation/whatsnew/modeshape/modeshape-news-7.1.0.M2.html 2010-09-07 16:57:00 UTC (rev 24774)
@@ -10,7 +10,7 @@
</head>
<body>
<h1>ModeShape 7.1.0 M2 What's New</h1>
-<p align="right"><a href="../index.html">< Main Index</a></p>
+<p align="right"><a href="../index.html">< Main Index</a> <a href="../usage/usage-news-3.2.0.M2.html">Usage Reporting ></a></p>
<p>Last revised September 1, 2010</p>
<p>The ModeShape publishing feature, which is new to JBoss Tools, enables you to publish files to (upload) and unpublish files from (remove) ModeShape repositories.
Once files are uploaded to a ModeShaper repository, the appropriate ModeShape sequencers will extract and add information, such as relationships and metadata.
Modified: trunk/documentation/whatsnew/usage/usage-news-3.2.0.M2.html
===================================================================
--- trunk/documentation/whatsnew/usage/usage-news-3.2.0.M2.html 2010-09-07 16:31:23 UTC (rev 24773)
+++ trunk/documentation/whatsnew/usage/usage-news-3.2.0.M2.html 2010-09-07 16:57:00 UTC (rev 24774)
@@ -11,9 +11,7 @@
<h1>What's New Usage Reporting 3.2.0.M2</h1>
<p align="right">
-<a href="../index.html">< Main Index</a>
-<a href="../cdi/cdi-news-3.2.0.M2.html">CDI Tools ></a>
-</p>
+<a href="../index.html">< Main Index</a></p>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
<tr>
<td colspan="2">
15 years, 7 months
JBoss Tools SVN: r24773 - trunk/documentation/whatsnew/images.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-09-07 12:31:23 -0400 (Tue, 07 Sep 2010)
New Revision: 24773
Modified:
trunk/documentation/whatsnew/images/usage-reporting-confirmation.png
trunk/documentation/whatsnew/images/usage-reporting-preferences.png
Log:
updated images for usage N&N
Modified: trunk/documentation/whatsnew/images/usage-reporting-confirmation.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/images/usage-reporting-preferences.png
===================================================================
(Binary files differ)
15 years, 7 months
JBoss Tools SVN: r24772 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-09-07 12:09:53 -0400 (Tue, 07 Sep 2010)
New Revision: 24772
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java
Log:
https://jira.jboss.org/browse/JBIDE-3875
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java 2010-09-07 15:36:15 UTC (rev 24771)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java 2010-09-07 16:09:53 UTC (rev 24772)
@@ -17,6 +17,7 @@
import org.w3c.dom.*;
import org.xml.sax.Attributes;
+import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
@@ -99,14 +100,19 @@
stream1 = url.openStream();
stream2 = new BufferedInputStream(stream1, 16384);
-
Element g = parse(stream2);
if(g == null) {
+ System.out.println("SAX parser failed to load meta resource " + name);
+ stream1 = url.openStream();
+ stream2 = new BufferedInputStream(stream1, 16384);
+ g = XMLUtilities.getElement(stream2, new EmptyResolver());
+ }
+ if(g == null) {
ModelPlugin.getPluginLog().logInfo("Corrupted meta resource " + name); //$NON-NLS-1$
} else {
load0(g, name, url.toString());
}
-
+
} catch (IOException e) {
ModelPlugin.getPluginLog().logError("MetaLoader: Cannot read resource " + url.toString()); //$NON-NLS-1$
return;
@@ -151,28 +157,16 @@
}
- boolean isRootUsed = false;
-
Element parse(InputStream stream) {
- if(isRootUsed) {
- root = XMLUtilities.createDocumentElement("meta"); //$NON-NLS-1$
- ModelPlugin.getDefault().logError("Is root used");
- System.out.println("Is root used");
- }
- isRootUsed = true;
Parser p = new Parser();
p.documentElement = root;
p.current = root;
p.parse(stream);
Element g = p.documentElement;
g = XMLUtilities.getUniqueChild(g, "XModelEntityGroup"); //$NON-NLS-1$
- try {
+ if(g != null) {
p.documentElement.removeChild(g);
- } catch (NullPointerException e) {
- ModelPlugin.getDefault().logError("Null pointer while trying to remove child " + g);
- System.out.println("Null pointer while trying to remove child " + g);
}
- isRootUsed = false;
return g;
}
@@ -274,14 +268,6 @@
SAXValidator.setFeature(parserInstance, VALIDATION_DYNAMIC_FEATURE_ID, false);
SAXValidator.setFeature(parserInstance, FATAL_ERROR_PROCESSING_FEATURE_ID, false);
- class EmptyHandler implements org.apache.xerces.xni.parser.XMLEntityResolver {
-
- public XMLInputSource resolveEntity(XMLResourceIdentifier id)
- throws XNIException, IOException {
- return new XMLInputSource(id.getPublicId(), id.getBaseSystemId(), id.getBaseSystemId(), new StringReader(""), null);
- }
-
- }
try {
if(MetaLibLoader.validateMetaXML) {
parserInstance.setProperty(ENTITY_RESOLVER_PROPERTY_ID, new XMLEntityResolverImpl());
@@ -346,3 +332,18 @@
public void startPrefixMapping(String prefix, String uri) throws SAXException {}
}
+
+class EmptyHandler implements org.apache.xerces.xni.parser.XMLEntityResolver {
+
+ public XMLInputSource resolveEntity(XMLResourceIdentifier id)
+ throws XNIException, IOException {
+ return new XMLInputSource(id.getPublicId(), id.getBaseSystemId(), id.getBaseSystemId(), new StringReader(""), null);
+ }
+
+}
+
+class EmptyResolver implements EntityResolver {
+ public InputSource resolveEntity(String publicID, String systemID) throws SAXException, IOException {
+ return new InputSource(new StringReader("")); //$NON-NLS-1$
+ }
+}
15 years, 7 months
JBoss Tools SVN: r24771 - in trunk/seam: plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-09-07 11:36:15 -0400 (Tue, 07 Sep 2010)
New Revision: 24771
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotationMarkerResolution.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotationMarkerResolution.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/RenameAnnotationMarkerResolution.java
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent1.java
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent2.java
Removed:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotaionMarkerResolution.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotaionMarkerResolution.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6869
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2010-09-07 15:24:48 UTC (rev 24770)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2010-09-07 15:36:15 UTC (rev 24771)
@@ -374,6 +374,8 @@
public static String ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE;
+ public static String RENAME_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE;
+
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, SeamUIMessages.class);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java 2010-09-07 15:24:48 UTC (rev 24770)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java 2010-09-07 15:36:15 UTC (rev 24771)
@@ -56,7 +56,7 @@
this.end = end;
}
- protected void deleteAnnotation(String annotationTypeName){
+ protected void deleteAnnotation(){
try{
ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
@@ -65,7 +65,7 @@
IType type = compilationUnit.findPrimaryType();
if(javaElement != null && type != null){
if(javaElement instanceof IAnnotatable){
- IAnnotation annotation = findAnnotation(type, (IAnnotatable)javaElement, annotationTypeName);
+ IAnnotation annotation = findAnnotation(type, (IAnnotatable)javaElement);
if(annotation != null){
IBuffer buffer = compilationUnit.getBuffer();
@@ -73,12 +73,12 @@
buffer.replace(annotation.getSourceRange().getOffset(), annotation.getSourceRange().getLength(), "");
// check and delete import
- IImportDeclaration importDeclaration = compilationUnit.getImport(annotationTypeName);
+ IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
IImportContainer importContainer = compilationUnit.getImportContainer();
if(importDeclaration != null && importContainer != null){
int importSize = importContainer.getSourceRange().getOffset()+importContainer.getSourceRange().getLength();
String text = buffer.getText(importSize, buffer.getLength()-importSize);
- if(checkImport(text, annotationTypeName))
+ if(checkImport(text, qualifiedName))
importDeclaration.delete(false, new NullProgressMonitor());
}
compilationUnit.commitWorkingCopy(false, new NullProgressMonitor());
@@ -145,7 +145,7 @@
return name;
}
- protected void addAnnotation(String annotationTypeName, String annotationString, boolean insertName){
+ protected void addAnnotation(String annotationString, boolean insertName){
try{
ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
@@ -153,9 +153,9 @@
IJavaElement javaElement = compilationUnit.getElementAt(start);
IType type = getType(javaElement);
if(type != null){
- IImportDeclaration importDeclaration = compilationUnit.getImport(annotationTypeName);
+ IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
if(importDeclaration == null || !importDeclaration.exists())
- compilationUnit.createImport(annotationTypeName, null, new NullProgressMonitor());
+ compilationUnit.createImport(qualifiedName, null, new NullProgressMonitor());
IBuffer buffer = compilationUnit.getBuffer();
@@ -172,24 +172,51 @@
}
}
+ protected void renameAnnotation(String annotationString){
+ try{
+ ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
+ ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
+
+ IJavaElement javaElement = compilationUnit.getElementAt(start);
+ IType type = getType(javaElement);
+ if(type != null){
+ IAnnotation annotation = findAnnotation(type, type);
+ if(annotation != null){
+ IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
+ if(importDeclaration == null || !importDeclaration.exists())
+ compilationUnit.createImport(qualifiedName, null, new NullProgressMonitor());
+
+ IBuffer buffer = compilationUnit.getBuffer();
+
+ String name= "(\""+generateComponentName(compilationUnit.findPrimaryType().getElementName())+"\")";
+
+ buffer.replace(annotation.getSourceRange().getOffset(), annotation.getSourceRange().getLength(), annotationString+name);
+ compilationUnit.commitWorkingCopy(false, new NullProgressMonitor());
+ }
+ }
+ }catch(CoreException ex){
+ SeamGuiPlugin.getPluginLog().logError(ex);
+ }
+ }
- private IAnnotation findAnnotation(IType sourceType, IAnnotatable member, String annotationTypeName) {
+
+ private IAnnotation findAnnotation(IType sourceType, IAnnotatable member) {
try {
IAnnotation[] annotations = member.getAnnotations();
- String simpleAnnotationTypeName = annotationTypeName;
- int lastDot = annotationTypeName.lastIndexOf('.');
+ String simpleAnnotationTypeName = qualifiedName;
+ int lastDot = qualifiedName.lastIndexOf('.');
if(lastDot>-1) {
simpleAnnotationTypeName = simpleAnnotationTypeName.substring(lastDot + 1);
}
for (IAnnotation annotation : annotations) {
- if(annotationTypeName.equals(annotation.getElementName())) {
+ if(qualifiedName.equals(annotation.getElementName())) {
return annotation;
}
if(simpleAnnotationTypeName.equals(annotation.getElementName())) {
String fullAnnotationclassName = EclipseJavaUtil.resolveType(sourceType, simpleAnnotationTypeName);
if(fullAnnotationclassName!=null) {
IType annotationType = sourceType.getJavaProject().findType(fullAnnotationclassName);
- if(annotationType!=null && annotationType.getFullyQualifiedName().equals(annotationTypeName)) {
+ if(annotationType!=null && annotationType.getFullyQualifiedName().equals(qualifiedName)) {
return annotation;
}
}
Deleted: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotaionMarkerResolution.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotaionMarkerResolution.java 2010-09-07 15:24:48 UTC (rev 24770)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotaionMarkerResolution.java 2010-09-07 15:36:15 UTC (rev 24771)
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.seam.ui.marker;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-
-/**
- * @author Daniel Azarov
- */
-public class AddAnnotaionMarkerResolution extends
- AbstractSeamMarkerResolution {
- boolean insertName;
-
- public AddAnnotaionMarkerResolution(String label, String qualifiedName, IFile file, int start, int end, boolean insertName){
- super(label, qualifiedName, file, start, end);
- this.insertName = insertName;
- }
-
- public void run(IMarker marker) {
- addAnnotation(qualifiedName,"@"+getShortName(qualifiedName), insertName); //$NON-NLS-1$
- }
-
-}
Copied: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotationMarkerResolution.java (from rev 24756, trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotaionMarkerResolution.java)
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotationMarkerResolution.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotationMarkerResolution.java 2010-09-07 15:36:15 UTC (rev 24771)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.seam.ui.marker;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+
+/**
+ * @author Daniel Azarov
+ */
+public class AddAnnotationMarkerResolution extends
+ AbstractSeamMarkerResolution {
+ boolean insertName;
+
+ public AddAnnotationMarkerResolution(String label, String qualifiedName, IFile file, int start, int end, boolean insertName){
+ super(label, qualifiedName, file, start, end);
+ this.insertName = insertName;
+ }
+
+ public void run(IMarker marker) {
+ addAnnotation("@"+getShortName(qualifiedName), insertName); //$NON-NLS-1$
+ }
+
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotationMarkerResolution.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotaionMarkerResolution.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotaionMarkerResolution.java 2010-09-07 15:24:48 UTC (rev 24770)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotaionMarkerResolution.java 2010-09-07 15:36:15 UTC (rev 24771)
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.seam.ui.marker;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-
-/**
- * @author Daniel Azarov
- */
-public class DeleteAnnotaionMarkerResolution extends
- AbstractSeamMarkerResolution {
-
- public DeleteAnnotaionMarkerResolution(String label, String qualifiedName, IFile file, int start, int end){
- super(label, qualifiedName, file, start, end);
- }
-
- public String getLabel() {
- return label;
- }
-
- public void run(IMarker marker) {
- deleteAnnotation(qualifiedName);
- }
-}
Copied: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotationMarkerResolution.java (from rev 24756, trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotaionMarkerResolution.java)
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotationMarkerResolution.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotationMarkerResolution.java 2010-09-07 15:36:15 UTC (rev 24771)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.seam.ui.marker;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+
+/**
+ * @author Daniel Azarov
+ */
+public class DeleteAnnotationMarkerResolution extends
+ AbstractSeamMarkerResolution {
+
+ public DeleteAnnotationMarkerResolution(String label, String qualifiedName, IFile file, int start, int end){
+ super(label, qualifiedName, file, start, end);
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void run(IMarker marker) {
+ deleteAnnotation();
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotationMarkerResolution.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/RenameAnnotationMarkerResolution.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/RenameAnnotationMarkerResolution.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/RenameAnnotationMarkerResolution.java 2010-09-07 15:36:15 UTC (rev 24771)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.seam.ui.marker;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+
+/**
+ * @author Daniel Azarov
+ */
+public class RenameAnnotationMarkerResolution extends
+ AbstractSeamMarkerResolution {
+
+ public RenameAnnotationMarkerResolution(String label, String qualifiedName,
+ IFile file, int start, int end) {
+ super(label, qualifiedName, file, start, end);
+ }
+
+ public void run(IMarker marker) {
+ renameAnnotation("@"+getShortName(qualifiedName)); //$NON-NLS-1$
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/RenameAnnotationMarkerResolution.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java 2010-09-07 15:24:48 UTC (rev 24770)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java 2010-09-07 15:36:15 UTC (rev 24771)
@@ -23,6 +23,7 @@
* @author Daniel Azarov
*/
public class SeamProblemMarkerResolutionGenerator implements IMarkerResolutionGenerator2 {
+ private static final String JAVA_EXTENSION = "java"; //$NON-NLS-1$
public IMarkerResolution[] getResolutions(IMarker marker) {
try{
@@ -42,6 +43,9 @@
IFile file = (IFile)marker.getResource();
+ if(!JAVA_EXTENSION.equals(file.getFileExtension()))
+ return new IMarkerResolution[]{};
+
attribute = ((Integer)marker.getAttribute(IMarker.CHAR_START));
if(attribute == null)
return new IMarkerResolution[]{};
@@ -52,32 +56,35 @@
return new IMarkerResolution[]{};
int end = attribute.intValue();
- if(messageId == SeamCoreValidator.NONUNIQUE_COMPONENT_NAME_MESSAGE_ID)
- return new IMarkerResolution[]{new DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Name",file, start, end)};
- else if(messageId == SeamCoreValidator.DUPLICATE_REMOVE_MESSAGE_ID)
- return new IMarkerResolution[]{new DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_REMOVE_ANNOTATION_MARKER_RESOLUTION_TITLE, "javax.ejb.Remove", file, start, end)};
+ if(messageId == SeamCoreValidator.NONUNIQUE_COMPONENT_NAME_MESSAGE_ID){
+ return new IMarkerResolution[]{
+ new RenameAnnotationMarkerResolution(SeamUIMessages.RENAME_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Name", file, start, end),
+ new DeleteAnnotationMarkerResolution(SeamUIMessages.DELETE_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Name",file, start, end)
+ };
+ } else if(messageId == SeamCoreValidator.DUPLICATE_REMOVE_MESSAGE_ID)
+ return new IMarkerResolution[]{new DeleteAnnotationMarkerResolution(SeamUIMessages.DELETE_REMOVE_ANNOTATION_MARKER_RESOLUTION_TITLE, "javax.ejb.Remove", file, start, end)};
else if(messageId == SeamCoreValidator.DUPLICATE_DESTROY_MESSAGE_ID)
- return new IMarkerResolution[]{new DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_DESTROY_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Destroy", file, start, end)};
+ return new IMarkerResolution[]{new DeleteAnnotationMarkerResolution(SeamUIMessages.DELETE_DESTROY_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Destroy", file, start, end)};
else if(messageId == SeamCoreValidator.DUPLICATE_CREATE_MESSAGE_ID)
- return new IMarkerResolution[]{new DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_CREATE_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Create", file, start, end)};
+ return new IMarkerResolution[]{new DeleteAnnotationMarkerResolution(SeamUIMessages.DELETE_CREATE_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Create", file, start, end)};
else if(messageId == SeamCoreValidator.DUPLICATE_UNWRAP_MESSAGE_ID)
- return new IMarkerResolution[]{new DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_UNWRAP_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Unwrap", file, start, end)};
+ return new IMarkerResolution[]{new DeleteAnnotationMarkerResolution(SeamUIMessages.DELETE_UNWRAP_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Unwrap", file, start, end)};
else if(messageId == SeamCoreValidator.DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN_MESSAGE_ID)
- return new IMarkerResolution[]{new DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_DESTROY_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Destroy", file, start, end)};
+ return new IMarkerResolution[]{new DeleteAnnotationMarkerResolution(SeamUIMessages.DELETE_DESTROY_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Destroy", file, start, end)};
else if(messageId == SeamCoreValidator.CREATE_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID)
return new IMarkerResolution[]{
- new AddAnnotaionMarkerResolution(SeamUIMessages.ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Name", file, start, end, true),
- new DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_CREATE_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Create", file, start, end)
+ new AddAnnotationMarkerResolution(SeamUIMessages.ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Name", file, start, end, true),
+ new DeleteAnnotationMarkerResolution(SeamUIMessages.DELETE_CREATE_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Create", file, start, end)
};
else if(messageId == SeamCoreValidator.UNWRAP_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID)
return new IMarkerResolution[]{
- new AddAnnotaionMarkerResolution(SeamUIMessages.ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Name", file, start, end, true),
- new DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_UNWRAP_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Unwrap", file, start, end)
+ new AddAnnotationMarkerResolution(SeamUIMessages.ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Name", file, start, end, true),
+ new DeleteAnnotationMarkerResolution(SeamUIMessages.DELETE_UNWRAP_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Unwrap", file, start, end)
};
else if(messageId == SeamCoreValidator.OBSERVER_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID)
return new IMarkerResolution[]{
- new AddAnnotaionMarkerResolution(SeamUIMessages.ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Name", file, start, end, true),
- new DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_OBSERVER_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Observer", file, start, end)
+ new AddAnnotationMarkerResolution(SeamUIMessages.ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Name", file, start, end, true),
+ new DeleteAnnotationMarkerResolution(SeamUIMessages.DELETE_OBSERVER_ANNOTATION_MARKER_RESOLUTION_TITLE, "org.jboss.seam.annotations.Observer", file, start, end)
};
return new IMarkerResolution[]{};
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2010-09-07 15:24:48 UTC (rev 24770)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2010-09-07 15:36:15 UTC (rev 24771)
@@ -195,3 +195,4 @@
DELETE_UNWRAP_ANNOTATION_MARKER_RESOLUTION_TITLE=Delete @Unwrap annotation
DELETE_OBSERVER_ANNOTATION_MARKER_RESOLUTION_TITLE=Delete @Oserver annotation
ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE=Add @Name annotation
+RENAME_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE=Rename @Name annotation
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent1.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent1.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent1.java 2010-09-07 15:36:15 UTC (rev 24771)
@@ -0,0 +1,7 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import org.jboss.seam.annotations.Name;
+
+@Name("duplicateComponentName")
+public class DuplicateComponent1 {
+}
\ No newline at end of file
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent1.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent2.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent2.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent2.java 2010-09-07 15:36:15 UTC (rev 24771)
@@ -0,0 +1,7 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import org.jboss.seam.annotations.Name;
+
+@Name("duplicateComponentName")
+public class DuplicateComponent2 {
+}
\ No newline at end of file
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent2.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java 2010-09-07 15:24:48 UTC (rev 24770)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/marker/SeamMarkerResolutionTest.java 2010-09-07 15:36:15 UTC (rev 24771)
@@ -21,8 +21,9 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
-import org.jboss.tools.seam.ui.marker.AddAnnotaionMarkerResolution;
-import org.jboss.tools.seam.ui.marker.DeleteAnnotaionMarkerResolution;
+import org.jboss.tools.seam.ui.marker.AddAnnotationMarkerResolution;
+import org.jboss.tools.seam.ui.marker.DeleteAnnotationMarkerResolution;
+import org.jboss.tools.seam.ui.marker.RenameAnnotationMarkerResolution;
import org.jboss.tools.test.util.JobUtils;
/**
@@ -60,8 +61,8 @@
.getResolutions(marker);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof DeleteAnnotaionMarkerResolution) {
- assertEquals("javax.ejb.Remove", ((DeleteAnnotaionMarkerResolution)resolution).getQualifiedName());
+ if (resolution instanceof DeleteAnnotationMarkerResolution) {
+ assertEquals("javax.ejb.Remove", ((DeleteAnnotationMarkerResolution)resolution).getQualifiedName());
found = true;
break;
}
@@ -88,8 +89,8 @@
.getResolutions(marker);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof DeleteAnnotaionMarkerResolution) {
- assertEquals("org.jboss.seam.annotations.Destroy", ((DeleteAnnotaionMarkerResolution)resolution).getQualifiedName());
+ if (resolution instanceof DeleteAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Destroy", ((DeleteAnnotationMarkerResolution)resolution).getQualifiedName());
found = true;
break;
}
@@ -116,8 +117,8 @@
.getResolutions(marker);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof DeleteAnnotaionMarkerResolution) {
- assertEquals("org.jboss.seam.annotations.Destroy", ((DeleteAnnotaionMarkerResolution)resolution).getQualifiedName());
+ if (resolution instanceof DeleteAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Destroy", ((DeleteAnnotationMarkerResolution)resolution).getQualifiedName());
found = true;
break;
}
@@ -144,8 +145,8 @@
.getResolutions(marker);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof DeleteAnnotaionMarkerResolution) {
- assertEquals("org.jboss.seam.annotations.Create", ((DeleteAnnotaionMarkerResolution)resolution).getQualifiedName());
+ if (resolution instanceof DeleteAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Create", ((DeleteAnnotationMarkerResolution)resolution).getQualifiedName());
found = true;
break;
}
@@ -172,8 +173,8 @@
.getResolutions(marker);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof DeleteAnnotaionMarkerResolution) {
- assertEquals("org.jboss.seam.annotations.Unwrap", ((DeleteAnnotaionMarkerResolution)resolution).getQualifiedName());
+ if (resolution instanceof DeleteAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Unwrap", ((DeleteAnnotationMarkerResolution)resolution).getQualifiedName());
found = true;
break;
}
@@ -201,12 +202,12 @@
.getResolutions(marker);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof DeleteAnnotaionMarkerResolution) {
- assertEquals("org.jboss.seam.annotations.Create", ((DeleteAnnotaionMarkerResolution)resolution).getQualifiedName());
+ if (resolution instanceof DeleteAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Create", ((DeleteAnnotationMarkerResolution)resolution).getQualifiedName());
dFound = true;
}
- if (resolution instanceof AddAnnotaionMarkerResolution) {
- assertEquals("org.jboss.seam.annotations.Name", ((AddAnnotaionMarkerResolution)resolution).getQualifiedName());
+ if (resolution instanceof AddAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Name", ((AddAnnotationMarkerResolution)resolution).getQualifiedName());
cFound = true;
}
}
@@ -234,12 +235,12 @@
.getResolutions(marker);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof DeleteAnnotaionMarkerResolution) {
- assertEquals("org.jboss.seam.annotations.Unwrap", ((DeleteAnnotaionMarkerResolution)resolution).getQualifiedName());
+ if (resolution instanceof DeleteAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Unwrap", ((DeleteAnnotationMarkerResolution)resolution).getQualifiedName());
dFound = true;
}
- if (resolution instanceof AddAnnotaionMarkerResolution) {
- assertEquals("org.jboss.seam.annotations.Name", ((AddAnnotaionMarkerResolution)resolution).getQualifiedName());
+ if (resolution instanceof AddAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Name", ((AddAnnotationMarkerResolution)resolution).getQualifiedName());
cFound = true;
}
}
@@ -267,12 +268,12 @@
.getResolutions(marker);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof DeleteAnnotaionMarkerResolution) {
- assertEquals("org.jboss.seam.annotations.Observer", ((DeleteAnnotaionMarkerResolution)resolution).getQualifiedName());
+ if (resolution instanceof DeleteAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Observer", ((DeleteAnnotationMarkerResolution)resolution).getQualifiedName());
dFound = true;
}
- if (resolution instanceof AddAnnotaionMarkerResolution) {
- assertEquals("org.jboss.seam.annotations.Name", ((AddAnnotaionMarkerResolution)resolution).getQualifiedName());
+ if (resolution instanceof AddAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Name", ((AddAnnotationMarkerResolution)resolution).getQualifiedName());
cFound = true;
}
}
@@ -283,5 +284,39 @@
assertTrue("The quickfix \"Delete @Observer annotation\" doesn't exist.", dFound);
assertTrue("The quickfix \"Add @Name annotation\" doesn't exist.", cFound);
}
+
+ public void testDuplicateComponentNameResolution() throws CoreException {
+ String TARGET_FILE_NAME = "src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent1.java";
+ IFile file = project.getFile(TARGET_FILE_NAME);
+
+ assertTrue("File - "+TARGET_FILE_NAME+" must be exists",file.exists());
+
+ IMarker[] markers = file.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
+
+ boolean dFound = false;
+ boolean cFound = false;
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
+ .getResolutions(marker);
+ for (int j = 0; j < resolutions.length; j++) {
+ IMarkerResolution resolution = resolutions[j];
+ if (resolution instanceof DeleteAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Name", ((DeleteAnnotationMarkerResolution)resolution).getQualifiedName());
+ dFound = true;
+ }
+ if (resolution instanceof RenameAnnotationMarkerResolution) {
+ assertEquals("org.jboss.seam.annotations.Name", ((RenameAnnotationMarkerResolution)resolution).getQualifiedName());
+ cFound = true;
+ }
+ }
+ if (dFound && cFound) {
+ break;
+ }
+ }
+ assertTrue("The quickfix \"Delete @Name annotation\" doesn't exist.", dFound);
+ assertTrue("The quickfix \"Rename @Name annotation\" doesn't exist.", cFound);
+ }
+
}
15 years, 7 months
JBoss Tools SVN: r24770 - in trunk/cdi: tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-09-07 11:24:48 -0400 (Tue, 07 Sep 2010)
New Revision: 24770
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7013 Non dependent producer method with parameterized return type with actual types is valid - Fixed
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-09-07 15:12:57 UTC (rev 24769)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-09-07 15:24:48 UTC (rev 24770)
@@ -880,6 +880,7 @@
private void validateProducer(IProducer producer) {
try {
Set<ITypeDeclaration> typeDeclarations = producer.getAllTypeDeclarations();
+ String[] typeVariables = producer.getBeanClass().getTypeParameterSignatures();
ITypeDeclaration typeDeclaration = null;
if (!typeDeclarations.isEmpty()) {
/*
@@ -894,6 +895,7 @@
*/
typeDeclaration = typeDeclarations.iterator().next();
String[] paramTypes = Signature.getTypeArguments(typeDeclaration.getSignature());
+ boolean variable = false;
for (String paramType : paramTypes) {
if (Signature.getTypeSignatureKind(paramType) == Signature.WILDCARD_TYPE_SIGNATURE) {
if (producer instanceof IProducerField) {
@@ -903,25 +905,25 @@
addError(CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD,
typeDeclaration, producer.getResource());
}
+ } else if(!variable && isTypeVariable(producer, Signature.toString(paramType), typeVariables)) {
+ /*
+ * 3.3. Producer methods
+ * - producer method with a parameterized return type with a type variable declares any scope other than @Dependent
+ *
+ * 3.4. Producer fields
+ * - producer field with a parameterized type with a type variable declares any scope other than @Dependent
+ */
+ variable = true;
+ IAnnotationDeclaration scopeOrStereotypeDeclaration = CDIUtil.getDifferentScopeDeclarationThanDepentend(producer);
+ if (scopeOrStereotypeDeclaration != null) {
+ boolean field = producer instanceof IProducerField;
+ addError(field ? CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD : CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD,
+ field ? CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD : CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD,
+ scopeOrStereotypeDeclaration, producer.getResource());
+ }
+ break;
}
}
-
- /*
- * 3.3. Producer methods
- * - producer method with a parameterized return type with a type variable declares any scope other than @Dependent
- *
- * 3.4. Producer fields
- * - producer field with a parameterized type with a type variable declares any scope other than @Dependent
- */
- if (paramTypes.length > 0) {
- IAnnotationDeclaration scopeOrStereotypeDeclaration = CDIUtil.getDifferentScopeDeclarationThanDepentend(producer);
- if (scopeOrStereotypeDeclaration != null) {
- boolean field = producer instanceof IProducerField;
- addError(field ? CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD : CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD,
- field ? CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD : CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD,
- scopeOrStereotypeDeclaration, producer.getResource());
- }
- }
}
/*
@@ -933,8 +935,6 @@
addError(CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, CDIPreferences.PRODUCER_ANNOTATED_INJECT, inject, producer.getResource());
}
- String[] typeVariables = producer.getBeanClass().getTypeParameterSignatures();
-
if (producer instanceof IProducerField) {
/*
* 3.5.1. Declaring a resource
@@ -1028,25 +1028,10 @@
*/
String typeSign = producerMethod.getMethod().getReturnType();
String typeString = Signature.toString(typeSign);
- ITypeParameter[] paramTypes = producerMethod.getMethod().getTypeParameters();
- boolean marked = false;
- for (ITypeParameter param : paramTypes) {
- String variableName = param.getElementName();
- if (variableName.equals(typeString)) {
- addError(CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE,
- typeDeclaration != null ? typeDeclaration : producer, producer.getResource());
- marked = true;
- }
+ if(isTypeVariable(producerMethod, typeString, typeVariables)) {
+ addError(CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE,
+ typeDeclaration != null ? typeDeclaration : producer, producer.getResource());
}
- if (!marked && typeVariables.length > 0) {
- for (String variableSig : typeVariables) {
- String variableName = Signature.getTypeVariable(variableSig);
- if (typeString.equals(variableName)) {
- addError(CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE,
- typeDeclaration != null ? typeDeclaration : producer, producer.getResource());
- }
- }
- }
/*
* 3.3.2. Declaring a producer method
* - non-static method of a session bean class is annotated @Produces, and the method is not a business method of the session bean
@@ -1111,6 +1096,27 @@
}
}
+ private boolean isTypeVariable(IProducer producer, String type, String[] typeVariables) throws JavaModelException {
+ if(producer instanceof IProducerMethod) {
+ ITypeParameter[] paramTypes = ((IProducerMethod)producer).getMethod().getTypeParameters();
+ for (ITypeParameter param : paramTypes) {
+ String variableName = param.getElementName();
+ if (variableName.equals(type)) {
+ return true;
+ }
+ }
+ }
+ if (typeVariables.length > 0) {
+ for (String variableSig : typeVariables) {
+ String variableName = Signature.getTypeVariable(variableSig);
+ if (type.equals(variableName)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
private void saveAllSuperTypesAsLinkedResources(IClassBean bean) {
Set<IParametedType> types = bean.getAllTypes();
for (IParametedType type : types) {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java 2010-09-07 15:12:57 UTC (rev 24769)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java 2010-09-07 15:24:48 UTC (rev 24770)
@@ -1,34 +1,38 @@
package org.jboss.jsr299.tck.tests.jbt.validation.producers;
+import java.util.List;
+
import javax.enterprise.context.Dependent;
+import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
+import javax.inject.Named;
-public class ParameterizedTypeWithWrongScope_Broken {
+public class ParameterizedTypeWithWrongScope_Broken <T> {
- @Produces public FunnelWeaver<String> getAnotherFunnelWeaver;
+ @Produces public FunnelWeaver<T> getAnotherFunnelWeaver;
@AnotherScope
- @Produces public FunnelWeaver<String> getAnotherFunnelWeaver2;
+ @Produces public FunnelWeaver<T> getAnotherFunnelWeaver2;
- @Dependent @Produces public FunnelWeaver<String> getAnotherFunnelWeaver3;
+ @Dependent @Produces public FunnelWeaver<T> getAnotherFunnelWeaver3;
@AnotherScope @Produces public String getAnotherFunnelWeaver4;
@FishStereotype
- @Produces public FunnelWeaver<String> getAnotherFunnelWeaver5;
+ @Produces public FunnelWeaver<T> getAnotherFunnelWeaver5;
- @Produces public FunnelWeaver<String> create(InjectionPoint point) {
+ @Produces public FunnelWeaver<T> create(InjectionPoint point) {
return null;
}
@AnotherScope
@Produces
- public FunnelWeaver<String> create2(InjectionPoint point) {
+ public <E> FunnelWeaver<E> create2(InjectionPoint point) {
return null;
}
- @Dependent @Produces public FunnelWeaver<String> create3(InjectionPoint point) {
+ @Dependent @Produces public <E> FunnelWeaver<E> create3(InjectionPoint point) {
return null;
}
@@ -38,7 +42,18 @@
@FishStereotype
@Produces
- public FunnelWeaver<String> create5(InjectionPoint point) {
+ public FunnelWeaver<T> create5(InjectionPoint point) {
return null;
}
+
+ @SuppressWarnings("unchecked")
+ @Produces
+ @Named
+ @RequestScoped
+ public List<String> getUsers() {
+ return null;
+ }
+
+ @AnotherScope
+ @Produces public FunnelWeaver<String> getAnotherFunnelWeaver7;
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java 2010-09-07 15:12:57 UTC (rev 24769)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java 2010-09-07 15:24:48 UTC (rev 24770)
@@ -456,13 +456,24 @@
*/
public void testParameterizedReturnTypeWithWrongScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 25, 39);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 21);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 29, 43);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 25);
assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 35);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 31);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 39);
}
/**
+ * https://jira.jboss.org/browse/JBIDE-7013
+ *
+ * @throws Exception
+ */
+ public void testParameterizedReturnTypeWithoutTypeVariableOk() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 52);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 57);
+ }
+
+ /**
* 3.3.2. Declaring a producer method
* - producer method is annotated @Inject
*
@@ -686,10 +697,10 @@
*/
public void testParameterizedTypeWithWrongScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 11, 18);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 9);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 14);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 16);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 15, 22);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 13);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 18);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 20);
}
/**
15 years, 7 months