Skip to content

Commit

Permalink
v0.54.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vladdu committed Mar 30, 2018
2 parents a56bb94 + 0f60c36 commit 054a785
Show file tree
Hide file tree
Showing 633 changed files with 8,975 additions and 9,158 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ junit.xml
*.xtendbin
.gradle
build/

\.idea/

*.iml
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

85 changes: 42 additions & 43 deletions extras/org.erlide.jvmcheck/src/org/erlide/jvmcheck/JvmCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,74 +18,73 @@
import org.eclipse.ui.PlatformUI;

public class JvmCheck implements IStartup, JvmCheckConstants_Actual {

public static String getJavaVersionProperty() {
return System.getProperty("java.version");
}

public static int getJavaVersion() {
String versionProperty = getJavaVersionProperty();
String[] versionSegments = versionProperty.split("\\.");

if(versionSegments.length < 2) {
return -1;
}
// v<9: 1.8...
// v>9: 9.x...
String javaVersionStr = versionSegments[0];
try {
int v = Integer.parseInt(javaVersionStr);
if (v == 1) {
javaVersionStr = versionSegments[1];
return Integer.parseInt(javaVersionStr);
}
return v;
} catch (NumberFormatException e) {
return -1;
}
}

@Override
final String versionProperty = JvmCheck.getJavaVersionProperty();
final String[] versionSegments = versionProperty.split("\\.");

// v<9: 1.8...
// v>9: 9.x...
String javaVersionStr = versionSegments[0];
try {
final int v = Integer.parseInt(javaVersionStr);
if (v == 1) {
javaVersionStr = versionSegments[1];
return Integer.parseInt(javaVersionStr);
}
return v;
} catch (final NumberFormatException e) {
return -1;
}
}

@Override
public void earlyStartup() {
final int javaVersion = getJavaVersion();
if(javaVersion >= REQUIRED_JAVA_VERSION)
final int javaVersion = JvmCheck.getJavaVersion();

if (javaVersion >= JvmCheckConstants_Actual.REQUIRED_JAVA_VERSION) {
return;

// Show error message to the user, because the platform just silently fails.
}

// Show error message to the user, because the platform just silently fails.
// See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=417336

Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
Shell activeShell = getActiveWorkbenchShell();

String message = "Could not start " + FEATURE_NAME + " because Java version is: " + javaVersion
+ "\nVersion " + REQUIRED_JAVA_VERSION + " is required";

final Shell activeShell = JvmCheck.getActiveWorkbenchShell();

final String message = "Could not start " + JvmCheckConstants_Actual.FEATURE_NAME
+ " because Java version is: " + javaVersion + "\nVersion "
+ JvmCheckConstants_Actual.REQUIRED_JAVA_VERSION + " or later is required";

System.err.println(message);
if(activeShell == null) {

if (activeShell == null) {
return;
}
MessageDialog.openError(activeShell, "Error", message);
}
});

}

/** Gets the active workbench window. */
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
}

/** Gets the active workbench shell. */
public static Shell getActiveWorkbenchShell() {
IWorkbenchWindow window = getActiveWorkbenchWindow();
if(window != null) {
final IWorkbenchWindow window = JvmCheck.getActiveWorkbenchWindow();
if (window != null) {
return window.getShell();
}
return null;
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.8
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public class CodeInspectionViewsManager {
public static final String GRAPH_VIEW = org.erlide.wrangler.refactoring.codeinspection.view.GraphImageView.VIEW_ID;
public static final String CODE_INSPECTION_VIEW = org.erlide.wrangler.refactoring.codeinspection.view.CodeInspectionResultsView.VIEW_ID;

private CodeInspectionViewsManager() {
}

/**
* Shows the image in the graph view with the given title.
*
Expand All @@ -48,9 +51,9 @@ public class CodeInspectionViewsManager {
* @param dotFile
* .dot file which is displayed
*/
static public void showDotImage(final Image img, final String title,
public static void showDotImage(final Image img, final String title,
final String secondaryID, final File dotFile) {
final GraphImageView view = (GraphImageView) showView(GRAPH_VIEW, secondaryID);
final GraphImageView view = (GraphImageView) CodeInspectionViewsManager.showView(CodeInspectionViewsManager.GRAPH_VIEW, secondaryID);
view.setViewTitle(title);
view.setImage(img);
view.setDotFile(dotFile);
Expand All @@ -64,11 +67,11 @@ static public void showDotImage(final Image img, final String title,
* @param e
* Erlang elements
*/
static public void showErlElements(final String title, final ArrayList<IErlElement> e,
public static void showErlElements(final String title, final ArrayList<IErlElement> e,
final String secId) {
try {
final CodeInspectionResultsView v = (CodeInspectionResultsView) showView(
CODE_INSPECTION_VIEW, secId);
final CodeInspectionResultsView v = (CodeInspectionResultsView) CodeInspectionViewsManager.showView(
CodeInspectionViewsManager.CODE_INSPECTION_VIEW, secId);
v.addElements(e);
v.setViewTitle(title);
v.refresh();
Expand All @@ -85,7 +88,7 @@ static public void showErlElements(final String title, final ArrayList<IErlEleme
*
* @return view which is shown
*/
static public IViewPart showView(final String viewId) {
public static IViewPart showView(final String viewId) {

final IWorkbench workbench = PlatformUI.getWorkbench();

Expand All @@ -108,7 +111,7 @@ static public IViewPart showView(final String viewId) {
* view secondary id, to handle multiple instances
* @return view object
*/
static public IViewPart showView(final String viewId, final String secondaryID) {
public static IViewPart showView(final String viewId, final String secondaryID) {
final IWorkbench workbench = PlatformUI.getWorkbench();

final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
Expand All @@ -128,8 +131,8 @@ static public IViewPart showView(final String viewId, final String secondaryID)
* @param viewId
* view, which will be hidden
*/
static public void hideView(final String viewId) {
hideView(viewId, null);
public static void hideView(final String viewId) {
CodeInspectionViewsManager.hideView(viewId, null);
}

/**
Expand All @@ -140,7 +143,7 @@ static public void hideView(final String viewId) {
* @param secondaryId
* secondary id of a view instance
*/
static public void hideView(final String viewId, final String secondaryId) {
public static void hideView(final String viewId, final String secondaryId) {
final IWorkbench workbench = PlatformUI.getWorkbench();

final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,37 +67,33 @@ public Object execute(final ExecutionEvent event) throws ExecutionException {
final IErlSelection wranglerSelection = GlobalParameters
.getWranglerSelection();

if (actionId.equals(
"org.erlide.wrangler.refactoring.codeinspection.cyclicdependencies")) {
if ("org.erlide.wrangler.refactoring.codeinspection.cyclicdependencies".equals(actionId)) {
final Boolean answer = MessageDialog.openQuestion(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
"Labels", "Label edges with function names called?");
runInspection("Cyclic module dependency", CYCLYC_VIEW_ID,
runInspection("Cyclic module dependency", GraphResultingInspectionHandler.CYCLYC_VIEW_ID,
"There is no cyclic dependent modules in the project!", tmpFile,
"cyclic_dependent_modules", "ssx", tmpFile.getAbsolutePath(),
wranglerSelection.getSearchPath(), new OtpErlangBoolean(answer));
} else if (actionId.equals(
"org.erlide.wrangler.refactoring.codeinspection.generatefunctioncallgraph")) {
runInspection("Function callgraph", FUNCTION_CALL_GRAPH_VIEW_ID,
} else if ("org.erlide.wrangler.refactoring.codeinspection.generatefunctioncallgraph".equals(actionId)) {
runInspection("Function callgraph", GraphResultingInspectionHandler.FUNCTION_CALL_GRAPH_VIEW_ID,
"There is no dependent functions in the module!", tmpFile,
"gen_function_callgraph", "sss", tmpFile.getAbsolutePath(),
wranglerSelection.getFilePath(),
wranglerSelection.getSearchPath());

} else if (actionId.equals(
"org.erlide.wrangler.refactoring.codeinspection.generatemodulegraph")) {
} else if ("org.erlide.wrangler.refactoring.codeinspection.generatemodulegraph".equals(actionId)) {
final Boolean answer = MessageDialog.openQuestion(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
"Labels", "Label edges with function names called?");
runInspection("Module dependency graph", MODULE_GRAPH_VIEW_ID,
runInspection("Module dependency graph", GraphResultingInspectionHandler.MODULE_GRAPH_VIEW_ID,
"There is no dependent modules in the project!", tmpFile,
"gen_module_graph", "ssx", tmpFile.getAbsolutePath(),
wranglerSelection.getSearchPath(), new OtpErlangBoolean(answer));

} else if (actionId.equals(
"org.erlide.wrangler.refactoring.codeinspection.improperdependecies")) {
} else if ("org.erlide.wrangler.refactoring.codeinspection.improperdependecies".equals(actionId)) {
runInspection("Improper module dependencies",
IMPROPER_DEPENDECIES_VIEW_ID,
GraphResultingInspectionHandler.IMPROPER_DEPENDECIES_VIEW_ID,
"There is no improper module dependecies!", tmpFile,
"improper_inter_module_calls", "ss", tmpFile.getAbsolutePath(),
wranglerSelection.getSearchPath());
Expand Down
Loading

0 comments on commit 054a785

Please sign in to comment.