Author: xcoulon
Date: 2011-12-02 13:04:37 -0500 (Fri, 02 Dec 2011)
New Revision: 36886
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java
Log:
Prevent NPE/unnecessary processing when no change occurred
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java 2011-12-02
17:27:17 UTC (rev 36885)
+++
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java 2011-12-02
18:04:37 UTC (rev 36886)
@@ -74,10 +74,14 @@
events, progressMonitor);
final List<JaxrsEndpointChangedEvent> jaxrsEndpointChanges =
jaxrsElementChangedProcessor.processEvents(
jaxrsElementChanges, progressMonitor);
+ if(jaxrsEndpointChanges == null || jaxrsEndpointChanges.isEmpty()) {
+ Logger.debug("No JAX-RS change to publish to the UI");
+ } else {
for (JaxrsEndpointChangedEvent change : jaxrsEndpointChanges) {
Logger.debug(change.toString());
EventService.getInstance().publish(change);
}
+ }
} catch (Throwable e) {
Logger.error("Failed to build or refresh the JAX-RS metamodel", e);
} finally {
Show replies by date