Skip to content
Snippets Groups Projects
Commit 97166c4f authored by Thomas's avatar Thomas
Browse files

Modified the packagedMarkedAsNotUsed feature to return true, iff a

module or file starts with "_".
parent cb4db22c
No related branches found
No related tags found
No related merge requests found
...@@ -154,7 +154,7 @@ public class TransformationExecutor extends EpsilonStandalone { ...@@ -154,7 +154,7 @@ public class TransformationExecutor extends EpsilonStandalone {
public boolean packageMarkedAsNotUsed(String url, String sourceFolder) { public boolean packageMarkedAsNotUsed(String url, String sourceFolder) {
url = url.substring(url.indexOf(sourceFolder) + sourceFolder.length()); url = url.substring(url.indexOf(sourceFolder) + sourceFolder.length());
url = url.substring(0, url.indexOf("/")); url = url.substring(0, url.indexOf("/"));
if(url.startsWith("_") && url.endsWith("_")) return true; if(url.startsWith("_")) return true;
return false; return false;
} }
...@@ -167,7 +167,7 @@ public class TransformationExecutor extends EpsilonStandalone { ...@@ -167,7 +167,7 @@ public class TransformationExecutor extends EpsilonStandalone {
public boolean packageETLFilesMarkedAsNotUsed(String url, String sourceFolder) { public boolean packageETLFilesMarkedAsNotUsed(String url, String sourceFolder) {
url = url.substring(url.indexOf(sourceFolder) + sourceFolder.length()); url = url.substring(url.indexOf(sourceFolder) + sourceFolder.length());
url = url.substring(url.indexOf("/")+1, url.indexOf(".etl")); url = url.substring(url.indexOf("/")+1, url.indexOf(".etl"));
if(url.startsWith("_") && url.endsWith("_")) return true; if(url.startsWith("_")) return true;
return false; return false;
} }
......
...@@ -693,8 +693,9 @@ public class UIUtil { ...@@ -693,8 +693,9 @@ public class UIUtil {
*/ */
public static boolean packageMarkedAsNotUsed(String classURL, String sourceFolder) { public static boolean packageMarkedAsNotUsed(String classURL, String sourceFolder) {
classURL = classURL.substring(classURL.indexOf(sourceFolder) + sourceFolder.length()); classURL = classURL.substring(classURL.indexOf(sourceFolder) + sourceFolder.length());
if (classURL.indexOf("/")>-1)
classURL = classURL.substring(0, classURL.indexOf("/")); classURL = classURL.substring(0, classURL.indexOf("/"));
if(classURL.startsWith("_") && classURL.endsWith("_")) return true; if(classURL.startsWith("_")) return true;
return false; return false;
} }
......
...@@ -90,20 +90,6 @@ public class EditPolicyService { ...@@ -90,20 +90,6 @@ public class EditPolicyService {
} }
} }
/**
* checks if the package part of a file url starts and ends with an _
*
* @param url
* the string url to check against
* @param sourceFolder
* the source folder in which the class is located in
* @return if the package part of a class url starts and ends with an _
*/
private static boolean isPackageMarkedAsNotUsed(String url) {
url = url.substring(url.lastIndexOf('/')+1, url.length());
return url.startsWith("_") && url.endsWith("_");
}
private static void loadAllFiles() { private static void loadAllFiles() {
Bundle UIBundle = Platform.getBundle("org.framed.iorm.ui"); Bundle UIBundle = Platform.getBundle("org.framed.iorm.ui");
...@@ -117,14 +103,14 @@ public class EditPolicyService { ...@@ -117,14 +103,14 @@ public class EditPolicyService {
if (moduleFileURLs != null) { if (moduleFileURLs != null) {
for (URL url : moduleFileURLs) { for (URL url : moduleFileURLs) {
if (!isPackageMarkedAsNotUsed(url.toString())) { if (!UIUtil.packageMarkedAsNotUsed(url.toString(), "modules/")) {
loadEditPolicyFile(url.toString()); loadEditPolicyFile(url.toString());
} }
} }
} }
if (coreFileURLs != null) { if (coreFileURLs != null) {
for (URL url : coreFileURLs) { for (URL url : coreFileURLs) {
if (!isPackageMarkedAsNotUsed(url.toString())) { if (!UIUtil.packageMarkedAsNotUsed(url.toString(), "core/")) {
loadEditPolicyFile(url.toString()); loadEditPolicyFile(url.toString());
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment