Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan E. Cook2016-05-17 16:59:40 -0400
committerAngel Avila2016-05-17 16:59:40 -0400
commit692d03cd692ee24251a043017520b9ff870846fe (patch)
treefb00f77155d39a2f985aea04b91095ad94a96617
parentb7c6c777bd6a51b8b9066ec8aac517c8a08db7f3 (diff)
downloadorg.eclipse.osee-692d03cd692ee24251a043017520b9ff870846fe.tar.gz
org.eclipse.osee-692d03cd692ee24251a043017520b9ff870846fe.tar.xz
org.eclipse.osee-692d03cd692ee24251a043017520b9ff870846fe.zip
refactor[ats_ATS284247]: Remove redundant null checks
Signed-off-by: Morgan E. Cook <Morgan.e.cook@boeing.com> Change-Id: Ic0b70768a7da7cece5a8a0b4c5746654add26193
-rw-r--r--plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/WorkspaceBundleLoadCoordinator.java2
-rw-r--r--plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/TestRunThread.java56
-rw-r--r--plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/internal/endpoint/EndpointComponent.java53
-rw-r--r--plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/Message.java5
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java28
-rw-r--r--plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipant.java2
-rw-r--r--plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/jobs/CommitJobDialog.java2
-rw-r--r--plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/viewers/actions/OpenAssociatedScript.java14
-rw-r--r--plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/viewers/data/ScriptItem.java11
-rw-r--r--plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ClearOteMarkerAction.java83
-rw-r--r--plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ClearOteMarkerActionView.java67
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerPopupAction.java11
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/FileOrDirectorySelectionPanel.java2
13 files changed, 159 insertions, 177 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/WorkspaceBundleLoadCoordinator.java b/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/WorkspaceBundleLoadCoordinator.java
index 827feaa456..eeb7f7fa6d 100644
--- a/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/WorkspaceBundleLoadCoordinator.java
+++ b/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/WorkspaceBundleLoadCoordinator.java
@@ -361,7 +361,7 @@ public class WorkspaceBundleLoadCoordinator {
bundlesToOperateOn.add(bundleInfo);
} else {
boolean newBundle = true;
- if (bundleList != null && bundleList.size() > 0) {
+ if (bundleList.size() > 0) {
byte[] digest1 = bundleInfo.getMd5Digest();
for (BundleInfoLite bundle : bundleList) {
byte[] digest2 = bundle.getMd5Digest();
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/TestRunThread.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/TestRunThread.java
index a0a1e754ac..ceb90ddf5b 100644
--- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/TestRunThread.java
+++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/TestRunThread.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.ote.core.framework.testrun;
import java.util.List;
import java.util.logging.Level;
-
import org.eclipse.osee.framework.jdk.core.type.IPropertyStore;
import org.eclipse.osee.framework.logging.BaseStatus;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -61,9 +60,9 @@ public class TestRunThread extends OseeTestThread {
if (testCase == null) {
continue;
}
-
- rb.append(listenerProvider.notifyPreTestCase(dataProvider.createOnPreTestCase(propertyStore, test,
- testCase)));
+
+ rb.append(
+ listenerProvider.notifyPreTestCase(dataProvider.createOnPreTestCase(propertyStore, test, testCase)));
try {
testCase.baseDoTestCase(getEnvironment());
if (Thread.interrupted()) {
@@ -80,22 +79,21 @@ public class TestRunThread extends OseeTestThread {
if (!ex.getClass().getName().startsWith("java")) {
String msg = ex.getClass().getName();
if (ex.getMessage() != null && !ex.getMessage().isEmpty()) {
- msg += ": "+ex.getMessage();
+ msg += ": " + ex.getMessage();
}
Throwable removeThisOnceWeGetRidOfSerializationOnAssociatedException = new Throwable(msg);
removeThisOnceWeGetRidOfSerializationOnAssociatedException.setStackTrace(ex.getStackTrace());
clientSideThrowable = removeThisOnceWeGetRidOfSerializationOnAssociatedException;
}
- methodresult.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, clientSideThrowable));
+ methodresult.addStatus(
+ new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, clientSideThrowable));
rb.append(methodresult);
- OseeLog.log(
- Activator.class,
- Level.SEVERE,
- "Exception running Test Case [" + testCase != null ? testCase.getClass().getName() : "unknown (null test case)" + "]",
- ex);
+ OseeLog.log(Activator.class, Level.SEVERE,
+ "Exception running Test Case [" + testCase.getClass().getName() + "]", ex);
}
- }
- rb.append(listenerProvider.notifyPostTestCase(dataProvider.createOnPostTestCase(propertyStore, test, testCase)));
+ }
+ rb.append(listenerProvider.notifyPostTestCase(
+ dataProvider.createOnPostTestCase(propertyStore, test, testCase)));
}
}
} finally {
@@ -125,26 +123,26 @@ public class TestRunThread extends OseeTestThread {
if (Thread.currentThread() == this.getThread()) {
throw new TestException("", Level.SEVERE);
}
- if(OtePropertiesCore.abortMultipleInterrupt.getBooleanValue()){
- this.interrupt();
- try{
- this.join(1000*60);
- } catch (InterruptedException ex){
- }
+ if (OtePropertiesCore.abortMultipleInterrupt.getBooleanValue()) {
+ this.interrupt();
+ try {
+ this.join(1000 * 60);
+ } catch (InterruptedException ex) {
+ }
} else {
- int count = 0;
- do{
- this.interrupt();
- try{
- this.join(10);
- } catch (InterruptedException ex){
- }
- count++;
- } while (this.isAlive() && count < 200);
+ int count = 0;
+ do {
+ this.interrupt();
+ try {
+ this.join(10);
+ } catch (InterruptedException ex) {
+ }
+ count++;
+ } while (this.isAlive() && count < 200);
}
if (this.isAlive()) {
OseeLog.reportStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE,
- "Waited 60s for test to abort but the thread did not die."));
+ "Waited 60s for test to abort but the thread did not die."));
return false;
}
return true;
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/internal/endpoint/EndpointComponent.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/internal/endpoint/EndpointComponent.java
index fe247740b0..05bb97ae9b 100644
--- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/internal/endpoint/EndpointComponent.java
+++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/internal/endpoint/EndpointComponent.java
@@ -4,7 +4,6 @@ import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.HashMap;
-
import org.eclipse.osee.framework.jdk.core.util.network.PortUtil;
import org.eclipse.osee.ote.core.CopyOnWriteNoIteratorList;
import org.eclipse.osee.ote.endpoint.EndpointDataProcessor;
@@ -16,19 +15,21 @@ import org.eclipse.osee.ote.endpoint.OteUdpEndpointSender;
import org.eclipse.osee.ote.properties.OtePropertiesCore;
public class EndpointComponent implements OteUdpEndpoint {
-
+
private OteUdpEndpointReceiverImpl receiver;
private HashMap<InetSocketAddress, OteUdpEndpointSender> senders = new HashMap<>();
- private CopyOnWriteNoIteratorList<OteUdpEndpointSender> broadcastThreaded = new CopyOnWriteNoIteratorList<>(OteUdpEndpointSender.class);//for backwards compatibility
+ private CopyOnWriteNoIteratorList<OteUdpEndpointSender> broadcastThreaded =
+ new CopyOnWriteNoIteratorList<>(OteUdpEndpointSender.class);//for backwards compatibility
private boolean debug = false;
-
- public EndpointComponent(){
+
+ public EndpointComponent() {
int port;
try {
- String strPort = OtePropertiesCore.endpointPort.getValue(Integer.toString(PortUtil.getInstance().getValidPort()));
- try{
+ String strPort =
+ OtePropertiesCore.endpointPort.getValue(Integer.toString(PortUtil.getInstance().getValidPort()));
+ try {
port = Integer.parseInt(strPort);
- } catch (Throwable th){
+ } catch (Throwable th) {
port = PortUtil.getInstance().getValidPort();
}
receiver = new OteUdpEndpointReceiverImpl(new InetSocketAddress(InetAddress.getLocalHost(), port));
@@ -36,15 +37,15 @@ public class EndpointComponent implements OteUdpEndpoint {
e.printStackTrace();
}
}
-
- public void start(){
+
+ public void start() {
receiver.start();
setDebugOutput(false);
}
-
- public synchronized void stop(){
+
+ public synchronized void stop() {
receiver.stop();
- for(OteEndpointSender sender: senders.values()){
+ for (OteEndpointSender sender : senders.values()) {
try {
sender.stop();
} catch (Throwable e) {
@@ -52,12 +53,12 @@ public class EndpointComponent implements OteUdpEndpoint {
}
}
}
-
+
@Override
public void setDebugOutput(boolean debug) {
String ioRedirect = OtePropertiesCore.ioRedirect.getValue();
- if(ioRedirect != null){
- if(Boolean.parseBoolean(ioRedirect)){
+ if (ioRedirect != null) {
+ if (Boolean.parseBoolean(ioRedirect)) {
this.debug = false;
System.out.println("Unable to enable Endpoint debug because -Dote.io.redirect is enabled.");
return;
@@ -65,7 +66,7 @@ public class EndpointComponent implements OteUdpEndpoint {
}
this.debug = debug;
receiver.setDebugOutput(debug);
- for(OteUdpEndpointSender sender: senders.values()){
+ for (OteUdpEndpointSender sender : senders.values()) {
sender.setDebug(debug);
}
}
@@ -78,7 +79,7 @@ public class EndpointComponent implements OteUdpEndpoint {
@Override
public synchronized OteUdpEndpointSender getOteEndpointThreadedSender(InetSocketAddress address) {
OteUdpEndpointSender sender = senders.get(address);
- if(sender == null || (sender != null && sender.isClosed())){
+ if (sender == null || sender.isClosed()) {
sender = new OteUdpEndpointSender(address);
sender.setDebug(debug);
sender.start();
@@ -91,24 +92,24 @@ public class EndpointComponent implements OteUdpEndpoint {
public OteUdpEndpointInlineSender getOteEndpointInlineSender(InetSocketAddress address) {
return new OteUdpEndpointInlineSender(address);
}
-
+
@Override
public synchronized OteUdpEndpointSender getOteEndpointSender(InetSocketAddress address) {
return getOteEndpointThreadedSender(address);
}
-
+
@Override
public void addBroadcast(OteUdpEndpointSender sender) {
- if(!isAlreadyInBroadcastThreadedList(sender) && sender instanceof OteUdpEndpointSender){
- broadcastThreaded.add((OteUdpEndpointSender)sender);
+ if (!isAlreadyInBroadcastThreadedList(sender) && sender instanceof OteUdpEndpointSender) {
+ broadcastThreaded.add((OteUdpEndpointSender) sender);
}
}
private boolean isAlreadyInBroadcastThreadedList(OteEndpointSender sender) {
OteEndpointSender[] oteUdpEndpointSenders = broadcastThreaded.get();
- for(int i = 0; i < oteUdpEndpointSenders.length; i++) {
- if(oteUdpEndpointSenders[i].getAddress().getPort() == sender.getAddress().getPort()){
- if(oteUdpEndpointSenders[i].getAddress().getAddress().equals(sender.getAddress().getAddress())){
+ for (int i = 0; i < oteUdpEndpointSenders.length; i++) {
+ if (oteUdpEndpointSenders[i].getAddress().getPort() == sender.getAddress().getPort()) {
+ if (oteUdpEndpointSenders[i].getAddress().getAddress().equals(sender.getAddress().getAddress())) {
return true;
}
}
@@ -128,7 +129,7 @@ public class EndpointComponent implements OteUdpEndpoint {
@Override
public void removeDataProcessor(EndpointDataProcessor processor) {
- receiver.removeDataProcessor(processor);
+ receiver.removeDataProcessor(processor);
}
@Override
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/Message.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/Message.java
index c164caf72c..468620b131 100644
--- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/Message.java
+++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/Message.java
@@ -859,9 +859,8 @@ public abstract class Message<S extends ITestEnvironmentMessageSystemAccessor, T
accessor.getTestScript().getTestCase(),
new CheckPoint(this.getMessageName(), "No Transmissions",
result ? "No Transmissions" : "Transmissions Occurred", result, time));
- if (accessor != null) {
- accessor.getLogger().methodEnded(accessor);
- }
+
+ accessor.getLogger().methodEnded(accessor);
return result;
}
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java
index 3b49727228..368d00c0bb 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java
@@ -34,11 +34,11 @@ import org.eclipse.osee.ote.define.AUTOGEN.OteAttributeTypes;
* @author Roberto E. Escobar
*/
public class ArtifactTestRunOperator implements TestRunOperator {
- private static final OteArtifactFetcher<Artifact> TEST_RUN_ARTIFACT_FETCHER = new OteArtifactFetcher<>(
- CoreArtifactTypes.TestRun);
+ private static final OteArtifactFetcher<Artifact> TEST_RUN_ARTIFACT_FETCHER =
+ new OteArtifactFetcher<>(CoreArtifactTypes.TestRun);
- private static final OteArtifactFetcher<Artifact> TEST_SCRIPT_ARTIFACT_FETCHER = new OteArtifactFetcher<>(
- CoreArtifactTypes.TestCase);
+ private static final OteArtifactFetcher<Artifact> TEST_SCRIPT_ARTIFACT_FETCHER =
+ new OteArtifactFetcher<>(CoreArtifactTypes.TestCase);
private final Artifact artifact;
@@ -149,12 +149,12 @@ public class ArtifactTestRunOperator implements TestRunOperator {
boolean toReturn = false;
try {
URI url = new URI(getScriptUrl());
- if (url != null) {
- String revision = getScriptRevision();
- if (Strings.isValid(revision)) {
- toReturn = true;
- }
+
+ String revision = getScriptRevision();
+ if (Strings.isValid(revision)) {
+ toReturn = true;
}
+
} catch (Exception ex) {
}
return toReturn;
@@ -163,9 +163,8 @@ public class ArtifactTestRunOperator implements TestRunOperator {
public boolean hasNotBeenCommitted() {
Artifact fetched = null;
try {
- fetched =
- getTestRunFetcher().searchForUniqueArtifactMatching(OteAttributeTypes.CHECKSUM, getChecksum(),
- artifact.getBranch());
+ fetched = getTestRunFetcher().searchForUniqueArtifactMatching(OteAttributeTypes.CHECKSUM, getChecksum(),
+ artifact.getBranch());
} catch (Exception ex) {
}
return fetched == null;
@@ -180,9 +179,8 @@ public class ArtifactTestRunOperator implements TestRunOperator {
}
public void createTestScriptSoftLink() throws OseeCoreException {
- Artifact testScript =
- getTestScriptFetcher().searchForUniqueArtifactMatching(CoreAttributeTypes.Name, artifact.getName(),
- artifact.getBranch());
+ Artifact testScript = getTestScriptFetcher().searchForUniqueArtifactMatching(CoreAttributeTypes.Name,
+ artifact.getName(), artifact.getBranch());
if (testScript != null) {
artifact.setSoleAttributeValue(CoreAttributeTypes.TestScriptGuid, testScript.getGuid());
}
diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipant.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipant.java
index 4968e9515f..8b44be408e 100644
--- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipant.java
+++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipant.java
@@ -559,7 +559,7 @@ public class DomainParticipant extends Entity implements EntityFactory {
}
- if (writer == null || writer != null && writer.isPublishBackToLocalDDSReaders()) {
+ if (writer != null && writer.isPublishBackToLocalDDSReaders()) {
// Notify all of the subscribers in our domain
for (Subscriber domainSubscribers : subscribers) {
domainSubscribers.processNewData(dataStoreItem);
diff --git a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/jobs/CommitJobDialog.java b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/jobs/CommitJobDialog.java
index 4b2079df7f..a37638bdfc 100644
--- a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/jobs/CommitJobDialog.java
+++ b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/jobs/CommitJobDialog.java
@@ -147,7 +147,7 @@ class CommitJobDialog extends UIJob {
if (columnIndex >= DUMMY_COLUMNS) {
if (element instanceof Artifact) {
Artifact artifact = (Artifact) element;
- if (artifact != null && artifact.isDeleted() != true) {
+ if (!artifact.isDeleted()) {
CommitColumnEnum column = CommitColumnEnum.values()[columnIndex - DUMMY_COLUMNS];
switch (column) {
case Branch:
diff --git a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/viewers/actions/OpenAssociatedScript.java b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/viewers/actions/OpenAssociatedScript.java
index 0606bf0c28..b486bd4030 100644
--- a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/viewers/actions/OpenAssociatedScript.java
+++ b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/viewers/actions/OpenAssociatedScript.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.ote.ui.define.viewers.actions;
import java.net.URL;
-
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.StructuredViewer;
@@ -67,13 +66,12 @@ public class OpenAssociatedScript extends AbstractActionHandler {
private void openRemoteScript(String scriptUrl, String revision) {
try {
URL urlToOpen = new URL(scriptUrl);
- if (urlToOpen != null) {
- IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
- IWebBrowser browser =
- browserSupport.createBrowser(IWorkbenchBrowserSupport.AS_EDITOR, "org.eclipse.ui.browser.editor",
- scriptUrl, "");
- browser.openURL(urlToOpen);
- }
+
+ IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
+ IWebBrowser browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.AS_EDITOR,
+ "org.eclipse.ui.browser.editor", scriptUrl, "");
+ browser.openURL(urlToOpen);
+
} catch (Exception ex) {
handleException();
}
diff --git a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/viewers/data/ScriptItem.java b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/viewers/data/ScriptItem.java
index 3634a56813..36a9b30db5 100644
--- a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/viewers/data/ScriptItem.java
+++ b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/viewers/data/ScriptItem.java
@@ -41,16 +41,14 @@ public class ScriptItem extends DataItem implements IXViewerItem {
private void setScriptUrlAndRevision(String scriptUrl, String revision) {
boolean wasThereAnError = false;
+
try {
URI url = new URI(scriptUrl);
- if (url != null) {
- this.scriptUrl = scriptUrl;
- } else {
- wasThereAnError = true;
- }
+ this.scriptUrl = scriptUrl;
} catch (Exception ex) {
wasThereAnError = true;
}
+
try {
if (Strings.isValid(revision)) {
this.revision = revision;
@@ -85,7 +83,8 @@ public class ScriptItem extends DataItem implements IXViewerItem {
public String getLabel(int index) {
String toReturn = "";
if (index == 0) {
- if (scriptUrl.equals(DEFAULT_SCRIPT_NAME) != true && revision.equals(DEFAULT_REVISION) != true && isFullDescriptionModeEnabled() != false) {
+ if (scriptUrl.equals(DEFAULT_SCRIPT_NAME) != true && revision.equals(
+ DEFAULT_REVISION) != true && isFullDescriptionModeEnabled() != false) {
toReturn = getFullLabel();
} else {
toReturn = getShortLabel();
diff --git a/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ClearOteMarkerAction.java b/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ClearOteMarkerAction.java
index 44f290e400..0d0f3ea0ac 100644
--- a/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ClearOteMarkerAction.java
+++ b/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ClearOteMarkerAction.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.ote.ui.markers;
import java.util.ArrayList;
import java.util.Iterator;
-
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
@@ -20,47 +19,45 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IEditorActionDelegate;
import org.eclipse.ui.IEditorPart;
-public class ClearOteMarkerAction implements IEditorActionDelegate{
-
- ArrayList<IResource> selections;
- private IEditorPart editor;
-
- public ClearOteMarkerAction() {
- selections = new ArrayList<>();
- }
-
- @Override
- public void run(IAction action) {
- for(IResource resource:selections){
- MarkerPlugin.findAndRemoveOteMarkers(resource);
- }
- }
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- selections.clear();
- if(selection instanceof StructuredSelection){
- Iterator<?> i = ((StructuredSelection)selection).iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof IResource) {
- IResource resource = (IResource) obj;
- if (resource != null) {
- selections.add(resource);
- }
- }
- }
- } else {
- Object obj = editor.getEditorInput().getAdapter(IResource.class);
- if(obj != null){
- selections.add((IResource)obj);
- }
- }
- }
-
- @Override
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- this.editor = targetEditor;
- }
+public class ClearOteMarkerAction implements IEditorActionDelegate {
+
+ ArrayList<IResource> selections;
+ private IEditorPart editor;
+
+ public ClearOteMarkerAction() {
+ selections = new ArrayList<>();
+ }
+
+ @Override
+ public void run(IAction action) {
+ for (IResource resource : selections) {
+ MarkerPlugin.findAndRemoveOteMarkers(resource);
+ }
+ }
+
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+ selections.clear();
+ if (selection instanceof StructuredSelection) {
+ Iterator<?> i = ((StructuredSelection) selection).iterator();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ if (obj instanceof IResource) {
+ IResource resource = (IResource) obj;
+ selections.add(resource);
+ }
+ }
+ } else {
+ Object obj = editor.getEditorInput().getAdapter(IResource.class);
+ if (obj != null) {
+ selections.add((IResource) obj);
+ }
+ }
+ }
+
+ @Override
+ public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+ this.editor = targetEditor;
+ }
}
diff --git a/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ClearOteMarkerActionView.java b/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ClearOteMarkerActionView.java
index 09b61d02f8..e0554a8f61 100644
--- a/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ClearOteMarkerActionView.java
+++ b/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ClearOteMarkerActionView.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.ote.ui.markers;
import java.util.ArrayList;
import java.util.Iterator;
-
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
@@ -22,38 +21,36 @@ import org.eclipse.ui.IViewPart;
public class ClearOteMarkerActionView implements IViewActionDelegate {
- ArrayList<IResource> selections;
-
- public ClearOteMarkerActionView() {
- selections = new ArrayList<>();
- }
-
- @Override
- public void run(IAction action) {
- for(IResource resource:selections){
- MarkerPlugin.findAndRemoveOteMarkers(resource);
- }
- }
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- selections.clear();
- if(selection instanceof StructuredSelection){
- Iterator<?> i = ((StructuredSelection)selection).iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof IResource) {
- IResource resource = (IResource) obj;
- if (resource != null) {
- selections.add(resource);
- }
- }
- }
- }
- }
-
- @Override
- public void init(IViewPart view) {
-
- }
+ ArrayList<IResource> selections;
+
+ public ClearOteMarkerActionView() {
+ selections = new ArrayList<>();
+ }
+
+ @Override
+ public void run(IAction action) {
+ for (IResource resource : selections) {
+ MarkerPlugin.findAndRemoveOteMarkers(resource);
+ }
+ }
+
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+ selections.clear();
+ if (selection instanceof StructuredSelection) {
+ Iterator<?> i = ((StructuredSelection) selection).iterator();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ if (obj instanceof IResource) {
+ IResource resource = (IResource) obj;
+ selections.add(resource);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void init(IViewPart view) {
+
+ }
}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerPopupAction.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerPopupAction.java
index e2a73ef724..68c1d2a4f0 100644
--- a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerPopupAction.java
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerPopupAction.java
@@ -13,7 +13,6 @@ package org.eclipse.osee.ote.ui.test.manager.actions;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jface.action.IAction;
@@ -31,19 +30,15 @@ public class AddToTestManagerPopupAction implements IWorkbenchWindowActionDelega
StructuredSelection sel = AWorkspace.getSelection();
Iterator<?> i = sel.iterator();
List<String> selection = new ArrayList<>();
-
+
while (i.hasNext()) {
Object obj = i.next();
if (obj instanceof IResource) {
IResource resource = (IResource) obj;
- if (resource != null) {
- selection.add(resource.getLocation().toOSString());
- }
+ selection.add(resource.getLocation().toOSString());
} else if (obj instanceof ICompilationUnit) {
ICompilationUnit resource = (ICompilationUnit) obj;
- if (resource != null) {
- selection.add(resource.getResource().getLocation().toOSString());
- }
+ selection.add(resource.getResource().getLocation().toOSString());
}
}
return selection.toArray(new String[0]);
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/FileOrDirectorySelectionPanel.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/FileOrDirectorySelectionPanel.java
index 3aa64e986b..ea8bc5e6a9 100644
--- a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/FileOrDirectorySelectionPanel.java
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/FileOrDirectorySelectionPanel.java
@@ -121,7 +121,7 @@ public class FileOrDirectorySelectionPanel extends Composite {
private boolean isValidFile(String text) {
File file = new File(text);
- return file != null && file.exists() != false && file.canWrite() != false;
+ return file.exists() && file.canWrite();
}
public boolean isValid() {

Back to the top