Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2017-02-15 17:12:35 -0500
committerjmisinco2017-02-16 12:25:11 -0500
commit68e19cb5ec76ede4538854d98e3aafdeebc77142 (patch)
tree9d9ae7b455b682d3eecc8b2b1a6b0da08b117e5d
parent846d6122c8070708d2dee732834e6b4158b38f42 (diff)
downloadorg.eclipse.osee-68e19cb5ec76ede4538854d98e3aafdeebc77142.tar.gz
org.eclipse.osee-68e19cb5ec76ede4538854d98e3aafdeebc77142.tar.xz
org.eclipse.osee-68e19cb5ec76ede4538854d98e3aafdeebc77142.zip
bug[ats_ATS348250]: Bug markers not showing up unless an outfile is opened
-rw-r--r--plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/MarkerPlugin.java42
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/StoreOutfileJob.java27
2 files changed, 31 insertions, 38 deletions
diff --git a/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/MarkerPlugin.java b/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/MarkerPlugin.java
index 6dd764412f..2a5abdf087 100644
--- a/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/MarkerPlugin.java
+++ b/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/MarkerPlugin.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.ote.ui.markers;
import java.util.List;
import java.util.logging.Level;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
@@ -56,21 +55,11 @@ public class MarkerPlugin implements BundleActivator {
// file.refreshLocal(depth, monitor);
if (file != null) {
switch (delta.getKind()) {
- case IResourceDelta.ADDED:
- // OseeLog.logf(Activator.class, Level.INFO, "ADDED %s updating
- // markers - delta kind: %d", file.getName(), delta.getKind());
- // addMarkers(file);
- break;
- case IResourceDelta.CHANGED:
- // OseeLog.logf(Activator.class, Level.INFO, "CHANGED %s updating
- // markers - delta kind: %d", file.getName(), delta.getKind());
- // updateMarkers(file);
- break;
case IResourceDelta.REMOVED:
- // OseeLog.logf(Activator.class, Level.INFO, "removing %s markers -
- // delta kind: %d", file.getName(), delta.getKind());
removeMarkers(file);
break;
+ default:
+ // do nothing
}
}
}
@@ -115,18 +104,19 @@ public class MarkerPlugin implements BundleActivator {
static synchronized void updateMarkerInfo(IFile file, List<IMarker> markers) {
filesToWatch.put(file, markers);
}
-
- public static void findAndRemoveOteMarkers(IResource resource){
- try {
- if(resource == null){
- return;
- }
- IMarker[] markersToRemove = resource.findMarkers("org.eclipse.osee.ote.ui.output.errorMarker", false, IResource.DEPTH_INFINITE);
- for(IMarker localMarker:markersToRemove){
- localMarker.delete();
- }
- } catch (CoreException e) {
- OseeLog.log(MarkerPlugin.class, Level.SEVERE, e);
- }
+
+ public static void findAndRemoveOteMarkers(IResource resource) {
+ try {
+ if (resource == null) {
+ return;
+ }
+ IMarker[] markersToRemove =
+ resource.findMarkers("org.eclipse.osee.ote.ui.output.errorMarker", false, IResource.DEPTH_INFINITE);
+ for (IMarker localMarker : markersToRemove) {
+ localMarker.delete();
+ }
+ } catch (CoreException e) {
+ OseeLog.log(MarkerPlugin.class, Level.SEVERE, e);
+ }
}
}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/StoreOutfileJob.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/StoreOutfileJob.java
index 6041ecdb28..488c64ddbe 100644
--- a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/StoreOutfileJob.java
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/StoreOutfileJob.java
@@ -15,6 +15,7 @@ import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -72,7 +73,8 @@ public class StoreOutfileJob extends Job {
try {
storeOutfile(scriptTask);
} catch (Exception e) {
- return new Status(IStatus.ERROR, TestManagerPlugin.PLUGIN_ID, "Failed to write out file to workspace", e);
+ return new Status(IStatus.ERROR, TestManagerPlugin.PLUGIN_ID, "Failed to write out file to workspace",
+ e);
}
}
// scriptTask.computeExists();
@@ -113,7 +115,8 @@ public class StoreOutfileJob extends Job {
}
private boolean isKeepSavedOutfileEnabled() {
- return testManagerEditor.getPropertyStore().getBoolean(TestManagerStorageKeys.KEEP_OLD_OUTFILE_COPIES_ENABLED_KEY);
+ return testManagerEditor.getPropertyStore().getBoolean(
+ TestManagerStorageKeys.KEEP_OLD_OUTFILE_COPIES_ENABLED_KEY);
}
private void storeOutfile(ScriptTask scriptTask) throws Exception {
@@ -125,10 +128,12 @@ public class StoreOutfileJob extends Job {
if (isKeepSavedOutfileEnabled()) {
moveOutputToNextAvailableSpot(scriptTask);
}
- // else {
- // task.getScriptModel().getOutputModel().getIFile().delete(true, null);
- // }
- IFile file = AIFile.constructIFile(clientOutfilePath);
+ IFile file = null;
+ IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(
+ org.eclipse.core.filesystem.URIUtil.toURI(clientOutfilePath));
+ if (files.length > 0) {
+ file = files[0];
+ }
if (file != null) {
AIFile.writeToFile(file, new ByteArrayInputStream(outBytes));
MarkerPlugin.addMarkers(file);
@@ -146,15 +151,13 @@ public class StoreOutfileJob extends Job {
String outputExtension = "." + outputModel.getFileExtension();
String extensionRegex = "\\" + outputExtension + "\\b";//escape the . and should be the end of the string (word b
int fileNum = 1;
- File destFile =
- new File(
- oldFile.getAbsoluteFile().toString().replaceFirst(extensionRegex, "." + fileNum + outputExtension));
+ File destFile = new File(
+ oldFile.getAbsoluteFile().toString().replaceFirst(extensionRegex, "." + fileNum + outputExtension));
if (destFile.exists()) {
while (destFile.exists()) {
fileNum++;
- destFile =
- new File(oldFile.getAbsoluteFile().toString().replaceFirst(extensionRegex,
- "." + fileNum + outputExtension));
+ destFile = new File(
+ oldFile.getAbsoluteFile().toString().replaceFirst(extensionRegex, "." + fileNum + outputExtension));
}
}
try {

Back to the top