Author: xcoulon
Date: 2012-10-12 11:21:36 -0400 (Fri, 12 Oct 2012)
New Revision: 44487
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedBuildJob.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilder.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedBuildJob.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
Log:
Fixed - JBIDE-12808 - JAX-RS builder and validator called twice when a changed file is
saved
https://issues.jboss.org/browse/JBIDE-12808
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedBuildJob.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedBuildJob.java 2012-10-12
14:59:10 UTC (rev 44486)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedBuildJob.java 2012-10-12
15:21:36 UTC (rev 44487)
@@ -48,7 +48,7 @@
try {
progressMonitor.beginTask("Building JAX-RS Metamodel", 4 * SCALE);
progressMonitor.worked(SCALE);
- Logger.debug("Building JAX-RS Metamodel...");
+ Logger.debug("Building JAX-RS Metamodel after Java element changed...");
if (progressMonitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilder.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilder.java 2012-10-12
14:59:10 UTC (rev 44486)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilder.java 2012-10-12
15:21:36 UTC (rev 44487)
@@ -93,6 +93,7 @@
* the progress monitor
*/
private void build(final int buildKind, final IProject project, final IProgressMonitor
progressMonitor) {
+ Logger.info("Building JAX-RS metamodel for project " + project.getName());
ResourceChangedBuildJob job = new ResourceChangedBuildJob(project,
getResourceChangeEvent(project, buildKind));
job.setRule(MutexJobSchedulingRule.getInstance());
job.schedule();
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedBuildJob.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedBuildJob.java 2012-10-12
14:59:10 UTC (rev 44486)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedBuildJob.java 2012-10-12
15:21:36 UTC (rev 44487)
@@ -51,7 +51,7 @@
long startTime = new Date().getTime();
try {
progressMonitor.beginTask("Building JAX-RS Metamodel", 4 * SCALE);
- Logger.debug("Building JAX-RS Metamodel...");
+ Logger.debug("Building JAX-RS Metamodel after resource changed...");
if (progressMonitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java 2012-10-12
14:59:10 UTC (rev 44486)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java 2012-10-12
15:21:36 UTC (rev 44487)
@@ -106,12 +106,12 @@
*/
public IStatus validate(Set<IFile> changedFiles, IProject project,
ContextValidationHelper validationHelper,
IProjectValidationContext context, ValidatorManager manager, IReporter reporter)
throws ValidationException {
- Logger.debug("*** Validating project {} after files {} changed... ***",
project.getName(),
- changedFiles.toString());
init(project, validationHelper, context, manager, reporter);
setAsYouTypeValidation(false);
try {
if (!changedFiles.isEmpty()) {
+ Logger.debug("*** Validating project {} after files {} changed... ***",
project.getName(),
+ changedFiles.toString());
final JaxrsMetamodel jaxrsMetamodel = JaxrsMetamodelLocator.get(project);
final Set<IResource> allResources = completeValidationSet(jaxrsMetamodel,
changedFiles.toArray(new IFile[changedFiles.size()]));
for (IResource changedResource : allResources) {
@@ -120,7 +120,7 @@
}
// trigger a full validation instead
else {
- validateAll(project, validationHelper, context, manager, reporter);
+ //validateAll(project, validationHelper, context, manager, reporter);
}
} catch (CoreException e) {
Logger.error("Failed to validate changed files " + changedFiles + " in
project " + project, e);