JBoss Tools SVN: r37302 - trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-12-13 19:17:07 -0500 (Tue, 13 Dec 2011)
New Revision: 37302
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
Log:
https://issues.jboss.org/browse/JBIDE-10187 Add support for a @SuppressWarnings
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 2011-12-14 00:10:43 UTC (rev 37301)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2011-12-14 00:17:07 UTC (rev 37302)
@@ -212,6 +212,14 @@
boolean result = false;
if(location instanceof IJavaSourceReference) {
IJavaElement element = ((IJavaSourceReference) location).getSourceElement();
+ if(element==null) {
+ // Check if it's really a java resource.
+ IResource resource = location.getResource();
+ if("java".equalsIgnoreCase(resource.getFileExtension())) {
+ throw new NullPointerException("IJavaSourceReference referenced to java source should not return null in getSourceElement()");
+ }
+ return result;
+ }
result = getSuppressWarningsAnnotation(preferenceKey, element)!=null;
}
14 years, 4 months
JBoss Tools SVN: r37301 - in trunk/seam/plugins/org.jboss.tools.seam.core: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-12-13 19:10:43 -0500 (Tue, 13 Dec 2011)
New Revision: 37301
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/.classpath
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
Log:
https://issues.jboss.org/browse/JBIDE-10187 Add support for a @SuppressWarnings
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/.classpath
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/.classpath 2011-12-13 23:50:33 UTC (rev 37300)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/.classpath 2011-12-14 00:10:43 UTC (rev 37301)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2011-12-13 23:50:33 UTC (rev 37300)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2011-12-14 00:10:43 UTC (rev 37301)
@@ -53,4 +53,4 @@
org.jboss.tools.seam.internal.core.scanner.lib,
org.jboss.tools.seam.internal.core.scanner.xml,
org.jboss.tools.seam.internal.core.validation
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
14 years, 4 months
JBoss Tools SVN: r37300 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-12-13 18:50:33 -0500 (Tue, 13 Dec 2011)
New Revision: 37300
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectTree.java
Log:
JBIDE-10330
https://issues.jboss.org/browse/JBIDE-10330
Provided loading of stored project dependencies at Eclipse restart.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2011-12-13 23:25:46 UTC (rev 37299)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2011-12-13 23:50:33 UTC (rev 37300)
@@ -30,6 +30,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.IClasspathEntry;
@@ -77,14 +78,31 @@
Set<IBuildParticipantFeature> buildParticipants = null;
Set<IBuildParticipant2Feature> buildParticipants2 = null;
+ /**
+ * Set only for instance created to initially load cdi model.
+ */
+ CDICoreNature cdi;
+
public CDICoreBuilder() {}
+ public CDICoreBuilder(CDICoreNature cdi) throws CoreException {
+ this.cdi = cdi;
+ build(IncrementalProjectBuilder.FULL_BUILD, null, new NullProgressMonitor());
+ }
+
CDICoreNature getCDICoreNature() {
+ if(cdi != null) {
+ return cdi;
+ }
IProject p = getProject();
if(p == null) return null;
return CDICorePlugin.getCDI(p, false);
}
+ IProject getCurrentProject() {
+ return cdi != null ? cdi.getProject() : getProject();
+ }
+
CDIResourceVisitor getResourceVisitor() {
if(resourceVisitor == null) {
resourceVisitor = new CDIResourceVisitor();
@@ -96,7 +114,7 @@
Set<ICDIBuilderDelegate> ds = getDelegates();
int relevance = 0;
for (ICDIBuilderDelegate d: ds) {
- int r = d.computeRelevance(getProject());
+ int r = d.computeRelevance(getCurrentProject());
if(r > relevance) {
builderDelegate = d;
relevance = r;
@@ -199,7 +217,7 @@
if (kind == FULL_BUILD) {
fullBuild(monitor);
} else {
- IResourceDelta delta = getDelta(getProject());
+ IResourceDelta delta = getDelta(getCurrentProject());
if (delta == null) {
fullBuild(monitor);
} else {
@@ -233,7 +251,7 @@
try {
CDIResourceVisitor rv = getResourceVisitor();
rv.incremental = false;
- getProject().accept(rv);
+ getCurrentProject().accept(rv);
FileSet fs = rv.fileSet;
invokeBuilderDelegates(fs, getCDICoreNature());
@@ -305,7 +323,7 @@
}
void addBasicTypes(FileSet fs) throws CoreException {
- IJavaProject jp = EclipseResourceUtil.getJavaProject(getProject());
+ IJavaProject jp = EclipseResourceUtil.getJavaProject(getCurrentProject());
if(jp == null) return;
for (String s: AnnotationHelper.SCOPE_ANNOTATION_TYPES) {
IType type = EclipseJavaUtil.findType(jp, s);
@@ -388,8 +406,8 @@
Set<IPath> visited = new HashSet<IPath>();
CDIResourceVisitor() {
- webinfs = WebUtils.getWebInfPaths(getProject());
- getJavaSourceRoots(getProject());
+ webinfs = WebUtils.getWebInfPaths(getCurrentProject());
+ getJavaSourceRoots(getCurrentProject());
}
void getJavaSourceRoots(IProject project) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java 2011-12-13 23:25:46 UTC (rev 37299)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java 2011-12-13 23:50:33 UTC (rev 37300)
@@ -388,7 +388,7 @@
isStorageResolved = true;
}
try {
- getProject().build(IncrementalProjectBuilder.FULL_BUILD, CDICoreBuilder.BUILDER_ID, new HashMap(), new NullProgressMonitor());
+ new CDICoreBuilder(this);
} catch (CoreException e) {
CDICorePlugin.getDefault().logError(e);
}
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 2011-12-13 23:25:46 UTC (rev 37299)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-12-13 23:50:33 UTC (rev 37300)
@@ -1110,7 +1110,7 @@
return scopesByPath.get(path);
}
- public void update(boolean updateDependent) {
+ public synchronized void update(boolean updateDependent) {
rebuildXML();
rebuildAnnotationTypes();
rebuildBeans();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectTree.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectTree.java 2011-12-13 23:25:46 UTC (rev 37299)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectTree.java 2011-12-13 23:50:33 UTC (rev 37300)
@@ -69,6 +69,11 @@
rootContext = root.getValidationContext();
}
requiredProjects.add(root.getProject());
+
+ for (IProject p: requiredProjects) {
+ CDICorePlugin.getCDI(p, true); //all should be active.
+ }
+
IValidatingProjectSet brunch = new ValidatingProjectSet(root.getProject(), requiredProjects, rootContext);
brunches.put(rootProject, brunch);
allProjects.addAll(brunch.getAllProjects());
14 years, 4 months
JBoss Tools SVN: r37299 - trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-12-13 18:25:46 -0500 (Tue, 13 Dec 2011)
New Revision: 37299
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
Add @SuppressWarnings quick fix https://issues.jboss.org/browse/JBIDE-10187
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-12-13 21:14:06 UTC (rev 37298)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-12-13 23:25:46 UTC (rev 37299)
@@ -43,6 +43,7 @@
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithDialog;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
import org.jboss.tools.common.base.test.validation.TestUtil;
+import org.jboss.tools.common.ui.marker.AddSuppressWarningsMarkerResolution;
import org.jboss.tools.common.ui.marker.ConfigureProblemSeverityMarkerResolution;
import org.jboss.tools.common.util.FileUtil;
@@ -59,6 +60,16 @@
}
fail("Configure Problem Severity marker resolution not found");
}
+
+ private void checkForAddSuppressWarnings(IFile file, IMarkerResolution[] resolutions){
+ if(file.getFileExtension().equals("java")){
+ for(IMarkerResolution resolution : resolutions){
+ if(resolution.getClass().equals(AddSuppressWarningsMarkerResolution.class))
+ return;
+ }
+ fail("Add @SuppressWarnings marker resolution not found");
+ }
+ }
private void checkResolution(IProject project, String[] fileNames, String markerType, String idName, int id, Class<? extends IMarkerResolution> resolutionClass) throws CoreException {
checkResolution(project, fileNames, new String[]{}, markerType, idName, id, resolutionClass);
@@ -86,6 +97,7 @@
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
.getResolutions(marker);
checkForConfigureProblemSeverity(resolutions);
+ checkForAddSuppressWarnings(file, resolutions);
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution.getClass().equals(resolutionClass)) {
14 years, 4 months
JBoss Tools SVN: r37298 - trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-12-13 16:14:06 -0500 (Tue, 13 Dec 2011)
New Revision: 37298
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
Log:
Add @SuppressWarnings quick fix https://issues.jboss.org/browse/JBIDE-10187
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2011-12-13 20:55:46 UTC (rev 37297)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2011-12-13 21:14:06 UTC (rev 37298)
@@ -35,6 +35,6 @@
CONFIGURE_PROBLEM_SEVERITY=Configure Problem Severity
ADD_SUPPRESS_WARNINGS_TITLE=Add @SuppressWarnings to ''{0}''
-ADD_SUPPRESS_WARNINGS_MESSAGE=This quick fix uses warning names that are not supported by Java Validator and will cause \"Unsupported @SuppressWarning\" problem message\n\n
+ADD_SUPPRESS_WARNINGS_MESSAGE=This quick fix uses warning names that are not supported by The Java Validator and will cause \"Unsupported @SuppressWarning\" problem message.\n\n
ADD_SUPPRESS_WARNINGS_QUESTION1=Do you want to disable 'Unsupported @SuppressWarnings' validation?
-ADD_SUPPRESS_WARNINGS_QUESTION2=Do you want to disable 'Unsupported @SuppressWarnings' validation on the Workspace or only on the project ''{0}''?
\ No newline at end of file
+ADD_SUPPRESS_WARNINGS_QUESTION2=Do you want to disable 'Unsupported @SuppressWarnings' validation on the Workspace or on the project ''{0}''?
\ No newline at end of file
14 years, 4 months
JBoss Tools SVN: r37297 - trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-12-13 15:55:46 -0500 (Tue, 13 Dec 2011)
New Revision: 37297
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java
Log:
https://issues.jboss.org/browse/JBIDE-10187
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java 2011-12-13 20:50:21 UTC (rev 37296)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java 2011-12-13 20:55:46 UTC (rev 37297)
@@ -24,18 +24,15 @@
public void testClass() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "*"), 8);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 8);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "*"), 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 7, 12);
}
public void testFieldWithSuppressInParentElement() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "*"), 13);
-
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "*"), 12);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 13);
}
public void testField() throws Exception {
@@ -60,8 +57,5 @@
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 27);
AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 26);
-
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 23);
}
}
\ No newline at end of file
14 years, 4 months
JBoss Tools SVN: r37296 - trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-12-13 15:50:21 -0500 (Tue, 13 Dec 2011)
New Revision: 37296
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java
Log:
NPE in ConfigureProblemSeverityResolutionGenerator https://issues.jboss.org/browse/JBIDE-10471
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java 2011-12-13 20:34:57 UTC (rev 37295)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java 2011-12-13 20:50:21 UTC (rev 37296)
@@ -17,9 +17,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.ILocalVariable;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolutionGenerator2;
import org.jboss.tools.common.EclipseUtil;
@@ -32,6 +29,7 @@
public class ConfigureProblemSeverityResolutionGenerator implements
IMarkerResolutionGenerator2 {
+ @Override
public IMarkerResolution[] getResolutions(IMarker marker) {
ArrayList<IMarkerResolution> resolutions = new ArrayList<IMarkerResolution>();
int position = marker.getAttribute(IMarker.CHAR_START, 0);
@@ -60,31 +58,18 @@
}
private IJavaElement findJavaElement(IFile file, int position){
- ICompilationUnit compilationUnit = null;
try {
- compilationUnit = EclipseUtil.getCompilationUnit(file);
- IJavaElement element = compilationUnit.getElementAt(position);
-// if(element != null && element instanceof IMethod){
-// IJavaElement parameter = findParameter((IMethod)element, position);
-// if(parameter != null){
-// return parameter;
-// }
-// }
- return element;
+ ICompilationUnit compilationUnit = EclipseUtil.getCompilationUnit(file);
+ if(compilationUnit != null){
+ return compilationUnit.getElementAt(position);
+ }
} catch (CoreException e) {
CommonUIPlugin.getDefault().logError(e);
}
return null;
}
-// private ILocalVariable findParameter(IMethod method, int position) throws JavaModelException{
-// for(ILocalVariable parameter : method.getParameters()){
-// if(parameter.getSourceRange().getOffset() <= position && parameter.getSourceRange().getOffset()+parameter.getSourceRange().getLength() > position)
-// return parameter;
-// }
-// return null;
-// }
-
+ @Override
public boolean hasResolutions(IMarker marker) {
try {
return getPreferenceKey(marker) != null && getPreferencePageId(marker) != null;
14 years, 4 months
JBoss Tools SVN: r37295 - trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-12-13 15:34:57 -0500 (Tue, 13 Dec 2011)
New Revision: 37295
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java
Log:
https://issues.jboss.org/browse/JBIDE-10187 Add support for a @SuppressWarnings
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java 2011-12-13 20:03:24 UTC (rev 37294)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java 2011-12-13 20:34:57 UTC (rev 37295)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck.validation;
+import java.text.MessageFormat;
+
import org.eclipse.core.resources.IFile;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
@@ -22,18 +24,18 @@
public void testClass() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLCICATE_EL_NAME, 8);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "*"), 8);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DUPLCICATE_EL_NAME, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "*"), 7);
}
public void testFieldWithSuppressInParentElement() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLCICATE_EL_NAME, 13);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "*"), 13);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DUPLCICATE_EL_NAME, 12);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "*"), 12);
}
public void testField() throws Exception {
@@ -42,7 +44,7 @@
AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 19);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 15, 17);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 15, 17, 23);
}
public void testParam() throws Exception {
14 years, 4 months
JBoss Tools SVN: r37294 - trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-12-13 15:03:24 -0500 (Tue, 13 Dec 2011)
New Revision: 37294
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
Log:
Add @SuppressWarnings quick fix https://issues.jboss.org/browse/JBIDE-10187
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2011-12-13 19:47:01 UTC (rev 37293)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2011-12-13 20:03:24 UTC (rev 37294)
@@ -36,5 +36,5 @@
CONFIGURE_PROBLEM_SEVERITY=Configure Problem Severity
ADD_SUPPRESS_WARNINGS_TITLE=Add @SuppressWarnings to ''{0}''
ADD_SUPPRESS_WARNINGS_MESSAGE=This quick fix uses warning names that are not supported by Java Validator and will cause \"Unsupported @SuppressWarning\" problem message\n\n
-ADD_SUPPRESS_WARNINGS_QUESTION1=Do you want to disable 'Unsupported @SuppressWarnings' validation
-ADD_SUPPRESS_WARNINGS_QUESTION2=Do you want to disable 'Unsupported @SuppressWarnings' validation on the Workspace or only on the project ''{0}''
\ No newline at end of file
+ADD_SUPPRESS_WARNINGS_QUESTION1=Do you want to disable 'Unsupported @SuppressWarnings' validation?
+ADD_SUPPRESS_WARNINGS_QUESTION2=Do you want to disable 'Unsupported @SuppressWarnings' validation on the Workspace or only on the project ''{0}''?
\ No newline at end of file
14 years, 4 months
JBoss Tools SVN: r37293 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test: resources/tck/tests/jbt/validation/suppresswarnings and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-12-13 14:47:01 -0500 (Tue, 13 Dec 2011)
New Revision: 37293
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/Fish.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java
Log:
https://issues.jboss.org/browse/JBIDE-10187 Add support for a @SuppressWarnings
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java 2011-12-13 19:47:01 UTC (rev 37293)
@@ -0,0 +1,30 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.suppresswarnings;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@Named("fishDulipcatedNameSecond")
+public class AnotherFish { // BROKEN
+
+ @Produces AnotherFish fish;
+
+ @Named("fishDulipcatedNameSecond")
+ @Produces Fish fish2BROKEN;
+
+ @Inject @Produces Fish iFishBROKEN;
+
+ @Inject @Produces Fish iFish2BROKEN;
+
+ @Produces
+ public void setFish(Fish fishBROKEN) {
+ }
+
+ @Inject @Produces
+ public void setFish2OK(Fish fishBROKEN) {
+ }
+
+ @Produces
+ public void setFish3(Fish fishBROKEN) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/Fish.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/Fish.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/Fish.java 2011-12-13 19:47:01 UTC (rev 37293)
@@ -0,0 +1,33 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.suppresswarnings;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@SuppressWarnings("org.jboss.tools.cdi.core.validator.problem.ambiguousElNames")
+@Named("fishDulipcatedName")
+public class Fish {
+
+ @Produces Fish fish;
+
+ @Named("fishDulipcatedName")
+ @Produces Fish fish2OK;
+
+ @SuppressWarnings("org.jboss.tools.cdi.core.validator.problem.producerAnnotatedInject")
+ @Inject @Produces Fish iFishOK;
+
+ @Inject @Produces Fish iFish2BROKEN;
+
+ @Produces
+ public void setFish(@SuppressWarnings("org.jboss.tools.cdi.core.validator.problem.unsatisfiedInjectionPoints") Fish fishOK) {
+ }
+
+ @SuppressWarnings({"org.jboss.tools.cdi.core.validator.problem.producerAnnotatedInject", "org.jboss.tools.cdi.core.validator.problem.unsatisfiedInjectionPoints"})
+ @Inject @Produces
+ public void setFish2OK(Fish fishOK) {
+ }
+
+ @Produces
+ public void setFish3(Fish fishBROKEN) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/suppresswarnings/Fish.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2011-12-13 19:31:35 UTC (rev 37292)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2011-12-13 19:47:01 UTC (rev 37293)
@@ -63,6 +63,7 @@
import org.jboss.tools.cdi.core.test.tck.validation.DisableCDISupportTest;
import org.jboss.tools.cdi.core.test.tck.validation.ELValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.IncrementalValidationTest;
+import org.jboss.tools.cdi.core.test.tck.validation.SuppressWarningsTests;
import org.jboss.tools.common.base.test.validation.ValidationExceptionTest;
import org.jboss.tools.test.util.ProjectImportTestSetup;
@@ -121,6 +122,7 @@
suite.addTestSuite(DeploymentProblemsValidationTests.class);
suite.addTestSuite(BeansXmlValidationTest.class);
suite.addTestSuite(AnnotationsValidationTest.class);
+ suite.addTestSuite(SuppressWarningsTests.class);
suite.addTestSuite(CoreValidationTest.class);
suite.addTestSuite(ELValidationTest.class);
suite.addTestSuite(IncrementalValidationTest.class);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java 2011-12-13 19:31:35 UTC (rev 37292)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java 2011-12-13 19:47:01 UTC (rev 37293)
@@ -20,8 +20,46 @@
*/
public class SuppressWarningsTests extends ValidationTest {
- public void testLegalTypesInTyped() throws Exception {
- IFile petShopFile = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(petShopFile, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 25);
+ public void testClass() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLCICATE_EL_NAME, 8);
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DUPLCICATE_EL_NAME, 7);
}
+
+ public void testFieldWithSuppressInParentElement() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLCICATE_EL_NAME, 13);
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DUPLCICATE_EL_NAME, 12);
+ }
+
+ public void testField() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 17);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 19);
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 15, 17);
+ }
+
+ public void testParam() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 22);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 31);
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 20, 24, 28);
+ }
+
+ public void testMultipleSuppress() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 27);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 26);
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 23);
+ }
}
\ No newline at end of file
14 years, 4 months