JBoss Tools SVN: r42126 - branches/jbosstools-3.3.x/maven/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-06-20 19:22:36 -0400 (Wed, 20 Jun 2012)
New Revision: 42126
Modified:
branches/jbosstools-3.3.x/maven/docs/reference/en-US/Book_Info.xml
branches/jbosstools-3.3.x/maven/docs/reference/en-US/creating_a_maven_module.xml
branches/jbosstools-3.3.x/maven/docs/reference/en-US/creating_a_maven_project.xml
Log:
updated with files from trunk
Modified: branches/jbosstools-3.3.x/maven/docs/reference/en-US/Book_Info.xml
===================================================================
--- branches/jbosstools-3.3.x/maven/docs/reference/en-US/Book_Info.xml 2012-06-20 23:09:21 UTC (rev 42125)
+++ branches/jbosstools-3.3.x/maven/docs/reference/en-US/Book_Info.xml 2012-06-20 23:22:36 UTC (rev 42126)
@@ -13,7 +13,7 @@
<edition>5.0.0</edition>
- <pubsnumber>3</pubsnumber>
+ <pubsnumber>4</pubsnumber>
<abstract>
<para>
Modified: branches/jbosstools-3.3.x/maven/docs/reference/en-US/creating_a_maven_module.xml
===================================================================
--- branches/jbosstools-3.3.x/maven/docs/reference/en-US/creating_a_maven_module.xml 2012-06-20 23:09:21 UTC (rev 42125)
+++ branches/jbosstools-3.3.x/maven/docs/reference/en-US/creating_a_maven_module.xml 2012-06-20 23:22:36 UTC (rev 42126)
@@ -4,7 +4,7 @@
A Maven module is a sub-project. To create a Maven module you will need to already have a Maven project available.
</para>
<para>
- The parent project must have its <guilabel>Packaing</guilabel> option be pre-configured to <guimenuitem>pom</guimenuitem> for a module to be created and associated to it. To ensure your parent project has this option set correctly before proceeding, double-click on the <filename>pom.xml</filename> file of your parent project in the <guilabel>Project Explorer</guilabel>.
+ The parent project must have its <guilabel>Packaging</guilabel> option be pre-configured to <guimenuitem>pom</guimenuitem>, for a module to be created and associated with it. To ensure your parent project has this option set correctly before proceeding, double-click on the <filename>pom.xml</filename> file of your parent project in the <guilabel>Project Explorer</guilabel>.
</para>
<para>
In the <guilabel>Overview</guilabel> settings page that is now displayed in your workbench, confirm that the option <guibutton>Packaging</guibutton> is set to <guimenuitem>pom</guimenuitem>. If it is not, select <guimenuitem>pom</guimenuitem> from the list menu and save the changes to your <filename>pom.xml</filename> file.
@@ -115,7 +115,7 @@
Specify archetype parameters <guilabel>Group Id</guilabel> and <guilabel>Version</guilabel>. Ensure that the values you specify for these fields are unique from those set in the parent project.
</para>
<para>
- In this example, the <guilabel>Group Id</guilabel> and <guilabel>Version</guilabel> settings of the parent project used are set to <property>group_id</property> and <property>0.0.1-SNAPSHOT</property> respectively. For the module <guilabel>Group Id</guilabel> and <guilabel>Version</guilabel> settings are being specified as <property>sub_group_id</property> and <property>0.1.1-SNAPSHOT</property> respectively, to avoid conflict.
+ In this example, the <guilabel>Group Id</guilabel> and <guilabel>Version</guilabel> settings of the parent project used are set to <property>group_id</property> and <property>0.0.1-SNAPSHOT</property> respectively. For the module, <guilabel>Group Id</guilabel> and <guilabel>Version</guilabel> settings are being specified as <property>sub_group_id</property> and <property>0.1.1-SNAPSHOT</property> respectively, to avoid conflict.
</para>
<figure id="module_creation_07">
<title>Archetype parameter settings</title>
Modified: branches/jbosstools-3.3.x/maven/docs/reference/en-US/creating_a_maven_project.xml
===================================================================
--- branches/jbosstools-3.3.x/maven/docs/reference/en-US/creating_a_maven_project.xml 2012-06-20 23:09:21 UTC (rev 42125)
+++ branches/jbosstools-3.3.x/maven/docs/reference/en-US/creating_a_maven_project.xml 2012-06-20 23:22:36 UTC (rev 42126)
@@ -87,7 +87,7 @@
</mediaobject>
</figure>
<para>
- Clicking <guibutton>Finish</guibutton> will bring back to the workbench and your Maven project will appear in the <guilabel>Project Explorer</guilabel>.
+ Clicking <guibutton>Finish</guibutton> will bring you back to the workbench and your Maven project will appear in the <guilabel>Project Explorer</guilabel>.
</para>
<figure id="application_creation_06">
<title>Project in the Project Explorer</title>
12 years, 7 months
JBoss Tools SVN: r42125 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-06-20 19:09:21 -0400 (Wed, 20 Jun 2012)
New Revision: 42125
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/CDIProjectAsYouType.java
Log:
JBIDE-10611
https://issues.jboss.org/browse/JBIDE-10611
CDI Model for as-you-type with modified file is improved to find injected beans correctly - copy is created with modified set of all beans.
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 2012-06-20 23:06:12 UTC (rev 42124)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2012-06-20 23:09:21 UTC (rev 42125)
@@ -82,8 +82,9 @@
* @author Viacheslav Kabanovich
*
*/
-public class CDIProject extends CDIElement implements ICDIProject {
+public class CDIProject extends CDIElement implements ICDIProject, Cloneable {
CDICoreNature n;
+ private ICDIProject declaringProject = this;
private Map<String, StereotypeElement> stereotypes = new HashMap<String, StereotypeElement>();
private Map<IPath, StereotypeElement> stereotypesByPath = new HashMap<IPath, StereotypeElement>();
@@ -114,6 +115,25 @@
public CDIProject() {}
+ public CDIProject getModifiedCopy(IFile file, Set<IBean> beans) {
+ CDIProject p = null;
+ try {
+ p = (CDIProject)clone();
+ } catch (CloneNotSupportedException e) {
+ e.printStackTrace();
+ return null;
+ }
+ p.declaringProject = this;
+ p.allBeans = new HashSet<IBean>();
+ synchronized(this) {
+ p.allBeans.addAll(allBeans);
+ }
+ p.allBeans.removeAll(getBeans(file.getFullPath()));
+ p.allBeans.addAll(beans);
+
+ return p;
+ }
+
@Override
public CDICoreNature getNature() {
return n;
@@ -316,7 +336,7 @@
* @see org.jboss.tools.cdi.core.IBeanManager#getBeans(boolean, org.jboss.tools.cdi.core.IInjectionPoint)
*/
public Set<IBean> getBeans(boolean attemptToResolveAmbiguousDependency, IInjectionPoint injectionPoint) {
- if(injectionPoint.getDeclaringProject() != this) {
+ if(injectionPoint.getDeclaringProject() != getDeclaringProject()) {
return injectionPoint.getDeclaringProject().getBeans(attemptToResolveAmbiguousDependency, injectionPoint);
}
Set<IBean> result = new HashSet<IBean>();
@@ -1028,7 +1048,7 @@
@Override
public ICDIProject getDeclaringProject() {
- return this;
+ return declaringProject;
}
@Override
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProjectAsYouType.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProjectAsYouType.java 2012-06-20 23:06:12 UTC (rev 42124)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProjectAsYouType.java 2012-06-20 23:09:21 UTC (rev 42125)
@@ -25,6 +25,18 @@
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IPackageDeclaration;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
+import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
+import org.eclipse.jdt.ui.IWorkingCopyManager;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IBean;
@@ -49,6 +61,7 @@
import org.jboss.tools.cdi.internal.core.scanner.CDIBuilderDelegate;
import org.jboss.tools.cdi.internal.core.scanner.FileSet;
import org.jboss.tools.cdi.internal.core.scanner.ImplementationCollector;
+import org.jboss.tools.common.CommonPlugin;
import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.java.IJavaReference;
import org.jboss.tools.common.java.IParametedType;
@@ -77,13 +90,17 @@
} catch (CoreException e) {
CDICorePlugin.getDefault().logError(e);
}
+ CDIProject p = ((CDIProject)project).getModifiedCopy(file, beans);
+ if(p != null) {
+ this.project = p;
+ }
}
private void build() throws CoreException {
DefinitionContext context = project.getNature().getDefinitions().getCleanCopy();
FileSet fileSet = new FileSet();
if(file.getName().endsWith(".java")) {
- ICompilationUnit unit = EclipseUtil.getCompilationUnit(file);
+ ICompilationUnit unit = findCompilationUnit();// EclipseUtil.getCompilationUnit(file);
if(unit!=null) {
if(file.getName().equals("package-info.java")) {
IPackageDeclaration[] pkg = unit.getPackageDeclarations();
@@ -112,6 +129,48 @@
}
+ private ICompilationUnit findCompilationUnit() {
+ IWorkbench workbench = CommonPlugin.getDefault().getWorkbench();
+ if(workbench != null) {
+ IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
+ for (IWorkbenchWindow window: windows) {
+ if(window.getShell() != null) {
+ IWorkbenchPage[] pages = window.getPages();
+ for (IWorkbenchPage page: pages) {
+ IEditorReference[] rs = page.getEditorReferences();
+ for (IEditorReference r: rs) {
+ IEditorPart part = r.getEditor(false);
+ if(part != null) {
+ IFile file = getFile(part);
+ if(file != null && file.equals(this.file) && part instanceof CompilationUnitEditor) {
+ IWorkingCopyManager manager= JavaUI.getWorkingCopyManager();
+ ICompilationUnit unit= manager.getWorkingCopy(part.getEditorInput());
+ if(unit != null) {
+ try {
+ unit.reconcile(ICompilationUnit.NO_AST,
+ false /* don't force problem detection */,
+ null /* use primary owner */,
+ null /* no progress monitor */);
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ return unit;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private IFile getFile(IEditorPart part) {
+ IEditorInput input = part.getEditorInput();
+ return (input instanceof IFileEditorInput) ? ((IFileEditorInput)input).getFile() : null;
+ }
+
synchronized void rebuildAnnotationTypes(List<AnnotationDefinition> ds) {
for (AnnotationDefinition d: ds) {
if(d.getResource() == null || !d.getResource().getFullPath().equals(file.getFullPath())) {
@@ -183,7 +242,7 @@
if(!typeDefinition.isVetoed()
//Type is defined in another project and modified/replaced in config in this (dependent) project
//We should reject type definition based on type, but we have to accept
- && (/*!vetoedTypes.contains(typeName) &&*/ getNature().getDefinitions().getTypeDefinition(typeName) == null && typeDefinition.getOriginalDefinition() == null)) {
+ && !(/*vetoedTypes.contains(typeName)*/false && getNature().getDefinitions().getTypeDefinition(typeName) == null && typeDefinition.getOriginalDefinition() == null)) {
if(typeDefinition.hasBeanConstructor()) {
beans.add(bean);
newClassBeans.put(typeDefinition.getType(), bean);
12 years, 7 months
JBoss Tools SVN: r42124 - branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-06-20 19:06:12 -0400 (Wed, 20 Jun 2012)
New Revision: 42124
Modified:
branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml
Log:
updated with fix from trunk
Modified: branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml
===================================================================
--- branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml 2012-06-20 23:04:34 UTC (rev 42123)
+++ branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml 2012-06-20 23:06:12 UTC (rev 42124)
@@ -13,7 +13,7 @@
<!-- JBDS-2212 -->
<varlistentry>
<term>
- <ulink url="https://issues.jboss.org/jira/browse/JBDS-2212">JBDS-2212<ulink>
+ <ulink url="https://issues.jboss.org/jira/browse/JBDS-2212">JBDS-2212</ulink>
</term>
<listitem>
<para>
12 years, 7 months
JBoss Tools SVN: r42123 - trunk/documentation/guides/JBDS_Release_Notes/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-06-20 19:04:34 -0400 (Wed, 20 Jun 2012)
New Revision: 42123
Modified:
trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
trunk/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml
Log:
updated with files from trunk
Modified: trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2012-06-20 23:04:21 UTC (rev 42122)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2012-06-20 23:04:34 UTC (rev 42123)
@@ -8,7 +8,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>5.0</productnumber>
<edition>5.0.0</edition>
- <pubsnumber>13</pubsnumber>
+ <pubsnumber>14</pubsnumber>
<abstract>
<para>
These release notes contain important information related to the JBoss Developer Studio. New features, known issues, resources, and other current issues are addressed here.
Modified: trunk/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml 2012-06-20 23:04:21 UTC (rev 42122)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml 2012-06-20 23:04:34 UTC (rev 42123)
@@ -9,7 +9,18 @@
<para>
Following is a list of known issues at the time of release.
</para>
- <variablelist>
+ <variablelist>
+ <!-- JBDS-2212 -->
+ <varlistentry>
+ <term>
+ <ulink url="https://issues.jboss.org/jira/browse/JBDS-2212">JBDS-2212<ulink>
+ </term>
+ <listitem>
+ <para>
+ Features of JBoss Developer Studio may show incorrect version numbers when viewing installation information. Under <menuchoice><guimenuitem>Help</guimenuitem><guimenuitem>About JBoss Developer Studio</guimenuitem><guimenuitem>Installation Details</guimenuitem><guimenuitem>Features</guimenuitem></menuchoice> some features will display a version number older than the previous release of JBoss Developer Studio. These numbers are incorrect and will be incremented correctly in the future.
+ </para>
+ </listitem>
+ </varlistentry>
<!-- JBDS-2180 -->
<varlistentry>
<term>
12 years, 7 months
JBoss Tools SVN: r42122 - branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-06-20 19:04:21 -0400 (Wed, 20 Jun 2012)
New Revision: 42122
Modified:
branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml
Log:
updated with files from trunk
Modified: branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
===================================================================
--- branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2012-06-20 21:40:46 UTC (rev 42121)
+++ branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2012-06-20 23:04:21 UTC (rev 42122)
@@ -8,7 +8,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>5.0</productnumber>
<edition>5.0.0</edition>
- <pubsnumber>13</pubsnumber>
+ <pubsnumber>14</pubsnumber>
<abstract>
<para>
These release notes contain important information related to the JBoss Developer Studio. New features, known issues, resources, and other current issues are addressed here.
Modified: branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml
===================================================================
--- branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml 2012-06-20 21:40:46 UTC (rev 42121)
+++ branches/jbosstools-3.3.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml 2012-06-20 23:04:21 UTC (rev 42122)
@@ -9,7 +9,18 @@
<para>
Following is a list of known issues at the time of release.
</para>
- <variablelist>
+ <variablelist>
+ <!-- JBDS-2212 -->
+ <varlistentry>
+ <term>
+ <ulink url="https://issues.jboss.org/jira/browse/JBDS-2212">JBDS-2212<ulink>
+ </term>
+ <listitem>
+ <para>
+ Features of JBoss Developer Studio may show incorrect version numbers when viewing installation information. Under <menuchoice><guimenuitem>Help</guimenuitem><guimenuitem>About JBoss Developer Studio</guimenuitem><guimenuitem>Installation Details</guimenuitem><guimenuitem>Features</guimenuitem></menuchoice> some features will display a version number older than the previous release of JBoss Developer Studio. These numbers are incorrect and will be incremented correctly in the future.
+ </para>
+ </listitem>
+ </varlistentry>
<!-- JBDS-2180 -->
<varlistentry>
<term>
12 years, 7 months
JBoss Tools SVN: r42121 - branches/jbosstools-3.3.x.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-06-20 17:40:46 -0400 (Wed, 20 Jun 2012)
New Revision: 42121
Removed:
branches/jbosstools-3.3.x/5.0.0.GA.html
Log:
committed in wrong place; remove
Deleted: branches/jbosstools-3.3.x/5.0.0.GA.html
===================================================================
--- branches/jbosstools-3.3.x/5.0.0.GA.html 2012-06-20 21:38:54 UTC (rev 42120)
+++ branches/jbosstools-3.3.x/5.0.0.GA.html 2012-06-20 21:40:46 UTC (rev 42121)
@@ -1,153 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
- <head>
- <title>JBoss Developer Studio - Early Access - Build 5.0.0.v20120615-1714-H213-GA</title>
- <link href="https://devstudio.jboss.com/web/jbds_styles.css" rel="stylesheet" type="text/css">
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
- <!-- Google Analytics -->
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-18653195-1']); // note, for Usage, use -2 suffix
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- <!-- Google Analytics -->
-
- <script type="text/javascript">
- <!--
- function toggle()
- {
- theImg=document.getElementById('screenshot');
- if (theImg.src.indexOf("540.png")>0)
- {
- theImg.src=theImg.src.replace("jbds-screenshot-browsersim-540.png","jbds-screenshot-browsersim.png");
- theImg.style.zIndex="1";
- theImg.style.position="absolute";
- theImg.style.top="-150px";
- theImg.style.left="-10px";
- }
- else
- {
- theImg.src=theImg.src.replace("jbds-screenshot-browsersim.png","jbds-screenshot-browsersim-540.png");
- theImg.style.zIndex="0";
- theImg.style.position="relative";
- theImg.style.top="0px";
- theImg.style.left="0px";
- }
- }
- -->
- </script>
- </head>
- <body>
-<div id="container">
- <div id="header">
- </div>
- <div id="content">
-
- <table width="100%">
- <tr>
- <td align="right"><small>
- <span style="font-size: x-small;">Build 5.0.0.v20120615-1714-H213-GA</span>
- </td>
- </tr>
- </table>
-
-<div class="rightsidebar" style="width:280px;padding-right:0px;padding-left:10px;z-index:-1;float:right">
- <h4>Installation :: Core Tooling</h4>
- <p style="width:260px;margin-right:15px">1. If you don't already have one installed, you will need to download and install Sun/Oracle JDK 6.0 or OpenJDK 6.0.</p>
- <p style="width:260px;margin-right:15px">2. Download the installer for your platform.</p>
- <p style="width:260px;margin-right:15px">3. Double-click the installer file to run it, or open a terminal and type <nobr><code>java -jar jbdevstudio-*.jar</code></nobr></p>
- <a href="http://www.redhat.com/promo/eap6beta/"><img src="https://devstudio.jboss.com/images/banner_JBEAP6beta.png" style="margin-left:-5px" border="0"/></a>
- <h4 style="padding-top:5px; margin-top:5px">Looking for EAP 6?</h4>
- <p style="width:260px;margin-right:15px"><a href="http://www.redhat.com/promo/eap6beta/">JBoss Enterprise Application Platform 6 Beta</a> is available now.
- <a href="http://www.redhat.com/promo/eap6beta/">Click here</a> for more information or to download your copy today!
- </li>
- </ol>
- </div>
-
-<h2 class="prime">JBoss Developer Studio 5.0 Early Access
-</h2>
-<br/>
- <p>We wish to give customers and users early access to Developer Studio so we can make the next version of JBoss Developer Studio an even better environment for
- developing on the JBoss Enterprise Platform. <a onClick="javascript: _gaq.push(['_trackPageview', this.href]);" href="readme.html">Click here for more information.</a></p>
-<p>
- Downloading anything from this site constitutes your agreement with the <a onClick="javascript: _gaq.push(['_trackPageview', this.href]);" href="readme.html">program terms</a>.</p>
-
-<div style="background-color:#eeeecc; width:580px;padding:10px;margin:0px;padding-top:0px;margin-top:0px;border:1px #aaaaaa solid;z-index:1;position:relative;float:left">
- <h2><a name="universal"></a>
- Download
- Latest Build: <span class="build">
- 5.0.0.GA
- </span></h2>
-
- <ul>
- <li class="multiplatform"><a onClick="javascript: _gaq.push(['_trackPageview', this.href]);" style="font-size: 18px;"
- href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">Universal Multi-Platform Standalone</a><span class="multispec"> 385.24M (<a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
- href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">MD5</a>)</li>
- <li class="multiplatform"><a onClick="javascript: _gaq.push(['_trackPageview', this.href]);" style="font-size: 18px;"
- href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">Universal Multi-Platform EAP 6 Bundle</a><span class="multispec"> 494.72M (<a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
- href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">MD5</a>)</li>
- <li class="note"><a name="64bnote"></a>The Visual Page Editor does not run on 64-bit Windows or Mac. While the source editor does work, visual editing & preview do not. If you require this, run the installer with a 32-bit JDK.</li>
- </ul>
-
- <p align="center"><a href="javascript:toggle()"><img border="0" id="screenshot" src="https://devstudio.jboss.com/images/jbds-screenshot-browsersim-540.png"/><br/><small>Click to enlarge</small></p>
-</div>
-<p style="clear:both"> </p>
-
-<hr/>
-
-
- <h2 class="prime">Other Downloads</h2>
-
- <h2>Sources</h2>
- <ul>
- <li class="multiplatform"><a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
- href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">Sources Zip</a><span class="multispec"> 110.92M (<a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
- href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">MD5</a>)</li>
- <li class="note"><a name="sourcesnote"></a>Does not include third-party code.</li>
- </ul>
-
- <h2>Update Site Zip</h2>
- <ul>
- <li class="multiplatform"><a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
- href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">Update Site Zip</a><span class="multispec"> 372.28M (<a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
- href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">MD5</a>)</li>
- <li class="note"><a name="sourcesnote"></a>Includes some third-party code.</li>
- </ul>
-
-</div>
-<p style="clear:both"> </p>
-
-<hr/>
- <h2>Release Notes</h2>
- <p>As this is an Early Access release, there are no release notes for JBoss Developer Studio yet available. However, the following link provides a list of issues closed in this release.
- Please note that documents pertaining to JBoss Tools may make mention of functionality not included or planned for inclusion in JBoss Developer Studio at this time.</p>
- <p>
- <ul>
- <li class="jirabug"><a href="https://issues.jboss.org/secure/IssueNavigator!executeAdvanced.jspa?jqlQu...'5.0.0.GA',+'3.3.0.GA')+and+Status+in+(Resolved,Closed)&runQuery=true&clear=true">JBoss Tools and Developer Studio - Resolved Issues</a> </li>
- <!--
- <li><a href="http://community.jboss.org/en/tools/blog/2011/12/23/jboss-tools-m5-is-com...">JBoss Tools - Release Announcement</a>
- </li>
- <li><a href="http://docs.jboss.org/tools/whatsnew/">JBoss Tools - New And Noteworthy</a>
- </li>
- <li><a href="http://sourceforge.net/projects/jboss/files/JBossTools/JBossTools3.3.0.x/...">JBoss Tools - Release Notes</a>
- </li>
--->
- </ul>
- </p>
- <h2>Feedback</h2>
- <p>The JBoss Developer Studio product team will directly assist
- with participant questions on a best effort basis at the
- <a href="https://community.jboss.org/community/jbossdevstudio?view=discussions">JBoss Developer Studio Community forum</a>.
- <p>We will then evaluate the feedback and if needed, we will report the issue in <a onClick="javascript: _gaq.push(['_trackPageview', this.href]);" href="https://jira.jboss.org/jira/secure/CreateIssue.jspa?pid=12310500&issuetype=1">JIRA</a>, then provide you a link to where the discussion can continue.</p>
- <h2>Thank you!</h2>
-
- </div>
- </div>
-</body>
-</html>
12 years, 7 months
JBoss Tools SVN: r42120 - branches/jbosstools-3.3.x.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-06-20 17:38:54 -0400 (Wed, 20 Jun 2012)
New Revision: 42120
Added:
branches/jbosstools-3.3.x/5.0.0.GA.html
Log:
new early access build - 5.0.0.GA
Added: branches/jbosstools-3.3.x/5.0.0.GA.html
===================================================================
--- branches/jbosstools-3.3.x/5.0.0.GA.html (rev 0)
+++ branches/jbosstools-3.3.x/5.0.0.GA.html 2012-06-20 21:38:54 UTC (rev 42120)
@@ -0,0 +1,153 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+ <head>
+ <title>JBoss Developer Studio - Early Access - Build 5.0.0.v20120615-1714-H213-GA</title>
+ <link href="https://devstudio.jboss.com/web/jbds_styles.css" rel="stylesheet" type="text/css">
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+ <!-- Google Analytics -->
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-18653195-1']); // note, for Usage, use -2 suffix
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+ </script>
+ <!-- Google Analytics -->
+
+ <script type="text/javascript">
+ <!--
+ function toggle()
+ {
+ theImg=document.getElementById('screenshot');
+ if (theImg.src.indexOf("540.png")>0)
+ {
+ theImg.src=theImg.src.replace("jbds-screenshot-browsersim-540.png","jbds-screenshot-browsersim.png");
+ theImg.style.zIndex="1";
+ theImg.style.position="absolute";
+ theImg.style.top="-150px";
+ theImg.style.left="-10px";
+ }
+ else
+ {
+ theImg.src=theImg.src.replace("jbds-screenshot-browsersim.png","jbds-screenshot-browsersim-540.png");
+ theImg.style.zIndex="0";
+ theImg.style.position="relative";
+ theImg.style.top="0px";
+ theImg.style.left="0px";
+ }
+ }
+ -->
+ </script>
+ </head>
+ <body>
+<div id="container">
+ <div id="header">
+ </div>
+ <div id="content">
+
+ <table width="100%">
+ <tr>
+ <td align="right"><small>
+ <span style="font-size: x-small;">Build 5.0.0.v20120615-1714-H213-GA</span>
+ </td>
+ </tr>
+ </table>
+
+<div class="rightsidebar" style="width:280px;padding-right:0px;padding-left:10px;z-index:-1;float:right">
+ <h4>Installation :: Core Tooling</h4>
+ <p style="width:260px;margin-right:15px">1. If you don't already have one installed, you will need to download and install Sun/Oracle JDK 6.0 or OpenJDK 6.0.</p>
+ <p style="width:260px;margin-right:15px">2. Download the installer for your platform.</p>
+ <p style="width:260px;margin-right:15px">3. Double-click the installer file to run it, or open a terminal and type <nobr><code>java -jar jbdevstudio-*.jar</code></nobr></p>
+ <a href="http://www.redhat.com/promo/eap6beta/"><img src="https://devstudio.jboss.com/images/banner_JBEAP6beta.png" style="margin-left:-5px" border="0"/></a>
+ <h4 style="padding-top:5px; margin-top:5px">Looking for EAP 6?</h4>
+ <p style="width:260px;margin-right:15px"><a href="http://www.redhat.com/promo/eap6beta/">JBoss Enterprise Application Platform 6 Beta</a> is available now.
+ <a href="http://www.redhat.com/promo/eap6beta/">Click here</a> for more information or to download your copy today!
+ </li>
+ </ol>
+ </div>
+
+<h2 class="prime">JBoss Developer Studio 5.0 Early Access
+</h2>
+<br/>
+ <p>We wish to give customers and users early access to Developer Studio so we can make the next version of JBoss Developer Studio an even better environment for
+ developing on the JBoss Enterprise Platform. <a onClick="javascript: _gaq.push(['_trackPageview', this.href]);" href="readme.html">Click here for more information.</a></p>
+<p>
+ Downloading anything from this site constitutes your agreement with the <a onClick="javascript: _gaq.push(['_trackPageview', this.href]);" href="readme.html">program terms</a>.</p>
+
+<div style="background-color:#eeeecc; width:580px;padding:10px;margin:0px;padding-top:0px;margin-top:0px;border:1px #aaaaaa solid;z-index:1;position:relative;float:left">
+ <h2><a name="universal"></a>
+ Download
+ Latest Build: <span class="build">
+ 5.0.0.GA
+ </span></h2>
+
+ <ul>
+ <li class="multiplatform"><a onClick="javascript: _gaq.push(['_trackPageview', this.href]);" style="font-size: 18px;"
+ href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">Universal Multi-Platform Standalone</a><span class="multispec"> 385.24M (<a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
+ href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">MD5</a>)</li>
+ <li class="multiplatform"><a onClick="javascript: _gaq.push(['_trackPageview', this.href]);" style="font-size: 18px;"
+ href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">Universal Multi-Platform EAP 6 Bundle</a><span class="multispec"> 494.72M (<a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
+ href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">MD5</a>)</li>
+ <li class="note"><a name="64bnote"></a>The Visual Page Editor does not run on 64-bit Windows or Mac. While the source editor does work, visual editing & preview do not. If you require this, run the installer with a 32-bit JDK.</li>
+ </ul>
+
+ <p align="center"><a href="javascript:toggle()"><img border="0" id="screenshot" src="https://devstudio.jboss.com/images/jbds-screenshot-browsersim-540.png"/><br/><small>Click to enlarge</small></p>
+</div>
+<p style="clear:both"> </p>
+
+<hr/>
+
+
+ <h2 class="prime">Other Downloads</h2>
+
+ <h2>Sources</h2>
+ <ul>
+ <li class="multiplatform"><a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
+ href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">Sources Zip</a><span class="multispec"> 110.92M (<a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
+ href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">MD5</a>)</li>
+ <li class="note"><a name="sourcesnote"></a>Does not include third-party code.</li>
+ </ul>
+
+ <h2>Update Site Zip</h2>
+ <ul>
+ <li class="multiplatform"><a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
+ href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">Update Site Zip</a><span class="multispec"> 372.28M (<a onClick="javascript: _gaq.push(['_trackPageview', this.href]);"
+ href="https://devstudio.jboss.com/earlyaccess/builds/development/5.0.0.GA/jbdev...">MD5</a>)</li>
+ <li class="note"><a name="sourcesnote"></a>Includes some third-party code.</li>
+ </ul>
+
+</div>
+<p style="clear:both"> </p>
+
+<hr/>
+ <h2>Release Notes</h2>
+ <p>As this is an Early Access release, there are no release notes for JBoss Developer Studio yet available. However, the following link provides a list of issues closed in this release.
+ Please note that documents pertaining to JBoss Tools may make mention of functionality not included or planned for inclusion in JBoss Developer Studio at this time.</p>
+ <p>
+ <ul>
+ <li class="jirabug"><a href="https://issues.jboss.org/secure/IssueNavigator!executeAdvanced.jspa?jqlQu...'5.0.0.GA',+'3.3.0.GA')+and+Status+in+(Resolved,Closed)&runQuery=true&clear=true">JBoss Tools and Developer Studio - Resolved Issues</a> </li>
+ <!--
+ <li><a href="http://community.jboss.org/en/tools/blog/2011/12/23/jboss-tools-m5-is-com...">JBoss Tools - Release Announcement</a>
+ </li>
+ <li><a href="http://docs.jboss.org/tools/whatsnew/">JBoss Tools - New And Noteworthy</a>
+ </li>
+ <li><a href="http://sourceforge.net/projects/jboss/files/JBossTools/JBossTools3.3.0.x/...">JBoss Tools - Release Notes</a>
+ </li>
+-->
+ </ul>
+ </p>
+ <h2>Feedback</h2>
+ <p>The JBoss Developer Studio product team will directly assist
+ with participant questions on a best effort basis at the
+ <a href="https://community.jboss.org/community/jbossdevstudio?view=discussions">JBoss Developer Studio Community forum</a>.
+ <p>We will then evaluate the feedback and if needed, we will report the issue in <a onClick="javascript: _gaq.push(['_trackPageview', this.href]);" href="https://jira.jboss.org/jira/secure/CreateIssue.jspa?pid=12310500&issuetype=1">JIRA</a>, then provide you a link to where the discussion can continue.</p>
+ <h2>Thank you!</h2>
+
+ </div>
+ </div>
+</body>
+</html>
12 years, 7 months
JBoss Tools SVN: r42119 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-06-20 16:30:33 -0400 (Wed, 20 Jun 2012)
New Revision: 42119
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
Log:
Seam test project is not generated even if the proper option is checked https://issues.jboss.org/browse/JBIDE-12186
EJB and EAR projects are not generated when proper option is checked https://issues.jboss.org/browse/JBIDE-12184
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2012-06-20 19:50:22 UTC (rev 42118)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2012-06-20 20:30:33 UTC (rev 42119)
@@ -32,6 +32,7 @@
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties;
+import org.eclipse.jst.servlet.ui.project.facet.WebProjectWizard;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -78,6 +79,7 @@
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider;
import org.jboss.tools.seam.internal.core.project.facet.SeamValidatorFactory;
import org.jboss.tools.seam.ui.wizard.SeamFormWizard;
+import org.jboss.tools.seam.ui.wizard.SeamProjectWizard;
import org.jboss.tools.seam.ui.wizard.SeamWizardFactory;
import org.jboss.tools.seam.ui.wizard.SeamWizardUtils;
@@ -125,7 +127,7 @@
Arrays.asList(new Object[] {
ISeamFacetDataModelProperties.DEPLOY_AS_WAR,
ISeamFacetDataModelProperties.DEPLOY_AS_EAR }),
- getDeployAsDefaultValue());
+ ISeamFacetDataModelProperties.DEPLOY_AS_WAR);
// Database group
private IFieldEditor connProfileSelEditor;
@@ -197,7 +199,7 @@
private Object getDeployAsDefaultValue() {
String result = SeamProjectPreferences
.getStringPreference(SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS);
- if (!isNewProjectWizard()) {
+ if (!isSeamProjectWizard()) {
ISelection sel = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getSelectionService()
.getSelection();
@@ -315,9 +317,10 @@
SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS,
this.jBossAsDeployAsEditor.getValueAsString());
- model.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_TEMPLATES_AND_LIBRARIES_COPYING, isNewProjectWizard());
+ model.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_TEMPLATES_AND_LIBRARIES_COPYING, isSeamProjectWizard() || isWebProjectWizard());
- model.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING, libraryListEditor.getValueAsString().equals(SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES) && isNewProjectWizard());
+ model.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING,
+ libraryListEditor.getValueAsString().equals(SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES) && (isSeamProjectWizard() || isWebProjectWizard()));
}
/*
@@ -419,11 +422,14 @@
}
});
+ Object deployAs = getDeployAsDefaultValue();
+ jBossAsDeployAsEditor.setValue(deployAs);
+
registerEditor(jBossAsDeployAsEditor, generalGroup, 3);
registerEditor(ejbProjectNameditor, generalGroup, 3);
- ejbProjectNameditor.setEnabled(getDeployAsDefaultValue().equals(ISeamFacetDataModelProperties.DEPLOY_AS_EAR));
+ ejbProjectNameditor.setEnabled(deployAs.equals(ISeamFacetDataModelProperties.DEPLOY_AS_EAR));
registerEditor(earProjectNameditor, generalGroup, 3);
- earProjectNameditor.setEnabled(getDeployAsDefaultValue().equals(ISeamFacetDataModelProperties.DEPLOY_AS_EAR));
+ earProjectNameditor.setEnabled(deployAs.equals(ISeamFacetDataModelProperties.DEPLOY_AS_EAR));
List<String> providers = new ArrayList<String>();
providers.add(SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES);
@@ -440,8 +446,10 @@
jBossAsDeployAsEditor.addPropertyChangeListener(new PropertyChangeListener(){
public void propertyChange(PropertyChangeEvent arg0) {
Boolean value = jBossAsDeployAsEditor.getValue() == ISeamFacetDataModelProperties.DEPLOY_AS_EAR;
- ejbProjectNameditor.setEnabled(value.booleanValue());
- earProjectNameditor.setEnabled(value.booleanValue());
+ if(!isWebProjectWizard()){
+ ejbProjectNameditor.setEnabled(value.booleanValue());
+ earProjectNameditor.setEnabled(value.booleanValue());
+ }
}
});
@@ -493,13 +501,24 @@
registerEditor(testProjectNameditor, generationGroup, 3);
registerEditor(testsPkgNameditor, generationGroup, 3);
- if(!isNewProjectWizard()){
+ if(!isSeamProjectWizard()){
createTestProjectCheckboxeditor.setValue(false);
createTestProjectCheckboxeditor.setEnabled(false);
testProjectNameditor.setEnabled(false);
testsPkgNameditor.setEnabled(false);
+ if(!isWebProjectWizard()){
+ libraryListEditor.setValue(providers.get(1));
+ libraryListEditor.setEnabled(false);
+ }
}
+ if(isWebProjectWizard()){
+ ejbProjectNameditor.setValue("");
+ ejbProjectNameditor.setEnabled(false);
+ earProjectNameditor.setValue("");
+ earProjectNameditor.setEnabled(false);
+ }
+
setControl(root);
if (validatorDelegate == null) {
@@ -517,7 +536,7 @@
validatorDelegate.addValidatorForProperty(sessionBeanPkgNameditor
.getName(), new PackageNameValidator(
sessionBeanPkgNameditor.getName(), "session beans")); //$NON-NLS-1$
- if (isNewProjectWizard()) {
+ if (isSeamProjectWizard()) {
validatorDelegate.addValidatorForProperty(
IFacetDataModelProperties.FACET_PROJECT_NAME,
new ProjectNamesDuplicationValidator(
@@ -629,11 +648,17 @@
}
}
- private boolean isNewProjectWizard() {
- // ModifyFacetedProjectWizard or NewProjectDataModelFacetWizard
- return getWizard() == null
- || getWizard() instanceof NewProjectDataModelFacetWizard;
+ private boolean isSeamProjectWizard() {
+ return getWizard() instanceof SeamProjectWizard;
}
+
+ private boolean isWebProjectWizard(){
+ IWizard wizard = getWizard();
+ if(wizard != null){
+ return wizard.getClass().equals(WebProjectWizard.class);
+ }
+ return false;
+ }
/**
*
@@ -654,8 +679,10 @@
sessionBeanPkgNameditor.setValue(getSessionPkgName(seamProjectName));
entityBeanPkgNameditor.setValue(getEntityPkgName(seamProjectName));
testsPkgNameditor.setValue(getTestPkgName(seamProjectName));
- ejbProjectNameditor.setValue(getEJBProjectName(seamProjectName));
- earProjectNameditor.setValue(getEARProjectName(seamProjectName));
+ if(!isWebProjectWizard()){
+ ejbProjectNameditor.setValue(getEJBProjectName(seamProjectName));
+ earProjectNameditor.setValue(getEARProjectName(seamProjectName));
+ }
testProjectNameditor.setValue(getTestProjectName(seamProjectName));
model.setStringProperty(
@@ -733,11 +760,13 @@
if("".equals(testsPkgNameditor.getValueAsString()))
testsPkgNameditor.setValue(getTestPkgName(seamProjectName));
- if("".equals(ejbProjectNameditor.getValueAsString()))
- ejbProjectNameditor.setValue(getEJBProjectName(seamProjectName));
+ if(!isWebProjectWizard()){
+ if("".equals(ejbProjectNameditor.getValueAsString()))
+ ejbProjectNameditor.setValue(getEJBProjectName(seamProjectName));
- if("".equals(earProjectNameditor.getValueAsString()))
- earProjectNameditor.setValue(getEARProjectName(seamProjectName));
+ if("".equals(earProjectNameditor.getValueAsString()))
+ earProjectNameditor.setValue(getEARProjectName(seamProjectName));
+ }
if("".equals(testProjectNameditor.getValueAsString()))
testProjectNameditor.setValue(getTestProjectName(seamProjectName));
@@ -852,13 +881,15 @@
}
private boolean canTestProjectBeCreated() {
- String seamRuntimeName = jBossSeamHomeEditor.getValueAsString();
- SeamRuntime seamRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(seamRuntimeName);
- if (seamRuntime != null) {
- // bootstrap folder was removed in Seam 2.3.0.Beta1 from WFK 2.0 ER4
- // See https://issues.jboss.org/browse/JBIDE-11611
- File bootstrap = new File(seamRuntime.getHomeDir(), "bootstrap");
- return bootstrap.exists();
+ if(isSeamProjectWizard()){
+ String seamRuntimeName = jBossSeamHomeEditor.getValueAsString();
+ SeamRuntime seamRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(seamRuntimeName);
+ if (seamRuntime != null) {
+ // bootstrap folder was removed in Seam 2.3.0.Beta1 from WFK 2.0 ER4
+ // See https://issues.jboss.org/browse/JBIDE-11611
+ File bootstrap = new File(seamRuntime.getHomeDir(), "bootstrap");
+ return bootstrap.exists();
+ }
}
return false;
}
@@ -901,7 +932,7 @@
}
}
- if (ISeamFacetDataModelProperties.DEPLOY_AS_EAR.equals(deployAs)) {
+ if (ISeamFacetDataModelProperties.DEPLOY_AS_EAR.equals(deployAs) && !isWebProjectWizard()) {
final String earProjectName = earProjectNameditor.getValueAsString();
status = ProjectCreationDataModelProviderNew
.validateName(earProjectName);
12 years, 7 months
JBoss Tools SVN: r42118 - tags.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-06-20 15:50:22 -0400 (Wed, 20 Jun 2012)
New Revision: 42118
Added:
tags/jbosstools-3.3.0.Final/
Log:
tag revision 42011 as 3.3.0.Final
12 years, 7 months
JBoss Tools SVN: r42117 - in trunk: common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-06-20 15:23:48 -0400 (Wed, 20 Jun 2012)
New Revision: 42117
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/AnnotationValidationDelegate.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationMessage.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java
Log:
https://issues.jboss.org/browse/JBIDE-10611 As-you-type CDI validation
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/AnnotationValidationDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/AnnotationValidationDelegate.java 2012-06-20 19:22:55 UTC (rev 42116)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/AnnotationValidationDelegate.java 2012-06-20 19:23:48 UTC (rev 42117)
@@ -44,10 +44,8 @@
static final String[] TMF = {TARGET_METHOD, TARGET_FIELD, TARGET_TYPE};
static final String[] MF = {TARGET_METHOD, TARGET_FIELD};
- static final String[][] STEREOTYPE_GENERAL_TARGET_VARAINTS = {TMF, MF,
- {TARGET_TYPE}, {TARGET_METHOD}, {TARGET_FIELD}};
- static final String[][] QUALIFIER_GENERAL_TARGET_VARIANTS = {{TARGET_METHOD, TARGET_FIELD, TARGET_PARAMETER, TARGET_TYPE},
- {TARGET_FIELD, TARGET_PARAMETER}};
+ static final String[][] STEREOTYPE_GENERAL_TARGET_VARAINTS = {TMF, MF, {TARGET_TYPE}, {TARGET_METHOD}, {TARGET_FIELD}};
+ static final String[][] QUALIFIER_GENERAL_TARGET_VARIANTS = {{TARGET_METHOD, TARGET_FIELD, TARGET_PARAMETER, TARGET_TYPE}, {TARGET_FIELD, TARGET_PARAMETER}};
static final String[][] SCOPE_GENERAL_TARGET_VARIANTS = {TMF};
static final String[][] STEREOTYPE_TMF_VARIANTS = {TMF};
static final String[][] STEREOTYPE_MF_VARIANTS = {MF};
@@ -90,22 +88,22 @@
String stName = stereotype.getSourceType().getElementName();
String superStName = superStereotype.getSourceType().getElementName();
if(result) {
- validator.addError(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_TMF, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{superStName, stName}, stereotypeDeclaration, resource);
+ validator.addProblem(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_TMF, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{superStName, stName}, stereotypeDeclaration, resource);
continue;
}
result = CDIUtil.checkTargetAnnotation(target, STEREOTYPE_M_VARIANTS);
if(result) {
- validator.addError(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_M, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{superStName, stName}, stereotypeDeclaration, resource);
+ validator.addProblem(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_M, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{superStName, stName}, stereotypeDeclaration, resource);
continue;
}
result = CDIUtil.checkTargetAnnotation(target, STEREOTYPE_F_VARIANTS);
if(result) {
- validator.addError(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_F, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{superStName, stName}, stereotypeDeclaration, resource);
+ validator.addProblem(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_F, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{superStName, stName}, stereotypeDeclaration, resource);
continue;
}
result = CDIUtil.checkTargetAnnotation(target, STEREOTYPE_MF_VARIANTS);
if(result) {
- validator.addError(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_MF, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{superStName, stName}, stereotypeDeclaration, resource);
+ validator.addProblem(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_MF, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{superStName, stName}, stereotypeDeclaration, resource);
}
}
}
@@ -126,7 +124,7 @@
first = false;
}
String stName = stereotype.getSourceType().getElementName();
- validator.addError(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE_FOR_STEREOTYPE, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{stName, bindings.toString()}, target, resource);
+ validator.addProblem(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE_FOR_STEREOTYPE, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{stName, bindings.toString()}, target, resource);
}
}
}
@@ -146,7 +144,7 @@
IAnnotationType superBinding = declaration.getAnnotation();
Boolean result = CDIUtil.checkTargetAnnotation(superBinding, TYPE_VARIANTS);
if(result!=null && result) {
- validator.addError(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{superBinding.getSourceType().getElementName(), binding.getSourceType().getElementName()}, declaration, binding.getResource());
+ validator.addProblem(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, new String[]{superBinding.getSourceType().getElementName(), binding.getSourceType().getElementName()}, declaration, binding.getResource());
}
}
}
@@ -189,11 +187,11 @@
void validateRetentionAnnotation(ICDIAnnotation type, String message, IResource resource, int message_id) throws JavaModelException {
IAnnotationDeclaration retention = type.getAnnotationDeclaration(CDIConstants.RETENTION_ANNOTATION_TYPE_NAME);
if(retention == null) {
- validator.addError(message, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, CDIUtil.convertToSourceReference(type.getSourceType().getNameRange(), resource, type.getSourceType()), resource, message_id);
+ validator.addProblem(message, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, CDIUtil.convertToSourceReference(type.getSourceType().getNameRange(), resource, type.getSourceType()), resource, message_id);
} else {
Object o = retention.getMemberValue(null);
if(o == null || !CDIConstants.RETENTION_POLICY_RUNTIME_TYPE_NAME.equals(o.toString())) {
- validator.addError(message, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, retention, resource, message_id);
+ validator.addProblem(message, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, retention, resource, message_id);
}
}
}
@@ -214,9 +212,9 @@
private void validateTargetAnnotation(ICDIAnnotation annotationType, String[][] variants, String message, IResource resource, int message_id) throws JavaModelException {
IAnnotationDeclaration target = annotationType.getAnnotationDeclaration(CDIConstants.TARGET_ANNOTATION_TYPE_NAME);
if(target==null) {
- validator.addError(message, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, CDIUtil.convertToSourceReference(annotationType.getSourceType().getNameRange(), resource, annotationType.getSourceType()), resource, message_id);
+ validator.addProblem(message, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, CDIUtil.convertToSourceReference(annotationType.getSourceType().getNameRange(), resource, annotationType.getSourceType()), resource, message_id);
} else if(!CDIUtil.checkTargetAnnotation(target, variants)) {
- validator.addError(message, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, target, resource, message_id);
+ validator.addProblem(message, CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, target, resource, message_id);
}
}
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java 2012-06-20 19:22:55 UTC (rev 42116)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java 2012-06-20 19:23:48 UTC (rev 42117)
@@ -187,7 +187,7 @@
}
IType type = getType(beansXml, typeNode, typeValidator, typepath, attr);
if(type!=null) {
- if(!type.isBinary()) {
+ if(!validator.isAsYouTypeValidation() && !type.isBinary()) {
validator.getValidationContext().addLinkedCoreResource(CDICoreValidator.SHORT_ID, beansXml.getFullPath().toOSString(), type.getPath(), false);
Set<IPath> relatedResources = new HashSet<IPath>();
IResource resource = type.getResource();
@@ -200,7 +200,7 @@
}
String typeError = typeValidator.validateType(context, type);
if(typeError != null) {
- IMarker marker = validator.addError(typeValidator.getIllegalTypeErrorMessage(), CDIPreferences.ILLEGAL_TYPE_NAME_IN_BEANS_XML,
+ IMarker marker = validator.addProblem(typeValidator.getIllegalTypeErrorMessage(), CDIPreferences.ILLEGAL_TYPE_NAME_IN_BEANS_XML,
new String[]{typeNode.getTypeName()}, typeNode.getLength(), typeNode.getStartOffset(), beansXml, typeValidator.getIllegalTypeErrorMessageId());
if(marker != null) bindMarkerToModel(marker, typepath, typeValidator.getTypeElementName());
if(type.isBinary()) {
@@ -210,14 +210,14 @@
TypeNode node = uniqueTypes.get(typeNode.getTypeName());
if(node!=null) {
if(!node.isMarkedAsDuplicated()) {
- IMarker marker = validator.addError(typeValidator.getDuplicateTypeErrorMessage(), CDIPreferences.DUPLICATE_TYPE_IN_BEANS_XML,
+ IMarker marker = validator.addProblem(typeValidator.getDuplicateTypeErrorMessage(), CDIPreferences.DUPLICATE_TYPE_IN_BEANS_XML,
new String[]{}, node.getLength(), node.getStartOffset(), beansXml);
if(marker != null) bindMarkerToModel(marker, typepath, typeValidator.getTypeElementName());
}
node.setMarkedAsDuplicated(true);
typeNode.setMarkedAsDuplicated(true);
typeNode.setDuplicationIndex(node.getDuplicationIndex() + 1);
- IMarker marker = validator.addError(typeValidator.getDuplicateTypeErrorMessage(), CDIPreferences.DUPLICATE_TYPE_IN_BEANS_XML,
+ IMarker marker = validator.addProblem(typeValidator.getDuplicateTypeErrorMessage(), CDIPreferences.DUPLICATE_TYPE_IN_BEANS_XML,
new String[]{}, typeNode.getLength(), typeNode.getStartOffset(), beansXml);
if(marker != null) {
int di = typeNode.getDuplicationIndex();
@@ -271,14 +271,14 @@
return null;
}
} else {
- IMarker marker = validator.addError(typeValidator.getEmptyTypeErrorMessage(), CDIPreferences.ILLEGAL_TYPE_NAME_IN_BEANS_XML,
+ IMarker marker = validator.addProblem(typeValidator.getEmptyTypeErrorMessage(), CDIPreferences.ILLEGAL_TYPE_NAME_IN_BEANS_XML,
new String[]{node.getTypeName()}, node.getLength(), node.getStartOffset(), beansXml, typeValidator.getUnknownTypeErrorMessageId());
bindMarkerToModel(marker, xmodelpath, attr);
return null;
}
if(type==null) {
addLinkedResourcesForUnknownType(beansXml, node.getTypeName());
- IMarker marker = validator.addError(typeValidator.getUnknownTypeErrorMessage(), CDIPreferences.ILLEGAL_TYPE_NAME_IN_BEANS_XML,
+ IMarker marker = validator.addProblem(typeValidator.getUnknownTypeErrorMessage(), CDIPreferences.ILLEGAL_TYPE_NAME_IN_BEANS_XML,
new String[]{node.getTypeName()}, node.getLength(), node.getStartOffset(), beansXml, typeValidator.getUnknownTypeErrorMessageId());
bindMarkerToModel(marker, xmodelpath, attr);
}
@@ -300,7 +300,7 @@
}
private void addLinkedResourcesForUnknownType(IFile beansXml, String typeName) {
- if(typeName!=null && typeName.trim().length()>0) {
+ if(!validator.isAsYouTypeValidation() && typeName!=null && typeName.trim().length()>0) {
IStatus status = JavaConventions.validateJavaTypeName(typeName, CompilerOptions.VERSION_1_7, CompilerOptions.VERSION_1_7);
if(status.getSeverity()!=IStatus.ERROR) {
String packagePath = typeName.replace('.', '/');
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 2012-06-20 19:22:55 UTC (rev 42116)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-06-20 19:23:48 UTC (rev 42117)
@@ -92,8 +92,6 @@
import org.jboss.tools.cdi.internal.core.impl.CDIProjectAsYouType;
import org.jboss.tools.cdi.internal.core.impl.SessionBean;
import org.jboss.tools.cdi.internal.core.impl.definition.Dependencies;
-import org.jboss.tools.common.el.core.ELReference;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.java.IAnnotationDeclaration;
import org.jboss.tools.common.java.IJavaReference;
import org.jboss.tools.common.java.IParametedType;
@@ -111,7 +109,6 @@
import org.jboss.tools.common.validation.IValidatingProjectTree;
import org.jboss.tools.common.validation.ValidationUtil;
import org.jboss.tools.common.validation.ValidatorManager;
-import org.jboss.tools.jst.web.kb.PageContextFactory;
import org.jboss.tools.jst.web.kb.internal.validation.KBValidator;
/**
@@ -142,6 +139,14 @@
private Set<IValidatorFeature> extensions;
private Set<IInjectionPointValidatorFeature> injectionValidationFeatures;
+ public CDIValidationContext(IProject project, ICDIProject cdiProject) {
+ this.project = project;
+ this.cdiProject = cdiProject;
+ dependencies = new Dependencies();
+ extensions = Collections.emptySet();
+ injectionValidationFeatures = Collections.emptySet();
+ }
+
public CDIValidationContext(IProject project) {
this.project = project;
CDICoreNature nature = CDICorePlugin.getCDI(project, true);
@@ -274,6 +279,7 @@
public void init(IProject rootProject, ContextValidationHelper validationHelper, IProjectValidationContext context, org.eclipse.wst.validation.internal.provisional.core.IValidator manager,
IReporter reporter) {
super.init(rootProject, validationHelper, context, manager, reporter);
+ setAsYouTypeValidation(false);
setMessageIdQuickFixAttributeName(MESSAGE_ID_ATTRIBUTE_NAME);
projectTree = validationHelper.getValidationContextManager().getValidatingProjectTree(this);
projectSet = projectTree.getBrunches().get(rootProject);
@@ -478,29 +484,38 @@
WorkbenchReporter.removeAllMessages(project, new String[]{CDICoreValidator.class.getName()}, null);
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.validation.IAsYouTypeValidator#validate(org.eclipse.wst.validation.internal.provisional.core.IValidator, org.eclipse.core.resources.IProject, org.eclipse.jface.text.IRegion, org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter, org.jboss.tools.common.validation.EditorValidationContext, org.jboss.tools.common.validation.IProjectValidationContext, org.eclipse.core.resources.IFile)
+ */
@Override
- public void validate(IValidator validatorManager, IProject rootProject, IRegion dirtyRegion, IValidationContext helper, IReporter reporter, EditorValidationContext validationContext, IProjectValidationContext projectContext, IFile file) {
-// init(rootProject, null, projectContext, validatorManager, reporter);
-//TODO init properly
-
- setReporter(reporter);
- setValidationManager(validatorManager);
- setValidationContext(projectContext);
- ContextValidationHelper helper1 = new ContextValidationHelper();
- helper1.setProject(rootProject);
- setCoreHelper(helper1);
- setMessageIdQuickFixAttributeName(MESSAGE_ID_ATTRIBUTE_NAME);
- CDICoreNature nature = CDICorePlugin.getCDI(rootProject, true);
- rootCdiProject = nature.getDelegate();
+ public void validate(IValidator validatorManager, IProject rootProject, IRegion dirtyRegion, IValidationContext helper, IReporter reporter, EditorValidationContext validationContext, IProjectValidationContext projectContext, final IFile file) {
+ ContextValidationHelper validationHelper = new ContextValidationHelper();
+ validationHelper.setProject(rootProject);
+ validationHelper.setValidationContextManager(validationContext);
+ init(rootProject, validationHelper, projectContext, validatorManager, reporter);
+ setAsYouTypeValidation(true);
this.document = validationContext.getDocument();
rootCdiProject = new CDIProjectAsYouType(rootCdiProject, file);
+ disableProblemAnnotations(new ITextSourceReference() {
+ @Override
+ public int getStartPosition() {
+ return 0;
+ }
-//TODO do not remove markers, disable
-// removeAllMessagesFromResource(file);
-// validateResource(file);
+ @Override
+ public IResource getResource() {
+ return file;
+ }
+
+ @Override
+ public int getLength() {
+ return document.getLength();
+ }
+ });
+ validateResource(file);
}
-
/**
* Validates a resource.
*
@@ -511,25 +526,35 @@
return;
}
displaySubtask(CDIValidationMessages.VALIDATING_RESOURCE, new String[] {file.getProject().getName(), file.getName()});
- coreHelper.getValidationContextManager().addValidatedProject(this, file.getProject());
- Set<IPath> dd = getCDIContext(file).getDependencies().getDirectDependencies(file.getFullPath());
- if(dd != null && !dd.isEmpty()) {
- Set<IPath> resources = new HashSet<IPath>();
- for (IPath p: dd) {
- IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(p);
- if(f.exists()) {
- resources.add(p);
- collectAllRelatedInjections(f, resources);
+ if(!isAsYouTypeValidation()) {
+ coreHelper.getValidationContextManager().addValidatedProject(this, file.getProject());
+
+ Set<IPath> dd = getCDIContext(file).getDependencies().getDirectDependencies(file.getFullPath());
+ if(dd != null && !dd.isEmpty()) {
+ Set<IPath> resources = new HashSet<IPath>();
+ for (IPath p: dd) {
+ IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(p);
+ if(f.exists()) {
+ resources.add(p);
+ collectAllRelatedInjections(f, resources);
+ }
}
+ for (IPath p: resources) {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, p.toOSString(), file.getFullPath(), false);
+ }
}
- for (IPath p: resources) {
- getValidationContext().addLinkedCoreResource(SHORT_ID, p.toOSString(), file.getFullPath(), false);
- }
}
- CDIValidationContext context = getCDIContext(file);
- ICDIProject cdiProject = context.getCdiProject();
+ CDIValidationContext context = null;
+ ICDIProject cdiProject = null;
+ if(isAsYouTypeValidation()) {
+ context = new CDIValidationContext(file.getProject(), rootCdiProject);
+ cdiProject = rootCdiProject;
+ } else {
+ context = getCDIContext(file);
+ cdiProject = context.getCdiProject();
+ }
if("beans.xml".equalsIgnoreCase(file.getName()) && CDIPreferences.shouldValidateBeansXml(file.getProject())) {
List<IFile> allBaensXmls = getAllBeansXmls();
if(allBaensXmls.contains(file)) { // See https://issues.jboss.org/browse/JBIDE-10166
@@ -542,13 +567,13 @@
}
IStereotype stereotype = cdiProject.getStereotype(file.getFullPath());
validateStereotype(stereotype);
-
+
IQualifier qualifier = cdiProject.getQualifier(file.getFullPath());
validateQualifier(qualifier);
-
+
IScope scope = cdiProject.getScope(file.getFullPath());
annotationValidator.validateScopeType(scope);
-
+
IInterceptorBinding binding = cdiProject.getInterceptorBinding(file.getFullPath());
validateInterceptorBinding(binding);
}
@@ -614,20 +639,23 @@
if(!bean.exists() || !shouldValidateType(bean.getBeanClass())) {
return;
}
- String beanPath = bean.getResource().getFullPath().toOSString();
- Set<IScopeDeclaration> scopeDeclarations = bean.getScopeDeclarations();
- for (IScopeDeclaration scopeDeclaration : scopeDeclarations) {
- IScope scope = scopeDeclaration.getScope();
- if (shouldValidateType(scope.getSourceType())) {
- getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, scope.getResource().getFullPath(), false);
+ String beanPath = null;
+ if(!isAsYouTypeValidation()) {
+ beanPath = bean.getResource().getFullPath().toOSString();
+ Set<IScopeDeclaration> scopeDeclarations = bean.getScopeDeclarations();
+ for (IScopeDeclaration scopeDeclaration : scopeDeclarations) {
+ IScope scope = scopeDeclaration.getScope();
+ if (shouldValidateType(scope.getSourceType())) {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, scope.getResource().getFullPath(), false);
+ }
}
- }
- addLinkedStereotypes(beanPath, bean);
- Set<IQualifierDeclaration> qualifierDeclarations = bean.getQualifierDeclarations();
- for (IQualifierDeclaration qualifierDeclaration : qualifierDeclarations) {
- IQualifier qualifier = qualifierDeclaration.getQualifier();
- if (shouldValidateType(qualifier.getSourceType())) {
- getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, qualifier.getResource().getFullPath(), false);
+ addLinkedStereotypes(beanPath, bean);
+ Set<IQualifierDeclaration> qualifierDeclarations = bean.getQualifierDeclarations();
+ for (IQualifierDeclaration qualifierDeclaration : qualifierDeclarations) {
+ IQualifier qualifier = qualifierDeclaration.getQualifier();
+ if (shouldValidateType(qualifier.getSourceType())) {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, qualifier.getResource().getFullPath(), false);
+ }
}
}
@@ -641,9 +669,11 @@
Set<IInjectionPoint> points = bean.getInjectionPoints();
for (IInjectionPoint point : points) {
- IType type = getTypeOfInjection(point);
- if(type!=null && !type.isBinary()) {
- getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, type.getPath(), false);
+ if(!isAsYouTypeValidation()) {
+ IType type = getTypeOfInjection(point);
+ if(type!=null && !type.isBinary()) {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, type.getPath(), false);
+ }
}
if(point.exists()) {
validateInjectionPoint(context, point);
@@ -660,11 +690,13 @@
if (bean instanceof IClassBean) {
IClassBean classBean = (IClassBean)bean;
- addLinkedInterceptorBindings(beanPath, classBean);
- Set<IBeanMethod> methods = classBean.getAllMethods();
- for (IBeanMethod method : methods) {
- addLinkedStereotypes(beanPath, method);
- addLinkedInterceptorBindings(beanPath, method);
+ if(!isAsYouTypeValidation()) {
+ addLinkedInterceptorBindings(beanPath, classBean);
+ Set<IBeanMethod> methods = classBean.getAllMethods();
+ for (IBeanMethod method : methods) {
+ addLinkedStereotypes(beanPath, method);
+ addLinkedInterceptorBindings(beanPath, method);
+ }
}
validateClassBean(classBean);
}
@@ -682,9 +714,11 @@
private void validateBeanName(CDIValidationContext context, IBean bean) {
String name = bean.getName();
if(name!=null && !name.startsWith("/")) {
- // Collect all relations between the bean and other CDI elements.
- getValidationContext().addVariableNameForELValidation(SHORT_ID, name);
- getValidationContext().addLinkedCoreResource(SHORT_ID, name, bean.getSourcePath(), true);
+ if(!isAsYouTypeValidation()) {
+ // Collect all relations between the bean and other CDI elements.
+ getValidationContext().addVariableNameForELValidation(SHORT_ID, name);
+ getValidationContext().addLinkedCoreResource(SHORT_ID, name, bean.getSourcePath(), true);
+ }
/*
* 5.3.1. Ambiguous EL names
* - All unresolvable ambiguous EL names are detected by the container when the application is initialized.
@@ -699,14 +733,16 @@
names.add(bName);
StringBuffer sb = new StringBuffer(bName);
for (IBean iBean : beans) {
- getValidationContext().addLinkedCoreResource(SHORT_ID, name, iBean.getSourcePath(), true);
+ if(!isAsYouTypeValidation()) {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, name, iBean.getSourcePath(), true);
+ }
bName = iBean.getElementName();
if(bean!=iBean && !names.contains(bName)) {
names.add(bName);
sb.append(", ").append(bName);
}
}
- addError(MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, sb.toString()), CDIPreferences.AMBIGUOUS_EL_NAMES, reference, bean.getResource());
+ addProblem(MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, sb.toString()), CDIPreferences.AMBIGUOUS_EL_NAMES, reference, bean.getResource());
} else {
/*
* • the EL name of one bean is of the form x.y, where y is a valid bean EL name, and x is the EL name of the other bean,
@@ -731,7 +767,7 @@
if(reference==null) {
reference = CDIUtil.getNamedDeclaration(bean);
}
- addError(MessageFormat.format(CDIValidationMessages.UNRESOLVABLE_EL_NAME, name, yName, xNameAsString, xBeans.iterator().next().getElementName()), CDIPreferences.AMBIGUOUS_EL_NAMES, reference, bean.getResource());
+ addProblem(MessageFormat.format(CDIValidationMessages.UNRESOLVABLE_EL_NAME, name, yName, xNameAsString, xBeans.iterator().next().getElementName()), CDIPreferences.AMBIGUOUS_EL_NAMES, reference, bean.getResource());
break;
}
}
@@ -782,21 +818,25 @@
}
private void addLinkedStereotypes(String beanPath, IStereotyped stereotyped) {
- Set<IStereotypeDeclaration> stereotypeDeclarations = stereotyped.getStereotypeDeclarations();
- for (IStereotypeDeclaration stereotypeDeclaration : stereotypeDeclarations) {
- IStereotype stereotype = stereotypeDeclaration.getStereotype();
- if (shouldValidateType(stereotype.getSourceType())) {
- getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, stereotype.getResource().getFullPath(), false);
+ if(!isAsYouTypeValidation()) {
+ Set<IStereotypeDeclaration> stereotypeDeclarations = stereotyped.getStereotypeDeclarations();
+ for (IStereotypeDeclaration stereotypeDeclaration : stereotypeDeclarations) {
+ IStereotype stereotype = stereotypeDeclaration.getStereotype();
+ if (shouldValidateType(stereotype.getSourceType())) {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, stereotype.getResource().getFullPath(), false);
+ }
}
}
}
private void addLinkedInterceptorBindings(String beanPath, IInterceptorBinded binded) {
- Set<IInterceptorBindingDeclaration> bindingDeclarations = CDIUtil.getAllInterceptorBindingDeclaratios(binded);
- for (IInterceptorBindingDeclaration bindingDeclaration : bindingDeclarations) {
- IInterceptorBinding binding = bindingDeclaration.getInterceptorBinding();
- if (shouldValidateType(binding.getSourceType())) {
- getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, binding.getResource().getFullPath(), false);
+ if(!isAsYouTypeValidation()) {
+ Set<IInterceptorBindingDeclaration> bindingDeclarations = CDIUtil.getAllInterceptorBindingDeclaratios(binded);
+ for (IInterceptorBindingDeclaration bindingDeclaration : bindingDeclarations) {
+ IInterceptorBinding binding = bindingDeclaration.getInterceptorBinding();
+ if (shouldValidateType(binding.getSourceType())) {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, beanPath, binding.getResource().getFullPath(), false);
+ }
}
}
}
@@ -827,14 +867,14 @@
if(hasConflictedInterceptorBindings(bean)) {
//TODO consider putting markers to interceptor bindings/stereotype declarations.
ITextSourceReference reference = CDIUtil.convertToSourceReference(bean.getBeanClass().getNameRange(), bean.getResource(), bean.getBeanClass());
- addError(CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, CDIPreferences.CONFLICTING_INTERCEPTOR_BINDINGS, reference, bean.getResource());
+ addProblem(CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, CDIPreferences.CONFLICTING_INTERCEPTOR_BINDINGS, reference, bean.getResource());
}
Set<IBeanMethod> methods = bean.getAllMethods();
for (IBeanMethod method : methods) {
if(hasConflictedInterceptorBindings(method)) {
//TODO consider putting markers to interceptor bindings/stereotype declarations.
ITextSourceReference reference = CDIUtil.convertToSourceReference(method.getMethod().getNameRange(), bean.getResource(), method.getMethod());
- addError(CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, CDIPreferences.CONFLICTING_INTERCEPTOR_BINDINGS, reference, bean.getResource());
+ addProblem(CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, CDIPreferences.CONFLICTING_INTERCEPTOR_BINDINGS, reference, bean.getResource());
}
}
} catch (JavaModelException e) {
@@ -875,14 +915,14 @@
IAnnotationDeclaration specializesDeclaration = bean.getSpecializesAnnotationDeclaration();
if(specializesDeclaration!=null) {
if(bean instanceof IDecorator) {
- addError(CDIValidationMessages.DECORATOR_ANNOTATED_SPECIALIZES, CDIPreferences.INTERCEPTOR_ANNOTATED_SPECIALIZES, specializesDeclaration, bean.getResource(), DECORATOR_ANNOTATED_SPECIALIZES_ID);
+ addProblem(CDIValidationMessages.DECORATOR_ANNOTATED_SPECIALIZES, CDIPreferences.INTERCEPTOR_ANNOTATED_SPECIALIZES, specializesDeclaration, bean.getResource(), DECORATOR_ANNOTATED_SPECIALIZES_ID);
} else if(bean instanceof IInterceptor) {
- addError(CDIValidationMessages.INTERCEPTOR_ANNOTATED_SPECIALIZES, CDIPreferences.INTERCEPTOR_ANNOTATED_SPECIALIZES, specializesDeclaration, bean.getResource(), INTERCEPTOR_ANNOTATED_SPECIALIZES_ID);
+ addProblem(CDIValidationMessages.INTERCEPTOR_ANNOTATED_SPECIALIZES, CDIPreferences.INTERCEPTOR_ANNOTATED_SPECIALIZES, specializesDeclaration, bean.getResource(), INTERCEPTOR_ANNOTATED_SPECIALIZES_ID);
}
}
IBean specializedBean = bean.getSpecializedBean();
if(specializedBean!=null) {
- if(shouldValidateType(specializedBean.getBeanClass())) {
+ if(!isAsYouTypeValidation() && shouldValidateType(specializedBean.getBeanClass())) {
getValidationContext().addLinkedCoreResource(SHORT_ID, bean.getSourcePath().toOSString(), specializedBean.getResource().getFullPath(), false);
}
@@ -913,7 +953,7 @@
}
}
if(missingTypes.length()>0) {
- addError(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, CDIPreferences.MISSING_TYPE_IN_SPECIALIZING_BEAN,
+ addProblem(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, CDIPreferences.MISSING_TYPE_IN_SPECIALIZING_BEAN,
new String[]{beanName, specializingBeanName, missingTypes.toString()},
bean.getSpecializesAnnotationDeclaration(), bean.getResource());
}
@@ -925,7 +965,7 @@
if(specializedBean.getName()!=null) {
IAnnotationDeclaration nameDeclaration = bean.getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
if(nameDeclaration!=null) {
- addError(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN, CDIPreferences.CONFLICTING_NAME_IN_SPECIALIZING_BEAN,
+ addProblem(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN, CDIPreferences.CONFLICTING_NAME_IN_SPECIALIZING_BEAN,
new String[]{beanName, specializingBeanName},
nameDeclaration, bean.getResource());
}
@@ -945,14 +985,14 @@
if(specializingBean!=bean && specializingBean.isEnabled()) {
sb.append(", ").append(specializingBean.getElementName());
moreThanTwo = true;
- if(shouldValidateType(specializingBean.getBeanClass())) {
+ if(!isAsYouTypeValidation() && shouldValidateType(specializingBean.getBeanClass())) {
getValidationContext().addLinkedCoreResource(SHORT_ID, specializingBean.getResource().getFullPath().toOSString(), bean.getSourcePath(), false);
getValidationContext().addLinkedCoreResource(SHORT_ID, bean.getSourcePath().toOSString(), specializingBean.getResource().getFullPath(), false);
}
}
}
if(moreThanTwo && specializesDeclaration!=null) {
- addError(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, CDIPreferences.INCONSISTENT_SPECIALIZATION,
+ addProblem(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, CDIPreferences.INCONSISTENT_SPECIALIZATION,
new String[]{sb.toString(), supperClassBean.getElementName()},
specializesDeclaration, bean.getResource());
}
@@ -977,7 +1017,7 @@
*/
if(injects.size()>1) {
for (IAnnotationDeclaration inject : injects) {
- addError(CDIValidationMessages.MULTIPLE_INJECTION_CONSTRUCTORS, CDIPreferences.MULTIPLE_INJECTION_CONSTRUCTORS, inject, bean.getResource(), MULTIPLE_INJECTION_CONSTRUCTORS_ID);
+ addProblem(CDIValidationMessages.MULTIPLE_INJECTION_CONSTRUCTORS, CDIPreferences.MULTIPLE_INJECTION_CONSTRUCTORS, inject, bean.getResource(), MULTIPLE_INJECTION_CONSTRUCTORS_ID);
}
}
}
@@ -1014,7 +1054,7 @@
int position = source.substring(start, end).indexOf("IF_EXISTS");
// TODO Shecks if IF_EXISTS as a string. But this string may be in a comment then we will show incorrect error message.
if(position>11) {
- addError(CDIValidationMessages.ILLEGAL_CONDITIONAL_OBSERVER, CDIPreferences.ILLEGAL_CONDITIONAL_OBSERVER, declaration, bean.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_CONDITIONAL_OBSERVER, CDIPreferences.ILLEGAL_CONDITIONAL_OBSERVER, declaration, bean.getResource());
}
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
@@ -1029,7 +1069,7 @@
*/
if(declarations.size()>1) {
for (ITextSourceReference declaration : declarations) {
- addError(CDIValidationMessages.MULTIPLE_OBSERVING_PARAMETERS, CDIPreferences.MULTIPLE_OBSERVING_PARAMETERS, declaration, bean.getResource(), MULTIPLE_OBSERVING_PARAMETERS_ID);
+ addProblem(CDIValidationMessages.MULTIPLE_OBSERVING_PARAMETERS, CDIPreferences.MULTIPLE_OBSERVING_PARAMETERS, declaration, bean.getResource(), MULTIPLE_OBSERVING_PARAMETERS_ID);
}
}
/*
@@ -1045,9 +1085,9 @@
String pref = observer.getMethod().isConstructor()?CDIPreferences.CONSTRUCTOR_PARAMETER_ILLEGALLY_ANNOTATED:CDIPreferences.OBSERVER_ANNOTATED_INJECT;
String message = observer.getMethod().isConstructor()?CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES:CDIValidationMessages.OBSERVER_ANNOTATED_INJECT;
int messageId = observer.getMethod().isConstructor()?CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES_ID:OBSERVER_ANNOTATED_INJECT_ID;
- addError(message, pref, injectDeclaration, bean.getResource(), messageId);
+ addProblem(message, pref, injectDeclaration, bean.getResource(), messageId);
for (ITextSourceReference declaration : declarations) {
- addError(message, pref, declaration, bean.getResource(), messageId);
+ addProblem(message, pref, declaration, bean.getResource(), messageId);
}
}
} catch (JavaModelException e) {
@@ -1059,11 +1099,11 @@
*/
if(bean instanceof IDecorator) {
for (ITextSourceReference declaration : declarations) {
- addError(CDIValidationMessages.OBSERVER_IN_DECORATOR, CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource(), OBSERVER_IN_DECORATOR_ID);
+ addProblem(CDIValidationMessages.OBSERVER_IN_DECORATOR, CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource(), OBSERVER_IN_DECORATOR_ID);
}
} else if(bean instanceof IInterceptor) {
for (ITextSourceReference declaration : declarations) {
- addError(CDIValidationMessages.OBSERVER_IN_INTERCEPTOR, CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource(), OBSERVER_IN_INTERCEPTOR_ID);
+ addProblem(CDIValidationMessages.OBSERVER_IN_INTERCEPTOR, CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource(), OBSERVER_IN_INTERCEPTOR_ID);
}
}
@@ -1092,7 +1132,7 @@
for (IBeanMethod disposerMethod : disposerMethods) {
Set<ITextSourceReference> disposerDeclarations = CDIUtil.getAnnotationPossitions(disposerMethod, CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME);
for (ITextSourceReference declaration : disposerDeclarations) {
- addError(CDIValidationMessages.MULTIPLE_DISPOSERS_FOR_PRODUCER, CDIPreferences.MULTIPLE_DISPOSERS_FOR_PRODUCER, declaration, bean.getResource(), MULTIPLE_DISPOSERS_FOR_PRODUCER_ID);
+ addProblem(CDIValidationMessages.MULTIPLE_DISPOSERS_FOR_PRODUCER, CDIPreferences.MULTIPLE_DISPOSERS_FOR_PRODUCER, declaration, bean.getResource(), MULTIPLE_DISPOSERS_FOR_PRODUCER_ID);
}
}
}
@@ -1118,7 +1158,7 @@
}
if (disposerDeclarations.size() > 1) {
for (ITextSourceReference declaration : disposerDeclarations) {
- addError(CDIValidationMessages.MULTIPLE_DISPOSING_PARAMETERS, CDIPreferences.MULTIPLE_DISPOSING_PARAMETERS, declaration, bean.getResource(), MULTIPLE_DISPOSING_PARAMETERS_ID);
+ addProblem(CDIValidationMessages.MULTIPLE_DISPOSING_PARAMETERS, CDIPreferences.MULTIPLE_DISPOSING_PARAMETERS, declaration, bean.getResource(), MULTIPLE_DISPOSING_PARAMETERS_ID);
}
}
@@ -1141,7 +1181,7 @@
}
if (observesExists) {
for (ITextSourceReference declaration : declarations) {
- addError(CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, CDIPreferences.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, declaration, bean.getResource(), OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED_ID);
+ addProblem(CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, CDIPreferences.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, declaration, bean.getResource(), OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED_ID);
}
}
@@ -1161,9 +1201,9 @@
String pref = disposer.getMethod().isConstructor()?CDIPreferences.CONSTRUCTOR_PARAMETER_ILLEGALLY_ANNOTATED:CDIPreferences.DISPOSER_ANNOTATED_INJECT;
String message = disposer.getMethod().isConstructor()?CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES:CDIValidationMessages.DISPOSER_ANNOTATED_INJECT;
int messageId = disposer.getMethod().isConstructor()?CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES_ID:DISPOSER_ANNOTATED_INJECT_ID;
- addError(message, pref, injectDeclaration, bean.getResource(), messageId);
+ addProblem(message, pref, injectDeclaration, bean.getResource(), messageId);
for (ITextSourceReference declaration : disposerDeclarations) {
- addError(message, pref, declaration, bean.getResource(), messageId);
+ addProblem(message, pref, declaration, bean.getResource(), messageId);
}
}
} catch (JavaModelException e) {
@@ -1188,10 +1228,9 @@
//for custom implementations
decoratorDeclaration = decorator.getNameLocation(true);
}
- addError(CDIValidationMessages.DISPOSER_IN_DECORATOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, decoratorDeclaration, bean
- .getResource(), DISPOSER_IN_DECORATOR_ID);
+ addProblem(CDIValidationMessages.DISPOSER_IN_DECORATOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, decoratorDeclaration, bean.getResource(), DISPOSER_IN_DECORATOR_ID);
for (ITextSourceReference declaration : disposerDeclarations) {
- addError(CDIValidationMessages.DISPOSER_IN_DECORATOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource(), DISPOSER_IN_DECORATOR_ID);
+ addProblem(CDIValidationMessages.DISPOSER_IN_DECORATOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource(), DISPOSER_IN_DECORATOR_ID);
}
}
@@ -1206,10 +1245,10 @@
//for custom implementations
interceptorDeclaration = interceptor.getNameLocation(true);
}
- addError(CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, interceptorDeclaration, bean
+ addProblem(CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, interceptorDeclaration, bean
.getResource(), DISPOSER_IN_INTERCEPTOR_ID);
for (ITextSourceReference declaration : disposerDeclarations) {
- addError(CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean
+ addProblem(CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean
.getResource(), DISPOSER_IN_INTERCEPTOR_ID);
}
}
@@ -1220,7 +1259,7 @@
*/
if (!boundDisposers.contains(disposer)) {
for (ITextSourceReference declaration : disposerDeclarations) {
- addError(CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, CDIPreferences.NO_PRODUCER_MATCHING_DISPOSER, declaration, bean.getResource());
+ addProblem(CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, CDIPreferences.NO_PRODUCER_MATCHING_DISPOSER, declaration, bean.getResource());
}
}
}
@@ -1242,9 +1281,9 @@
saveAllSuperTypesAsLinkedResources(bean);
for (ITextSourceReference declaration : annotatedParams) {
String bindedErrorMessage = NLS.bind(errorMessage, new String[]{method.getMethod().getElementName(), bean.getBeanClass().getElementName()});
- addError(bindedErrorMessage, preferencesKey, declaration, bean.getResource(), id);
+ addProblem(bindedErrorMessage, preferencesKey, declaration, bean.getResource(), id);
}
- } else if (iMethod != method.getMethod() && !iMethod.isBinary()) {
+ } else if (!isAsYouTypeValidation() && iMethod != method.getMethod() && !iMethod.isBinary()) {
getValidationContext().addLinkedCoreResource(SHORT_ID, bean.getSourcePath().toOSString(), iMethod.getResource().getFullPath(), false);
}
}
@@ -1279,10 +1318,10 @@
for (String paramType : paramTypes) {
if (Signature.getTypeSignatureKind(paramType) == Signature.WILDCARD_TYPE_SIGNATURE) {
if (producer instanceof IProducerField) {
- addError(CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD_OR_VARIABLE, typeDeclarationReference,
+ addProblem(CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD_OR_VARIABLE, typeDeclarationReference,
producer.getResource());
} else {
- addError(CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD_OR_VARIABLE,
+ addProblem(CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD_OR_VARIABLE,
typeDeclarationReference, producer.getResource());
}
} else if(!variable && isTypeVariable(producer, Signature.toString(paramType), typeVariables)) {
@@ -1297,7 +1336,7 @@
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,
+ addProblem(field ? CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD : CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD,
field ? CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN : CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN,
scopeOrStereotypeDeclaration, producer.getResource());
}
@@ -1312,7 +1351,7 @@
*/
IAnnotationDeclaration inject = producer.getAnnotation(CDIConstants.INJECT_ANNOTATION_TYPE_NAME);
if (inject != null) {
- addError(CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, CDIPreferences.PRODUCER_ANNOTATED_INJECT, inject, inject.getResource() != null ? inject.getResource() : producer.getResource(), PRODUCER_ANNOTATED_INJECT_ID);
+ addProblem(CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, CDIPreferences.PRODUCER_ANNOTATED_INJECT, inject, inject.getResource() != null ? inject.getResource() : producer.getResource(), PRODUCER_ANNOTATED_INJECT_ID);
}
if (producer instanceof IProducerField) {
@@ -1330,7 +1369,7 @@
if (nameDeclaration != null) {
declaration = nameDeclaration;
}
- addError(CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, CDIPreferences.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, declaration, producer.getResource());
+ addProblem(CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, CDIPreferences.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, declaration, producer.getResource());
}
}
}
@@ -1344,7 +1383,7 @@
for (String variableSig : typeVariables) {
String variableName = Signature.getTypeVariable(variableSig);
if (typeString.equals(variableName)) {
- addError(CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD_OR_VARIABLE, typeDeclaration != null ? typeDeclarationReference : producer, producer.getResource());
+ addProblem(CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD_OR_VARIABLE, typeDeclaration != null ? typeDeclarationReference : producer, producer.getResource());
}
}
}
@@ -1353,7 +1392,7 @@
* - non-static field of a session bean class is annotated @Produces
*/
if(producer.getClassBean() instanceof ISessionBean && !Flags.isStatic(producerField.getField().getFlags())) {
- addError(CDIValidationMessages.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN, CDIPreferences.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, producer.getProducesAnnotation(), producer.getResource(), ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN_ID);
+ addProblem(CDIValidationMessages.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN, CDIPreferences.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, producer.getProducesAnnotation(), producer.getResource(), ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN_ID);
}
} else {
IProducerMethod producerMethod = (IProducerMethod) producer;
@@ -1388,13 +1427,13 @@
}
if (observesDeclarations.size() > 1) {
for (ITextSourceReference declaration : observesDeclarations) {
- addError(CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, CDIPreferences.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED,
+ addProblem(CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, CDIPreferences.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED,
declaration, producer.getResource(), PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES_ID);
}
}
if (disposalDeclarations.size() > 1) {
for (ITextSourceReference declaration : disposalDeclarations) {
- addError(CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, CDIPreferences.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED,
+ addProblem(CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, CDIPreferences.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED,
declaration, producer.getResource(), PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES_ID);
}
}
@@ -1409,7 +1448,7 @@
String typeSign = producerMethod.getMethod().getReturnType();
String typeString = Signature.toString(typeSign);
if(isTypeVariable(producerMethod, typeString, typeVariables)) {
- addError(CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD_OR_VARIABLE,
+ addProblem(CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD_OR_VARIABLE,
typeDeclaration != null ? typeDeclarationReference : producer, producer.getResource());
}
/*
@@ -1421,9 +1460,9 @@
IMethod method = CDIUtil.getBusinessMethodDeclaration((SessionBean)classBean, producerMethod);
if(method==null) {
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, new String[]{producerMethod.getMethod().getElementName(), producer.getBeanClass().getElementName()});
- addError(bindedErrorMessage, CDIPreferences.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, producer.getProducesAnnotation(), producer.getResource(), ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN_ID);
+ addProblem(bindedErrorMessage, CDIPreferences.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, producer.getProducesAnnotation(), producer.getResource(), ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN_ID);
saveAllSuperTypesAsLinkedResources(classBean);
- } else if (method != producerMethod.getMethod() && method.exists() && !method.isReadOnly()) {
+ } else if (!isAsYouTypeValidation() && method != producerMethod.getMethod() && method.exists() && !method.isReadOnly()) {
getValidationContext().addLinkedCoreResource(SHORT_ID, classBean.getSourcePath().toOSString(), method.getResource().getFullPath(), false);
}
}
@@ -1435,7 +1474,7 @@
* 3.3.3. Specializing a producer method
* - method annotated @Specializes is static
*/
- addError(CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_STATIC, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, sDeclaration, producer.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_STATIC, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, sDeclaration, producer.getResource());
} else {
/*
* 3.3.3. Specializing a producer method
@@ -1465,7 +1504,7 @@
}
}
if(!overrides) {
- addError(CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_OVERRIDE, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, sDeclaration, producer.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_OVERRIDE, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, sDeclaration, producer.getResource());
}
saveAllSuperTypesAsLinkedResources(producer.getClassBean());
}
@@ -1498,11 +1537,13 @@
}
private void saveAllSuperTypesAsLinkedResources(IClassBean bean) {
- Set<IParametedType> types = bean.getAllTypes();
- for (IParametedType type : types) {
- IType superType = type.getType();
- if(superType!=null && !superType.isBinary() && superType.getResource()!=null && superType!=bean.getBeanClass()) {
- getValidationContext().addLinkedCoreResource(SHORT_ID, bean.getSourcePath().toOSString(), superType.getResource().getFullPath(), false);
+ if(!isAsYouTypeValidation()) {
+ Set<IParametedType> types = bean.getAllTypes();
+ for (IParametedType type : types) {
+ IType superType = type.getType();
+ if(superType!=null && !superType.isBinary() && superType.getResource()!=null && superType!=bean.getBeanClass()) {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, bean.getSourcePath().toOSString(), superType.getResource().getFullPath(), false);
+ }
}
}
}
@@ -1586,7 +1627,7 @@
if (named != null) {
boolean valueExists = named.getMemberValue(null) != null;
if (!valueExists) {
- addError(CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, CDIPreferences.PARAM_INJECTION_DECLARES_EMPTY_NAME, named, initializer.getResource(), PARAM_INJECTION_DECLARES_EMPTY_NAME_ID);
+ addProblem(CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, CDIPreferences.PARAM_INJECTION_DECLARES_EMPTY_NAME, named, initializer.getResource(), PARAM_INJECTION_DECLARES_EMPTY_NAME_ID);
}
}
@@ -1596,14 +1637,14 @@
* - generic method of a bean is annotated @Inject
*/
if(CDIUtil.isMethodGeneric(initializer)) {
- addError(CDIValidationMessages.GENERIC_METHOD_ANNOTATED_INJECT, CDIPreferences.GENERIC_METHOD_ANNOTATED_INJECT, declaration, initializer.getResource());
+ addProblem(CDIValidationMessages.GENERIC_METHOD_ANNOTATED_INJECT, CDIPreferences.GENERIC_METHOD_ANNOTATED_INJECT, declaration, initializer.getResource());
}
/*
* 3.9. Initializer methods
* - initializer method may not be static
*/
if(CDIUtil.isMethodStatic(initializer)) {
- addError(CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, CDIPreferences.GENERIC_METHOD_ANNOTATED_INJECT, declaration, initializer.getResource());
+ addProblem(CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, CDIPreferences.GENERIC_METHOD_ANNOTATED_INJECT, declaration, initializer.getResource());
}
}
@@ -1623,7 +1664,7 @@
Object value = named.getMemberValue(null);
boolean valueExists = value != null && value.toString().trim().length() > 0;
if (!valueExists) {
- addError(CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME,
+ addProblem(CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME,
CDIPreferences.PARAM_INJECTION_DECLARES_EMPTY_NAME,
named,
injection.getResource(),
@@ -1642,7 +1683,7 @@
* - injection point type is a type variable
*/
if(CDIUtil.isTypeVariable(injection, false)) {
- addError(CDIValidationMessages.INJECTION_TYPE_IS_VARIABLE, CDIPreferences.INJECTION_TYPE_IS_VARIABLE, declaration, injection.getResource());
+ addProblem(CDIValidationMessages.INJECTION_TYPE_IS_VARIABLE, CDIPreferences.INJECTION_TYPE_IS_VARIABLE, declaration, injection.getResource());
}
if(declaration!=null) {
@@ -1655,20 +1696,22 @@
IType type = getTypeOfInjection(injection);
if(!shouldIgnoreInjection(context, type, injection)) {
boolean instance = type!=null && CDIConstants.INSTANCE_TYPE_NAME.equals(type.getFullyQualifiedName());
- Set<IBean> allBeans = cdiProject.getBeans(false, injection);
- for (IBean bean : allBeans) {
- if(shouldValidateType(bean.getBeanClass())) {
- try {
- getValidationContext().addLinkedCoreResource(SHORT_ID, injection.getSourcePath().toOSString(), bean.getResource().getFullPath(), false);
- } catch (NullPointerException e) {
- throw new RuntimeException("bean exists=" + bean.getBeanClass().exists() + " resource= " + bean.getResource() + " injection= " + injection.getSourcePath(),e);
+ if(!isAsYouTypeValidation()) {
+ Set<IBean> allBeans = cdiProject.getBeans(false, injection);
+ for (IBean bean : allBeans) {
+ if(shouldValidateType(bean.getBeanClass())) {
+ try {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, injection.getSourcePath().toOSString(), bean.getResource().getFullPath(), false);
+ } catch (NullPointerException e) {
+ throw new RuntimeException("bean exists=" + bean.getBeanClass().exists() + " resource= " + bean.getResource() + " injection= " + injection.getSourcePath(),e);
+ }
}
}
}
if(type!=null && beans.isEmpty() && !instance) {
- addError(CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, CDIPreferences.UNSATISFIED_OR_AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), UNSATISFIED_INJECTION_POINTS_ID);
+ addProblem(CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, CDIPreferences.UNSATISFIED_OR_AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), UNSATISFIED_INJECTION_POINTS_ID);
} else if(beans.size()>1 && !instance) {
- addError(CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, CDIPreferences.UNSATISFIED_OR_AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), AMBIGUOUS_INJECTION_POINTS_ID);
+ addProblem(CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, CDIPreferences.UNSATISFIED_OR_AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), AMBIGUOUS_INJECTION_POINTS_ID);
} else if(beans.size()==1) {
IBean bean = beans.iterator().next();
/*
@@ -1676,7 +1719,7 @@
* - injection point of primitive type resolves to a bean that may have null values, such as a producer method with a non-primitive return type or a producer field with a non-primitive type
*/
if(bean.isNullable() && injection.getType()!=null && injection.getType().isPrimitive()) {
- addError(CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, CDIPreferences.INJECT_RESOLVES_TO_NULLABLE_BEAN, reference, injection.getResource());
+ addProblem(CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, CDIPreferences.INJECT_RESOLVES_TO_NULLABLE_BEAN, reference, injection.getResource());
}
/*
* 5.1.4. Inter-module injection
@@ -1694,15 +1737,15 @@
String typeSignature = injection.getType().getSignature();
int kind = Signature.getTypeSignatureKind(typeSignature);
if(kind == Signature.ARRAY_TYPE_SIGNATURE) {
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ addProblem(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
} else if(injection.getType().isPrimitive()) {
// - Primitive types cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ addProblem(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
} else if(injection.getType().getType().exists()){
try {
if(Flags.isFinal(injection.getType().getType().getFlags())) {
// - Classes which are declared final cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ addProblem(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
} else {
IMethod[] methods = injection.getType().getType().getMethods();
boolean hasDefaultConstructor = false;
@@ -1712,14 +1755,14 @@
hasDefaultConstructor = hasDefaultConstructor || (method.isConstructor() && !Flags.isPrivate(method.getFlags()) && method.getParameterNames().length==0);
if(Flags.isFinal(method.getFlags())) {
// - Classes which have final methods cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ addProblem(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
hasDefaultConstructor = true;
break;
}
}
if(!hasDefaultConstructor && hasConstructor) {
// - Classes which don't have a non-private constructor with no parameters cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ addProblem(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
}
}
} catch (JavaModelException e) {
@@ -1734,7 +1777,7 @@
// 8.3. Decorator resolution
// - If a decorator matches a managed bean, and the managed bean class is declared final, the container automatically detects
// the problem and treats it as a deployment problem.
- addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, bean.getElementName()), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
+ addProblem(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, bean.getElementName()), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
} else {
// 8.3. Decorator resolution
// - If a decorator matches a managed bean with a non-static, non-private, final method, and the decorator also implements that method,
@@ -1751,7 +1794,7 @@
int flags = beanMethod.getFlags();
if(!Flags.isPrivate(flags) && !Flags.isStatic(flags) && Flags.isFinal(flags)) {
String methodName = Signature.toString(beanMethod.getSignature(), beanMethod.getElementName(), beanMethod.getParameterNames(), false, false);
- addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, bean.getElementName(), methodName), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
+ addProblem(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, bean.getElementName(), methodName), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
reported = true;
break;
}
@@ -1777,7 +1820,7 @@
if(type!=null && CDIConstants.INJECTIONPOINT_TYPE_NAME.equals(type.getFullyQualifiedName())) {
IScope beanScope = injection.getBean().getScope();
if(injection.hasDefaultQualifier() && beanScope!=null && !CDIConstants.DEPENDENT_ANNOTATION_TYPE_NAME.equals(beanScope.getSourceType().getFullyQualifiedName())) {
- addError(CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, CDIPreferences.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, reference, injection.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, CDIPreferences.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, reference, injection.getResource());
}
}
}
@@ -1787,7 +1830,7 @@
*/
if(!(injection.getClassBean() instanceof IDecorator) && injection.isDelegate()) {
ITextSourceReference reference = injection.getDelegateAnnotation();
- addError(CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE, CDIPreferences.ILLEGAL_BEAN_DECLARING_DELEGATE, reference, injection.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE, CDIPreferences.ILLEGAL_BEAN_DECLARING_DELEGATE, reference, injection.getResource());
}
}
@@ -1807,9 +1850,9 @@
* - bean class of a session bean is annotated @Decorator
*/
if (decoratorDeclaration != null) {
- addError(CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
+ addProblem(CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
sessionDeclaration, bean.getResource(), SESSION_BEAN_ANNOTATED_DECORATOR_ID);
- addError(CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
+ addProblem(CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
decoratorDeclaration, bean.getResource(), SESSION_BEAN_ANNOTATED_DECORATOR_ID);
}
/*
@@ -1817,9 +1860,9 @@
* - bean class of a session bean is annotated @Interceptor
*/
if (interceptorDeclaration != null) {
- addError(CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
+ addProblem(CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
sessionDeclaration, bean.getResource(), SESSION_BEAN_ANNOTATED_INTERCEPTOR_ID);
- addError(CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
+ addProblem(CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
interceptorDeclaration, bean.getResource(), SESSION_BEAN_ANNOTATED_INTERCEPTOR_ID);
}
}
@@ -1836,7 +1879,7 @@
*/
String[] typeVariables = type.getTypeParameterSignatures();
if (typeVariables.length > 0) {
- addError(CDIValidationMessages.ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE, CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN,
+ addProblem(CDIValidationMessages.ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE, CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN,
declaration, bean.getResource());
} else {
if (bean.isStateless()) {
@@ -1845,7 +1888,7 @@
* - session bean specifies an illegal scope (a stateless session bean must belong to the @Dependent pseudo-scope)
*/
if (declaration != null) {
- addError(CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN,
+ addProblem(CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN,
declaration, bean.getResource());
}
} else if (bean.isSingleton()) {
@@ -1857,7 +1900,7 @@
declaration = CDIUtil.getDifferentScopeDeclarationThanApplicationScoped(bean);
}
if (declaration != null) {
- addError(CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN,
+ addProblem(CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN,
declaration, bean.getResource());
}
}
@@ -1876,11 +1919,11 @@
IBean sBean = bean.getSpecializedBean();
if (sBean == null) {
// The specializing bean extends nothing
- addError(CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, specializesDeclaration,
+ addProblem(CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, specializesDeclaration,
bean.getResource());
} else if (!CDIUtil.isSessionBean(sBean)) {
// The specializing bean directly extends a non-session bean class
- addError(CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, specializesDeclaration,
+ addProblem(CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, specializesDeclaration,
bean.getResource());
}
}
@@ -1894,8 +1937,8 @@
IAnnotationDeclaration decorator = bean.getAnnotation(CDIConstants.DECORATOR_STEREOTYPE_TYPE_NAME);
IAnnotationDeclaration interceptor = bean.getAnnotation(CDIConstants.INTERCEPTOR_ANNOTATION_TYPE_NAME);
if (decorator != null && interceptor != null) {
- addError(CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, CDIPreferences.BOTH_INTERCEPTOR_AND_DECORATOR, decorator, bean.getResource());
- addError(CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, CDIPreferences.BOTH_INTERCEPTOR_AND_DECORATOR, interceptor, bean.getResource());
+ addProblem(CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, CDIPreferences.BOTH_INTERCEPTOR_AND_DECORATOR, decorator, bean.getResource());
+ addProblem(CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, CDIPreferences.BOTH_INTERCEPTOR_AND_DECORATOR, interceptor, bean.getResource());
}
IAnnotationDeclaration declaration = CDIUtil.getDifferentScopeDeclarationThanDepentend(bean);
@@ -1910,7 +1953,7 @@
for (IField field : fields) {
if (Flags.isPublic(field.getFlags()) && !Flags.isStatic(field.getFlags())) {
ITextSourceReference fieldReference = CDIUtil.convertToSourceReference(field.getNameRange(), bean.getResource(), field);
- addError(CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD, CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN,
+ addProblem(CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD, CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN,
fieldReference, bean.getResource(), ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD_ID);
}
}
@@ -1920,7 +1963,7 @@
*/
String[] typeVariables = type.getTypeParameterSignatures();
if (typeVariables.length > 0) {
- addError(CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE, CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN,
+ addProblem(CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE, CDIPreferences.ILLEGAL_SCOPE_FOR_BEAN,
declaration, bean.getResource());
}
} catch (JavaModelException e) {
@@ -1940,7 +1983,7 @@
if (sBean instanceof ISessionBean || sBean.getAnnotation(CDIConstants.STATELESS_ANNOTATION_TYPE_NAME) != null
|| sBean.getAnnotation(CDIConstants.SINGLETON_ANNOTATION_TYPE_NAME) != null) {
// The specializing bean directly extends an enterprise bean class
- addError(CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN,
+ addProblem(CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN,
specializesDeclaration, bean.getResource());
} else {
// Validate the specializing bean extends a non simple bean
@@ -1956,12 +1999,12 @@
}
}
if (!hasDefaultConstructor) {
- addError(CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, specializesDeclaration, bean.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, specializesDeclaration, bean.getResource());
}
}
} else {
// The specializing bean extends nothing
- addError(CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, specializesDeclaration, bean.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, CDIPreferences.ILLEGAL_SPECIALIZING_BEAN, specializesDeclaration, bean.getResource());
}
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
@@ -1978,14 +2021,14 @@
if(!bindings.isEmpty()) {
if(Flags.isFinal(bean.getBeanClass().getFlags())) {
ITextSourceReference reference = CDIUtil.convertToSourceReference(bean.getBeanClass().getNameRange(), bean.getResource(), bean.getBeanClass());
- addError(CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD, reference, bean.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD, reference, bean.getResource());
} else {
IMethod[] methods = bean.getBeanClass().getMethods();
for (int i = 0; i < methods.length; i++) {
int flags = methods[i].getFlags();
if(Flags.isFinal(flags) && !Flags.isStatic(flags) && !Flags.isPrivate(flags)) {
ITextSourceReference reference = CDIUtil.convertToSourceReference(methods[i].getNameRange(), bean.getResource(), methods[i]);
- addError(CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD, reference, bean.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD, reference, bean.getResource());
}
}
}
@@ -1995,13 +2038,13 @@
if(!method.getInterceptorBindings().isEmpty()) {
if(Flags.isFinal(bean.getBeanClass().getFlags())) {
ITextSourceReference reference = CDIUtil.convertToSourceReference(bean.getBeanClass().getNameRange(), bean.getResource(), bean.getBeanClass());
- addError(CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD, reference, bean.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD, reference, bean.getResource());
} else {
IMethod sourceMethod = method.getMethod();
int flags = sourceMethod.getFlags();
if(Flags.isFinal(flags) && !Flags.isStatic(flags) && !Flags.isPrivate(flags)) {
ITextSourceReference reference = CDIUtil.convertToSourceReference(sourceMethod.getNameRange(), bean.getResource(), sourceMethod);
- addError(CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD, reference, bean.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD, reference, bean.getResource());
}
}
}
@@ -2028,7 +2071,7 @@
}
if(!passivatingCapable) {
ITextSourceReference reference = CDIUtil.convertToSourceReference(bean.getBeanClass().getNameRange(), bean.getResource(), bean.getBeanClass());
- addError(MessageFormat.format(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, bean.getElementName(), scope.getSourceType().getElementName()), CDIPreferences.NOT_PASSIVATION_CAPABLE_BEAN, reference, bean.getResource(), NOT_PASSIVATION_CAPABLE_BEAN_ID);
+ addProblem(MessageFormat.format(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, bean.getElementName(), scope.getSourceType().getElementName()), CDIPreferences.NOT_PASSIVATION_CAPABLE_BEAN, reference, bean.getResource(), NOT_PASSIVATION_CAPABLE_BEAN_ID);
}
}
}
@@ -2051,7 +2094,7 @@
if (declaration == null) {
declaration = CDIUtil.getNamedStereotypeDeclaration(interceptor);
}
- addError(CDIValidationMessages.INTERCEPTOR_HAS_NAME, CDIPreferences.INTERCEPTOR_OR_DECORATOR_HAS_NAME, declaration, interceptor.getResource(), INTERCEPTOR_HAS_NAME_ID);
+ addProblem(CDIValidationMessages.INTERCEPTOR_HAS_NAME, CDIPreferences.INTERCEPTOR_OR_DECORATOR_HAS_NAME, declaration, interceptor.getResource(), INTERCEPTOR_HAS_NAME_ID);
}
/*
@@ -2067,7 +2110,7 @@
//for custom implementations
declaration = interceptor.getNameLocation(true);
}
- addError(CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE, CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, declaration, interceptor
+ addProblem(CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE, CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, declaration, interceptor
.getResource());
}
/*
@@ -2079,7 +2122,7 @@
*/
Set<IProducer> producers = interceptor.getProducers();
for (IProducer producer : producers) {
- addError(CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, CDIPreferences.PRODUCER_IN_INTERCEPTOR_OR_DECORATOR, producer.getProducesAnnotation(), interceptor.getResource(), PRODUCER_IN_INTERCEPTOR_ID);
+ addProblem(CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, CDIPreferences.PRODUCER_IN_INTERCEPTOR_OR_DECORATOR, producer.getProducesAnnotation(), interceptor.getResource(), PRODUCER_IN_INTERCEPTOR_ID);
}
/*
* 9.2. Declaring the interceptor bindings of an interceptor
@@ -2089,7 +2132,7 @@
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());
+ addProblem(CDIValidationMessages.MISSING_INTERCEPTOR_BINDING, CDIPreferences.MISSING_INTERCEPTOR_BINDING, declaration, interceptor.getResource());
}
} else {
/*
@@ -2111,7 +2154,7 @@
if(declaration==null) {
declaration = interceptor.getInterceptorAnnotation();
}
- addError(CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, CDIPreferences.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, declaration, interceptor.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, CDIPreferences.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, declaration, interceptor.getResource());
markedAsWrong = true;
break;
}
@@ -2139,7 +2182,7 @@
if (declaration == null) {
declaration = CDIUtil.getNamedStereotypeDeclaration(decorator);
}
- addError(CDIValidationMessages.DECORATOR_HAS_NAME, CDIPreferences.INTERCEPTOR_OR_DECORATOR_HAS_NAME, declaration, decorator.getResource(), DECORATOR_HAS_NAME_ID);
+ addProblem(CDIValidationMessages.DECORATOR_HAS_NAME, CDIPreferences.INTERCEPTOR_OR_DECORATOR_HAS_NAME, declaration, decorator.getResource(), DECORATOR_HAS_NAME_ID);
}
/*
@@ -2155,7 +2198,7 @@
//for custom implementations
declaration = decorator.getNameLocation(true);
}
- addError(CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, declaration, decorator.getResource());
+ addProblem(CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, declaration, decorator.getResource());
}
/*
@@ -2167,7 +2210,7 @@
*/
Set<IProducer> producers = decorator.getProducers();
for (IProducer producer : producers) {
- addError(CDIValidationMessages.PRODUCER_IN_DECORATOR, CDIPreferences.PRODUCER_IN_INTERCEPTOR_OR_DECORATOR, producer.getProducesAnnotation(), decorator.getResource(), PRODUCER_IN_DECORATOR_ID);
+ addProblem(CDIValidationMessages.PRODUCER_IN_DECORATOR, CDIPreferences.PRODUCER_IN_INTERCEPTOR_OR_DECORATOR, producer.getProducesAnnotation(), decorator.getResource(), PRODUCER_IN_DECORATOR_ID);
}
Set<IInjectionPoint> injections = decorator.getInjectionPoints(true);
@@ -2189,7 +2232,7 @@
* 8.1.2. Decorator delegate injection points
* - injection point that is not an injected field, initializer method parameter or bean constructor method parameter is annotated @Delegate
*/
- addError(CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE, CDIPreferences.ILLEGAL_INJECTION_POINT_DELEGATE, delegateAnnotation, decorator.getResource());
+ addProblem(CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE, CDIPreferences.ILLEGAL_INJECTION_POINT_DELEGATE, delegateAnnotation, decorator.getResource());
}
}
}
@@ -2200,7 +2243,7 @@
* - decorator has more than one delegate injection point
*/
for (ITextSourceReference declaration : delegates) {
- addError(CDIValidationMessages.MULTIPLE_DELEGATE, CDIPreferences.MULTIPLE_OR_MISSING_DELEGATE, declaration, decorator.getResource());
+ addProblem(CDIValidationMessages.MULTIPLE_DELEGATE, CDIPreferences.MULTIPLE_OR_MISSING_DELEGATE, declaration, decorator.getResource());
}
} else if(delegates.isEmpty()) {
/*
@@ -2208,7 +2251,7 @@
* - decorator does not have a delegate injection point
*/
IAnnotationDeclaration declaration = decorator.getDecoratorAnnotation();
- addError(CDIValidationMessages.MISSING_DELEGATE, CDIPreferences.MULTIPLE_OR_MISSING_DELEGATE, declaration, decorator.getResource());
+ addProblem(CDIValidationMessages.MISSING_DELEGATE, CDIPreferences.MULTIPLE_OR_MISSING_DELEGATE, declaration, decorator.getResource());
}
/*
@@ -2223,7 +2266,7 @@
if(!checkTheOnlySuper(context, decorator, delegateParametedType)) {
Set<IParametedType> decoratedParametedTypes = decorator.getDecoratedTypes();
List<String> supers = null;
- if(shouldValidateType(delegateType)) {
+ if(!isAsYouTypeValidation() && shouldValidateType(delegateType)) {
getValidationContext().addLinkedCoreResource(SHORT_ID, decorator.getResource().getFullPath().toOSString(), delegateType.getResource().getFullPath(), false);
}
for (IParametedType decoratedParametedType : decoratedParametedTypes) {
@@ -2231,7 +2274,7 @@
if(decoratedType==null) {
continue;
}
- if(shouldValidateType(decoratedType)) {
+ if(!isAsYouTypeValidation() && shouldValidateType(decoratedType)) {
getValidationContext().addLinkedCoreResource(SHORT_ID, decorator.getResource().getFullPath().toOSString(), decoratedType.getResource().getFullPath(), false);
}
String decoratedTypeName = decoratedType.getFullyQualifiedName();
@@ -2253,7 +2296,7 @@
declaration = CDIUtil.convertToJavaSourceReference((ITypeDeclaration)delegateParametedType, delegate.getSourceMember());
}
String typeName = Signature.getSignatureSimpleName(decoratedParametedType.getSignature());
- addError(MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, typeName), CDIPreferences.DELEGATE_HAS_ILLEGAL_TYPE, declaration, decorator.getResource());
+ addProblem(MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, typeName), CDIPreferences.DELEGATE_HAS_ILLEGAL_TYPE, declaration, decorator.getResource());
break;
}
}
@@ -2321,9 +2364,9 @@
if (!typeWasFound) {
IMember e = bean instanceof IJavaReference ? ((IJavaReference)bean).getSourceMember() : bean.getBeanClass();
ITextSourceReference typedDeclarationReference = CDIUtil.convertToJavaSourceReference(typedDeclaration, e);
-
+
String message = CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION;
- addError(message, CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION, typedDeclarationReference, bean.getResource());
+ addProblem(message, CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION, typedDeclarationReference, bean.getResource());
}
}
}
@@ -2344,7 +2387,7 @@
? CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_PRODUCER_METHOD
: CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS;
for (IScopeDeclaration scope : scopes) {
- addError(message, CDIPreferences.MULTIPLE_SCOPE_TYPE_ANNOTATIONS, scope, bean.getResource());
+ addProblem(message, CDIPreferences.MULTIPLE_SCOPE_TYPE_ANNOTATIONS, scope, bean.getResource());
}
}
@@ -2366,7 +2409,7 @@
}
if (declarationMap.size() > 1) {
for (IStereotypeDeclaration stereotypeDeclaration : declarationMap.values()) {
- addError(CDIValidationMessages.MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE, CDIPreferences.MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE, stereotypeDeclaration, bean.getResource());
+ addProblem(CDIValidationMessages.MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE, CDIPreferences.MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE, stereotypeDeclaration, bean.getResource());
}
}
}
@@ -2381,7 +2424,7 @@
IAnnotationDeclaration scopeOrStereotypeDeclaration = CDIUtil.getDifferentScopeDeclarationThanDepentend(bean);
if (scopeOrStereotypeDeclaration != null) {
String message = interceptor?CDIValidationMessages.ILLEGAL_SCOPE_FOR_INTERCEPTOR:CDIValidationMessages.ILLEGAL_SCOPE_FOR_DECORATOR;
- addError(message, CDIPreferences.ILLEGAL_SCOPE_FOR_INTERCEPTOR_OR_DECORATOR, scopeOrStereotypeDeclaration, bean.getResource());
+ addProblem(message, CDIPreferences.ILLEGAL_SCOPE_FOR_INTERCEPTOR_OR_DECORATOR, scopeOrStereotypeDeclaration, bean.getResource());
}
}
}
@@ -2425,7 +2468,7 @@
Object name = nameDeclaration.getMemberValue(null);
if (name != null && name.toString().length() > 0) {
ITextSourceReference location = nameDeclaration;
- addError(CDIValidationMessages.STEREOTYPE_DECLARES_NON_EMPTY_NAME, CDIPreferences.STEREOTYPE_DECLARES_NON_EMPTY_NAME, location, resource, STEREOTYPE_DECLARES_NON_EMPTY_NAME_ID);
+ addProblem(CDIValidationMessages.STEREOTYPE_DECLARES_NON_EMPTY_NAME, CDIPreferences.STEREOTYPE_DECLARES_NON_EMPTY_NAME, location, resource, STEREOTYPE_DECLARES_NON_EMPTY_NAME_ID);
}
}
@@ -2433,14 +2476,14 @@
IAnnotationDeclaration typedDeclaration = stereotype.getAnnotationDeclaration(CDIConstants.TYPED_ANNOTATION_TYPE_NAME);
if (typedDeclaration != null) {
ITextSourceReference location = typedDeclaration;
- addError(CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED, CDIPreferences.STEREOTYPE_IS_ANNOTATED_TYPED, location, resource, STEREOTYPE_IS_ANNOTATED_TYPED_ID);
+ addProblem(CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED, CDIPreferences.STEREOTYPE_IS_ANNOTATED_TYPED, location, resource, STEREOTYPE_IS_ANNOTATED_TYPED_ID);
}
// 3. Qualifier other than @Named
for (IAnnotationDeclaration a : as) {
if (a instanceof IQualifierDeclaration && a != nameDeclaration) {
ITextSourceReference location = a;
- addError(CDIValidationMessages.ILLEGAL_QUALIFIER_IN_STEREOTYPE, CDIPreferences.ILLEGAL_QUALIFIER_IN_STEREOTYPE, location, resource);
+ addProblem(CDIValidationMessages.ILLEGAL_QUALIFIER_IN_STEREOTYPE, CDIPreferences.ILLEGAL_QUALIFIER_IN_STEREOTYPE, location, resource);
}
}
@@ -2449,7 +2492,7 @@
Set<IScopeDeclaration> scopeDeclarations = stereotype.getScopeDeclarations();
if (scopeDeclarations.size() > 1) {
for (IScopeDeclaration scope : scopeDeclarations) {
- addError(CDIValidationMessages.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, CDIPreferences.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, scope, stereotype.getResource());
+ addProblem(CDIValidationMessages.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, CDIPreferences.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, scope, stereotype.getResource());
}
}
@@ -2535,7 +2578,7 @@
if(kind == Signature.ARRAY_TYPE_SIGNATURE) {
if(!annotation.getNonBindingMethods().contains(method)) {
ITextSourceReference reference = CDIUtil.convertToSourceReference(method.getNameRange(), annotation.getResource(), method);
- addError(arrayMessageErrorKey, preferencesKey, reference, annotation.getResource(), arrayMessageId);
+ addProblem(arrayMessageErrorKey, preferencesKey, reference, annotation.getResource(), arrayMessageId);
}
} else if(kind == Signature.CLASS_TYPE_SIGNATURE) {
String typeName = Signature.getSignatureSimpleName(returnTypeSignature);
@@ -2550,7 +2593,7 @@
if(memberType!=null && memberType.isAnnotation()) {
if(!annotation.getNonBindingMethods().contains(method)) {
ITextSourceReference reference = CDIUtil.convertToSourceReference(method.getNameRange(), annotation.getResource(), method);
- addError(annotationValueErrorKey, preferencesKey, reference, annotation.getResource(), annotationValueId);
+ addProblem(annotationValueErrorKey, preferencesKey, reference, annotation.getResource(), annotationValueId);
}
}
}
@@ -2570,13 +2613,14 @@
return PREFERENCE_PAGE_ID;
}
+ private static final String BUNDLE_NAME = "org.jboss.tools.cdi.internal.core.validation.messages";
+
/*
* (non-Javadoc)
* @see org.jboss.tools.common.validation.TempMarkerManager#getMessageBundleName()
*/
@Override
protected String getMessageBundleName() {
- // TODO
- return null;
+ return BUNDLE_NAME;
}
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java 2012-06-20 19:22:55 UTC (rev 42116)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java 2012-06-20 19:23:48 UTC (rev 42117)
@@ -17,8 +17,8 @@
import java.util.Map;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -47,13 +47,83 @@
*/
abstract public class TempMarkerManager extends ValidationErrorManager {
+ protected boolean asYouTypeValidation;
+
protected abstract String getMessageBundleName();
- public IMessage addMesssage(IFile target, ITextSourceReference location, String preferenceKey, String textMessage, String[] messageArguments) {
+ /**
+ * @return the asYouTypeValidation
+ */
+ public boolean isAsYouTypeValidation() {
+ return asYouTypeValidation;
+ }
+
+ /**
+ * @param asYouTypeValidation the asYouTypeValidation to set
+ */
+ public void setAsYouTypeValidation(boolean asYouTypeValidation) {
+ this.asYouTypeValidation = asYouTypeValidation;
+ }
+
+ public void addProblem(String message, String preferenceKey, ITextSourceReference location, IResource target) {
+ if(asYouTypeValidation) {
+ addMesssage(target, location, preferenceKey, message);
+ } else {
+ addError(message, preferenceKey, location, target);
+ }
+ }
+
+ public void addProblem(String message, String preferenceKey, String[] messageArguments, ITextSourceReference location, IResource target) {
+ if(asYouTypeValidation) {
+ addMesssage(target, location, preferenceKey, message, messageArguments);
+ } else {
+ addError(message, preferenceKey, messageArguments, location, target);
+ }
+ }
+
+ public void addProblem(String message, String preferenceKey, ITextSourceReference location, IResource target, Integer quickFixId) {
+ if(asYouTypeValidation) {
+ addMesssage(target, location, preferenceKey, message, quickFixId);
+ } else {
+ addError(message, preferenceKey, location, target, quickFixId);
+ }
+ }
+
+ public IMarker addProblem(String message, String preferenceKey, String[] messageArguments, int length, int offset, IResource target, Integer quickFixId) {
+ if(asYouTypeValidation) {
+ addMesssage(target, offset, length, preferenceKey, message, messageArguments, quickFixId);
+ return null;
+ } else {
+ return addError(message, preferenceKey, messageArguments, length, offset, target, quickFixId);
+ }
+ }
+
+ public IMarker addProblem(String message, String preferenceKey, String[] messageArguments, int length, int offset, IResource target) {
+ if(asYouTypeValidation) {
+ addMesssage(target, offset, length, preferenceKey, message, messageArguments);
+ return null;
+ } else {
+ return addError(message, preferenceKey, messageArguments, length, offset, target);
+ }
+ }
+
+ public IMessage addMesssage(IResource target, ITextSourceReference location, String preferenceKey, String textMessage) {
+ return addMesssage(target, -1, location, preferenceKey, textMessage, null);
+ }
+
+ public IMessage addMesssage(IResource target, ITextSourceReference location, String preferenceKey, String textMessage, String[] messageArguments) {
return addMesssage(target, -1, location, preferenceKey, textMessage, messageArguments);
}
- public IMessage addMesssage(IFile target, int lineNumber, ITextSourceReference location, String preferenceKey, String textMessage, String[] messageArguments) {
+ public IMessage addMesssage(IResource target, ITextSourceReference location, String preferenceKey, String textMessage, Integer quickFixId) {
+ IMessage message = addMesssage(target, -1, location, preferenceKey, textMessage, null);
+ if(message!=null) {
+ message.setAttribute(messageIdQuickFixAttributeName, quickFixId);
+ }
+ return message;
+ }
+
+ public IMessage addMesssage(IResource target, int lineNumber, ITextSourceReference location, String preferenceKey, String textMessage, String[] messageArguments) {
int severity = getSeverity(preferenceKey, target);
IMessage message = null;
try {
@@ -66,16 +136,24 @@
return message;
}
- public IMessage addMesssage(IFile target, int offset, int length, String preferenceKey, String message, String[] messageArguments) {
+ public IMessage addMesssage(IResource target, int offset, int length, String preferenceKey, String messageText, String[] messageArguments, int quickFixId) {
+ IMessage message = addMesssage(target, -1, offset, length, preferenceKey, messageText, messageArguments);
+ if(message!=null) {
+ message.setAttribute(messageIdQuickFixAttributeName, quickFixId);
+ }
+ return message;
+ }
+
+ public IMessage addMesssage(IResource target, int offset, int length, String preferenceKey, String message, String[] messageArguments) {
return addMesssage(target, -1, offset, length, preferenceKey, message, messageArguments);
}
- public IMessage addMesssage(IFile target, int lineNumber, int offset, int length, String preferenceKey, String message, String[] messageArguments) {
+ public IMessage addMesssage(IResource target, int lineNumber, int offset, int length, String preferenceKey, String message, String[] messageArguments) {
int severity = getSeverity(preferenceKey, target);
return severity!=-1?addMesssage(target, lineNumber, offset, length, severity, preferenceKey, message, messageArguments):null;
}
- private IMessage addMesssage(IFile target, int lineNumber, int offset, int length, int severity, String preferenceKey, String textMessage, String[] messageArguments) {
+ private IMessage addMesssage(IResource target, int lineNumber, int offset, int length, int severity, String preferenceKey, String textMessage, String[] messageArguments) {
if(lineNumber<0) {
try {
lineNumber = document.getLineOfOffset(offset) + 1;
@@ -89,8 +167,8 @@
public static final String AS_YOU_TYPE_VALIDATION_ANNOTATION_ATTRIBUTE = "org.jboss.tools.common.validation.asyoutype";
- private static IMessage addMesssage(IValidator validator, IReporter reporter, int offset, int length, IFile file, int lineNumber, int severity, String textMessage, Object[] messageArguments, String bundleName) {
- Message message = new ValidationMessage(severity, MessageFormat.format(textMessage, messageArguments), file);
+ private static IMessage addMesssage(IValidator validator, IReporter reporter, int offset, int length, IResource target, int lineNumber, int severity, String textMessage, Object[] messageArguments, String bundleName) {
+ Message message = new ValidationMessage(severity, messageArguments!=null?MessageFormat.format(textMessage, messageArguments):textMessage, target);
message.setOffset(offset);
message.setLength(length);
message.setLineNo(lineNumber);
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2012-06-20 19:22:55 UTC (rev 42116)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2012-06-20 19:23:48 UTC (rev 42117)
@@ -66,7 +66,7 @@
protected IDocument document;
protected Set<IFile> dirtyFiles;
- private String messageIdQuickFixAttributeName;
+ protected String messageIdQuickFixAttributeName;
/**
* Constructor
@@ -395,7 +395,6 @@
return marker;
}
-
public IMarker addError(String message, String preferenceKey,
String[] messageArguments, int length, int offset, IResource target) {
return addError(message, preferenceKey, messageArguments, 0, length, offset, target);
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationMessage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationMessage.java 2012-06-20 19:22:55 UTC (rev 42116)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationMessage.java 2012-06-20 19:23:48 UTC (rev 42117)
@@ -12,7 +12,7 @@
import java.util.Locale;
-import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
import org.eclipse.wst.validation.internal.core.Message;
import org.jboss.tools.common.CommonPlugin;
@@ -23,8 +23,8 @@
private String message;
- public ValidationMessage(int severity, String message, IFile file) {
- super(CommonPlugin.PLUGIN_ID, severity, message, null, file);
+ public ValidationMessage(int severity, String message, IResource target) {
+ super(CommonPlugin.PLUGIN_ID, severity, message, null, target);
this.message = message;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2012-06-20 19:22:55 UTC (rev 42116)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2012-06-20 19:23:48 UTC (rev 42117)
@@ -148,6 +148,7 @@
@Override
public void init(IProject project, ContextValidationHelper validationHelper, IProjectValidationContext context, org.eclipse.wst.validation.internal.provisional.core.IValidator manager, IReporter reporter) {
super.init(project, validationHelper, context, manager, reporter);
+ setAsYouTypeValidation(false);
resolvers = ELResolverFactoryManager.getInstance().getResolvers(project);
mainFactory = ELParserUtil.getJbossFactory();
validateVars = ELSeverityPreferences.ENABLE.equals(ELSeverityPreferences.getInstance().getProjectPreference(validatingProject, ELSeverityPreferences.CHECK_VARS));
@@ -251,6 +252,7 @@
@Override
public void validate(IValidator validatorManager, IProject rootProject, IRegion dirtyRegion, IValidationContext helper, IReporter reporter, EditorValidationContext validationContext, IProjectValidationContext projectContext, IFile file) {
init(rootProject, null, projectContext, validatorManager, reporter);
+ setAsYouTypeValidation(true);
this.document = validationContext.getDocument();
ELContext elContext = PageContextFactory.createPageContext(validationContext.getDocument(), true);
Set<ELReference> references = elContext.getELReferences(dirtyRegion);
12 years, 7 months