repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.fireDefaultSREChanged | private static void fireDefaultSREChanged(ISREInstall previous, ISREInstall current) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).defaultSREInstallChanged(previous, current);
}
} | java | private static void fireDefaultSREChanged(ISREInstall previous, ISREInstall current) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).defaultSREInstallChanged(previous, current);
}
} | [
"private",
"static",
"void",
"fireDefaultSREChanged",
"(",
"ISREInstall",
"previous",
",",
"ISREInstall",
"current",
")",
"{",
"for",
"(",
"final",
"Object",
"listener",
":",
"SRE_LISTENERS",
".",
"getListeners",
"(",
")",
")",
"{",
"(",
"(",
"ISREInstallChanged... | Notifies registered listeners that the default SRE has changed.
@param previous the previous SRE
@param current the new current default SRE | [
"Notifies",
"registered",
"listeners",
"that",
"the",
"default",
"SRE",
"has",
"changed",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L391-L395 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.isPlatformSRE | public static boolean isPlatformSRE(ISREInstall sre) {
if (sre != null) {
LOCK.lock();
try {
return platformSREInstalls.contains(sre.getId());
} finally {
LOCK.unlock();
}
}
return false;
} | java | public static boolean isPlatformSRE(ISREInstall sre) {
if (sre != null) {
LOCK.lock();
try {
return platformSREInstalls.contains(sre.getId());
} finally {
LOCK.unlock();
}
}
return false;
} | [
"public",
"static",
"boolean",
"isPlatformSRE",
"(",
"ISREInstall",
"sre",
")",
"{",
"if",
"(",
"sre",
"!=",
"null",
")",
"{",
"LOCK",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"platformSREInstalls",
".",
"contains",
"(",
"sre",
".",
"getId",
"... | Replies if the given SRE is provided by the Eclipse platform
through an extension point.
@param sre the sre.
@return <code>true</code> if the SRE was provided through an extension
point. | [
"Replies",
"if",
"the",
"given",
"SRE",
"is",
"provided",
"by",
"the",
"Eclipse",
"platform",
"through",
"an",
"extension",
"point",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L421-L431 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.clearSREConfiguration | public static void clearSREConfiguration() throws CoreException {
final SARLEclipsePlugin plugin = SARLEclipsePlugin.getDefault();
plugin.getPreferences().remove(getCurrentPreferenceKey());
plugin.savePreferences();
} | java | public static void clearSREConfiguration() throws CoreException {
final SARLEclipsePlugin plugin = SARLEclipsePlugin.getDefault();
plugin.getPreferences().remove(getCurrentPreferenceKey());
plugin.savePreferences();
} | [
"public",
"static",
"void",
"clearSREConfiguration",
"(",
")",
"throws",
"CoreException",
"{",
"final",
"SARLEclipsePlugin",
"plugin",
"=",
"SARLEclipsePlugin",
".",
"getDefault",
"(",
")",
";",
"plugin",
".",
"getPreferences",
"(",
")",
".",
"remove",
"(",
"get... | Remove the SRE configuration information from the preferences.
@throws CoreException if trying to save the current state of SREs encounters a problem | [
"Remove",
"the",
"SRE",
"configuration",
"information",
"from",
"the",
"preferences",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L457-L461 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.initializeSREExtensions | private static void initializeSREExtensions() {
final MultiStatus status = new MultiStatus(SARLEclipsePlugin.PLUGIN_ID,
IStatus.OK, "Exceptions occurred", null); //$NON-NLS-1$
final IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
SARLEclipsePlugin.PLUGIN_ID, SARLEclipseC... | java | private static void initializeSREExtensions() {
final MultiStatus status = new MultiStatus(SARLEclipsePlugin.PLUGIN_ID,
IStatus.OK, "Exceptions occurred", null); //$NON-NLS-1$
final IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
SARLEclipsePlugin.PLUGIN_ID, SARLEclipseC... | [
"private",
"static",
"void",
"initializeSREExtensions",
"(",
")",
"{",
"final",
"MultiStatus",
"status",
"=",
"new",
"MultiStatus",
"(",
"SARLEclipsePlugin",
".",
"PLUGIN_ID",
",",
"IStatus",
".",
"OK",
",",
"\"Exceptions occurred\"",
",",
"null",
")",
";",
"//$... | Initializes SRE extensions. | [
"Initializes",
"SRE",
"extensions",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L466-L493 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.getSREsAsXML | public static String getSREsAsXML(IProgressMonitor monitor) throws CoreException {
initializeSREs();
try {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentBuilder builder = factory.newDocumentBuilder();
final Document xmldocument = builder.newDocument();
final ... | java | public static String getSREsAsXML(IProgressMonitor monitor) throws CoreException {
initializeSREs();
try {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentBuilder builder = factory.newDocumentBuilder();
final Document xmldocument = builder.newDocument();
final ... | [
"public",
"static",
"String",
"getSREsAsXML",
"(",
"IProgressMonitor",
"monitor",
")",
"throws",
"CoreException",
"{",
"initializeSREs",
"(",
")",
";",
"try",
"{",
"final",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
... | Returns the listing of currently installed SREs as a single XML file.
@param monitor monitor on the XML building.
@return an XML representation of all of the currently installed SREs.
@throws CoreException if trying to compute the XML for the SRE state encounters a problem. | [
"Returns",
"the",
"listing",
"of",
"currently",
"installed",
"SREs",
"as",
"a",
"single",
"XML",
"file",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L552-L572 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.initializePersistedSREs | @SuppressWarnings("checkstyle:cyclomaticcomplexity")
private static String initializePersistedSREs() {
// // FOR DEBUG
// try {
// clearSREConfiguration();
// } catch (CoreException e1) {
// e1.printStackTrace();
// }
final String rawXml = SARLEclipsePlugin.getDefault().getPreferences().get(
... | java | @SuppressWarnings("checkstyle:cyclomaticcomplexity")
private static String initializePersistedSREs() {
// // FOR DEBUG
// try {
// clearSREConfiguration();
// } catch (CoreException e1) {
// e1.printStackTrace();
// }
final String rawXml = SARLEclipsePlugin.getDefault().getPreferences().get(
... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:cyclomaticcomplexity\"",
")",
"private",
"static",
"String",
"initializePersistedSREs",
"(",
")",
"{",
"//\t\t// FOR DEBUG",
"//\t\ttry {",
"//\t\t\tclearSREConfiguration();",
"//\t\t} catch (CoreException e1) {",
"//\t\t\te1.printStackTrac... | This method loads installed SREs based an existing user preference
or old SRE configurations file. | [
"This",
"method",
"loads",
"installed",
"SREs",
"based",
"an",
"existing",
"user",
"preference",
"or",
"old",
"SRE",
"configurations",
"file",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L640-L723 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.initializeSREs | @SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:variabledeclarationusagedistance",
"checkstyle:npathcomplexity"})
private static void initializeSREs() {
ISREInstall[] newSREs = new ISREInstall[0];
boolean savePrefs = false;
LOCK.lock();
final String previousDefault = defaultSREId;
try {
... | java | @SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:variabledeclarationusagedistance",
"checkstyle:npathcomplexity"})
private static void initializeSREs() {
ISREInstall[] newSREs = new ISREInstall[0];
boolean savePrefs = false;
LOCK.lock();
final String previousDefault = defaultSREId;
try {
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"checkstyle:cyclomaticcomplexity\"",
",",
"\"checkstyle:variabledeclarationusagedistance\"",
",",
"\"checkstyle:npathcomplexity\"",
"}",
")",
"private",
"static",
"void",
"initializeSREs",
"(",
")",
"{",
"ISREInstall",
"[",
"]",
"newSREs... | Perform SRE install initialization. Does not hold locks
while performing change notification.
@since 3.2 | [
"Perform",
"SRE",
"install",
"initialization",
".",
"Does",
"not",
"hold",
"locks",
"while",
"performing",
"change",
"notification",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L731-L812 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.createUniqueIdentifier | public static String createUniqueIdentifier() {
String id;
do {
id = UUID.randomUUID().toString();
} while (getSREFromId(id) != null);
return id;
} | java | public static String createUniqueIdentifier() {
String id;
do {
id = UUID.randomUUID().toString();
} while (getSREFromId(id) != null);
return id;
} | [
"public",
"static",
"String",
"createUniqueIdentifier",
"(",
")",
"{",
"String",
"id",
";",
"do",
"{",
"id",
"=",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
";",
"}",
"while",
"(",
"getSREFromId",
"(",
"id",
")",
"!=",
"null",
")... | Replies an unique identifier.
@return a unique identifier. | [
"Replies",
"an",
"unique",
"identifier",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L826-L832 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.isUnpackedSRE | public static boolean isUnpackedSRE(File directory) {
File manifestFile = new File(directory, "META-INF"); //$NON-NLS-1$
manifestFile = new File(manifestFile, "MANIFEST.MF"); //$NON-NLS-1$
if (manifestFile.canRead()) {
try (InputStream manifestStream = new FileInputStream(manifestFile)) {
final Manifest ma... | java | public static boolean isUnpackedSRE(File directory) {
File manifestFile = new File(directory, "META-INF"); //$NON-NLS-1$
manifestFile = new File(manifestFile, "MANIFEST.MF"); //$NON-NLS-1$
if (manifestFile.canRead()) {
try (InputStream manifestStream = new FileInputStream(manifestFile)) {
final Manifest ma... | [
"public",
"static",
"boolean",
"isUnpackedSRE",
"(",
"File",
"directory",
")",
"{",
"File",
"manifestFile",
"=",
"new",
"File",
"(",
"directory",
",",
"\"META-INF\"",
")",
";",
"//$NON-NLS-1$",
"manifestFile",
"=",
"new",
"File",
"(",
"manifestFile",
",",
"\"M... | Replies if the given directory contains a SRE.
@param directory the directory.
@return <code>true</code> if the given directory contains a SRE. Otherwise <code>false</code>.
@see #isPackedSRE(File) | [
"Replies",
"if",
"the",
"given",
"directory",
"contains",
"a",
"SRE",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L870-L891 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.isPackedSRE | public static boolean isPackedSRE(File jarFile) {
try (JarFile jFile = new JarFile(jarFile)) {
final Manifest manifest = jFile.getManifest();
if (manifest == null) {
return false;
}
final Attributes sarlSection = manifest.getAttributes(SREConstants.MANIFEST_SECTION_SRE);
if (sarlSection == null) {
... | java | public static boolean isPackedSRE(File jarFile) {
try (JarFile jFile = new JarFile(jarFile)) {
final Manifest manifest = jFile.getManifest();
if (manifest == null) {
return false;
}
final Attributes sarlSection = manifest.getAttributes(SREConstants.MANIFEST_SECTION_SRE);
if (sarlSection == null) {
... | [
"public",
"static",
"boolean",
"isPackedSRE",
"(",
"File",
"jarFile",
")",
"{",
"try",
"(",
"JarFile",
"jFile",
"=",
"new",
"JarFile",
"(",
"jarFile",
")",
")",
"{",
"final",
"Manifest",
"manifest",
"=",
"jFile",
".",
"getManifest",
"(",
")",
";",
"if",
... | Replies if the given JAR file contains a SRE.
<p>The SRE detection is based on the content of the manifest.
@param jarFile the JAR file to test.
@return <code>true</code> if the given directory contains a SRE. Otherwise <code>false</code>.
@see #isUnpackedSRE(File) | [
"Replies",
"if",
"the",
"given",
"JAR",
"file",
"contains",
"a",
"SRE",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L928-L947 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.getDeclaredBootstrap | public static String getDeclaredBootstrap(IPath path) {
try {
final IFile location = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
if (location != null) {
final IPath pathLocation = location.getLocation();
if (pathLocation != null) {
final File file = pathLocation.toFile();
if (file.... | java | public static String getDeclaredBootstrap(IPath path) {
try {
final IFile location = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
if (location != null) {
final IPath pathLocation = location.getLocation();
if (pathLocation != null) {
final File file = pathLocation.toFile();
if (file.... | [
"public",
"static",
"String",
"getDeclaredBootstrap",
"(",
"IPath",
"path",
")",
"{",
"try",
"{",
"final",
"IFile",
"location",
"=",
"ResourcesPlugin",
".",
"getWorkspace",
"(",
")",
".",
"getRoot",
"(",
")",
".",
"getFile",
"(",
"path",
")",
";",
"if",
... | Replies the bootstrap name declared within the given path, corresponding to a JAR file or a folder.
<p>The SRE bootstrap detection is based on the service definition within META-INF folder.
@param path the path to test.
@return the bootstrap or {@code null} if none.
@since 0.7
@see #containsPackedBootstrap(IPath)
@se... | [
"Replies",
"the",
"bootstrap",
"name",
"declared",
"within",
"the",
"given",
"path",
"corresponding",
"to",
"a",
"JAR",
"file",
"or",
"a",
"folder",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L1110-L1141 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/proxy/JreProxyInstaller.java | JreProxyInstaller.processElement | protected Object processElement(Object obj, Class<?> expectedType) {
if (obj == null || obj instanceof Proxy) {
return obj;
}
if (obj instanceof Doc) {
return wrap(obj);
} else if (expectedType != null && expectedType.isArray()) {
final Class<?> componentType = expectedType.getComponentType();
if (D... | java | protected Object processElement(Object obj, Class<?> expectedType) {
if (obj == null || obj instanceof Proxy) {
return obj;
}
if (obj instanceof Doc) {
return wrap(obj);
} else if (expectedType != null && expectedType.isArray()) {
final Class<?> componentType = expectedType.getComponentType();
if (D... | [
"protected",
"Object",
"processElement",
"(",
"Object",
"obj",
",",
"Class",
"<",
"?",
">",
"expectedType",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
"||",
"obj",
"instanceof",
"Proxy",
")",
"{",
"return",
"obj",
";",
"}",
"if",
"(",
"obj",
"instanceof... | Filter the given document.
@param obj the document to filter.
@param expectedType the expected type of the {@code obj}.
@return the filtered {@code obj}. | [
"Filter",
"the",
"given",
"document",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/proxy/JreProxyInstaller.java#L100-L134 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/proxy/JreProxyInstaller.java | JreProxyInstaller.wrap | protected Object wrap(Object object) {
if (object == null || object instanceof Proxy) {
return object;
}
final Class<?> type = object.getClass();
return Proxy.newProxyInstance(type.getClassLoader(), type.getInterfaces(), new ProxyHandler(object));
} | java | protected Object wrap(Object object) {
if (object == null || object instanceof Proxy) {
return object;
}
final Class<?> type = object.getClass();
return Proxy.newProxyInstance(type.getClassLoader(), type.getInterfaces(), new ProxyHandler(object));
} | [
"protected",
"Object",
"wrap",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
"||",
"object",
"instanceof",
"Proxy",
")",
"{",
"return",
"object",
";",
"}",
"final",
"Class",
"<",
"?",
">",
"type",
"=",
"object",
".",
"getClass",... | Unwrap the given object.
@param object the object.
@return the unwrapped object. | [
"Unwrap",
"the",
"given",
"object",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/proxy/JreProxyInstaller.java#L146-L152 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.writePackageFiles | protected void writePackageFiles(QualifiedName name, String lineSeparator,
IExtraLanguageGeneratorContext context) {
final IFileSystemAccess2 fsa = context.getFileSystemAccess();
final String outputConfiguration = getOutputConfigurationName();
QualifiedName libraryName = null;
for (final String segment : nam... | java | protected void writePackageFiles(QualifiedName name, String lineSeparator,
IExtraLanguageGeneratorContext context) {
final IFileSystemAccess2 fsa = context.getFileSystemAccess();
final String outputConfiguration = getOutputConfigurationName();
QualifiedName libraryName = null;
for (final String segment : nam... | [
"protected",
"void",
"writePackageFiles",
"(",
"QualifiedName",
"name",
",",
"String",
"lineSeparator",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"final",
"IFileSystemAccess2",
"fsa",
"=",
"context",
".",
"getFileSystemAccess",
"(",
")",
";",
"final"... | Generate the Python package files.
<p>This function generates the "__init__.py" files for all the packages.
@param name the name of the generated type.
@param lineSeparator the line separator.
@param context the generation context. | [
"Generate",
"the",
"Python",
"package",
"files",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L203-L227 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.generatePythonClassDeclaration | @SuppressWarnings("static-method")
protected boolean generatePythonClassDeclaration(String typeName, boolean isAbstract,
List<? extends JvmTypeReference> superTypes, String comment, boolean ignoreObjectType, PyAppendable it,
IExtraLanguageGeneratorContext context) {
if (!Strings.isEmpty(typeName)) {
it.appe... | java | @SuppressWarnings("static-method")
protected boolean generatePythonClassDeclaration(String typeName, boolean isAbstract,
List<? extends JvmTypeReference> superTypes, String comment, boolean ignoreObjectType, PyAppendable it,
IExtraLanguageGeneratorContext context) {
if (!Strings.isEmpty(typeName)) {
it.appe... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"boolean",
"generatePythonClassDeclaration",
"(",
"String",
"typeName",
",",
"boolean",
"isAbstract",
",",
"List",
"<",
"?",
"extends",
"JvmTypeReference",
">",
"superTypes",
",",
"String",
"comment"... | Generate the type declaration for a Python class.
@param typeName name of the type.
@param isAbstract indicates if the type is abstract (interface included).
@param superTypes the super types.
@param comment the type declaration's comment.
@param ignoreObjectType ignores the "Object" type if the super types.
@param it... | [
"Generate",
"the",
"type",
"declaration",
"for",
"a",
"Python",
"class",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L251-L280 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.generateDocString | protected static boolean generateDocString(String comment, PyAppendable it) {
final String cmt = comment == null ? null : comment.trim();
if (!Strings.isEmpty(cmt)) {
assert cmt != null;
it.append("\"\"\"").increaseIndentation(); //$NON-NLS-1$
for (final String line : cmt.split("[\n\r\f]+")) { //$NON-NLS-... | java | protected static boolean generateDocString(String comment, PyAppendable it) {
final String cmt = comment == null ? null : comment.trim();
if (!Strings.isEmpty(cmt)) {
assert cmt != null;
it.append("\"\"\"").increaseIndentation(); //$NON-NLS-1$
for (final String line : cmt.split("[\n\r\f]+")) { //$NON-NLS-... | [
"protected",
"static",
"boolean",
"generateDocString",
"(",
"String",
"comment",
",",
"PyAppendable",
"it",
")",
"{",
"final",
"String",
"cmt",
"=",
"comment",
"==",
"null",
"?",
"null",
":",
"comment",
".",
"trim",
"(",
")",
";",
"if",
"(",
"!",
"String... | Generate a Python docstring with the given comment.
@param comment the comment.
@param it the receiver of the docstring.
@return {@code true} if the docstring is added, {@code false} otherwise. | [
"Generate",
"a",
"Python",
"docstring",
"with",
"the",
"given",
"comment",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L288-L301 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.generateBlockComment | protected static boolean generateBlockComment(String comment, PyAppendable it) {
final String cmt = comment == null ? null : comment.trim();
if (!Strings.isEmpty(cmt)) {
assert cmt != null;
for (final String line : cmt.split("[\n\r\f]+")) { //$NON-NLS-1$
it.append("# ").append(line).newLine(); //$NON-NLS... | java | protected static boolean generateBlockComment(String comment, PyAppendable it) {
final String cmt = comment == null ? null : comment.trim();
if (!Strings.isEmpty(cmt)) {
assert cmt != null;
for (final String line : cmt.split("[\n\r\f]+")) { //$NON-NLS-1$
it.append("# ").append(line).newLine(); //$NON-NLS... | [
"protected",
"static",
"boolean",
"generateBlockComment",
"(",
"String",
"comment",
",",
"PyAppendable",
"it",
")",
"{",
"final",
"String",
"cmt",
"=",
"comment",
"==",
"null",
"?",
"null",
":",
"comment",
".",
"trim",
"(",
")",
";",
"if",
"(",
"!",
"Str... | Generate a Python block comment with the given comment.
@param comment the comment.
@param it the receiver of the block comment.
@return {@code true} if the block comment is added, {@code false} otherwise. | [
"Generate",
"a",
"Python",
"block",
"comment",
"with",
"the",
"given",
"comment",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L309-L319 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.generateTypeDeclaration | @SuppressWarnings({ "checkstyle:parameternumber" })
protected boolean generateTypeDeclaration(
String fullyQualifiedName,
String name, boolean isAbstract,
List<? extends JvmTypeReference> superTypes,
String comment,
boolean ignoreObjectType, List<? extends XtendMember> members, PyAppendable it,
IExtr... | java | @SuppressWarnings({ "checkstyle:parameternumber" })
protected boolean generateTypeDeclaration(
String fullyQualifiedName,
String name, boolean isAbstract,
List<? extends JvmTypeReference> superTypes,
String comment,
boolean ignoreObjectType, List<? extends XtendMember> members, PyAppendable it,
IExtr... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"checkstyle:parameternumber\"",
"}",
")",
"protected",
"boolean",
"generateTypeDeclaration",
"(",
"String",
"fullyQualifiedName",
",",
"String",
"name",
",",
"boolean",
"isAbstract",
",",
"List",
"<",
"?",
"extends",
"JvmTypeRefere... | Generate the given type.
@param fullyQualifiedName the fully qualified name of the type.
@param name the name of the type.
@param isAbstract indicates if the type is abstract.
@param superTypes the super types.
@param comment the comment.
@param ignoreObjectType ignores the "Object" type if the super types.
@param mem... | [
"Generate",
"the",
"given",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L335-L375 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.generateEnumerationDeclaration | protected boolean generateEnumerationDeclaration(SarlEnumeration enumeration, PyAppendable it, IExtraLanguageGeneratorContext context) {
if (!Strings.isEmpty(enumeration.getName())) {
it.append("class ").append(enumeration.getName()); //$NON-NLS-1$
it.append("(Enum"); //$NON-NLS-1$
it.append(newType("enum.En... | java | protected boolean generateEnumerationDeclaration(SarlEnumeration enumeration, PyAppendable it, IExtraLanguageGeneratorContext context) {
if (!Strings.isEmpty(enumeration.getName())) {
it.append("class ").append(enumeration.getName()); //$NON-NLS-1$
it.append("(Enum"); //$NON-NLS-1$
it.append(newType("enum.En... | [
"protected",
"boolean",
"generateEnumerationDeclaration",
"(",
"SarlEnumeration",
"enumeration",
",",
"PyAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isEmpty",
"(",
"enumeration",
".",
"getName",
"(",
... | Generate the given enumeration declaration.
@param enumeration the enumeration.
@param it the receiver of the generated code.
@param context the context.
@return {@code true} if a declaration was generated. {@code false} if no enumeration was generated.
@since 0.8 | [
"Generate",
"the",
"given",
"enumeration",
"declaration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L385-L411 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.generatePythonConstructors | protected boolean generatePythonConstructors(String container, List<? extends XtendMember> members,
PyAppendable it, IExtraLanguageGeneratorContext context) {
// Prepare field initialization
boolean hasConstructor = false;
for (final XtendMember member : members) {
if (context.getCancelIndicator().isCancele... | java | protected boolean generatePythonConstructors(String container, List<? extends XtendMember> members,
PyAppendable it, IExtraLanguageGeneratorContext context) {
// Prepare field initialization
boolean hasConstructor = false;
for (final XtendMember member : members) {
if (context.getCancelIndicator().isCancele... | [
"protected",
"boolean",
"generatePythonConstructors",
"(",
"String",
"container",
",",
"List",
"<",
"?",
"extends",
"XtendMember",
">",
"members",
",",
"PyAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"// Prepare field initialization",
"... | Generate the constructors for a Python class.
@param container the fully qualified name of the container.
@param members the members to be added.
@param it the output.
@param context the generation context.
@return {@code true} if a constructor was generated. {@code false} if no constructor was generated. | [
"Generate",
"the",
"constructors",
"for",
"a",
"Python",
"class",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L421-L452 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.newType | @SuppressWarnings("static-method")
protected JvmType newType(String pythonName) {
final JvmGenericType type = TypesFactory.eINSTANCE.createJvmGenericType();
final int index = pythonName.indexOf("."); //$NON-NLS-1$
if (index <= 0) {
type.setSimpleName(pythonName);
} else {
type.setPackageName(pythonName.s... | java | @SuppressWarnings("static-method")
protected JvmType newType(String pythonName) {
final JvmGenericType type = TypesFactory.eINSTANCE.createJvmGenericType();
final int index = pythonName.indexOf("."); //$NON-NLS-1$
if (index <= 0) {
type.setSimpleName(pythonName);
} else {
type.setPackageName(pythonName.s... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"JvmType",
"newType",
"(",
"String",
"pythonName",
")",
"{",
"final",
"JvmGenericType",
"type",
"=",
"TypesFactory",
".",
"eINSTANCE",
".",
"createJvmGenericType",
"(",
")",
";",
"final",
"int",
... | Create a JvmType for a Python type.
@param pythonName the python type name.
@return the type. | [
"Create",
"a",
"JvmType",
"for",
"a",
"Python",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L459-L470 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.generatePythonField | protected void generatePythonField(SarlField field, PyAppendable it, IExtraLanguageGeneratorContext context) {
generateBlockComment(getTypeBuilder().getDocumentation(field), it);
if (!field.isStatic()) {
it.append("self."); //$NON-NLS-1$
}
final String fieldName = it.declareUniqueNameVariable(field, field.ge... | java | protected void generatePythonField(SarlField field, PyAppendable it, IExtraLanguageGeneratorContext context) {
generateBlockComment(getTypeBuilder().getDocumentation(field), it);
if (!field.isStatic()) {
it.append("self."); //$NON-NLS-1$
}
final String fieldName = it.declareUniqueNameVariable(field, field.ge... | [
"protected",
"void",
"generatePythonField",
"(",
"SarlField",
"field",
",",
"PyAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"generateBlockComment",
"(",
"getTypeBuilder",
"(",
")",
".",
"getDocumentation",
"(",
"field",
")",
",",
"i... | Create a field declaration.
@param field the field to generate.
@param it the output
@param context the generation context. | [
"Create",
"a",
"field",
"declaration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L478-L492 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.generateGuardEvaluators | protected void generateGuardEvaluators(String container, PyAppendable it, IExtraLanguageGeneratorContext context) {
final Map<String, Map<String, List<Pair<XExpression, String>>>> allGuardEvaluators = context.getMapData(EVENT_GUARDS_MEMENTO);
final Map<String, List<Pair<XExpression, String>>> guardEvaluators = allG... | java | protected void generateGuardEvaluators(String container, PyAppendable it, IExtraLanguageGeneratorContext context) {
final Map<String, Map<String, List<Pair<XExpression, String>>>> allGuardEvaluators = context.getMapData(EVENT_GUARDS_MEMENTO);
final Map<String, List<Pair<XExpression, String>>> guardEvaluators = allG... | [
"protected",
"void",
"generateGuardEvaluators",
"(",
"String",
"container",
",",
"PyAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"Pair",
"<",
"XExpressi... | Generate the memorized guard evaluators.
@param container the fully qualified name of the container of the guards.
@param it the output.
@param context the generation context. | [
"Generate",
"the",
"memorized",
"guard",
"evaluators",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L601-L636 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator._before | protected void _before(SarlCapacityUses uses, IExtraLanguageGeneratorContext context) {
// Rename the function in order to produce the good features at the calls.
for (final JvmTypeReference capacity : uses.getCapacities()) {
final JvmType type = capacity.getType();
if (type instanceof JvmDeclaredType) {
... | java | protected void _before(SarlCapacityUses uses, IExtraLanguageGeneratorContext context) {
// Rename the function in order to produce the good features at the calls.
for (final JvmTypeReference capacity : uses.getCapacities()) {
final JvmType type = capacity.getType();
if (type instanceof JvmDeclaredType) {
... | [
"protected",
"void",
"_before",
"(",
"SarlCapacityUses",
"uses",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"// Rename the function in order to produce the good features at the calls.",
"for",
"(",
"final",
"JvmTypeReference",
"capacity",
":",
"uses",
".",
"g... | Mark the functions of the used capacities in order to have a valid feature call within the code.
@param uses the capacity uses.
@param context the context. | [
"Mark",
"the",
"functions",
"of",
"the",
"used",
"capacities",
"in",
"order",
"to",
"have",
"a",
"valid",
"feature",
"call",
"within",
"the",
"code",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L1035-L1043 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/validator/ExtraLanguageValidatorSupport.java | ExtraLanguageValidatorSupport.checkExtraLanguageRules | @Check(CheckType.NORMAL)
public void checkExtraLanguageRules(EObject currentObject) {
final List<AbstractExtraLanguageValidator> validators = this.validatorProvider.getValidators(
currentObject.eResource());
if (!validators.isEmpty()) {
for (final AbstractExtraLanguageValidator validator : validators) {
... | java | @Check(CheckType.NORMAL)
public void checkExtraLanguageRules(EObject currentObject) {
final List<AbstractExtraLanguageValidator> validators = this.validatorProvider.getValidators(
currentObject.eResource());
if (!validators.isEmpty()) {
for (final AbstractExtraLanguageValidator validator : validators) {
... | [
"@",
"Check",
"(",
"CheckType",
".",
"NORMAL",
")",
"public",
"void",
"checkExtraLanguageRules",
"(",
"EObject",
"currentObject",
")",
"{",
"final",
"List",
"<",
"AbstractExtraLanguageValidator",
">",
"validators",
"=",
"this",
".",
"validatorProvider",
".",
"getV... | Check the rules for the activated extra languages.
@param currentObject the current object to test. | [
"Check",
"the",
"rules",
"for",
"the",
"activated",
"extra",
"languages",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/validator/ExtraLanguageValidatorSupport.java#L76-L87 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/InjectionFragment2.java | InjectionFragment2.setComment | public void setComment(String comment) {
this.comment = comment;
if (!Strings.isEmpty(comment)) {
this.name = MessageFormat.format("{0} [{1}]", getClass().getName(), comment); //$NON-NLS-1$
} else {
this.name = getClass().getName();
}
} | java | public void setComment(String comment) {
this.comment = comment;
if (!Strings.isEmpty(comment)) {
this.name = MessageFormat.format("{0} [{1}]", getClass().getName(), comment); //$NON-NLS-1$
} else {
this.name = getClass().getName();
}
} | [
"public",
"void",
"setComment",
"(",
"String",
"comment",
")",
"{",
"this",
".",
"comment",
"=",
"comment",
";",
"if",
"(",
"!",
"Strings",
".",
"isEmpty",
"(",
"comment",
")",
")",
"{",
"this",
".",
"name",
"=",
"MessageFormat",
".",
"format",
"(",
... | Change the comment for the injection fragment.
@param comment the comment for the fragment. | [
"Change",
"the",
"comment",
"for",
"the",
"injection",
"fragment",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/InjectionFragment2.java#L88-L95 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SARLGeneratorConfigProvider.java | SARLGeneratorConfigProvider.createDefaultGeneratorConfig | protected GeneratorConfig createDefaultGeneratorConfig() {
final GeneratorConfig config = new GeneratorConfig();
if (this.defaultVersion == null) {
this.defaultVersion = JavaVersion.fromQualifier(System.getProperty("java.specification.version")); //$NON-NLS-1$
if (this.defaultVersion != null) {
config.set... | java | protected GeneratorConfig createDefaultGeneratorConfig() {
final GeneratorConfig config = new GeneratorConfig();
if (this.defaultVersion == null) {
this.defaultVersion = JavaVersion.fromQualifier(System.getProperty("java.specification.version")); //$NON-NLS-1$
if (this.defaultVersion != null) {
config.set... | [
"protected",
"GeneratorConfig",
"createDefaultGeneratorConfig",
"(",
")",
"{",
"final",
"GeneratorConfig",
"config",
"=",
"new",
"GeneratorConfig",
"(",
")",
";",
"if",
"(",
"this",
".",
"defaultVersion",
"==",
"null",
")",
"{",
"this",
".",
"defaultVersion",
"=... | Invoked for creating the default generator configuration.
@return the configuration. | [
"Invoked",
"for",
"creating",
"the",
"default",
"generator",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SARLGeneratorConfigProvider.java#L71-L82 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/sarl/actionprototype/DefaultActionPrototypeProvider.java | DefaultActionPrototypeProvider.createPrototype | protected InferredPrototype createPrototype(QualifiedActionName id,
boolean isVarargs, FormalParameterProvider parameters) {
assert parameters != null;
final ActionParameterTypes key = new ActionParameterTypes(isVarargs, parameters.getFormalParameterCount());
final Map<ActionParameterTypes, List<InferredStanda... | java | protected InferredPrototype createPrototype(QualifiedActionName id,
boolean isVarargs, FormalParameterProvider parameters) {
assert parameters != null;
final ActionParameterTypes key = new ActionParameterTypes(isVarargs, parameters.getFormalParameterCount());
final Map<ActionParameterTypes, List<InferredStanda... | [
"protected",
"InferredPrototype",
"createPrototype",
"(",
"QualifiedActionName",
"id",
",",
"boolean",
"isVarargs",
",",
"FormalParameterProvider",
"parameters",
")",
"{",
"assert",
"parameters",
"!=",
"null",
";",
"final",
"ActionParameterTypes",
"key",
"=",
"new",
"... | Build and replies the inferred action signature for the element with
the given ID. This function creates the different signatures according
to the definition, or not, of default values for the formal parameters.
@param id identifier of the function.
@param isVarargs indicates if the signature has a variatic parameter.... | [
"Build",
"and",
"replies",
"the",
"inferred",
"action",
"signature",
"for",
"the",
"element",
"with",
"the",
"given",
"ID",
".",
"This",
"function",
"creates",
"the",
"different",
"signatures",
"according",
"to",
"the",
"definition",
"or",
"not",
"of",
"defaul... | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/sarl/actionprototype/DefaultActionPrototypeProvider.java#L239-L267 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/bugfixes/unpublished/BugMultilineCommentIndentation.java | BugMultilineCommentIndentation.fix | @SuppressWarnings("static-method")
public ITextReplacerContext fix(final ITextReplacerContext context, IComment comment) {
final IHiddenRegion hiddenRegion = comment.getHiddenRegion();
if (detectBugSituation(hiddenRegion) && fixBug(hiddenRegion)) {
// Indentation of the first comment line
final ITextRegionAc... | java | @SuppressWarnings("static-method")
public ITextReplacerContext fix(final ITextReplacerContext context, IComment comment) {
final IHiddenRegion hiddenRegion = comment.getHiddenRegion();
if (detectBugSituation(hiddenRegion) && fixBug(hiddenRegion)) {
// Indentation of the first comment line
final ITextRegionAc... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"public",
"ITextReplacerContext",
"fix",
"(",
"final",
"ITextReplacerContext",
"context",
",",
"IComment",
"comment",
")",
"{",
"final",
"IHiddenRegion",
"hiddenRegion",
"=",
"comment",
".",
"getHiddenRegion",
"(... | Fixing the bug.
@param context the replacement context.
@param comment the comment for which the fix must be applied.
@return the new context. | [
"Fixing",
"the",
"bug",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/bugfixes/unpublished/BugMultilineCommentIndentation.java#L59-L71 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/MainProjectWizardPage.java | MainProjectWizardPage.putDefaultClasspathEntriesIn | public void putDefaultClasspathEntriesIn(Collection<IClasspathEntry> classpathEntries) {
final IPath newPath = this.jreGroup.getJREContainerPath();
if (newPath != null) {
classpathEntries.add(JavaCore.newContainerEntry(newPath));
} else {
final IClasspathEntry[] entries = PreferenceConstants.getDefaultJRELi... | java | public void putDefaultClasspathEntriesIn(Collection<IClasspathEntry> classpathEntries) {
final IPath newPath = this.jreGroup.getJREContainerPath();
if (newPath != null) {
classpathEntries.add(JavaCore.newContainerEntry(newPath));
} else {
final IClasspathEntry[] entries = PreferenceConstants.getDefaultJRELi... | [
"public",
"void",
"putDefaultClasspathEntriesIn",
"(",
"Collection",
"<",
"IClasspathEntry",
">",
"classpathEntries",
")",
"{",
"final",
"IPath",
"newPath",
"=",
"this",
".",
"jreGroup",
".",
"getJREContainerPath",
"(",
")",
";",
"if",
"(",
"newPath",
"!=",
"nul... | Returns the default class path entries to be added on new projects.
By default this is the JRE container as selected by the user.
@param classpathEntries the collection in which the classpath entries will be added. | [
"Returns",
"the",
"default",
"class",
"path",
"entries",
"to",
"be",
"added",
"on",
"new",
"projects",
".",
"By",
"default",
"this",
"is",
"the",
"JRE",
"container",
"as",
"selected",
"by",
"the",
"user",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/MainProjectWizardPage.java#L383-L398 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/MainProjectWizardPage.java | MainProjectWizardPage.getOutputLocation | public IPath getOutputLocation() {
IPath outputLocationPath = new Path(getProjectName()).makeAbsolute();
outputLocationPath = outputLocationPath.append(
Path.fromPortableString(SARLConfig.FOLDER_BIN));
return outputLocationPath;
} | java | public IPath getOutputLocation() {
IPath outputLocationPath = new Path(getProjectName()).makeAbsolute();
outputLocationPath = outputLocationPath.append(
Path.fromPortableString(SARLConfig.FOLDER_BIN));
return outputLocationPath;
} | [
"public",
"IPath",
"getOutputLocation",
"(",
")",
"{",
"IPath",
"outputLocationPath",
"=",
"new",
"Path",
"(",
"getProjectName",
"(",
")",
")",
".",
"makeAbsolute",
"(",
")",
";",
"outputLocationPath",
"=",
"outputLocationPath",
".",
"append",
"(",
"Path",
"."... | Returns the source class path entries to be added on new projects.
The underlying resource may not exist.
@return returns the default class path entries | [
"Returns",
"the",
"source",
"class",
"path",
"entries",
"to",
"be",
"added",
"on",
"new",
"projects",
".",
"The",
"underlying",
"resource",
"may",
"not",
"exist",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/MainProjectWizardPage.java#L406-L413 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/extractor/AbstractCodeElementExtractor.java | AbstractCodeElementExtractor.findAction | protected static Action findAction(EObject grammarComponent, String assignmentName) {
for (final Action action : GrammarUtil.containedActions(grammarComponent)) {
if (GrammarUtil.isAssignedAction(action)) {
if (Objects.equals(assignmentName, action.getFeature())) {
return action;
}
}
}
return n... | java | protected static Action findAction(EObject grammarComponent, String assignmentName) {
for (final Action action : GrammarUtil.containedActions(grammarComponent)) {
if (GrammarUtil.isAssignedAction(action)) {
if (Objects.equals(assignmentName, action.getFeature())) {
return action;
}
}
}
return n... | [
"protected",
"static",
"Action",
"findAction",
"(",
"EObject",
"grammarComponent",
",",
"String",
"assignmentName",
")",
"{",
"for",
"(",
"final",
"Action",
"action",
":",
"GrammarUtil",
".",
"containedActions",
"(",
"grammarComponent",
")",
")",
"{",
"if",
"(",... | Replies the assignment component with the given nazme in the given grammar component.
@param grammarComponent the component to explore.
@param assignmentName the name of the assignment to search for.
@return the assignment component. | [
"Replies",
"the",
"assignment",
"component",
"with",
"the",
"given",
"nazme",
"in",
"the",
"given",
"grammar",
"component",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/extractor/AbstractCodeElementExtractor.java#L112-L121 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/extractor/AbstractCodeElementExtractor.java | AbstractCodeElementExtractor.getContainerInRule | protected EObject getContainerInRule(EObject root, EObject content) {
EObject container = content;
do {
final EClassifier classifier = getGeneratedTypeFor(container);
if (classifier != null) {
return container;
}
container = container.eContainer();
} while (container != root);
final EClassifier ... | java | protected EObject getContainerInRule(EObject root, EObject content) {
EObject container = content;
do {
final EClassifier classifier = getGeneratedTypeFor(container);
if (classifier != null) {
return container;
}
container = container.eContainer();
} while (container != root);
final EClassifier ... | [
"protected",
"EObject",
"getContainerInRule",
"(",
"EObject",
"root",
",",
"EObject",
"content",
")",
"{",
"EObject",
"container",
"=",
"content",
";",
"do",
"{",
"final",
"EClassifier",
"classifier",
"=",
"getGeneratedTypeFor",
"(",
"container",
")",
";",
"if",... | Replies the container in the grammar rule for the given content element.
@param root the biggest enclosing element to consider in the grammar.
@param content the grammar element to search for the container.
@return the container of the content. | [
"Replies",
"the",
"container",
"in",
"the",
"grammar",
"rule",
"for",
"the",
"given",
"content",
"element",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/extractor/AbstractCodeElementExtractor.java#L157-L171 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.createClassCellEditor | protected CellEditor createClassCellEditor() {
return new DialogCellEditor(getControl()) {
@Override
protected Object openDialogBox(Control cellEditorWindow) {
final OpenTypeSelectionDialog dialog = new OpenTypeSelectionDialog(
getControl().getShell(),
false,
PlatformUI.getWorkbench().getP... | java | protected CellEditor createClassCellEditor() {
return new DialogCellEditor(getControl()) {
@Override
protected Object openDialogBox(Control cellEditorWindow) {
final OpenTypeSelectionDialog dialog = new OpenTypeSelectionDialog(
getControl().getShell(),
false,
PlatformUI.getWorkbench().getP... | [
"protected",
"CellEditor",
"createClassCellEditor",
"(",
")",
"{",
"return",
"new",
"DialogCellEditor",
"(",
"getControl",
"(",
")",
")",
"{",
"@",
"Override",
"protected",
"Object",
"openDialogBox",
"(",
"Control",
"cellEditorWindow",
")",
"{",
"final",
"OpenType... | Create a cell editor that enables to select a class.
@return the cell editor. | [
"Create",
"a",
"cell",
"editor",
"that",
"enables",
"to",
"select",
"a",
"class",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L334-L359 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.enableButtons | private void enableButtons() {
final int itemCount = this.list.getTable().getItemCount();
final boolean hasElement = itemCount > 0;
IStructuredSelection selection;
if (hasElement) {
selection = this.list.getStructuredSelection();
final int selectionCount = selection.size();
if (selectionCount <= 0 || s... | java | private void enableButtons() {
final int itemCount = this.list.getTable().getItemCount();
final boolean hasElement = itemCount > 0;
IStructuredSelection selection;
if (hasElement) {
selection = this.list.getStructuredSelection();
final int selectionCount = selection.size();
if (selectionCount <= 0 || s... | [
"private",
"void",
"enableButtons",
"(",
")",
"{",
"final",
"int",
"itemCount",
"=",
"this",
".",
"list",
".",
"getTable",
"(",
")",
".",
"getItemCount",
"(",
")",
";",
"final",
"boolean",
"hasElement",
"=",
"itemCount",
">",
"0",
";",
"IStructuredSelectio... | Enables the type conversion buttons based on selected items counts in the viewer. | [
"Enables",
"the",
"type",
"conversion",
"buttons",
"based",
"on",
"selected",
"items",
"counts",
"in",
"the",
"viewer",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L389-L414 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.setTypeConversions | protected void setTypeConversions(List<Pair<String, String>> typeConversions, boolean notifyController) {
this.conversions.clear();
if (typeConversions != null) {
for (final Pair<String, String> entry : typeConversions) {
this.conversions.add(new ConversionMapping(entry.getKey(), entry.getValue()));
}
}... | java | protected void setTypeConversions(List<Pair<String, String>> typeConversions, boolean notifyController) {
this.conversions.clear();
if (typeConversions != null) {
for (final Pair<String, String> entry : typeConversions) {
this.conversions.add(new ConversionMapping(entry.getKey(), entry.getValue()));
}
}... | [
"protected",
"void",
"setTypeConversions",
"(",
"List",
"<",
"Pair",
"<",
"String",
",",
"String",
">",
">",
"typeConversions",
",",
"boolean",
"notifyController",
")",
"{",
"this",
".",
"conversions",
".",
"clear",
"(",
")",
";",
"if",
"(",
"typeConversions... | Sets the type conversions to be displayed in this block.
@param typeConversions the type conversions.
@param notifyController indicates if the controller should be notified. | [
"Sets",
"the",
"type",
"conversions",
"to",
"be",
"displayed",
"in",
"this",
"block",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L422-L434 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.addTypeConversion | protected void addTypeConversion(String javaType, String targetType, boolean updateSelection) {
final ConversionMapping entry = new ConversionMapping(javaType, targetType);
this.conversions.add(entry);
//refresh from model
refreshListUI();
if (updateSelection) {
this.list.setSelection(new StructuredSelecti... | java | protected void addTypeConversion(String javaType, String targetType, boolean updateSelection) {
final ConversionMapping entry = new ConversionMapping(javaType, targetType);
this.conversions.add(entry);
//refresh from model
refreshListUI();
if (updateSelection) {
this.list.setSelection(new StructuredSelecti... | [
"protected",
"void",
"addTypeConversion",
"(",
"String",
"javaType",
",",
"String",
"targetType",
",",
"boolean",
"updateSelection",
")",
"{",
"final",
"ConversionMapping",
"entry",
"=",
"new",
"ConversionMapping",
"(",
"javaType",
",",
"targetType",
")",
";",
"th... | Add a type conversion.
@param javaType the name of the java type.
@param targetType the name of the target type.
@param updateSelection indicates if the selection should be updated. | [
"Add",
"a",
"type",
"conversion",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L442-L456 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.removeCurrentTypeConversion | @SuppressWarnings("unchecked")
protected void removeCurrentTypeConversion() {
final IStructuredSelection selection = this.list.getStructuredSelection();
final String[] types = new String[selection.size()];
final Iterator<ConversionMapping> iter = selection.iterator();
int i = 0;
while (iter.hasNext()) {
t... | java | @SuppressWarnings("unchecked")
protected void removeCurrentTypeConversion() {
final IStructuredSelection selection = this.list.getStructuredSelection();
final String[] types = new String[selection.size()];
final Iterator<ConversionMapping> iter = selection.iterator();
int i = 0;
while (iter.hasNext()) {
t... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"removeCurrentTypeConversion",
"(",
")",
"{",
"final",
"IStructuredSelection",
"selection",
"=",
"this",
".",
"list",
".",
"getStructuredSelection",
"(",
")",
";",
"final",
"String",
"[",
"]"... | Remove the current type conversion. | [
"Remove",
"the",
"current",
"type",
"conversion",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L468-L479 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.moveSelectionTop | protected void moveSelectionTop() {
final IStructuredSelection selection = this.list.getStructuredSelection();
final int index = this.conversions.indexOf(selection.getFirstElement());
if (index > 0) {
final int endIndex = index + selection.size() - 1;
for (int i = 0; i < selection.size(); ++i) {
final C... | java | protected void moveSelectionTop() {
final IStructuredSelection selection = this.list.getStructuredSelection();
final int index = this.conversions.indexOf(selection.getFirstElement());
if (index > 0) {
final int endIndex = index + selection.size() - 1;
for (int i = 0; i < selection.size(); ++i) {
final C... | [
"protected",
"void",
"moveSelectionTop",
"(",
")",
"{",
"final",
"IStructuredSelection",
"selection",
"=",
"this",
".",
"list",
".",
"getStructuredSelection",
"(",
")",
";",
"final",
"int",
"index",
"=",
"this",
".",
"conversions",
".",
"indexOf",
"(",
"select... | Move the selection at the top. | [
"Move",
"the",
"selection",
"at",
"the",
"top",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L483-L497 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.moveSelectionUp | protected void moveSelectionUp() {
final IStructuredSelection selection = this.list.getStructuredSelection();
final int index = this.conversions.indexOf(selection.getFirstElement());
if (index > 0) {
final ConversionMapping previous = this.conversions.remove(index - 1);
this.conversions.add(index + selectio... | java | protected void moveSelectionUp() {
final IStructuredSelection selection = this.list.getStructuredSelection();
final int index = this.conversions.indexOf(selection.getFirstElement());
if (index > 0) {
final ConversionMapping previous = this.conversions.remove(index - 1);
this.conversions.add(index + selectio... | [
"protected",
"void",
"moveSelectionUp",
"(",
")",
"{",
"final",
"IStructuredSelection",
"selection",
"=",
"this",
".",
"list",
".",
"getStructuredSelection",
"(",
")",
";",
"final",
"int",
"index",
"=",
"this",
".",
"conversions",
".",
"indexOf",
"(",
"selecti... | Move the selection up. | [
"Move",
"the",
"selection",
"up",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L501-L512 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.moveSelectionDown | protected void moveSelectionDown() {
final IStructuredSelection selection = this.list.getStructuredSelection();
final int index = this.conversions.indexOf(selection.getFirstElement());
if (index >= 0 && (index + selection.size()) < this.conversions.size()) {
final ConversionMapping next = this.conversions.remo... | java | protected void moveSelectionDown() {
final IStructuredSelection selection = this.list.getStructuredSelection();
final int index = this.conversions.indexOf(selection.getFirstElement());
if (index >= 0 && (index + selection.size()) < this.conversions.size()) {
final ConversionMapping next = this.conversions.remo... | [
"protected",
"void",
"moveSelectionDown",
"(",
")",
"{",
"final",
"IStructuredSelection",
"selection",
"=",
"this",
".",
"list",
".",
"getStructuredSelection",
"(",
")",
";",
"final",
"int",
"index",
"=",
"this",
".",
"conversions",
".",
"indexOf",
"(",
"selec... | Move the selection down. | [
"Move",
"the",
"selection",
"down",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L516-L527 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.moveSelectionBottom | protected void moveSelectionBottom() {
final IStructuredSelection selection = this.list.getStructuredSelection();
final int index = this.conversions.indexOf(selection.getFirstElement());
if (index >= 0 && (index + selection.size()) < this.conversions.size()) {
for (int i = 0; i < selection.size(); ++i) {
f... | java | protected void moveSelectionBottom() {
final IStructuredSelection selection = this.list.getStructuredSelection();
final int index = this.conversions.indexOf(selection.getFirstElement());
if (index >= 0 && (index + selection.size()) < this.conversions.size()) {
for (int i = 0; i < selection.size(); ++i) {
f... | [
"protected",
"void",
"moveSelectionBottom",
"(",
")",
"{",
"final",
"IStructuredSelection",
"selection",
"=",
"this",
".",
"list",
".",
"getStructuredSelection",
"(",
")",
";",
"final",
"int",
"index",
"=",
"this",
".",
"conversions",
".",
"indexOf",
"(",
"sel... | Move the selection at the bottom. | [
"Move",
"the",
"selection",
"at",
"the",
"bottom",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L531-L544 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.removeTypeConversions | protected void removeTypeConversions(String... types) {
for (final String type : types) {
final Iterator<ConversionMapping> iterator = this.conversions.iterator();
while (iterator.hasNext()) {
final ConversionMapping pair = iterator.next();
if (Strings.equal(pair.getSource(), type)) {
iterator.remo... | java | protected void removeTypeConversions(String... types) {
for (final String type : types) {
final Iterator<ConversionMapping> iterator = this.conversions.iterator();
while (iterator.hasNext()) {
final ConversionMapping pair = iterator.next();
if (Strings.equal(pair.getSource(), type)) {
iterator.remo... | [
"protected",
"void",
"removeTypeConversions",
"(",
"String",
"...",
"types",
")",
"{",
"for",
"(",
"final",
"String",
"type",
":",
"types",
")",
"{",
"final",
"Iterator",
"<",
"ConversionMapping",
">",
"iterator",
"=",
"this",
".",
"conversions",
".",
"itera... | Remove the given type conversions.
@param types the type conversions to be removed. | [
"Remove",
"the",
"given",
"type",
"conversions",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L550-L565 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.refreshListUI | protected void refreshListUI() {
final Display display = Display.getDefault();
if (display.getThread().equals(Thread.currentThread())) {
if (!this.list.isBusy()) {
this.list.refresh();
}
} else {
display.syncExec(new Runnable() {
@SuppressWarnings("synthetic-access")
@Override
public void... | java | protected void refreshListUI() {
final Display display = Display.getDefault();
if (display.getThread().equals(Thread.currentThread())) {
if (!this.list.isBusy()) {
this.list.refresh();
}
} else {
display.syncExec(new Runnable() {
@SuppressWarnings("synthetic-access")
@Override
public void... | [
"protected",
"void",
"refreshListUI",
"(",
")",
"{",
"final",
"Display",
"display",
"=",
"Display",
".",
"getDefault",
"(",
")",
";",
"if",
"(",
"display",
".",
"getThread",
"(",
")",
".",
"equals",
"(",
"Thread",
".",
"currentThread",
"(",
")",
")",
"... | Refresh the UI list of type conversions. | [
"Refresh",
"the",
"UI",
"list",
"of",
"type",
"conversions",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L579-L596 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java | AbstractConversionTable.sortByTargetColumn | private void sortByTargetColumn() {
this.list.setComparator(new ViewerComparator() {
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 != null && e2 != null) {
return e1.toString().compareToIgnoreCase(e2.toString());
}
return super.compare(viewer, e1, e2);
}
@Ov... | java | private void sortByTargetColumn() {
this.list.setComparator(new ViewerComparator() {
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 != null && e2 != null) {
return e1.toString().compareToIgnoreCase(e2.toString());
}
return super.compare(viewer, e1, e2);
}
@Ov... | [
"private",
"void",
"sortByTargetColumn",
"(",
")",
"{",
"this",
".",
"list",
".",
"setComparator",
"(",
"new",
"ViewerComparator",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"compare",
"(",
"Viewer",
"viewer",
",",
"Object",
"e1",
",",
"Object",
"e2"... | Sorts the type conversions by target type. | [
"Sorts",
"the",
"type",
"conversions",
"by",
"target",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractConversionTable.java#L630-L646 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java | BuildSettingWizardPage.updateStatus | private void updateStatus(Throwable event) {
Throwable cause = event;
while (cause != null
&& (!(cause instanceof CoreException))
&& cause.getCause() != null
&& cause.getCause() != cause) {
cause = cause.getCause();
}
if (cause instanceof CoreException) {
updateStatus(((CoreException) cause).g... | java | private void updateStatus(Throwable event) {
Throwable cause = event;
while (cause != null
&& (!(cause instanceof CoreException))
&& cause.getCause() != null
&& cause.getCause() != cause) {
cause = cause.getCause();
}
if (cause instanceof CoreException) {
updateStatus(((CoreException) cause).g... | [
"private",
"void",
"updateStatus",
"(",
"Throwable",
"event",
")",
"{",
"Throwable",
"cause",
"=",
"event",
";",
"while",
"(",
"cause",
"!=",
"null",
"&&",
"(",
"!",
"(",
"cause",
"instanceof",
"CoreException",
")",
")",
"&&",
"cause",
".",
"getCause",
"... | Update the status of this page according to the given exception.
@param event the exception. | [
"Update",
"the",
"status",
"of",
"this",
"page",
"according",
"to",
"the",
"given",
"exception",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java#L193-L213 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java | BuildSettingWizardPage.performFinish | public void performFinish(IProgressMonitor monitor) throws CoreException, InterruptedException {
final SubMonitor subMonitor = SubMonitor.convert(monitor, 4);
try {
monitor.beginTask(NewWizardMessages.NewJavaProjectWizardPageTwo_operation_create, 3);
if (this.currProject == null) {
updateProject(subMonito... | java | public void performFinish(IProgressMonitor monitor) throws CoreException, InterruptedException {
final SubMonitor subMonitor = SubMonitor.convert(monitor, 4);
try {
monitor.beginTask(NewWizardMessages.NewJavaProjectWizardPageTwo_operation_create, 3);
if (this.currProject == null) {
updateProject(subMonito... | [
"public",
"void",
"performFinish",
"(",
"IProgressMonitor",
"monitor",
")",
"throws",
"CoreException",
",",
"InterruptedException",
"{",
"final",
"SubMonitor",
"subMonitor",
"=",
"SubMonitor",
".",
"convert",
"(",
"monitor",
",",
"4",
")",
";",
"try",
"{",
"moni... | Called from the wizard on finish.
@param monitor the progress monitor
@throws CoreException thrown when the project creation or configuration failed
@throws InterruptedException thrown when the user canceled the project creation | [
"Called",
"from",
"the",
"wizard",
"on",
"finish",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java#L604-L627 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java | BuildSettingWizardPage.createProvisonalProject | protected IProject createProvisonalProject() {
final IStatus status = changeToNewProject();
if (status != null) {
updateStatus(status);
if (!status.isOK()) {
ErrorDialog.openError(
getShell(),
NewWizardMessages.NewJavaProjectWizardPageTwo_error_title,
null,
status);
}
}
retu... | java | protected IProject createProvisonalProject() {
final IStatus status = changeToNewProject();
if (status != null) {
updateStatus(status);
if (!status.isOK()) {
ErrorDialog.openError(
getShell(),
NewWizardMessages.NewJavaProjectWizardPageTwo_error_title,
null,
status);
}
}
retu... | [
"protected",
"IProject",
"createProvisonalProject",
"(",
")",
"{",
"final",
"IStatus",
"status",
"=",
"changeToNewProject",
"(",
")",
";",
"if",
"(",
"status",
"!=",
"null",
")",
"{",
"updateStatus",
"(",
"status",
")",
";",
"if",
"(",
"!",
"status",
".",
... | Creates the provisional project on which the wizard is working on.
The provisional project is typically created when the page is entered
the first time. The early project creation is required to configure
linked folders.
@return the provisional project | [
"Creates",
"the",
"provisional",
"project",
"on",
"which",
"the",
"wizard",
"is",
"working",
"on",
".",
"The",
"provisional",
"project",
"is",
"typically",
"created",
"when",
"the",
"page",
"is",
"entered",
"the",
"first",
"time",
".",
"The",
"early",
"proje... | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java#L637-L650 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java | BuildSettingWizardPage.removeProvisonalProject | protected void removeProvisonalProject() {
if (!this.currProject.exists()) {
this.currProject = null;
return;
}
final IRunnableWithProgress op = new IRunnableWithProgress() {
@SuppressWarnings("synthetic-access")
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException,... | java | protected void removeProvisonalProject() {
if (!this.currProject.exists()) {
this.currProject = null;
return;
}
final IRunnableWithProgress op = new IRunnableWithProgress() {
@SuppressWarnings("synthetic-access")
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException,... | [
"protected",
"void",
"removeProvisonalProject",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"currProject",
".",
"exists",
"(",
")",
")",
"{",
"this",
".",
"currProject",
"=",
"null",
";",
"return",
";",
"}",
"final",
"IRunnableWithProgress",
"op",
"=",
"... | Removes the provisional project. The provisional project is typically
removed when the user cancels the wizard or goes back to the first page. | [
"Removes",
"the",
"provisional",
"project",
".",
"The",
"provisional",
"project",
"is",
"typically",
"removed",
"when",
"the",
"user",
"cancels",
"the",
"wizard",
"or",
"goes",
"back",
"to",
"the",
"first",
"page",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java#L656-L679 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/UniqueAddressParticipantRepository.java | UniqueAddressParticipantRepository.registerParticipant | public ADDRESST registerParticipant(ADDRESST address, EventListener entity) {
synchronized (mutex()) {
addListener(address, entity);
this.participants.put(entity.getID(), address);
}
return address;
} | java | public ADDRESST registerParticipant(ADDRESST address, EventListener entity) {
synchronized (mutex()) {
addListener(address, entity);
this.participants.put(entity.getID(), address);
}
return address;
} | [
"public",
"ADDRESST",
"registerParticipant",
"(",
"ADDRESST",
"address",
",",
"EventListener",
"entity",
")",
"{",
"synchronized",
"(",
"mutex",
"(",
")",
")",
"{",
"addListener",
"(",
"address",
",",
"entity",
")",
";",
"this",
".",
"participants",
".",
"pu... | Registers a new participant in this repository.
@param address the address of the participant
@param entity the entity associated to the specified address
@return the address of the participant | [
"Registers",
"a",
"new",
"participant",
"in",
"this",
"repository",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/UniqueAddressParticipantRepository.java#L87-L93 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/UniqueAddressParticipantRepository.java | UniqueAddressParticipantRepository.unregisterParticipant | public ADDRESST unregisterParticipant(UUID entityID) {
synchronized (mutex()) {
removeListener(this.participants.get(entityID));
return this.participants.remove(entityID);
}
} | java | public ADDRESST unregisterParticipant(UUID entityID) {
synchronized (mutex()) {
removeListener(this.participants.get(entityID));
return this.participants.remove(entityID);
}
} | [
"public",
"ADDRESST",
"unregisterParticipant",
"(",
"UUID",
"entityID",
")",
"{",
"synchronized",
"(",
"mutex",
"(",
")",
")",
"{",
"removeListener",
"(",
"this",
".",
"participants",
".",
"get",
"(",
"entityID",
")",
")",
";",
"return",
"this",
".",
"part... | Remove a participant with the given ID from this repository.
@param entityID identifier of the participant to remove from this repository.
@return the address that was mapped to the given participant. | [
"Remove",
"a",
"participant",
"with",
"the",
"given",
"ID",
"from",
"this",
"repository",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/UniqueAddressParticipantRepository.java#L111-L116 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/UniqueAddressParticipantRepository.java | UniqueAddressParticipantRepository.getParticipantAddresses | public SynchronizedCollection<ADDRESST> getParticipantAddresses() {
final Object mutex = mutex();
synchronized (mutex) {
return Collections3.synchronizedCollection(this.participants.values(), mutex);
}
} | java | public SynchronizedCollection<ADDRESST> getParticipantAddresses() {
final Object mutex = mutex();
synchronized (mutex) {
return Collections3.synchronizedCollection(this.participants.values(), mutex);
}
} | [
"public",
"SynchronizedCollection",
"<",
"ADDRESST",
">",
"getParticipantAddresses",
"(",
")",
"{",
"final",
"Object",
"mutex",
"=",
"mutex",
"(",
")",
";",
"synchronized",
"(",
"mutex",
")",
"{",
"return",
"Collections3",
".",
"synchronizedCollection",
"(",
"th... | Replies all the addresses of the participants that ar einside this repository.
@return all the addresses. | [
"Replies",
"all",
"the",
"addresses",
"of",
"the",
"participants",
"that",
"ar",
"einside",
"this",
"repository",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/UniqueAddressParticipantRepository.java#L145-L150 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/UniqueAddressParticipantRepository.java | UniqueAddressParticipantRepository.getParticipantIDs | public SynchronizedSet<UUID> getParticipantIDs() {
final Object mutex = mutex();
synchronized (mutex) {
return Collections3.synchronizedSet(this.participants.keySet(), mutex);
}
} | java | public SynchronizedSet<UUID> getParticipantIDs() {
final Object mutex = mutex();
synchronized (mutex) {
return Collections3.synchronizedSet(this.participants.keySet(), mutex);
}
} | [
"public",
"SynchronizedSet",
"<",
"UUID",
">",
"getParticipantIDs",
"(",
")",
"{",
"final",
"Object",
"mutex",
"=",
"mutex",
"(",
")",
";",
"synchronized",
"(",
"mutex",
")",
"{",
"return",
"Collections3",
".",
"synchronizedSet",
"(",
"this",
".",
"participa... | Replies the identifiers of all the participants in this repository.
@return all the identifiers. | [
"Replies",
"the",
"identifiers",
"of",
"all",
"the",
"participants",
"in",
"this",
"repository",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/UniqueAddressParticipantRepository.java#L157-L162 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/InitializeMojo.java | InitializeMojo.addSourceFolder | protected void addSourceFolder(String path) {
final List<String> existingFolders1 = this.project.getCompileSourceRoots();
final List<String> existingFolders2 = this.project.getTestCompileSourceRoots();
if (!existingFolders1.contains(path) && !existingFolders2.contains(path)) {
getLog().info(MessageFormat.forma... | java | protected void addSourceFolder(String path) {
final List<String> existingFolders1 = this.project.getCompileSourceRoots();
final List<String> existingFolders2 = this.project.getTestCompileSourceRoots();
if (!existingFolders1.contains(path) && !existingFolders2.contains(path)) {
getLog().info(MessageFormat.forma... | [
"protected",
"void",
"addSourceFolder",
"(",
"String",
"path",
")",
"{",
"final",
"List",
"<",
"String",
">",
"existingFolders1",
"=",
"this",
".",
"project",
".",
"getCompileSourceRoots",
"(",
")",
";",
"final",
"List",
"<",
"String",
">",
"existingFolders2",... | Add a source folder in the current projecT.
@param path the source folder path. | [
"Add",
"a",
"source",
"folder",
"in",
"the",
"current",
"projecT",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/InitializeMojo.java#L70-L79 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/acceptors/MissedMethodAddModification.java | MissedMethodAddModification.cloneTypeReferences | private List<LightweightTypeReference> cloneTypeReferences(List<JvmTypeReference> types,
Map<String, JvmTypeReference> typeParameterMap) {
final List<LightweightTypeReference> newList = new ArrayList<>(types.size());
for (final JvmTypeReference type : types) {
newList.add(cloneTypeReference(type, typeParamete... | java | private List<LightweightTypeReference> cloneTypeReferences(List<JvmTypeReference> types,
Map<String, JvmTypeReference> typeParameterMap) {
final List<LightweightTypeReference> newList = new ArrayList<>(types.size());
for (final JvmTypeReference type : types) {
newList.add(cloneTypeReference(type, typeParamete... | [
"private",
"List",
"<",
"LightweightTypeReference",
">",
"cloneTypeReferences",
"(",
"List",
"<",
"JvmTypeReference",
">",
"types",
",",
"Map",
"<",
"String",
",",
"JvmTypeReference",
">",
"typeParameterMap",
")",
"{",
"final",
"List",
"<",
"LightweightTypeReference... | Clone the given types by applying the type parameter mapping when necessary.
@param types the types to clone.
@param typeParameterMap the type parameter mapping.
@return the clones. | [
"Clone",
"the",
"given",
"types",
"by",
"applying",
"the",
"type",
"parameter",
"mapping",
"when",
"necessary",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/acceptors/MissedMethodAddModification.java#L321-L328 | train |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/configs/subconfigs/ValidatorConfig.java | ValidatorConfig.setWarningLevels | @BQConfigProperty("Specify the levels of specific warnings")
public void setWarningLevels(Map<String, Severity> levels) {
if (levels == null) {
this.warningLevels = new HashMap<>();
} else {
this.warningLevels = levels;
}
} | java | @BQConfigProperty("Specify the levels of specific warnings")
public void setWarningLevels(Map<String, Severity> levels) {
if (levels == null) {
this.warningLevels = new HashMap<>();
} else {
this.warningLevels = levels;
}
} | [
"@",
"BQConfigProperty",
"(",
"\"Specify the levels of specific warnings\"",
")",
"public",
"void",
"setWarningLevels",
"(",
"Map",
"<",
"String",
",",
"Severity",
">",
"levels",
")",
"{",
"if",
"(",
"levels",
"==",
"null",
")",
"{",
"this",
".",
"warningLevels"... | Change the specific warning levels.
@param levels the warnings levels. | [
"Change",
"the",
"specific",
"warning",
"levels",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/configs/subconfigs/ValidatorConfig.java#L90-L97 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.quoteRegex | protected static String quoteRegex(String regex) {
if (regex == null) {
return ""; //$NON-NLS-1$
}
return regex.replaceAll(REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_PROTECT);
} | java | protected static String quoteRegex(String regex) {
if (regex == null) {
return ""; //$NON-NLS-1$
}
return regex.replaceAll(REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_PROTECT);
} | [
"protected",
"static",
"String",
"quoteRegex",
"(",
"String",
"regex",
")",
"{",
"if",
"(",
"regex",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"//$NON-NLS-1$",
"}",
"return",
"regex",
".",
"replaceAll",
"(",
"REGEX_SPECIAL_CHARS",
",",
"REGEX_SPECIAL_CHAR... | Protect the given regular expression.
@param regex the expression to protect.
@return the protected expression. | [
"Protect",
"the",
"given",
"regular",
"expression",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L136-L141 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.orRegex | protected static String orRegex(Iterable<String> elements) {
final StringBuilder regex = new StringBuilder();
for (final String element : elements) {
if (regex.length() > 0) {
regex.append("|"); //$NON-NLS-1$
}
regex.append("(?:"); //$NON-NLS-1$
regex.append(quoteRegex(element));
regex.append(")"... | java | protected static String orRegex(Iterable<String> elements) {
final StringBuilder regex = new StringBuilder();
for (final String element : elements) {
if (regex.length() > 0) {
regex.append("|"); //$NON-NLS-1$
}
regex.append("(?:"); //$NON-NLS-1$
regex.append(quoteRegex(element));
regex.append(")"... | [
"protected",
"static",
"String",
"orRegex",
"(",
"Iterable",
"<",
"String",
">",
"elements",
")",
"{",
"final",
"StringBuilder",
"regex",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"final",
"String",
"element",
":",
"elements",
")",
"{",
"if",... | Build a regular expression that is matching one of the given elements.
@param elements the elements to match.
@return the regular expression | [
"Build",
"a",
"regular",
"expression",
"that",
"is",
"matching",
"one",
"of",
"the",
"given",
"elements",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L148-L159 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.sortedConcat | @SafeVarargs
protected static Set<String> sortedConcat(Iterable<String>... iterables) {
final Set<String> set = new TreeSet<>();
for (final Iterable<String> iterable : iterables) {
for (final String obj : iterable) {
set.add(obj);
}
}
return set;
} | java | @SafeVarargs
protected static Set<String> sortedConcat(Iterable<String>... iterables) {
final Set<String> set = new TreeSet<>();
for (final Iterable<String> iterable : iterables) {
for (final String obj : iterable) {
set.add(obj);
}
}
return set;
} | [
"@",
"SafeVarargs",
"protected",
"static",
"Set",
"<",
"String",
">",
"sortedConcat",
"(",
"Iterable",
"<",
"String",
">",
"...",
"iterables",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"set",
"=",
"new",
"TreeSet",
"<>",
"(",
")",
";",
"for",
"(",
... | Concat the given iterables.
@param iterables the iterables.
@return the concat result. | [
"Concat",
"the",
"given",
"iterables",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L175-L184 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.addMimeType | public void addMimeType(String mimeType) {
if (!Strings.isEmpty(mimeType)) {
for (final String mtype : mimeType.split("[:;,]")) { //$NON-NLS-1$
this.mimeTypes.add(mtype);
}
}
} | java | public void addMimeType(String mimeType) {
if (!Strings.isEmpty(mimeType)) {
for (final String mtype : mimeType.split("[:;,]")) { //$NON-NLS-1$
this.mimeTypes.add(mtype);
}
}
} | [
"public",
"void",
"addMimeType",
"(",
"String",
"mimeType",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isEmpty",
"(",
"mimeType",
")",
")",
"{",
"for",
"(",
"final",
"String",
"mtype",
":",
"mimeType",
".",
"split",
"(",
"\"[:;,]\"",
")",
")",
"{",
"... | Add a mime type for the SARL source code.
@param mimeType the mime type of SARL. | [
"Add",
"a",
"mime",
"type",
"for",
"the",
"SARL",
"source",
"code",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L190-L196 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.getMimeTypes | @Pure
public List<String> getMimeTypes() {
if (this.mimeTypes.isEmpty()) {
return Arrays.asList("text/x-" + getLanguageSimpleName().toLowerCase()); //$NON-NLS-1$
}
return this.mimeTypes;
} | java | @Pure
public List<String> getMimeTypes() {
if (this.mimeTypes.isEmpty()) {
return Arrays.asList("text/x-" + getLanguageSimpleName().toLowerCase()); //$NON-NLS-1$
}
return this.mimeTypes;
} | [
"@",
"Pure",
"public",
"List",
"<",
"String",
">",
"getMimeTypes",
"(",
")",
"{",
"if",
"(",
"this",
".",
"mimeTypes",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"Arrays",
".",
"asList",
"(",
"\"text/x-\"",
"+",
"getLanguageSimpleName",
"(",
")",
".... | Replies the mime types for the SARL source code.
@return the mime type for SARL. | [
"Replies",
"the",
"mime",
"types",
"for",
"the",
"SARL",
"source",
"code",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L202-L208 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.getBasename | @Pure
public String getBasename(String defaultName) {
if (Strings.isEmpty(this.basename)) {
return defaultName;
}
return this.basename;
} | java | @Pure
public String getBasename(String defaultName) {
if (Strings.isEmpty(this.basename)) {
return defaultName;
}
return this.basename;
} | [
"@",
"Pure",
"public",
"String",
"getBasename",
"(",
"String",
"defaultName",
")",
"{",
"if",
"(",
"Strings",
".",
"isEmpty",
"(",
"this",
".",
"basename",
")",
")",
"{",
"return",
"defaultName",
";",
"}",
"return",
"this",
".",
"basename",
";",
"}"
] | Replies the basename of the XML file to generate.
@param defaultName the name to reply if the basename was not set.
@return the basename. | [
"Replies",
"the",
"basename",
"of",
"the",
"XML",
"file",
"to",
"generate",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L235-L241 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.exploreGrammar | @SuppressWarnings("checkstyle:nestedifdepth")
private static void exploreGrammar(Grammar grammar, Set<String> expressionKeywords,
Set<String> modifiers, Set<String> primitiveTypes, Set<String> punctuation,
Set<String> literals, Set<String> excludedKeywords, Set<String> ignored) {
for (final AbstractRule rule :... | java | @SuppressWarnings("checkstyle:nestedifdepth")
private static void exploreGrammar(Grammar grammar, Set<String> expressionKeywords,
Set<String> modifiers, Set<String> primitiveTypes, Set<String> punctuation,
Set<String> literals, Set<String> excludedKeywords, Set<String> ignored) {
for (final AbstractRule rule :... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:nestedifdepth\"",
")",
"private",
"static",
"void",
"exploreGrammar",
"(",
"Grammar",
"grammar",
",",
"Set",
"<",
"String",
">",
"expressionKeywords",
",",
"Set",
"<",
"String",
">",
"modifiers",
",",
"Set",
"<",
"Stri... | Explore the grammar for extracting the key elements.
@param grammar the grammar to explore.
@param expressionKeywords the SARL keywords, usually within expressions.
@param modifiers the modifier keywords.
@param primitiveTypes the primitive types.
@param punctuation the set of detected punctuation symbols.
@param lite... | [
"Explore",
"the",
"grammar",
"for",
"extracting",
"the",
"key",
"elements",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L329-L361 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.generate | protected final void generate(Set<String> literals, Set<String> expressionKeywords,
Set<String> modifiers, Set<String> primitiveTypes, Set<String> punctuation,
Set<String> ignored, Set<String> specialKeywords, Set<String> typeDeclarationKeywords) {
final T appendable = newStyleAppendable();
generate(appendabl... | java | protected final void generate(Set<String> literals, Set<String> expressionKeywords,
Set<String> modifiers, Set<String> primitiveTypes, Set<String> punctuation,
Set<String> ignored, Set<String> specialKeywords, Set<String> typeDeclarationKeywords) {
final T appendable = newStyleAppendable();
generate(appendabl... | [
"protected",
"final",
"void",
"generate",
"(",
"Set",
"<",
"String",
">",
"literals",
",",
"Set",
"<",
"String",
">",
"expressionKeywords",
",",
"Set",
"<",
"String",
">",
"modifiers",
",",
"Set",
"<",
"String",
">",
"primitiveTypes",
",",
"Set",
"<",
"S... | Generate the external specification.
@param literals the SARL literals.
@param expressionKeywords the SARL keywords, usually within expressions.
@param modifiers the modifier keywords.
@param primitiveTypes the primitive types.
@param punctuation the SARL punctuation symbols.
@param ignored the ignored literals (mostl... | [
"Generate",
"the",
"external",
"specification",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L476-L487 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.concat | public static CharSequence concat(CharSequence... lines) {
return new CharSequence() {
private final StringBuilder content = new StringBuilder();
private int next;
private int length = -1;
@Override
public String toString() {
ensure(length());
return this.content.toString();
}
privat... | java | public static CharSequence concat(CharSequence... lines) {
return new CharSequence() {
private final StringBuilder content = new StringBuilder();
private int next;
private int length = -1;
@Override
public String toString() {
ensure(length());
return this.content.toString();
}
privat... | [
"public",
"static",
"CharSequence",
"concat",
"(",
"CharSequence",
"...",
"lines",
")",
"{",
"return",
"new",
"CharSequence",
"(",
")",
"{",
"private",
"final",
"StringBuilder",
"content",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"private",
"int",
"next",
... | Contact the given strings of characters.
@param lines the lines.
@return the concatenation result. | [
"Contact",
"the",
"given",
"strings",
"of",
"characters",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L528-L577 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.generateReadme | protected void generateReadme(String basename) {
final Object content = getReadmeFileContent(basename);
if (content != null) {
final String textualContent = content.toString();
if (!Strings.isEmpty(textualContent)) {
final byte[] bytes = textualContent.getBytes();
for (final String output : getOutputs... | java | protected void generateReadme(String basename) {
final Object content = getReadmeFileContent(basename);
if (content != null) {
final String textualContent = content.toString();
if (!Strings.isEmpty(textualContent)) {
final byte[] bytes = textualContent.getBytes();
for (final String output : getOutputs... | [
"protected",
"void",
"generateReadme",
"(",
"String",
"basename",
")",
"{",
"final",
"Object",
"content",
"=",
"getReadmeFileContent",
"(",
"basename",
")",
";",
"if",
"(",
"content",
"!=",
"null",
")",
"{",
"final",
"String",
"textualContent",
"=",
"content",... | Generate the README file.
@param basename the basename of the generated file.
@since 0.6 | [
"Generate",
"the",
"README",
"file",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L584-L602 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.getLanguageSimpleName | protected String getLanguageSimpleName() {
final String name = getGrammar().getName();
final int index = name.lastIndexOf('.');
if (index > 0) {
return name.substring(index + 1);
}
return name;
} | java | protected String getLanguageSimpleName() {
final String name = getGrammar().getName();
final int index = name.lastIndexOf('.');
if (index > 0) {
return name.substring(index + 1);
}
return name;
} | [
"protected",
"String",
"getLanguageSimpleName",
"(",
")",
"{",
"final",
"String",
"name",
"=",
"getGrammar",
"(",
")",
".",
"getName",
"(",
")",
";",
"final",
"int",
"index",
"=",
"name",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"index",... | Replies the simple name of the language.
@return the name. | [
"Replies",
"the",
"simple",
"name",
"of",
"the",
"language",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L665-L672 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.lines | @Pure
protected String lines(String prefix, String... lines) {
final String delimiter = getCodeConfig().getLineDelimiter();
final StringBuilder buffer = new StringBuilder();
for (final String line : lines) {
buffer.append(prefix);
buffer.append(line);
buffer.append(delimiter);
}
return buffer.toStri... | java | @Pure
protected String lines(String prefix, String... lines) {
final String delimiter = getCodeConfig().getLineDelimiter();
final StringBuilder buffer = new StringBuilder();
for (final String line : lines) {
buffer.append(prefix);
buffer.append(line);
buffer.append(delimiter);
}
return buffer.toStri... | [
"@",
"Pure",
"protected",
"String",
"lines",
"(",
"String",
"prefix",
",",
"String",
"...",
"lines",
")",
"{",
"final",
"String",
"delimiter",
"=",
"getCodeConfig",
"(",
")",
".",
"getLineDelimiter",
"(",
")",
";",
"final",
"StringBuilder",
"buffer",
"=",
... | Merge the given lines with prefix.
@param prefix the prefix to add to each line.
@param lines the lines.
@return the merged elements. | [
"Merge",
"the",
"given",
"lines",
"with",
"prefix",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L694-L704 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlOutputConfigurationProvider.java | SarlOutputConfigurationProvider.createStandardOutputConfiguration | @SuppressWarnings("static-method")
protected OutputConfiguration createStandardOutputConfiguration() {
final OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
defaultOutput.setDescription(Messages.SarlOutputConfigurationProvider_0);
defaultOutput.setOutputDirectory(SA... | java | @SuppressWarnings("static-method")
protected OutputConfiguration createStandardOutputConfiguration() {
final OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
defaultOutput.setDescription(Messages.SarlOutputConfigurationProvider_0);
defaultOutput.setOutputDirectory(SA... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"OutputConfiguration",
"createStandardOutputConfiguration",
"(",
")",
"{",
"final",
"OutputConfiguration",
"defaultOutput",
"=",
"new",
"OutputConfiguration",
"(",
"IFileSystemAccess",
".",
"DEFAULT_OUTPUT",... | Create the standard output configuration.
@return the configuration, never {@code null}.
@since 0.8 | [
"Create",
"the",
"standard",
"output",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlOutputConfigurationProvider.java#L67-L79 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/modules/kernel/MandatoryKernelModule.java | MandatoryKernelModule.getKernel | @Provides
@io.janusproject.kernel.annotations.Kernel
@Singleton
public static AgentContext getKernel(ContextSpaceService contextService,
@Named(JanusConfig.DEFAULT_CONTEXT_ID_NAME) UUID janusContextID,
@Named(JanusConfig.DEFAULT_SPACE_ID_NAME) UUID defaultJanusSpaceId) {
return contextService.createContext(j... | java | @Provides
@io.janusproject.kernel.annotations.Kernel
@Singleton
public static AgentContext getKernel(ContextSpaceService contextService,
@Named(JanusConfig.DEFAULT_CONTEXT_ID_NAME) UUID janusContextID,
@Named(JanusConfig.DEFAULT_SPACE_ID_NAME) UUID defaultJanusSpaceId) {
return contextService.createContext(j... | [
"@",
"Provides",
"@",
"io",
".",
"janusproject",
".",
"kernel",
".",
"annotations",
".",
"Kernel",
"@",
"Singleton",
"public",
"static",
"AgentContext",
"getKernel",
"(",
"ContextSpaceService",
"contextService",
",",
"@",
"Named",
"(",
"JanusConfig",
".",
"DEFAU... | Construct the root agent context within the Janus platform.
@param contextService the service for managing the contexts.
@param janusContextID the root context's id.
@param defaultJanusSpaceId the id of the space within the root context.
@return the root context. | [
"Construct",
"the",
"root",
"agent",
"context",
"within",
"the",
"Janus",
"platform",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/modules/kernel/MandatoryKernelModule.java#L93-L100 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/modules/kernel/MandatoryKernelModule.java | MandatoryKernelModule.createAgentInternalEventsDispatcher | @Provides
public static AgentInternalEventsDispatcher createAgentInternalEventsDispatcher(Injector injector) {
final AgentInternalEventsDispatcher aeb = new AgentInternalEventsDispatcher(injector.getInstance(ExecutorService.class));
// to be able to inject the ExecutorService and SubscriberFindingStrategy
inject... | java | @Provides
public static AgentInternalEventsDispatcher createAgentInternalEventsDispatcher(Injector injector) {
final AgentInternalEventsDispatcher aeb = new AgentInternalEventsDispatcher(injector.getInstance(ExecutorService.class));
// to be able to inject the ExecutorService and SubscriberFindingStrategy
inject... | [
"@",
"Provides",
"public",
"static",
"AgentInternalEventsDispatcher",
"createAgentInternalEventsDispatcher",
"(",
"Injector",
"injector",
")",
"{",
"final",
"AgentInternalEventsDispatcher",
"aeb",
"=",
"new",
"AgentInternalEventsDispatcher",
"(",
"injector",
".",
"getInstance... | Create an instance of the event dispatcher for an agent.
@param injector the injector.
@return the event dispatcher. | [
"Create",
"an",
"instance",
"of",
"the",
"event",
"dispatcher",
"for",
"an",
"agent",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/modules/kernel/MandatoryKernelModule.java#L107-L113 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLReentrantTypeResolver.java | SARLReentrantTypeResolver.getSarlCapacityFieldType | protected LightweightTypeReference getSarlCapacityFieldType(IResolvedTypes resolvedTypes, JvmField field) {
// For capacity call redirection
LightweightTypeReference fieldType = resolvedTypes.getActualType(field);
final JvmAnnotationReference capacityAnnotation = this.annotationLookup.findAnnotation(field,
Im... | java | protected LightweightTypeReference getSarlCapacityFieldType(IResolvedTypes resolvedTypes, JvmField field) {
// For capacity call redirection
LightweightTypeReference fieldType = resolvedTypes.getActualType(field);
final JvmAnnotationReference capacityAnnotation = this.annotationLookup.findAnnotation(field,
Im... | [
"protected",
"LightweightTypeReference",
"getSarlCapacityFieldType",
"(",
"IResolvedTypes",
"resolvedTypes",
",",
"JvmField",
"field",
")",
"{",
"// For capacity call redirection",
"LightweightTypeReference",
"fieldType",
"=",
"resolvedTypes",
".",
"getActualType",
"(",
"field"... | Replies the type of the field that represents a SARL capacity buffer.
@param resolvedTypes the resolver of types.
@param field the field.
@return the type, never {@code null}. | [
"Replies",
"the",
"type",
"of",
"the",
"field",
"that",
"represents",
"a",
"SARL",
"capacity",
"buffer",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLReentrantTypeResolver.java#L143-L153 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLReentrantTypeResolver.java | SARLReentrantTypeResolver.createSarlCapacityExtensionProvider | protected XAbstractFeatureCall createSarlCapacityExtensionProvider(JvmIdentifiableElement thisFeature, JvmField field) {
// For capacity call redirection
if (thisFeature instanceof JvmDeclaredType) {
final JvmAnnotationReference capacityAnnotation = this.annotationLookup.findAnnotation(field,
ImportedCapaci... | java | protected XAbstractFeatureCall createSarlCapacityExtensionProvider(JvmIdentifiableElement thisFeature, JvmField field) {
// For capacity call redirection
if (thisFeature instanceof JvmDeclaredType) {
final JvmAnnotationReference capacityAnnotation = this.annotationLookup.findAnnotation(field,
ImportedCapaci... | [
"protected",
"XAbstractFeatureCall",
"createSarlCapacityExtensionProvider",
"(",
"JvmIdentifiableElement",
"thisFeature",
",",
"JvmField",
"field",
")",
"{",
"// For capacity call redirection",
"if",
"(",
"thisFeature",
"instanceof",
"JvmDeclaredType",
")",
"{",
"final",
"Jvm... | Create the extension provider dedicated to the access to the used capacity functions.
@param thisFeature the current object.
@param field the extension field.
@return the SARL capacity extension provider, or {@code null}. | [
"Create",
"the",
"extension",
"provider",
"dedicated",
"to",
"the",
"access",
"to",
"the",
"used",
"capacity",
"functions",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLReentrantTypeResolver.java#L161-L182 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/executors/JdkRejectedExecutionHandler.java | JdkRejectedExecutionHandler.runRejectedTask | protected static boolean runRejectedTask(Runnable runnable, ThreadPoolExecutor executor) {
// Runs the task directly in the calling thread of the {@code execute} method,
// unless the executor has been shut down, in which case the task
// is discarded.
if (!executor.isShutdown()) {
runnable.run();
return ... | java | protected static boolean runRejectedTask(Runnable runnable, ThreadPoolExecutor executor) {
// Runs the task directly in the calling thread of the {@code execute} method,
// unless the executor has been shut down, in which case the task
// is discarded.
if (!executor.isShutdown()) {
runnable.run();
return ... | [
"protected",
"static",
"boolean",
"runRejectedTask",
"(",
"Runnable",
"runnable",
",",
"ThreadPoolExecutor",
"executor",
")",
"{",
"// Runs the task directly in the calling thread of the {@code execute} method,",
"// unless the executor has been shut down, in which case the task",
"// is... | Run the given task within the current thread if the executor is not shut down.
The task is not run by the given executor. The executor is used for checking if
the executor service is shut down.
@param runnable the runnable task to be executed
@param executor the executor attempting to give the shut down status
@return... | [
"Run",
"the",
"given",
"task",
"within",
"the",
"current",
"thread",
"if",
"the",
"executor",
"is",
"not",
"shut",
"down",
".",
"The",
"task",
"is",
"not",
"run",
"by",
"the",
"given",
"executor",
".",
"The",
"executor",
"is",
"used",
"for",
"checking",
... | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/executors/JdkRejectedExecutionHandler.java#L79-L88 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/Capacities.java | Capacities.createSkillDelegator | @Pure
public static <C extends Capacity> C createSkillDelegator(Skill originalSkill, Class<C> capacity, AgentTrait capacityCaller)
throws Exception {
final String name = capacity.getName() + CAPACITY_WRAPPER_NAME;
final Class<?> type = Class.forName(name, true, capacity.getClassLoader());
final Constructor<?>... | java | @Pure
public static <C extends Capacity> C createSkillDelegator(Skill originalSkill, Class<C> capacity, AgentTrait capacityCaller)
throws Exception {
final String name = capacity.getName() + CAPACITY_WRAPPER_NAME;
final Class<?> type = Class.forName(name, true, capacity.getClassLoader());
final Constructor<?>... | [
"@",
"Pure",
"public",
"static",
"<",
"C",
"extends",
"Capacity",
">",
"C",
"createSkillDelegator",
"(",
"Skill",
"originalSkill",
",",
"Class",
"<",
"C",
">",
"capacity",
",",
"AgentTrait",
"capacityCaller",
")",
"throws",
"Exception",
"{",
"final",
"String",... | Create a delegator for the given skill.
<p>The delegator is wrapping the original skill in order to set the value of the caller
that will be replied by {@link #getCaller()}. The associated caller is given as argument.
<p>The delegator is an instance of an specific inner type, sub-type of {@link Capacity.ContextAwareC... | [
"Create",
"a",
"delegator",
"for",
"the",
"given",
"skill",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/Capacities.java#L87-L94 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/Capacities.java | Capacities.createSkillDelegatorIfPossible | @Pure
public static <C extends Capacity> C createSkillDelegatorIfPossible(Skill originalSkill, Class<C> capacity, AgentTrait capacityCaller)
throws ClassCastException {
try {
return Capacities.createSkillDelegator(originalSkill, capacity, capacityCaller);
} catch (Exception e) {
return capacity.cast(origi... | java | @Pure
public static <C extends Capacity> C createSkillDelegatorIfPossible(Skill originalSkill, Class<C> capacity, AgentTrait capacityCaller)
throws ClassCastException {
try {
return Capacities.createSkillDelegator(originalSkill, capacity, capacityCaller);
} catch (Exception e) {
return capacity.cast(origi... | [
"@",
"Pure",
"public",
"static",
"<",
"C",
"extends",
"Capacity",
">",
"C",
"createSkillDelegatorIfPossible",
"(",
"Skill",
"originalSkill",
",",
"Class",
"<",
"C",
">",
"capacity",
",",
"AgentTrait",
"capacityCaller",
")",
"throws",
"ClassCastException",
"{",
"... | Create a delegator for the given skill when it is possible.
<p>The delegator is wrapping the original skill in order to set the value of the caller
that will be replied by {@link #getCaller()}. The associated caller is given as argument.
<p>The delegator is an instance of an specific inner type, sub-type of {@link Ca... | [
"Create",
"a",
"delegator",
"for",
"the",
"given",
"skill",
"when",
"it",
"is",
"possible",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/Capacities.java#L122-L130 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/appenders/AbstractSourceAppender.java | AbstractSourceAppender.build | protected void build(EObject object, ISourceAppender appender) throws IOException {
final IJvmTypeProvider provider = getTypeResolutionContext();
if (provider != null) {
final Map<Key<?>, Binding<?>> bindings = this.originalInjector.getBindings();
Injector localInjector = CodeBuilderFactory.createOverridingIn... | java | protected void build(EObject object, ISourceAppender appender) throws IOException {
final IJvmTypeProvider provider = getTypeResolutionContext();
if (provider != null) {
final Map<Key<?>, Binding<?>> bindings = this.originalInjector.getBindings();
Injector localInjector = CodeBuilderFactory.createOverridingIn... | [
"protected",
"void",
"build",
"(",
"EObject",
"object",
",",
"ISourceAppender",
"appender",
")",
"throws",
"IOException",
"{",
"final",
"IJvmTypeProvider",
"provider",
"=",
"getTypeResolutionContext",
"(",
")",
";",
"if",
"(",
"provider",
"!=",
"null",
")",
"{",... | Build the source code and put it into the given appender.
@param the object to serialize
@param appender the object that permits to create the source code.
@param context the context for type resolution. | [
"Build",
"the",
"source",
"code",
"and",
"put",
"it",
"into",
"the",
"given",
"appender",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/appenders/AbstractSourceAppender.java#L100-L125 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/controlflow/ExtendedSARLEarlyExitComputer.java | ExtendedSARLEarlyExitComputer.isEarlyExitSARLStatement | protected boolean isEarlyExitSARLStatement(XExpression expression) {
if (expression instanceof XAbstractFeatureCall) {
// Do not call expression.getFeature() since the feature may be unresolved.
// The type resolution at this point causes exceptions in the reentrant type resolver.
// The second parameter (fa... | java | protected boolean isEarlyExitSARLStatement(XExpression expression) {
if (expression instanceof XAbstractFeatureCall) {
// Do not call expression.getFeature() since the feature may be unresolved.
// The type resolution at this point causes exceptions in the reentrant type resolver.
// The second parameter (fa... | [
"protected",
"boolean",
"isEarlyExitSARLStatement",
"(",
"XExpression",
"expression",
")",
"{",
"if",
"(",
"expression",
"instanceof",
"XAbstractFeatureCall",
")",
"{",
"// Do not call expression.getFeature() since the feature may be unresolved.",
"// The type resolution at this poin... | Replies if the given expression is a early-exit SARL statement.
@param expression the expression to test.
@return <code>true</code> if the given expression is a SARL early-exit
statement, <code>false</code> otherwise.
@see ISarlEarlyExitComputer#isEarlyExitAnnotatedElement(Object) | [
"Replies",
"if",
"the",
"given",
"expression",
"is",
"a",
"early",
"-",
"exit",
"SARL",
"statement",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/controlflow/ExtendedSARLEarlyExitComputer.java#L68-L79 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/TypeParameterBuilderImpl.java | TypeParameterBuilderImpl.addUpperConstraint | public void addUpperConstraint(String type) {
final JvmUpperBound constraint = this.jvmTypesFactory.createJvmUpperBound();
constraint.setTypeReference(newTypeRef(this.context, type));
getJvmTypeParameter().getConstraints().add(constraint);
} | java | public void addUpperConstraint(String type) {
final JvmUpperBound constraint = this.jvmTypesFactory.createJvmUpperBound();
constraint.setTypeReference(newTypeRef(this.context, type));
getJvmTypeParameter().getConstraints().add(constraint);
} | [
"public",
"void",
"addUpperConstraint",
"(",
"String",
"type",
")",
"{",
"final",
"JvmUpperBound",
"constraint",
"=",
"this",
".",
"jvmTypesFactory",
".",
"createJvmUpperBound",
"(",
")",
";",
"constraint",
".",
"setTypeReference",
"(",
"newTypeRef",
"(",
"this",
... | Add upper type bounds.
@param type the type. | [
"Add",
"upper",
"type",
"bounds",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/TypeParameterBuilderImpl.java#L88-L92 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/TypeParameterBuilderImpl.java | TypeParameterBuilderImpl.addLowerConstraint | public void addLowerConstraint(String type) {
final JvmLowerBound constraint = this.jvmTypesFactory.createJvmLowerBound();
constraint.setTypeReference(newTypeRef(this.context, type));
getJvmTypeParameter().getConstraints().add(constraint);
} | java | public void addLowerConstraint(String type) {
final JvmLowerBound constraint = this.jvmTypesFactory.createJvmLowerBound();
constraint.setTypeReference(newTypeRef(this.context, type));
getJvmTypeParameter().getConstraints().add(constraint);
} | [
"public",
"void",
"addLowerConstraint",
"(",
"String",
"type",
")",
"{",
"final",
"JvmLowerBound",
"constraint",
"=",
"this",
".",
"jvmTypesFactory",
".",
"createJvmLowerBound",
"(",
")",
";",
"constraint",
".",
"setTypeReference",
"(",
"newTypeRef",
"(",
"this",
... | Add lower type bounds.
@param type the type. | [
"Add",
"lower",
"type",
"bounds",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/TypeParameterBuilderImpl.java#L97-L101 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java | SARLEclipsePlugin.getImageDescriptor | public ImageDescriptor getImageDescriptor(String imagePath) {
ImageDescriptor descriptor = getImageRegistry().getDescriptor(imagePath);
if (descriptor == null) {
descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(SARLEclipsePlugin.PLUGIN_ID, imagePath);
if (descriptor != null) {
getImageRegistry().pu... | java | public ImageDescriptor getImageDescriptor(String imagePath) {
ImageDescriptor descriptor = getImageRegistry().getDescriptor(imagePath);
if (descriptor == null) {
descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(SARLEclipsePlugin.PLUGIN_ID, imagePath);
if (descriptor != null) {
getImageRegistry().pu... | [
"public",
"ImageDescriptor",
"getImageDescriptor",
"(",
"String",
"imagePath",
")",
"{",
"ImageDescriptor",
"descriptor",
"=",
"getImageRegistry",
"(",
")",
".",
"getDescriptor",
"(",
"imagePath",
")",
";",
"if",
"(",
"descriptor",
"==",
"null",
")",
"{",
"descr... | Replies the image descriptor for the given image path.
@param imagePath path of the image.
@return the image descriptor. | [
"Replies",
"the",
"image",
"descriptor",
"for",
"the",
"given",
"image",
"path",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java#L130-L139 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java | SARLEclipsePlugin.createMultiStatus | @SuppressWarnings("static-method")
public IStatus createMultiStatus(Iterable<? extends IStatus> status) {
final IStatus max = findMax(status);
final MultiStatus multiStatus;
if (max == null) {
multiStatus = new MultiStatus(PLUGIN_ID, 0, null, null);
} else {
multiStatus = new MultiStatus(PLUGIN_ID, 0, ma... | java | @SuppressWarnings("static-method")
public IStatus createMultiStatus(Iterable<? extends IStatus> status) {
final IStatus max = findMax(status);
final MultiStatus multiStatus;
if (max == null) {
multiStatus = new MultiStatus(PLUGIN_ID, 0, null, null);
} else {
multiStatus = new MultiStatus(PLUGIN_ID, 0, ma... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"public",
"IStatus",
"createMultiStatus",
"(",
"Iterable",
"<",
"?",
"extends",
"IStatus",
">",
"status",
")",
"{",
"final",
"IStatus",
"max",
"=",
"findMax",
"(",
"status",
")",
";",
"final",
"MultiStatu... | Create a multistatus.
@param status the status to put in the same status instance.
@return the status. | [
"Create",
"a",
"multistatus",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java#L256-L269 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java | SARLEclipsePlugin.logErrorMessage | public void logErrorMessage(String message) {
getILog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, null));
} | java | public void logErrorMessage(String message) {
getILog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, null));
} | [
"public",
"void",
"logErrorMessage",
"(",
"String",
"message",
")",
"{",
"getILog",
"(",
")",
".",
"log",
"(",
"new",
"Status",
"(",
"IStatus",
".",
"ERROR",
",",
"PLUGIN_ID",
",",
"message",
",",
"null",
")",
")",
";",
"}"
] | Logs an internal error with the specified message.
@param message the error message to log | [
"Logs",
"an",
"internal",
"error",
"with",
"the",
"specified",
"message",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java#L286-L288 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java | SARLEclipsePlugin.logDebugMessage | @SuppressWarnings({"static-method", "checkstyle:regexp"})
public void logDebugMessage(String message, Throwable cause) {
Debug.println(message);
if (cause != null) {
Debug.printStackTrace(cause);
}
} | java | @SuppressWarnings({"static-method", "checkstyle:regexp"})
public void logDebugMessage(String message, Throwable cause) {
Debug.println(message);
if (cause != null) {
Debug.printStackTrace(cause);
}
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"static-method\"",
",",
"\"checkstyle:regexp\"",
"}",
")",
"public",
"void",
"logDebugMessage",
"(",
"String",
"message",
",",
"Throwable",
"cause",
")",
"{",
"Debug",
".",
"println",
"(",
"message",
")",
";",
"if",
"(",
... | Logs an internal debug message with the specified message.
@param message the debug message to log
@param cause the cause of the message log. | [
"Logs",
"an",
"internal",
"debug",
"message",
"with",
"the",
"specified",
"message",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java#L316-L322 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java | SARLEclipsePlugin.savePreferences | public void savePreferences() {
final IEclipsePreferences prefs = getPreferences();
try {
prefs.flush();
} catch (BackingStoreException e) {
getILog().log(createStatus(IStatus.ERROR, e));
}
} | java | public void savePreferences() {
final IEclipsePreferences prefs = getPreferences();
try {
prefs.flush();
} catch (BackingStoreException e) {
getILog().log(createStatus(IStatus.ERROR, e));
}
} | [
"public",
"void",
"savePreferences",
"(",
")",
"{",
"final",
"IEclipsePreferences",
"prefs",
"=",
"getPreferences",
"(",
")",
";",
"try",
"{",
"prefs",
".",
"flush",
"(",
")",
";",
"}",
"catch",
"(",
"BackingStoreException",
"e",
")",
"{",
"getILog",
"(",
... | Saves the preferences for the plug-in. | [
"Saves",
"the",
"preferences",
"for",
"the",
"plug",
"-",
"in",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java#L356-L363 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java | SARLEclipsePlugin.openError | public void openError(Shell shell, String title, String message, Throwable exception) {
final Throwable ex = (exception != null) ? Throwables.getRootCause(exception) : null;
if (ex != null) {
log(ex);
final IStatus status = createStatus(IStatus.ERROR, message, ex);
ErrorDialog.openError(shell, title, messa... | java | public void openError(Shell shell, String title, String message, Throwable exception) {
final Throwable ex = (exception != null) ? Throwables.getRootCause(exception) : null;
if (ex != null) {
log(ex);
final IStatus status = createStatus(IStatus.ERROR, message, ex);
ErrorDialog.openError(shell, title, messa... | [
"public",
"void",
"openError",
"(",
"Shell",
"shell",
",",
"String",
"title",
",",
"String",
"message",
",",
"Throwable",
"exception",
")",
"{",
"final",
"Throwable",
"ex",
"=",
"(",
"exception",
"!=",
"null",
")",
"?",
"Throwables",
".",
"getRootCause",
"... | Display an error dialog and log the error.
@param shell the parent container.
@param title the title of the dialog box.
@param message the message to display into the dialog box.
@param exception the exception to be logged.
@since 0.6
@see #log(Throwable) | [
"Display",
"an",
"error",
"dialog",
"and",
"log",
"the",
"error",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java#L375-L384 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractSuperTypeSelectionDialog.java | AbstractSuperTypeSelectionDialog.createSearchScope | public static IJavaSearchScope createSearchScope(IJavaProject project, Class<?> type, boolean onlySubTypes) {
try {
final IType superType = project.findType(type.getName());
return SearchEngine.createStrictHierarchyScope(
project,
superType,
// only sub types
onlySubTypes,
// include th... | java | public static IJavaSearchScope createSearchScope(IJavaProject project, Class<?> type, boolean onlySubTypes) {
try {
final IType superType = project.findType(type.getName());
return SearchEngine.createStrictHierarchyScope(
project,
superType,
// only sub types
onlySubTypes,
// include th... | [
"public",
"static",
"IJavaSearchScope",
"createSearchScope",
"(",
"IJavaProject",
"project",
",",
"Class",
"<",
"?",
">",
"type",
",",
"boolean",
"onlySubTypes",
")",
"{",
"try",
"{",
"final",
"IType",
"superType",
"=",
"project",
".",
"findType",
"(",
"type",... | Creates a searching scope including only one project.
@param project the scope of the search.
@param type the expected super type.
@param onlySubTypes indicates if only the subtypes of the given types are allowed. If
<code>false</code>, the super type is allowed too.
@return the search scope. | [
"Creates",
"a",
"searching",
"scope",
"including",
"only",
"one",
"project",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractSuperTypeSelectionDialog.java#L99-L114 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractSuperTypeSelectionDialog.java | AbstractSuperTypeSelectionDialog.fillWizardPageWithSelectedTypes | private void fillWizardPageWithSelectedTypes() {
final StructuredSelection selection = getSelectedItems();
if (selection == null) {
return;
}
for (final Iterator<?> iter = selection.iterator(); iter.hasNext();) {
final Object obj = iter.next();
if (obj instanceof TypeNameMatch) {
accessedHistoryIte... | java | private void fillWizardPageWithSelectedTypes() {
final StructuredSelection selection = getSelectedItems();
if (selection == null) {
return;
}
for (final Iterator<?> iter = selection.iterator(); iter.hasNext();) {
final Object obj = iter.next();
if (obj instanceof TypeNameMatch) {
accessedHistoryIte... | [
"private",
"void",
"fillWizardPageWithSelectedTypes",
"(",
")",
"{",
"final",
"StructuredSelection",
"selection",
"=",
"getSelectedItems",
"(",
")",
";",
"if",
"(",
"selection",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
"final",
"Iterator",
"<",
... | Adds selected interfaces to the list. | [
"Adds",
"selected",
"interfaces",
"to",
"the",
"list",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractSuperTypeSelectionDialog.java#L190-L213 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/cast/CastScopeSession.java | CastScopeSession.createCastOperatorScope | protected IScope createCastOperatorScope(EObject context, EReference reference, IResolvedTypes resolvedTypes) {
if (!(context instanceof SarlCastedExpression)) {
return IScope.NULLSCOPE;
}
final SarlCastedExpression call = (SarlCastedExpression) context;
final XExpression receiver = call.getTarget();
if (r... | java | protected IScope createCastOperatorScope(EObject context, EReference reference, IResolvedTypes resolvedTypes) {
if (!(context instanceof SarlCastedExpression)) {
return IScope.NULLSCOPE;
}
final SarlCastedExpression call = (SarlCastedExpression) context;
final XExpression receiver = call.getTarget();
if (r... | [
"protected",
"IScope",
"createCastOperatorScope",
"(",
"EObject",
"context",
",",
"EReference",
"reference",
",",
"IResolvedTypes",
"resolvedTypes",
")",
"{",
"if",
"(",
"!",
"(",
"context",
"instanceof",
"SarlCastedExpression",
")",
")",
"{",
"return",
"IScope",
... | create a scope for cast operator.
@param context the context.
@param reference the reference to the internal feature.
@param resolvedTypes the resolved types.
@return the scope. | [
"create",
"a",
"scope",
"for",
"cast",
"operator",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/cast/CastScopeSession.java#L78-L88 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/BlockExpressionBuilderImpl.java | BlockExpressionBuilderImpl.eInit | public void eInit(IJvmTypeProvider context) {
setTypeResolutionContext(context);
if (this.block == null) {
this.block = XbaseFactory.eINSTANCE.createXBlockExpression();
}
} | java | public void eInit(IJvmTypeProvider context) {
setTypeResolutionContext(context);
if (this.block == null) {
this.block = XbaseFactory.eINSTANCE.createXBlockExpression();
}
} | [
"public",
"void",
"eInit",
"(",
"IJvmTypeProvider",
"context",
")",
"{",
"setTypeResolutionContext",
"(",
"context",
")",
";",
"if",
"(",
"this",
".",
"block",
"==",
"null",
")",
"{",
"this",
".",
"block",
"=",
"XbaseFactory",
".",
"eINSTANCE",
".",
"creat... | Create the XBlockExpression. | [
"Create",
"the",
"XBlockExpression",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/BlockExpressionBuilderImpl.java#L66-L71 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/BlockExpressionBuilderImpl.java | BlockExpressionBuilderImpl.getAutoGeneratedActionString | @Pure
public String getAutoGeneratedActionString(Resource resource) {
TaskTags tags = getTaskTagProvider().getTaskTags(resource);
String taskTag;
if (tags != null && tags.getTaskTags() != null && !tags.getTaskTags().isEmpty()) {
taskTag = tags.getTaskTags().get(0).getName();
} else {
taskTag = "TODO";
... | java | @Pure
public String getAutoGeneratedActionString(Resource resource) {
TaskTags tags = getTaskTagProvider().getTaskTags(resource);
String taskTag;
if (tags != null && tags.getTaskTags() != null && !tags.getTaskTags().isEmpty()) {
taskTag = tags.getTaskTags().get(0).getName();
} else {
taskTag = "TODO";
... | [
"@",
"Pure",
"public",
"String",
"getAutoGeneratedActionString",
"(",
"Resource",
"resource",
")",
"{",
"TaskTags",
"tags",
"=",
"getTaskTagProvider",
"(",
")",
".",
"getTaskTags",
"(",
"resource",
")",
";",
"String",
"taskTag",
";",
"if",
"(",
"tags",
"!=",
... | Replies the string for "auto-generated" comments.
@param resource the resource for which the comment must be determined.
@return the comment text. | [
"Replies",
"the",
"string",
"for",
"auto",
"-",
"generated",
"comments",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/BlockExpressionBuilderImpl.java#L85-L95 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/BlockExpressionBuilderImpl.java | BlockExpressionBuilderImpl.addExpression | public IExpressionBuilder addExpression() {
final IExpressionBuilder builder = this.expressionProvider.get();
builder.eInit(getXBlockExpression(), new Procedures.Procedure1<XExpression>() {
private int index = -1;
public void apply(XExpression it) {
if (this.index >= 0) {
getXBlockExpression(... | java | public IExpressionBuilder addExpression() {
final IExpressionBuilder builder = this.expressionProvider.get();
builder.eInit(getXBlockExpression(), new Procedures.Procedure1<XExpression>() {
private int index = -1;
public void apply(XExpression it) {
if (this.index >= 0) {
getXBlockExpression(... | [
"public",
"IExpressionBuilder",
"addExpression",
"(",
")",
"{",
"final",
"IExpressionBuilder",
"builder",
"=",
"this",
".",
"expressionProvider",
".",
"get",
"(",
")",
";",
"builder",
".",
"eInit",
"(",
"getXBlockExpression",
"(",
")",
",",
"new",
"Procedures",
... | Add an expression inside the block.
@return the expression builder. | [
"Add",
"an",
"expression",
"inside",
"the",
"block",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/BlockExpressionBuilderImpl.java#L139-L153 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java | FixedFatJarExportPage.handleAntScriptBrowseButtonPressed | private void handleAntScriptBrowseButtonPressed() {
FileDialog dialog= new FileDialog(getContainer().getShell(), SWT.SAVE);
dialog.setFilterExtensions(new String[] { "*." + ANTSCRIPT_EXTENSION }); //$NON-NLS-1$
String currentSourceString= getAntScriptValue();
int lastSeparatorIndex= currentSourceString.lastInd... | java | private void handleAntScriptBrowseButtonPressed() {
FileDialog dialog= new FileDialog(getContainer().getShell(), SWT.SAVE);
dialog.setFilterExtensions(new String[] { "*." + ANTSCRIPT_EXTENSION }); //$NON-NLS-1$
String currentSourceString= getAntScriptValue();
int lastSeparatorIndex= currentSourceString.lastInd... | [
"private",
"void",
"handleAntScriptBrowseButtonPressed",
"(",
")",
"{",
"FileDialog",
"dialog",
"=",
"new",
"FileDialog",
"(",
"getContainer",
"(",
")",
".",
"getShell",
"(",
")",
",",
"SWT",
".",
"SAVE",
")",
";",
"dialog",
".",
"setFilterExtensions",
"(",
... | Open an appropriate ant script browser so that the user can specify a source
to import from | [
"Open",
"an",
"appropriate",
"ant",
"script",
"browser",
"so",
"that",
"the",
"user",
"can",
"specify",
"a",
"source",
"to",
"import",
"from"
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java#L279-L292 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java | FixedFatJarExportPage.getAntScriptValue | private String getAntScriptValue() {
String antScriptText= fAntScriptNamesCombo.getText().trim();
if (antScriptText.indexOf('.') < 0)
antScriptText+= "." + ANTSCRIPT_EXTENSION; //$NON-NLS-1$
return antScriptText;
} | java | private String getAntScriptValue() {
String antScriptText= fAntScriptNamesCombo.getText().trim();
if (antScriptText.indexOf('.') < 0)
antScriptText+= "." + ANTSCRIPT_EXTENSION; //$NON-NLS-1$
return antScriptText;
} | [
"private",
"String",
"getAntScriptValue",
"(",
")",
"{",
"String",
"antScriptText",
"=",
"fAntScriptNamesCombo",
".",
"getText",
"(",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"antScriptText",
".",
"indexOf",
"(",
"'",
"'",
")",
"<",
"0",
")",
"antScri... | Answer the contents of the ant script specification widget. If this
value does not have the required suffix then add it first.
@return java.lang.String | [
"Answer",
"the",
"contents",
"of",
"the",
"ant",
"script",
"specification",
"widget",
".",
"If",
"this",
"value",
"does",
"not",
"have",
"the",
"required",
"suffix",
"then",
"add",
"it",
"first",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java#L300-L305 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java | FixedFatJarExportPage.createLabel | protected Label createLabel(Composite parent, String text, boolean bold) {
Label label= new Label(parent, SWT.NONE);
if (bold)
label.setFont(JFaceResources.getBannerFont());
label.setText(text);
GridData gridData= new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
label.setLayoutData(gridData);
retur... | java | protected Label createLabel(Composite parent, String text, boolean bold) {
Label label= new Label(parent, SWT.NONE);
if (bold)
label.setFont(JFaceResources.getBannerFont());
label.setText(text);
GridData gridData= new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
label.setLayoutData(gridData);
retur... | [
"protected",
"Label",
"createLabel",
"(",
"Composite",
"parent",
",",
"String",
"text",
",",
"boolean",
"bold",
")",
"{",
"Label",
"label",
"=",
"new",
"Label",
"(",
"parent",
",",
"SWT",
".",
"NONE",
")",
";",
"if",
"(",
"bold",
")",
"label",
".",
"... | Creates a new label with an optional bold font.
@param parent the parent control
@param text the label text
@param bold bold or not
@return the new label control | [
"Creates",
"a",
"new",
"label",
"with",
"an",
"optional",
"bold",
"font",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java#L315-L323 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java | FixedFatJarExportPage.createLibraryHandlingGroup | protected void createLibraryHandlingGroup(Composite parent) {
fLibraryHandlingGroup= new Composite(parent, SWT.NONE);
GridLayout layout= new GridLayout();
fLibraryHandlingGroup.setLayout(layout);
fLibraryHandlingGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL | Gri... | java | protected void createLibraryHandlingGroup(Composite parent) {
fLibraryHandlingGroup= new Composite(parent, SWT.NONE);
GridLayout layout= new GridLayout();
fLibraryHandlingGroup.setLayout(layout);
fLibraryHandlingGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL | Gri... | [
"protected",
"void",
"createLibraryHandlingGroup",
"(",
"Composite",
"parent",
")",
"{",
"fLibraryHandlingGroup",
"=",
"new",
"Composite",
"(",
"parent",
",",
"SWT",
".",
"NONE",
")",
";",
"GridLayout",
"layout",
"=",
"new",
"GridLayout",
"(",
")",
";",
"fLibr... | Create the export options specification widgets.
@param parent org.eclipse.swt.widgets.Composite | [
"Create",
"the",
"export",
"options",
"specification",
"widgets",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java#L330-L373 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java | FixedFatJarExportPage.updateModel | @Override
protected void updateModel() {
super.updateModel();
String comboText= fAntScriptNamesCombo.getText();
IPath path= Path.fromOSString(comboText);
if (path.segmentCount() > 0 && ensureAntScriptFileIsValid(path.toFile()) && path.getFileExtension() == null)
path= path.addFileExtension(ANTSCRIPT_EXTENS... | java | @Override
protected void updateModel() {
super.updateModel();
String comboText= fAntScriptNamesCombo.getText();
IPath path= Path.fromOSString(comboText);
if (path.segmentCount() > 0 && ensureAntScriptFileIsValid(path.toFile()) && path.getFileExtension() == null)
path= path.addFileExtension(ANTSCRIPT_EXTENS... | [
"@",
"Override",
"protected",
"void",
"updateModel",
"(",
")",
"{",
"super",
".",
"updateModel",
"(",
")",
";",
"String",
"comboText",
"=",
"fAntScriptNamesCombo",
".",
"getText",
"(",
")",
";",
"IPath",
"path",
"=",
"Path",
".",
"fromOSString",
"(",
"comb... | Stores the widget values in the JAR package. | [
"Stores",
"the",
"widget",
"values",
"in",
"the",
"JAR",
"package",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java#L397-L407 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java | FixedFatJarExportPage.getAbsoluteLocation | private IPath getAbsoluteLocation(IPath location) {
if (location.isAbsolute())
return location;
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
if (location.segmentCount() >= 2 && !"..".equals(location.segment(0))) { //$NON-NLS-1$
IFile file= root.getFile(location);
IPath absolutePath= fi... | java | private IPath getAbsoluteLocation(IPath location) {
if (location.isAbsolute())
return location;
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
if (location.segmentCount() >= 2 && !"..".equals(location.segment(0))) { //$NON-NLS-1$
IFile file= root.getFile(location);
IPath absolutePath= fi... | [
"private",
"IPath",
"getAbsoluteLocation",
"(",
"IPath",
"location",
")",
"{",
"if",
"(",
"location",
".",
"isAbsolute",
"(",
")",
")",
"return",
"location",
";",
"IWorkspaceRoot",
"root",
"=",
"ResourcesPlugin",
".",
"getWorkspace",
"(",
")",
".",
"getRoot",
... | Gets the absolute location relative to the workspace.
@param location the location
@return the absolute path for the location of the file
@since 3.8 | [
"Gets",
"the",
"absolute",
"location",
"relative",
"to",
"the",
"workspace",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java#L472-L488 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java | FixedFatJarExportPage.ensureAntScriptFileIsValid | private boolean ensureAntScriptFileIsValid(File antScriptFile) {
if (antScriptFile.exists() && antScriptFile.isDirectory() && fAntScriptNamesCombo.getText().length() > 0) {
setErrorMessage(FatJarPackagerMessages.FatJarPackageWizardPage_error_antScriptLocationIsDir);
fAntScriptNamesCombo.setFocus();
return fa... | java | private boolean ensureAntScriptFileIsValid(File antScriptFile) {
if (antScriptFile.exists() && antScriptFile.isDirectory() && fAntScriptNamesCombo.getText().length() > 0) {
setErrorMessage(FatJarPackagerMessages.FatJarPackageWizardPage_error_antScriptLocationIsDir);
fAntScriptNamesCombo.setFocus();
return fa... | [
"private",
"boolean",
"ensureAntScriptFileIsValid",
"(",
"File",
"antScriptFile",
")",
"{",
"if",
"(",
"antScriptFile",
".",
"exists",
"(",
")",
"&&",
"antScriptFile",
".",
"isDirectory",
"(",
")",
"&&",
"fAntScriptNamesCombo",
".",
"getText",
"(",
")",
".",
"... | Returns a boolean indicating whether the passed File handle is is valid and available for
use.
@param antScriptFile the ant script
@return boolean | [
"Returns",
"a",
"boolean",
"indicating",
"whether",
"the",
"passed",
"File",
"handle",
"is",
"is",
"valid",
"and",
"available",
"for",
"use",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java#L497-L511 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java | FixedFatJarExportPage.getPathLabel | protected static String getPathLabel(IPath path, boolean isOSPath) {
String label;
if (isOSPath) {
label= path.toOSString();
} else {
label= path.makeRelative().toString();
}
return label;
} | java | protected static String getPathLabel(IPath path, boolean isOSPath) {
String label;
if (isOSPath) {
label= path.toOSString();
} else {
label= path.makeRelative().toString();
}
return label;
} | [
"protected",
"static",
"String",
"getPathLabel",
"(",
"IPath",
"path",
",",
"boolean",
"isOSPath",
")",
"{",
"String",
"label",
";",
"if",
"(",
"isOSPath",
")",
"{",
"label",
"=",
"path",
".",
"toOSString",
"(",
")",
";",
"}",
"else",
"{",
"label",
"="... | Returns the label of a path.
@param path the path
@param isOSPath if <code>true</code>, the path represents an OS path, if <code>false</code> it is a workspace path.
@return the label of the path to be used in the UI. | [
"Returns",
"the",
"label",
"of",
"a",
"path",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java#L711-L719 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.