Skip to content

Commit

Permalink
[lang] Add warning for discouraged calls to Thread class.
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Oct 6, 2018
1 parent 99cc24e commit 8db0dfd
Show file tree
Hide file tree
Showing 2 changed files with 963 additions and 1 deletion.
Expand Up @@ -33,6 +33,7 @@
import org.eclipse.xtext.common.types.JvmMember;
import org.eclipse.xtext.xbase.XAbstractFeatureCall;
import org.eclipse.xtext.xbase.jvmmodel.ILogicalContainerProvider;
import org.eclipse.xtext.xbase.lib.InputOutput;

import io.sarl.lang.annotation.PrivateAPI;
import io.sarl.lang.typesystem.SARLAnnotationUtil;
Expand Down Expand Up @@ -135,7 +136,10 @@ public boolean isDiscouragedCall(XAbstractFeatureCall call) {
case "java.lang.System.exit": //$NON-NLS-1$
return isInsideOOTypeDeclaration(call);
default:
if (id.startsWith("org.eclipse.xtext.xbase.lib.InputOutput")) { //$NON-NLS-1$
if (id.startsWith(InputOutput.class.getName())) {
return true;
}
if (id.startsWith(Thread.class.getName())) {
return true;
}
}
Expand Down

0 comments on commit 8db0dfd

Please sign in to comment.