Author: dgolovin
Date: 2011-08-24 18:52:40 -0400 (Wed, 24 Aug 2011)
New Revision: 34248
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
Log:
code cleanup:
1. Empty if else blocks removed
2. Null checks removed
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-08-24
21:57:03 UTC (rev 34247)
+++
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2011-08-24
22:52:40 UTC (rev 34248)
@@ -141,17 +141,12 @@
public IMarker addError(String message, String preferenceKey,
String[] messageArguments, ITextSourceReference location,
IResource target) {
- if(location == null) {
- //
- } else if(location.getResource() != null && location.getResource().exists()) {
- if(!location.getResource().equals(target)) {
- target = location.getResource();
- }
- } else {
- //
+ IResource newTarget = target;
+ if(location.getResource() != null && location.getResource().exists() &&
!location.getResource().equals(target)) {
+ newTarget = location.getResource();
}
return addError(message, preferenceKey, messageArguments, 0, location
- .getLength(), location.getStartPosition(), target);
+ .getLength(), location.getStartPosition(), newTarget);
}
/*
@@ -372,9 +367,6 @@
String message, int severityEnumValue, String targetObjectName,
String groupName, int offset, int length, int maxNumberOfMarkersPerFile, String
markerType) throws CoreException {
- if ((message == null) || (resource == null) || (!resource.exists())) {
- return null;
- }
int severity = getSeverity(severityEnumValue);
if(markerType==null) {