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.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.generateJvmElements | protected void generateJvmElements(ResourceSet resourceSet, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_21);
getLogger().info(Messages.SarlBatchCompiler_21);
final List<Resource> originalResources = resourceSet.getResources();
final List<Resource> toBeRes... | java | protected void generateJvmElements(ResourceSet resourceSet, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_21);
getLogger().info(Messages.SarlBatchCompiler_21);
final List<Resource> originalResources = resourceSet.getResources();
final List<Resource> toBeRes... | [
"protected",
"void",
"generateJvmElements",
"(",
"ResourceSet",
"resourceSet",
",",
"IProgressMonitor",
"progress",
")",
"{",
"assert",
"progress",
"!=",
"null",
";",
"progress",
".",
"subTask",
"(",
"Messages",
".",
"SarlBatchCompiler_21",
")",
";",
"getLogger",
... | Generate the JVM model elements.
@param progress monitor of the progress of the compilation.
@param resourceSet the container of the scripts. | [
"Generate",
"the",
"JVM",
"model",
"elements",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1570-L1595 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.validate | @SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity", "checkstyle:nestedifdepth"})
protected List<Issue> validate(ResourceSet resourceSet, Collection<Resource> validResources, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_38);
getL... | java | @SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity", "checkstyle:nestedifdepth"})
protected List<Issue> validate(ResourceSet resourceSet, Collection<Resource> validResources, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_38);
getL... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"checkstyle:cyclomaticcomplexity\"",
",",
"\"checkstyle:npathcomplexity\"",
",",
"\"checkstyle:nestedifdepth\"",
"}",
")",
"protected",
"List",
"<",
"Issue",
">",
"validate",
"(",
"ResourceSet",
"resourceSet",
",",
"Collection",
"<",
... | Generate the JVM model elements, and validate generated elements.
@param resourceSet the container of the scripts.
@param validResources will be filled by this function with the collection of resources that was successfully validated.
@param progress monitor of the progress of the compilation.
@return the list of the ... | [
"Generate",
"the",
"JVM",
"model",
"elements",
"and",
"validate",
"generated",
"elements",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1604-L1656 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.isSourceFile | @SuppressWarnings("static-method")
protected boolean isSourceFile(Resource resource) {
if (resource instanceof BatchLinkableResource) {
return !((BatchLinkableResource) resource).isLoadedFromStorage();
}
return false;
} | java | @SuppressWarnings("static-method")
protected boolean isSourceFile(Resource resource) {
if (resource instanceof BatchLinkableResource) {
return !((BatchLinkableResource) resource).isLoadedFromStorage();
}
return false;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"boolean",
"isSourceFile",
"(",
"Resource",
"resource",
")",
"{",
"if",
"(",
"resource",
"instanceof",
"BatchLinkableResource",
")",
"{",
"return",
"!",
"(",
"(",
"BatchLinkableResource",
")",
"r... | Replies if the given resource is a script.
@param resource the resource to test.
@return <code>true</code> if the given resource is a script. | [
"Replies",
"if",
"the",
"given",
"resource",
"is",
"a",
"script",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1663-L1669 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.preCompileStubs | protected boolean preCompileStubs(File sourceDirectory, File classDirectory, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_50);
return runJavaCompiler(classDirectory, Collections.singletonList(sourceDirectory), getClassPath(),
false, false, progress);
} | java | protected boolean preCompileStubs(File sourceDirectory, File classDirectory, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_50);
return runJavaCompiler(classDirectory, Collections.singletonList(sourceDirectory), getClassPath(),
false, false, progress);
} | [
"protected",
"boolean",
"preCompileStubs",
"(",
"File",
"sourceDirectory",
",",
"File",
"classDirectory",
",",
"IProgressMonitor",
"progress",
")",
"{",
"assert",
"progress",
"!=",
"null",
";",
"progress",
".",
"subTask",
"(",
"Messages",
".",
"SarlBatchCompiler_50"... | Compile the stub files before the compilation of the project's files.
@param sourceDirectory the source directory where stubs are stored.
@param classDirectory the output directory, where stub binary files should be generated.
@param progress monitor of the progress of the compilation.
@return the success status. Repl... | [
"Compile",
"the",
"stub",
"files",
"before",
"the",
"compilation",
"of",
"the",
"project",
"s",
"files",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1678-L1683 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.preCompileJava | protected boolean preCompileJava(File sourceDirectory, File classDirectory, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_51);
return runJavaCompiler(classDirectory, getSourcePaths(),
Iterables.concat(Collections.singleton(sourceDirectory), getClassPath()),
... | java | protected boolean preCompileJava(File sourceDirectory, File classDirectory, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_51);
return runJavaCompiler(classDirectory, getSourcePaths(),
Iterables.concat(Collections.singleton(sourceDirectory), getClassPath()),
... | [
"protected",
"boolean",
"preCompileJava",
"(",
"File",
"sourceDirectory",
",",
"File",
"classDirectory",
",",
"IProgressMonitor",
"progress",
")",
"{",
"assert",
"progress",
"!=",
"null",
";",
"progress",
".",
"subTask",
"(",
"Messages",
".",
"SarlBatchCompiler_51",... | Compile the java files before the compilation of the project's files.
@param sourceDirectory the source directory where java files are stored.
@param classDirectory the output directory, where binary files should be generated.
@param progress monitor of the progress of the compilation.
@return the success status. Repl... | [
"Compile",
"the",
"java",
"files",
"before",
"the",
"compilation",
"of",
"the",
"project",
"s",
"files",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1692-L1698 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.postCompileJava | protected boolean postCompileJava(IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_52);
final File classOutputPath = getClassOutputPath();
if (classOutputPath == null) {
getLogger().info(Messages.SarlBatchCompiler_24);
return true;
}
getLogger().info(Me... | java | protected boolean postCompileJava(IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_52);
final File classOutputPath = getClassOutputPath();
if (classOutputPath == null) {
getLogger().info(Messages.SarlBatchCompiler_24);
return true;
}
getLogger().info(Me... | [
"protected",
"boolean",
"postCompileJava",
"(",
"IProgressMonitor",
"progress",
")",
"{",
"assert",
"progress",
"!=",
"null",
";",
"progress",
".",
"subTask",
"(",
"Messages",
".",
"SarlBatchCompiler_52",
")",
";",
"final",
"File",
"classOutputPath",
"=",
"getClas... | Compile the java files after the compilation of the project's files.
@param progress monitor of the progress of the compilation.
@return the success status. Replies <code>false</code> if the activity is canceled. | [
"Compile",
"the",
"java",
"files",
"after",
"the",
"compilation",
"of",
"the",
"project",
"s",
"files",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1705-L1723 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.runJavaCompiler | @SuppressWarnings({ "resource" })
protected boolean runJavaCompiler(File classDirectory, Iterable<File> sourcePathDirectories,
Iterable<File> classPathEntries, boolean enableCompilerOutput,
boolean enableOptimization, IProgressMonitor progress) {
String encoding = this.encodingProvider.getDefaultEncoding();
... | java | @SuppressWarnings({ "resource" })
protected boolean runJavaCompiler(File classDirectory, Iterable<File> sourcePathDirectories,
Iterable<File> classPathEntries, boolean enableCompilerOutput,
boolean enableOptimization, IProgressMonitor progress) {
String encoding = this.encodingProvider.getDefaultEncoding();
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"resource\"",
"}",
")",
"protected",
"boolean",
"runJavaCompiler",
"(",
"File",
"classDirectory",
",",
"Iterable",
"<",
"File",
">",
"sourcePathDirectories",
",",
"Iterable",
"<",
"File",
">",
"classPathEntries",
",",
"boolean"... | Run the Java compiler.
@param classDirectory the output directory.
@param sourcePathDirectories the source directories.
@param classPathEntries classpath entries.
@param enableCompilerOutput indicates if the Java compiler output is displayed.
@param enableOptimization indicates if the Java compiler must applied optimi... | [
"Run",
"the",
"Java",
"compiler",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1747-L1781 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.createStubs | protected File createStubs(ResourceSet resourceSet, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_53);
final File outputDirectory = createTempDir(STUB_FOLDER_PREFIX);
if (progress.isCanceled()) {
return null;
}
if (getLogger().isDebugEnabled()) {
get... | java | protected File createStubs(ResourceSet resourceSet, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_53);
final File outputDirectory = createTempDir(STUB_FOLDER_PREFIX);
if (progress.isCanceled()) {
return null;
}
if (getLogger().isDebugEnabled()) {
get... | [
"protected",
"File",
"createStubs",
"(",
"ResourceSet",
"resourceSet",
",",
"IProgressMonitor",
"progress",
")",
"{",
"assert",
"progress",
"!=",
"null",
";",
"progress",
".",
"subTask",
"(",
"Messages",
".",
"SarlBatchCompiler_53",
")",
";",
"final",
"File",
"o... | Create the stubs.
@param resourceSet the input resource set.
@param progress monitor of the progress of the compilation.
@return the folder in which the stubs are located. Replies <code>null</code> if the activity is canceled. | [
"Create",
"the",
"stubs",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1833-L1860 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.loadSARLFiles | protected void loadSARLFiles(ResourceSet resourceSet, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_54);
this.encodingProvider.setDefaultEncoding(getFileEncoding());
final NameBasedFilter nameBasedFilter = new NameBasedFilter();
nameBasedFilter.setExtension(... | java | protected void loadSARLFiles(ResourceSet resourceSet, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_54);
this.encodingProvider.setDefaultEncoding(getFileEncoding());
final NameBasedFilter nameBasedFilter = new NameBasedFilter();
nameBasedFilter.setExtension(... | [
"protected",
"void",
"loadSARLFiles",
"(",
"ResourceSet",
"resourceSet",
",",
"IProgressMonitor",
"progress",
")",
"{",
"assert",
"progress",
"!=",
"null",
";",
"progress",
".",
"subTask",
"(",
"Messages",
".",
"SarlBatchCompiler_54",
")",
";",
"this",
".",
"enc... | Load the SARL files in the given resource set.
@param progress monitor of the progress of the compilation.
@param resourceSet the resource set to load from. | [
"Load",
"the",
"SARL",
"files",
"in",
"the",
"given",
"resource",
"set",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1867-L1894 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.createTempDir | protected File createTempDir(String namePrefix) {
final File tempDir = new File(getTempDirectory(), namePrefix);
cleanFolder(tempDir, ACCEPT_ALL_FILTER, true, true);
if (!tempDir.mkdirs()) {
throw new RuntimeException(MessageFormat.format(Messages.SarlBatchCompiler_8, tempDir.getAbsolutePath()));
}
this.te... | java | protected File createTempDir(String namePrefix) {
final File tempDir = new File(getTempDirectory(), namePrefix);
cleanFolder(tempDir, ACCEPT_ALL_FILTER, true, true);
if (!tempDir.mkdirs()) {
throw new RuntimeException(MessageFormat.format(Messages.SarlBatchCompiler_8, tempDir.getAbsolutePath()));
}
this.te... | [
"protected",
"File",
"createTempDir",
"(",
"String",
"namePrefix",
")",
"{",
"final",
"File",
"tempDir",
"=",
"new",
"File",
"(",
"getTempDirectory",
"(",
")",
",",
"namePrefix",
")",
";",
"cleanFolder",
"(",
"tempDir",
",",
"ACCEPT_ALL_FILTER",
",",
"true",
... | Create a temporary subdirectory inside the root temp directory.
@param namePrefix the prefix for the folder name.
@return the temp directory.
@see #getTempDirectory() | [
"Create",
"a",
"temporary",
"subdirectory",
"inside",
"the",
"root",
"temp",
"directory",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1902-L1910 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.cleanFolder | protected boolean cleanFolder(File parentFolder, FileFilter filter, boolean continueOnError,
boolean deleteParentFolder) {
try {
if (getLogger().isDebugEnabled()) {
getLogger().debug(Messages.SarlBatchCompiler_9, parentFolder.toString());
}
return Files.cleanFolder(parentFolder, null, continueOnError,... | java | protected boolean cleanFolder(File parentFolder, FileFilter filter, boolean continueOnError,
boolean deleteParentFolder) {
try {
if (getLogger().isDebugEnabled()) {
getLogger().debug(Messages.SarlBatchCompiler_9, parentFolder.toString());
}
return Files.cleanFolder(parentFolder, null, continueOnError,... | [
"protected",
"boolean",
"cleanFolder",
"(",
"File",
"parentFolder",
",",
"FileFilter",
"filter",
",",
"boolean",
"continueOnError",
",",
"boolean",
"deleteParentFolder",
")",
"{",
"try",
"{",
"if",
"(",
"getLogger",
"(",
")",
".",
"isDebugEnabled",
"(",
")",
"... | Clean the folders.
@param parentFolder the parent folder.
@param filter the file filter for the file to remove..
@param continueOnError indicates if the cleaning should continue on error.
@param deleteParentFolder indicates if the parent folder should be removed.
@return the success status. | [
"Clean",
"the",
"folders",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1920-L1930 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.checkConfiguration | protected boolean checkConfiguration(IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_55);
final File output = getOutputPath();
if (getLogger().isDebugEnabled()) {
getLogger().debug(Messages.SarlBatchCompiler_35, output);
}
if (output == null) {
reportI... | java | protected boolean checkConfiguration(IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_55);
final File output = getOutputPath();
if (getLogger().isDebugEnabled()) {
getLogger().debug(Messages.SarlBatchCompiler_35, output);
}
if (output == null) {
reportI... | [
"protected",
"boolean",
"checkConfiguration",
"(",
"IProgressMonitor",
"progress",
")",
"{",
"assert",
"progress",
"!=",
"null",
";",
"progress",
".",
"subTask",
"(",
"Messages",
".",
"SarlBatchCompiler_55",
")",
";",
"final",
"File",
"output",
"=",
"getOutputPath... | Check the compiler configuration; and logs errors.
@param progress monitor of the progress of the compilation.
@return success status. Replies <code>false</code> if the operation is canceled. | [
"Check",
"the",
"compiler",
"configuration",
";",
"and",
"logs",
"errors",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1937-L1966 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.createClassLoader | @SuppressWarnings("static-method")
protected ClassLoader createClassLoader(Iterable<File> jarsAndFolders, ClassLoader parentClassLoader) {
return new URLClassLoader(Iterables.toArray(Iterables.transform(jarsAndFolders, from -> {
try {
final URL url = from.toURI().toURL();
assert url != null;
return ur... | java | @SuppressWarnings("static-method")
protected ClassLoader createClassLoader(Iterable<File> jarsAndFolders, ClassLoader parentClassLoader) {
return new URLClassLoader(Iterables.toArray(Iterables.transform(jarsAndFolders, from -> {
try {
final URL url = from.toURI().toURL();
assert url != null;
return ur... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"ClassLoader",
"createClassLoader",
"(",
"Iterable",
"<",
"File",
">",
"jarsAndFolders",
",",
"ClassLoader",
"parentClassLoader",
")",
"{",
"return",
"new",
"URLClassLoader",
"(",
"Iterables",
".",
... | Create the project class loader.
@param jarsAndFolders the project class path.
@param parentClassLoader the parent class loader.
@return the class loader for the project. | [
"Create",
"the",
"project",
"class",
"loader",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L2231-L2242 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.destroyClassLoader | protected void destroyClassLoader(ClassLoader classLoader) {
if (classLoader instanceof Closeable) {
try {
((Closeable) classLoader).close();
} catch (Exception e) {
reportInternalWarning(Messages.SarlBatchCompiler_18, e);
}
}
} | java | protected void destroyClassLoader(ClassLoader classLoader) {
if (classLoader instanceof Closeable) {
try {
((Closeable) classLoader).close();
} catch (Exception e) {
reportInternalWarning(Messages.SarlBatchCompiler_18, e);
}
}
} | [
"protected",
"void",
"destroyClassLoader",
"(",
"ClassLoader",
"classLoader",
")",
"{",
"if",
"(",
"classLoader",
"instanceof",
"Closeable",
")",
"{",
"try",
"{",
"(",
"(",
"Closeable",
")",
"classLoader",
")",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(... | Null-safe destruction of the given class loaders.
@param classLoader the class loader to destroy. | [
"Null",
"-",
"safe",
"destruction",
"of",
"the",
"given",
"class",
"loaders",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L2248-L2256 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.setWarningSeverity | public void setWarningSeverity(String warningId, Severity severity) {
if (!Strings.isEmpty(warningId) && severity != null) {
this.issueSeverityProvider.setSeverity(warningId, severity);
}
} | java | public void setWarningSeverity(String warningId, Severity severity) {
if (!Strings.isEmpty(warningId) && severity != null) {
this.issueSeverityProvider.setSeverity(warningId, severity);
}
} | [
"public",
"void",
"setWarningSeverity",
"(",
"String",
"warningId",
",",
"Severity",
"severity",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isEmpty",
"(",
"warningId",
")",
"&&",
"severity",
"!=",
"null",
")",
"{",
"this",
".",
"issueSeverityProvider",
".",
... | Change the severity level of a warning.
@param warningId the identifier of the warning. If {@code null} or empty, this function does nothing.
@param severity the new severity. If {@code null} this function does nothing.
@since 0.5 | [
"Change",
"the",
"severity",
"level",
"of",
"a",
"warning",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L2264-L2268 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/ParticipantRepository.java | ParticipantRepository.addListener | protected EventListener addListener(ADDRESST key, EventListener value) {
synchronized (mutex()) {
return this.listeners.put(key, value);
}
} | java | protected EventListener addListener(ADDRESST key, EventListener value) {
synchronized (mutex()) {
return this.listeners.put(key, value);
}
} | [
"protected",
"EventListener",
"addListener",
"(",
"ADDRESST",
"key",
",",
"EventListener",
"value",
")",
"{",
"synchronized",
"(",
"mutex",
"(",
")",
")",
"{",
"return",
"this",
".",
"listeners",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}",
"}"
] | Add a participant with the given address in this repository.
@param key address of the participant.
@param value is the participant to map to the address.
@return the participant that was previously associated to the given address. | [
"Add",
"a",
"participant",
"with",
"the",
"given",
"address",
"in",
"this",
"repository",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/ParticipantRepository.java#L126-L130 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/ParticipantRepository.java | ParticipantRepository.getAdresses | protected SynchronizedSet<ADDRESST> getAdresses() {
final Object mutex = mutex();
synchronized (mutex) {
return Collections3.synchronizedSet(this.listeners.keySet(), mutex);
}
} | java | protected SynchronizedSet<ADDRESST> getAdresses() {
final Object mutex = mutex();
synchronized (mutex) {
return Collections3.synchronizedSet(this.listeners.keySet(), mutex);
}
} | [
"protected",
"SynchronizedSet",
"<",
"ADDRESST",
">",
"getAdresses",
"(",
")",
"{",
"final",
"Object",
"mutex",
"=",
"mutex",
"(",
")",
";",
"synchronized",
"(",
"mutex",
")",
"{",
"return",
"Collections3",
".",
"synchronizedSet",
"(",
"this",
".",
"listener... | Replies all the addresses from the inside of this repository.
@return the addresses in this repository. | [
"Replies",
"all",
"the",
"addresses",
"from",
"the",
"inside",
"of",
"this",
"repository",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/ParticipantRepository.java#L158-L163 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/ParticipantRepository.java | ParticipantRepository.getListeners | public SynchronizedCollection<EventListener> getListeners() {
final Object mutex = mutex();
synchronized (mutex) {
return Collections3.synchronizedCollection(this.listeners.values(), mutex);
}
} | java | public SynchronizedCollection<EventListener> getListeners() {
final Object mutex = mutex();
synchronized (mutex) {
return Collections3.synchronizedCollection(this.listeners.values(), mutex);
}
} | [
"public",
"SynchronizedCollection",
"<",
"EventListener",
">",
"getListeners",
"(",
")",
"{",
"final",
"Object",
"mutex",
"=",
"mutex",
"(",
")",
";",
"synchronized",
"(",
"mutex",
")",
"{",
"return",
"Collections3",
".",
"synchronizedCollection",
"(",
"this",
... | Replies all the participants from the inside of this repository.
@return the participants. | [
"Replies",
"all",
"the",
"participants",
"from",
"the",
"inside",
"of",
"this",
"repository",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/ParticipantRepository.java#L170-L175 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/ParticipantRepository.java | ParticipantRepository.listenersEntrySet | protected Set<Entry<ADDRESST, EventListener>> listenersEntrySet() {
final Object mutex = mutex();
synchronized (mutex) {
return Collections3.synchronizedSet(this.listeners.entrySet(), mutex);
}
} | java | protected Set<Entry<ADDRESST, EventListener>> listenersEntrySet() {
final Object mutex = mutex();
synchronized (mutex) {
return Collections3.synchronizedSet(this.listeners.entrySet(), mutex);
}
} | [
"protected",
"Set",
"<",
"Entry",
"<",
"ADDRESST",
",",
"EventListener",
">",
">",
"listenersEntrySet",
"(",
")",
"{",
"final",
"Object",
"mutex",
"=",
"mutex",
"(",
")",
";",
"synchronized",
"(",
"mutex",
")",
"{",
"return",
"Collections3",
".",
"synchron... | Replies the pairs of addresses and participants in this repository.
@return the pairs of addresses and participants | [
"Replies",
"the",
"pairs",
"of",
"addresses",
"and",
"participants",
"in",
"this",
"repository",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/ParticipantRepository.java#L182-L187 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/shortcuts/AbstractSarlLaunchShortcut.java | AbstractSarlLaunchShortcut.searchAndLaunch | private void searchAndLaunch(String mode, Object... scope) {
final ElementDescription element = searchAndSelect(true, scope);
if (element != null) {
try {
launch(element.projectName, element.elementName, mode);
} catch (CoreException e) {
SARLEclipsePlugin.getDefault().openError(getShell(),
io.s... | java | private void searchAndLaunch(String mode, Object... scope) {
final ElementDescription element = searchAndSelect(true, scope);
if (element != null) {
try {
launch(element.projectName, element.elementName, mode);
} catch (CoreException e) {
SARLEclipsePlugin.getDefault().openError(getShell(),
io.s... | [
"private",
"void",
"searchAndLaunch",
"(",
"String",
"mode",
",",
"Object",
"...",
"scope",
")",
"{",
"final",
"ElementDescription",
"element",
"=",
"searchAndSelect",
"(",
"true",
",",
"scope",
")",
";",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"try"... | Resolves an element type that can be launched from the given scope and launches in the
specified mode.
@param mode launch mode.
@param scope the elements to consider for an element type that can be launched. | [
"Resolves",
"an",
"element",
"type",
"that",
"can",
"be",
"launched",
"from",
"the",
"given",
"scope",
"and",
"launches",
"in",
"the",
"specified",
"mode",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/shortcuts/AbstractSarlLaunchShortcut.java#L219-L230 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/shortcuts/AbstractSarlLaunchShortcut.java | AbstractSarlLaunchShortcut.launch | protected void launch(String projectName, String fullyQualifiedName, String mode)
throws CoreException {
final List<ILaunchConfiguration> configs = getCandidates(projectName, fullyQualifiedName);
ILaunchConfiguration config = null;
final int count = configs.size();
if (count == 1) {
config = configs.get(0... | java | protected void launch(String projectName, String fullyQualifiedName, String mode)
throws CoreException {
final List<ILaunchConfiguration> configs = getCandidates(projectName, fullyQualifiedName);
ILaunchConfiguration config = null;
final int count = configs.size();
if (count == 1) {
config = configs.get(0... | [
"protected",
"void",
"launch",
"(",
"String",
"projectName",
",",
"String",
"fullyQualifiedName",
",",
"String",
"mode",
")",
"throws",
"CoreException",
"{",
"final",
"List",
"<",
"ILaunchConfiguration",
">",
"configs",
"=",
"getCandidates",
"(",
"projectName",
",... | Launches the given element type in the specified mode.
@param projectName the name of the project.
@param fullyQualifiedName the element name.
@param mode launch mode
@throws CoreException if something is going wrong. | [
"Launches",
"the",
"given",
"element",
"type",
"in",
"the",
"specified",
"mode",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/shortcuts/AbstractSarlLaunchShortcut.java#L277-L296 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/CodeBuilderFactory.java | CodeBuilderFactory.computeUnusedUri | @Pure
protected URI computeUnusedUri(ResourceSet resourceSet) {
String name = "__synthetic";
for (int i = 0; i < Integer.MAX_VALUE; ++i) {
URI syntheticUri = URI.createURI(name + i + "." + getScriptFileExtension());
if (resourceSet.getResource(syntheticUri, false) == null) {
return syntheticUri;
}
}... | java | @Pure
protected URI computeUnusedUri(ResourceSet resourceSet) {
String name = "__synthetic";
for (int i = 0; i < Integer.MAX_VALUE; ++i) {
URI syntheticUri = URI.createURI(name + i + "." + getScriptFileExtension());
if (resourceSet.getResource(syntheticUri, false) == null) {
return syntheticUri;
}
}... | [
"@",
"Pure",
"protected",
"URI",
"computeUnusedUri",
"(",
"ResourceSet",
"resourceSet",
")",
"{",
"String",
"name",
"=",
"\"__synthetic\"",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"Integer",
".",
"MAX_VALUE",
";",
"++",
"i",
")",
"{",
"UR... | Compute a unused URI for a synthetic resource.
@param resourceSet the resource set in which the resource should be located.
@return the uri. | [
"Compute",
"a",
"unused",
"URI",
"for",
"a",
"synthetic",
"resource",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/CodeBuilderFactory.java#L118-L128 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/CodeBuilderFactory.java | CodeBuilderFactory.createResource | @Pure
protected Resource createResource(ResourceSet resourceSet) {
URI uri = computeUnusedUri(resourceSet);
Resource resource = getResourceFactory().createResource(uri);
resourceSet.getResources().add(resource);
return resource;
} | java | @Pure
protected Resource createResource(ResourceSet resourceSet) {
URI uri = computeUnusedUri(resourceSet);
Resource resource = getResourceFactory().createResource(uri);
resourceSet.getResources().add(resource);
return resource;
} | [
"@",
"Pure",
"protected",
"Resource",
"createResource",
"(",
"ResourceSet",
"resourceSet",
")",
"{",
"URI",
"uri",
"=",
"computeUnusedUri",
"(",
"resourceSet",
")",
";",
"Resource",
"resource",
"=",
"getResourceFactory",
"(",
")",
".",
"createResource",
"(",
"ur... | Create a synthetic resource.
@param resourceSet the resourceSet.
@return the resource. | [
"Create",
"a",
"synthetic",
"resource",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/CodeBuilderFactory.java#L178-L184 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/CodeBuilderFactory.java | CodeBuilderFactory.getInjector | @Pure
protected Injector getInjector() {
if (this.builderInjector == null) {
ImportManager importManager = this.importManagerProvider.get();
this.builderInjector = createOverridingInjector(this.originalInjector, new CodeBuilderModule(importManager));
}
return builderInjector;
} | java | @Pure
protected Injector getInjector() {
if (this.builderInjector == null) {
ImportManager importManager = this.importManagerProvider.get();
this.builderInjector = createOverridingInjector(this.originalInjector, new CodeBuilderModule(importManager));
}
return builderInjector;
} | [
"@",
"Pure",
"protected",
"Injector",
"getInjector",
"(",
")",
"{",
"if",
"(",
"this",
".",
"builderInjector",
"==",
"null",
")",
"{",
"ImportManager",
"importManager",
"=",
"this",
".",
"importManagerProvider",
".",
"get",
"(",
")",
";",
"this",
".",
"bui... | Replies the injector.
@return the injector. | [
"Replies",
"the",
"injector",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/CodeBuilderFactory.java#L189-L196 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorUnitBuilderImpl.java | SarlBehaviorUnitBuilderImpl.getGuard | @Pure
public IExpressionBuilder getGuard() {
IExpressionBuilder exprBuilder = this.expressionProvider.get();
exprBuilder.eInit(getSarlBehaviorUnit(), new Procedures.Procedure1<XExpression>() {
public void apply(XExpression expr) {
getSarlBehaviorUnit().setGuard(expr);
}
}, getTypeResolutionContext(... | java | @Pure
public IExpressionBuilder getGuard() {
IExpressionBuilder exprBuilder = this.expressionProvider.get();
exprBuilder.eInit(getSarlBehaviorUnit(), new Procedures.Procedure1<XExpression>() {
public void apply(XExpression expr) {
getSarlBehaviorUnit().setGuard(expr);
}
}, getTypeResolutionContext(... | [
"@",
"Pure",
"public",
"IExpressionBuilder",
"getGuard",
"(",
")",
"{",
"IExpressionBuilder",
"exprBuilder",
"=",
"this",
".",
"expressionProvider",
".",
"get",
"(",
")",
";",
"exprBuilder",
".",
"eInit",
"(",
"getSarlBehaviorUnit",
"(",
")",
",",
"new",
"Proc... | Change the guard.
@param value the value of the guard. It may be <code>null</code>. | [
"Change",
"the",
"guard",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorUnitBuilderImpl.java#L117-L126 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorUnitBuilderImpl.java | SarlBehaviorUnitBuilderImpl.getExpression | public IBlockExpressionBuilder getExpression() {
IBlockExpressionBuilder block = this.blockExpressionProvider.get();
block.eInit(getTypeResolutionContext());
XBlockExpression expr = block.getXBlockExpression();
this.sarlBehaviorUnit.setExpression(expr);
return block;
} | java | public IBlockExpressionBuilder getExpression() {
IBlockExpressionBuilder block = this.blockExpressionProvider.get();
block.eInit(getTypeResolutionContext());
XBlockExpression expr = block.getXBlockExpression();
this.sarlBehaviorUnit.setExpression(expr);
return block;
} | [
"public",
"IBlockExpressionBuilder",
"getExpression",
"(",
")",
"{",
"IBlockExpressionBuilder",
"block",
"=",
"this",
".",
"blockExpressionProvider",
".",
"get",
"(",
")",
";",
"block",
".",
"eInit",
"(",
"getTypeResolutionContext",
"(",
")",
")",
";",
"XBlockExpr... | Create the block of code.
@return the block builder. | [
"Create",
"the",
"block",
"of",
"code",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorUnitBuilderImpl.java#L131-L137 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/AbstractSREInstallPage.java | AbstractSREInstallPage.validateNameAgainstOtherSREs | protected IStatus validateNameAgainstOtherSREs(String name) {
IStatus nameStatus = SARLEclipsePlugin.getDefault().createOkStatus();
if (isDuplicateName(name)) {
nameStatus = SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR,
ISREInstall.CODE_NAME,
Messages.SREInstallWizard_1);
} else {
fin... | java | protected IStatus validateNameAgainstOtherSREs(String name) {
IStatus nameStatus = SARLEclipsePlugin.getDefault().createOkStatus();
if (isDuplicateName(name)) {
nameStatus = SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR,
ISREInstall.CODE_NAME,
Messages.SREInstallWizard_1);
} else {
fin... | [
"protected",
"IStatus",
"validateNameAgainstOtherSREs",
"(",
"String",
"name",
")",
"{",
"IStatus",
"nameStatus",
"=",
"SARLEclipsePlugin",
".",
"getDefault",
"(",
")",
".",
"createOkStatus",
"(",
")",
";",
"if",
"(",
"isDuplicateName",
"(",
"name",
")",
")",
... | Replies if the name of the SRE is valid against the names of
the other SRE.
@param name the name to validate.
@return the validation status. | [
"Replies",
"if",
"the",
"name",
"of",
"the",
"SRE",
"is",
"valid",
"against",
"the",
"names",
"of",
"the",
"other",
"SRE",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/AbstractSREInstallPage.java#L119-L134 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/AbstractSREInstallPage.java | AbstractSREInstallPage.setPageStatus | protected void setPageStatus(IStatus status) {
this.status = status == null ? SARLEclipsePlugin.getDefault().createOkStatus() : status;
} | java | protected void setPageStatus(IStatus status) {
this.status = status == null ? SARLEclipsePlugin.getDefault().createOkStatus() : status;
} | [
"protected",
"void",
"setPageStatus",
"(",
"IStatus",
"status",
")",
"{",
"this",
".",
"status",
"=",
"status",
"==",
"null",
"?",
"SARLEclipsePlugin",
".",
"getDefault",
"(",
")",
".",
"createOkStatus",
"(",
")",
":",
"status",
";",
"}"
] | Change the status associated to this page.
Any previous status is overrided by the given value.
<p>You must call {@link #updatePageStatus()} after
invoking this methid.
@param status the new status. | [
"Change",
"the",
"status",
"associated",
"to",
"this",
"page",
".",
"Any",
"previous",
"status",
"is",
"overrided",
"by",
"the",
"given",
"value",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/AbstractSREInstallPage.java#L144-L146 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/AbstractSREInstallPage.java | AbstractSREInstallPage.isDuplicateName | private boolean isDuplicateName(String name) {
if (this.existingNames != null) {
final String newName = Strings.nullToEmpty(name);
for (final String existingName : this.existingNames) {
if (newName.equals(existingName)) {
return true;
}
}
}
return false;
} | java | private boolean isDuplicateName(String name) {
if (this.existingNames != null) {
final String newName = Strings.nullToEmpty(name);
for (final String existingName : this.existingNames) {
if (newName.equals(existingName)) {
return true;
}
}
}
return false;
} | [
"private",
"boolean",
"isDuplicateName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"this",
".",
"existingNames",
"!=",
"null",
")",
"{",
"final",
"String",
"newName",
"=",
"Strings",
".",
"nullToEmpty",
"(",
"name",
")",
";",
"for",
"(",
"final",
"Stri... | Returns whether the name is already in use by an existing SRE.
@param name new name.
@return whether the name is already in use. | [
"Returns",
"whether",
"the",
"name",
"is",
"already",
"in",
"use",
"by",
"an",
"existing",
"SRE",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/AbstractSREInstallPage.java#L154-L164 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/AbstractSREInstallPage.java | AbstractSREInstallPage.setExistingNames | void setExistingNames(String... names) {
this.existingNames = names;
for (int i = 0; i < this.existingNames.length; ++i) {
this.existingNames[i] = Strings.nullToEmpty(this.existingNames[i]);
}
} | java | void setExistingNames(String... names) {
this.existingNames = names;
for (int i = 0; i < this.existingNames.length; ++i) {
this.existingNames[i] = Strings.nullToEmpty(this.existingNames[i]);
}
} | [
"void",
"setExistingNames",
"(",
"String",
"...",
"names",
")",
"{",
"this",
".",
"existingNames",
"=",
"names",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"existingNames",
".",
"length",
";",
"++",
"i",
")",
"{",
"this",
".... | Sets the names of existing SREs, not including the SRE being edited. This method
is called by the wizard and clients should not call this method.
@param names existing SRE names or an empty array. | [
"Sets",
"the",
"names",
"of",
"existing",
"SREs",
"not",
"including",
"the",
"SRE",
"being",
"edited",
".",
"This",
"method",
"is",
"called",
"by",
"the",
"wizard",
"and",
"clients",
"should",
"not",
"call",
"this",
"method",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/AbstractSREInstallPage.java#L172-L177 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/AbstractSREInstallPage.java | AbstractSREInstallPage.updatePageStatus | protected void updatePageStatus() {
if (this.status.isOK()) {
setMessage(null, IMessageProvider.NONE);
} else {
switch (this.status.getSeverity()) {
case IStatus.ERROR:
setMessage(this.status.getMessage(), IMessageProvider.ERROR);
break;
case IStatus.INFO:
setMessage(this.status.getMessage()... | java | protected void updatePageStatus() {
if (this.status.isOK()) {
setMessage(null, IMessageProvider.NONE);
} else {
switch (this.status.getSeverity()) {
case IStatus.ERROR:
setMessage(this.status.getMessage(), IMessageProvider.ERROR);
break;
case IStatus.INFO:
setMessage(this.status.getMessage()... | [
"protected",
"void",
"updatePageStatus",
"(",
")",
"{",
"if",
"(",
"this",
".",
"status",
".",
"isOK",
"(",
")",
")",
"{",
"setMessage",
"(",
"null",
",",
"IMessageProvider",
".",
"NONE",
")",
";",
"}",
"else",
"{",
"switch",
"(",
"this",
".",
"statu... | Updates the status message on the page, based on the status of the SRE and other
status provided by the page. | [
"Updates",
"the",
"status",
"message",
"on",
"the",
"page",
"based",
"on",
"the",
"status",
"of",
"the",
"SRE",
"and",
"other",
"status",
"provided",
"by",
"the",
"page",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/AbstractSREInstallPage.java#L188-L207 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/sarl/actionprototype/ActionPrototype.java | ActionPrototype.toActionId | public String toActionId() {
final StringBuilder b = new StringBuilder();
b.append(getActionName());
for (final String type : this.signature) {
b.append("_"); //$NON-NLS-1$
for (final char c : type.replaceAll("(\\[\\])|\\*", "Array").toCharArray()) { //$NON-NLS-1$//$NON-NLS-2$
if (Character.isJavaIdenti... | java | public String toActionId() {
final StringBuilder b = new StringBuilder();
b.append(getActionName());
for (final String type : this.signature) {
b.append("_"); //$NON-NLS-1$
for (final char c : type.replaceAll("(\\[\\])|\\*", "Array").toCharArray()) { //$NON-NLS-1$//$NON-NLS-2$
if (Character.isJavaIdenti... | [
"public",
"String",
"toActionId",
"(",
")",
"{",
"final",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"b",
".",
"append",
"(",
"getActionName",
"(",
")",
")",
";",
"for",
"(",
"final",
"String",
"type",
":",
"this",
".",
"signatur... | Replies the string that permits to identify the action prototype according to the Java variable name.
@return the identifier. | [
"Replies",
"the",
"string",
"that",
"permits",
"to",
"identify",
"the",
"action",
"prototype",
"according",
"to",
"the",
"Java",
"variable",
"name",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/sarl/actionprototype/ActionPrototype.java#L129-L141 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/space/AbstractEventSpace.java | AbstractEventSpace.emit | public final void emit(UUID eventSource, Event event, Scope<Address> scope) {
assert event != null;
ensureEventSource(eventSource, event);
assert getSpaceID().equals(event.getSource().getSpaceID()) : "The source address must belong to this space"; //$NON-NLS-1$
try {
final Scope<Address> scopeInstance = (sco... | java | public final void emit(UUID eventSource, Event event, Scope<Address> scope) {
assert event != null;
ensureEventSource(eventSource, event);
assert getSpaceID().equals(event.getSource().getSpaceID()) : "The source address must belong to this space"; //$NON-NLS-1$
try {
final Scope<Address> scopeInstance = (sco... | [
"public",
"final",
"void",
"emit",
"(",
"UUID",
"eventSource",
",",
"Event",
"event",
",",
"Scope",
"<",
"Address",
">",
"scope",
")",
"{",
"assert",
"event",
"!=",
"null",
";",
"ensureEventSource",
"(",
"eventSource",
",",
"event",
")",
";",
"assert",
"... | Emit the given event in the given scope.
<p>This function emits on the internal event bus of the agent (call to {@link #doEmit(Event, Scope)}), and on the network.
@param eventSource the source of the event.
@param event the event to emit.
@param scope description of the scope of the event, i.e. the receivers of the ... | [
"Emit",
"the",
"given",
"event",
"in",
"the",
"given",
"scope",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/space/AbstractEventSpace.java#L130-L146 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/space/AbstractEventSpace.java | AbstractEventSpace.ensureEventSource | protected void ensureEventSource(UUID eventSource, Event event) {
if (event.getSource() == null) {
if (eventSource != null) {
event.setSource(new Address(getSpaceID(), eventSource));
} else {
throw new AssertionError("Every event must have a source"); //$NON-NLS-1$
}
}
} | java | protected void ensureEventSource(UUID eventSource, Event event) {
if (event.getSource() == null) {
if (eventSource != null) {
event.setSource(new Address(getSpaceID(), eventSource));
} else {
throw new AssertionError("Every event must have a source"); //$NON-NLS-1$
}
}
} | [
"protected",
"void",
"ensureEventSource",
"(",
"UUID",
"eventSource",
",",
"Event",
"event",
")",
"{",
"if",
"(",
"event",
".",
"getSource",
"(",
")",
"==",
"null",
")",
"{",
"if",
"(",
"eventSource",
"!=",
"null",
")",
"{",
"event",
".",
"setSource",
... | Ensure that the given event has a source.
@param eventSource the source of the event.
@param event the event to emit.
@since 2.0.6.0 | [
"Ensure",
"that",
"the",
"given",
"event",
"has",
"a",
"source",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/space/AbstractEventSpace.java#L154-L162 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/space/AbstractEventSpace.java | AbstractEventSpace.doEmit | protected void doEmit(Event event, Scope<? super Address> scope) {
assert scope != null;
assert event != null;
final UniqueAddressParticipantRepository<Address> particips = getParticipantInternalDataStructure();
final SynchronizedCollection<EventListener> listeners = particips.getListeners();
synchronized (li... | java | protected void doEmit(Event event, Scope<? super Address> scope) {
assert scope != null;
assert event != null;
final UniqueAddressParticipantRepository<Address> particips = getParticipantInternalDataStructure();
final SynchronizedCollection<EventListener> listeners = particips.getListeners();
synchronized (li... | [
"protected",
"void",
"doEmit",
"(",
"Event",
"event",
",",
"Scope",
"<",
"?",
"super",
"Address",
">",
"scope",
")",
"{",
"assert",
"scope",
"!=",
"null",
";",
"assert",
"event",
"!=",
"null",
";",
"final",
"UniqueAddressParticipantRepository",
"<",
"Address... | Do the emission of the event.
<p>This function emits the event <strong>only on the internal event bus</strong> of the agents.
@param event the event to emit.
@param scope description of the scope of the event, i.e. the receivers of the event. | [
"Do",
"the",
"emission",
"of",
"the",
"event",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/space/AbstractEventSpace.java#L172-L185 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/DataViewDelegate.java | DataViewDelegate.undelegate | public static Object undelegate(Object object) {
Object obj = object;
while (obj instanceof Delegator) {
obj = ((Delegator<?>) obj).getDelegatedObject();
}
return obj;
} | java | public static Object undelegate(Object object) {
Object obj = object;
while (obj instanceof Delegator) {
obj = ((Delegator<?>) obj).getDelegatedObject();
}
return obj;
} | [
"public",
"static",
"Object",
"undelegate",
"(",
"Object",
"object",
")",
"{",
"Object",
"obj",
"=",
"object",
";",
"while",
"(",
"obj",
"instanceof",
"Delegator",
")",
"{",
"obj",
"=",
"(",
"(",
"Delegator",
"<",
"?",
">",
")",
"obj",
")",
".",
"get... | Find the delegated object.
@param object the object.
@return the delegator object. | [
"Find",
"the",
"delegated",
"object",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/DataViewDelegate.java#L44-L50 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/editor/DocumentAutoFormatter.java | DocumentAutoFormatter.formatRegion | protected void formatRegion(IXtextDocument document, int offset, int length) {
try {
final int startLineIndex = document.getLineOfOffset(previousSiblingChar(document, offset));
final int endLineIndex = document.getLineOfOffset(offset + length);
int regionLength = 0;
for (int i = startLineIndex; i <= endLi... | java | protected void formatRegion(IXtextDocument document, int offset, int length) {
try {
final int startLineIndex = document.getLineOfOffset(previousSiblingChar(document, offset));
final int endLineIndex = document.getLineOfOffset(offset + length);
int regionLength = 0;
for (int i = startLineIndex; i <= endLi... | [
"protected",
"void",
"formatRegion",
"(",
"IXtextDocument",
"document",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"try",
"{",
"final",
"int",
"startLineIndex",
"=",
"document",
".",
"getLineOfOffset",
"(",
"previousSiblingChar",
"(",
"document",
",",... | Called for formatting a region.
@param document the document to format.
@param offset the offset of the text to format.
@param length the length of the text. | [
"Called",
"for",
"formatting",
"a",
"region",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/editor/DocumentAutoFormatter.java#L113-L130 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.core/src/io/sarl/bootstrap/SRE.java | SRE.getServiceLoader | @Pure
public static ServiceLoader<SREBootstrap> getServiceLoader(boolean onlyInstalledInJRE) {
synchronized (SRE.class) {
ServiceLoader<SREBootstrap> sl = loader == null ? null : loader.get();
if (sl == null) {
if (onlyInstalledInJRE) {
sl = ServiceLoader.loadInstalled(SREBootstrap.class);
} el... | java | @Pure
public static ServiceLoader<SREBootstrap> getServiceLoader(boolean onlyInstalledInJRE) {
synchronized (SRE.class) {
ServiceLoader<SREBootstrap> sl = loader == null ? null : loader.get();
if (sl == null) {
if (onlyInstalledInJRE) {
sl = ServiceLoader.loadInstalled(SREBootstrap.class);
} el... | [
"@",
"Pure",
"public",
"static",
"ServiceLoader",
"<",
"SREBootstrap",
">",
"getServiceLoader",
"(",
"boolean",
"onlyInstalledInJRE",
")",
"{",
"synchronized",
"(",
"SRE",
".",
"class",
")",
"{",
"ServiceLoader",
"<",
"SREBootstrap",
">",
"sl",
"=",
"loader",
... | Replies all the installed SRE into the class path.
@param onlyInstalledInJRE indicates if the services will be considered only into the libraries that are
installed into the JRE. If {@code true}, only the libraries into the JRE will be considered and
the application libraries will be ignored. If {@code false}, the app... | [
"Replies",
"all",
"the",
"installed",
"SRE",
"into",
"the",
"class",
"path",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/bootstrap/SRE.java#L95-L109 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.core/src/io/sarl/bootstrap/SRE.java | SRE.getBootstrappedLibraries | public static Set<URL> getBootstrappedLibraries() {
final String name = PREFIX + SREBootstrap.class.getName();
final Set<URL> result = new TreeSet<>();
try {
final Enumeration<URL> enumr = ClassLoader.getSystemResources(name);
while (enumr.hasMoreElements()) {
final URL url = enumr.nextElement();
if... | java | public static Set<URL> getBootstrappedLibraries() {
final String name = PREFIX + SREBootstrap.class.getName();
final Set<URL> result = new TreeSet<>();
try {
final Enumeration<URL> enumr = ClassLoader.getSystemResources(name);
while (enumr.hasMoreElements()) {
final URL url = enumr.nextElement();
if... | [
"public",
"static",
"Set",
"<",
"URL",
">",
"getBootstrappedLibraries",
"(",
")",
"{",
"final",
"String",
"name",
"=",
"PREFIX",
"+",
"SREBootstrap",
".",
"class",
".",
"getName",
"(",
")",
";",
"final",
"Set",
"<",
"URL",
">",
"result",
"=",
"new",
"T... | Replies all the libraries that contains a SRE bootstrap.
@return the set of libraries.
@since 0.7 | [
"Replies",
"all",
"the",
"libraries",
"that",
"contains",
"a",
"SRE",
"bootstrap",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/bootstrap/SRE.java#L116-L131 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.core/src/io/sarl/bootstrap/SRE.java | SRE.getBootstrap | @Pure
public static SREBootstrap getBootstrap() {
synchronized (SRE.class) {
if (currentSRE == null) {
final Iterator<SREBootstrap> iterator = getServiceLoader().iterator();
if (iterator.hasNext()) {
currentSRE = iterator.next();
} else {
currentSRE = new VoidSREBootstrap();
}
}
re... | java | @Pure
public static SREBootstrap getBootstrap() {
synchronized (SRE.class) {
if (currentSRE == null) {
final Iterator<SREBootstrap> iterator = getServiceLoader().iterator();
if (iterator.hasNext()) {
currentSRE = iterator.next();
} else {
currentSRE = new VoidSREBootstrap();
}
}
re... | [
"@",
"Pure",
"public",
"static",
"SREBootstrap",
"getBootstrap",
"(",
")",
"{",
"synchronized",
"(",
"SRE",
".",
"class",
")",
"{",
"if",
"(",
"currentSRE",
"==",
"null",
")",
"{",
"final",
"Iterator",
"<",
"SREBootstrap",
">",
"iterator",
"=",
"getService... | Find and reply the current SRE.
@return the current SRE, never {@code null}.
@throws IllegalStateException if a SRE cannot be found. | [
"Find",
"and",
"reply",
"the",
"current",
"SRE",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/bootstrap/SRE.java#L166-L179 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/hover/SARLHoverSignatureProvider.java | SARLHoverSignatureProvider._signature | protected String _signature(XCastedExpression castExpression, boolean typeAtEnd) {
if (castExpression instanceof SarlCastedExpression) {
final JvmOperation delegate = ((SarlCastedExpression) castExpression).getFeature();
if (delegate != null) {
return _signature(delegate, typeAtEnd);
}
}
return Messa... | java | protected String _signature(XCastedExpression castExpression, boolean typeAtEnd) {
if (castExpression instanceof SarlCastedExpression) {
final JvmOperation delegate = ((SarlCastedExpression) castExpression).getFeature();
if (delegate != null) {
return _signature(delegate, typeAtEnd);
}
}
return Messa... | [
"protected",
"String",
"_signature",
"(",
"XCastedExpression",
"castExpression",
",",
"boolean",
"typeAtEnd",
")",
"{",
"if",
"(",
"castExpression",
"instanceof",
"SarlCastedExpression",
")",
"{",
"final",
"JvmOperation",
"delegate",
"=",
"(",
"(",
"SarlCastedExpressi... | Replies the hover for a SARL casted expression.
@param castExpression the casted expression.
@param typeAtEnd indicates if the type should be put at end.
@return the string representation into the hover. | [
"Replies",
"the",
"hover",
"for",
"a",
"SARL",
"casted",
"expression",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/hover/SARLHoverSignatureProvider.java#L245-L254 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/hover/SARLHoverSignatureProvider.java | SARLHoverSignatureProvider.getTypeName | protected String getTypeName(JvmType type) {
if (type != null) {
if (type instanceof JvmDeclaredType) {
final ITypeReferenceOwner owner = new StandardTypeReferenceOwner(this.services, type);
return owner.toLightweightTypeReference(type).getHumanReadableName();
}
return type.getSimpleName();
}
ret... | java | protected String getTypeName(JvmType type) {
if (type != null) {
if (type instanceof JvmDeclaredType) {
final ITypeReferenceOwner owner = new StandardTypeReferenceOwner(this.services, type);
return owner.toLightweightTypeReference(type).getHumanReadableName();
}
return type.getSimpleName();
}
ret... | [
"protected",
"String",
"getTypeName",
"(",
"JvmType",
"type",
")",
"{",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"if",
"(",
"type",
"instanceof",
"JvmDeclaredType",
")",
"{",
"final",
"ITypeReferenceOwner",
"owner",
"=",
"new",
"StandardTypeReferenceOwner",
... | Replies the type name for the given type.
@param type the type.
@return the string representation of the given type. | [
"Replies",
"the",
"type",
"name",
"for",
"the",
"given",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/hover/SARLHoverSignatureProvider.java#L273-L282 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java | AbstractSARLLaunchConfigurationDelegate.getSREInstallFor | protected static ISREInstall getSREInstallFor(ILaunchConfiguration configuration,
ILaunchConfigurationAccessor configAccessor,
IJavaProjectAccessor projectAccessor) throws CoreException {
assert configAccessor != null;
assert projectAccessor != null;
final ISREInstall sre;
if (configAccessor.getUseProject... | java | protected static ISREInstall getSREInstallFor(ILaunchConfiguration configuration,
ILaunchConfigurationAccessor configAccessor,
IJavaProjectAccessor projectAccessor) throws CoreException {
assert configAccessor != null;
assert projectAccessor != null;
final ISREInstall sre;
if (configAccessor.getUseProject... | [
"protected",
"static",
"ISREInstall",
"getSREInstallFor",
"(",
"ILaunchConfiguration",
"configuration",
",",
"ILaunchConfigurationAccessor",
"configAccessor",
",",
"IJavaProjectAccessor",
"projectAccessor",
")",
"throws",
"CoreException",
"{",
"assert",
"configAccessor",
"!=",
... | Replies the SRE installation to be used for the given configuration.
@param configuration the configuration to check.
@param configAccessor the accessor to the SRE configuration.
@param projectAccessor the accessor to the Java project.
@return the SRE install.
@throws CoreException if impossible to get the SRE. | [
"Replies",
"the",
"SRE",
"installation",
"to",
"be",
"used",
"for",
"the",
"given",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java#L158-L181 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java | AbstractSARLLaunchConfigurationDelegate.getProjectSpecificSRE | private static ISREInstall getProjectSpecificSRE(ILaunchConfiguration configuration, boolean verify,
IJavaProjectAccessor projectAccessor) throws CoreException {
assert projectAccessor != null;
final IJavaProject jprj = projectAccessor.get(configuration);
if (jprj != null) {
final IProject prj = jprj.getPro... | java | private static ISREInstall getProjectSpecificSRE(ILaunchConfiguration configuration, boolean verify,
IJavaProjectAccessor projectAccessor) throws CoreException {
assert projectAccessor != null;
final IJavaProject jprj = projectAccessor.get(configuration);
if (jprj != null) {
final IProject prj = jprj.getPro... | [
"private",
"static",
"ISREInstall",
"getProjectSpecificSRE",
"(",
"ILaunchConfiguration",
"configuration",
",",
"boolean",
"verify",
",",
"IJavaProjectAccessor",
"projectAccessor",
")",
"throws",
"CoreException",
"{",
"assert",
"projectAccessor",
"!=",
"null",
";",
"final... | Replies the project SRE from the given configuration.
@param configuration the configuration to read.
@param verify if true verify the SRE validity, do nothing otherwise
@param projectAccessor the accessor to the Java project.
@return the project SRE or <code>null</code>.
@throws CoreException Some error occurs when ... | [
"Replies",
"the",
"project",
"SRE",
"from",
"the",
"given",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java#L191-L220 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java | AbstractSARLLaunchConfigurationDelegate.join | protected static String join(String... values) {
final StringBuilder buffer = new StringBuilder();
for (final String value : values) {
if (!Strings.isNullOrEmpty(value)) {
if (buffer.length() > 0) {
buffer.append(" "); //$NON-NLS-1$
}
buffer.append(value);
}
}
return buffer.toString();
} | java | protected static String join(String... values) {
final StringBuilder buffer = new StringBuilder();
for (final String value : values) {
if (!Strings.isNullOrEmpty(value)) {
if (buffer.length() > 0) {
buffer.append(" "); //$NON-NLS-1$
}
buffer.append(value);
}
}
return buffer.toString();
} | [
"protected",
"static",
"String",
"join",
"(",
"String",
"...",
"values",
")",
"{",
"final",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"final",
"String",
"value",
":",
"values",
")",
"{",
"if",
"(",
"!",
"Strings",... | Replies a string that is the concatenation of the given values.
@param values the values to merge.
@return the concatenation result. | [
"Replies",
"a",
"string",
"that",
"is",
"the",
"concatenation",
"of",
"the",
"given",
"values",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java#L314-L325 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java | AbstractSARLLaunchConfigurationDelegate.getOrComputeUnresolvedSARLRuntimeClasspath | private IRuntimeClasspathEntry[] getOrComputeUnresolvedSARLRuntimeClasspath(ILaunchConfiguration configuration)
throws CoreException {
// Get the buffered entries
IRuntimeClasspathEntry[] entries = null;
synchronized (this) {
if (this.unresolvedClasspathEntries != null) {
entries = this.unresolvedClassp... | java | private IRuntimeClasspathEntry[] getOrComputeUnresolvedSARLRuntimeClasspath(ILaunchConfiguration configuration)
throws CoreException {
// Get the buffered entries
IRuntimeClasspathEntry[] entries = null;
synchronized (this) {
if (this.unresolvedClasspathEntries != null) {
entries = this.unresolvedClassp... | [
"private",
"IRuntimeClasspathEntry",
"[",
"]",
"getOrComputeUnresolvedSARLRuntimeClasspath",
"(",
"ILaunchConfiguration",
"configuration",
")",
"throws",
"CoreException",
"{",
"// Get the buffered entries",
"IRuntimeClasspathEntry",
"[",
"]",
"entries",
"=",
"null",
";",
"syn... | Replies the class path for the SARL application.
@param configuration the configuration that provides the classpath.
@return the filtered entries.
@throws CoreException if impossible to get the classpath. | [
"Replies",
"the",
"class",
"path",
"for",
"the",
"SARL",
"application",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java#L471-L490 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java | AbstractSARLLaunchConfigurationDelegate.computeUnresolvedSARLRuntimeClasspath | public static IRuntimeClasspathEntry[] computeUnresolvedSARLRuntimeClasspath(ILaunchConfiguration configuration,
ILaunchConfigurationAccessor configAccessor,
IJavaProjectAccessor projectAccessor) throws CoreException {
// Get the classpath from the configuration.
final IRuntimeClasspathEntry[] entries = JavaR... | java | public static IRuntimeClasspathEntry[] computeUnresolvedSARLRuntimeClasspath(ILaunchConfiguration configuration,
ILaunchConfigurationAccessor configAccessor,
IJavaProjectAccessor projectAccessor) throws CoreException {
// Get the classpath from the configuration.
final IRuntimeClasspathEntry[] entries = JavaR... | [
"public",
"static",
"IRuntimeClasspathEntry",
"[",
"]",
"computeUnresolvedSARLRuntimeClasspath",
"(",
"ILaunchConfiguration",
"configuration",
",",
"ILaunchConfigurationAccessor",
"configAccessor",
",",
"IJavaProjectAccessor",
"projectAccessor",
")",
"throws",
"CoreException",
"{... | Compute the class path for the given launch configuration.
@param configuration the configuration that provides the classpath.
@param configAccessor the accessor to the SRE configuration.
@param projectAccessor the accessor to the Java project.
@return the filtered entries.
@throws CoreException if impossible to get t... | [
"Compute",
"the",
"class",
"path",
"for",
"the",
"given",
"launch",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java#L500-L520 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java | AbstractSARLLaunchConfigurationDelegate.getSREClasspathEntries | private static List<IRuntimeClasspathEntry> getSREClasspathEntries(
ILaunchConfiguration configuration,
ILaunchConfigurationAccessor configAccessor,
IJavaProjectAccessor projectAccessor) throws CoreException {
final ISREInstall sre = getSREInstallFor(configuration, configAccessor, projectAccessor);
return ... | java | private static List<IRuntimeClasspathEntry> getSREClasspathEntries(
ILaunchConfiguration configuration,
ILaunchConfigurationAccessor configAccessor,
IJavaProjectAccessor projectAccessor) throws CoreException {
final ISREInstall sre = getSREInstallFor(configuration, configAccessor, projectAccessor);
return ... | [
"private",
"static",
"List",
"<",
"IRuntimeClasspathEntry",
">",
"getSREClasspathEntries",
"(",
"ILaunchConfiguration",
"configuration",
",",
"ILaunchConfigurationAccessor",
"configAccessor",
",",
"IJavaProjectAccessor",
"projectAccessor",
")",
"throws",
"CoreException",
"{",
... | Replies the classpath entries associated to the SRE of the given configuration.
@param configuration the configuration to read.
@param configAccessor the accessor to the SRE configuration.
@param projectAccessor the accessor to the Java project.
@return the classpath entries for the SRE associated to the configuration... | [
"Replies",
"the",
"classpath",
"entries",
"associated",
"to",
"the",
"SRE",
"of",
"the",
"given",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java#L530-L536 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java | AbstractSARLLaunchConfigurationDelegate.isNotSREEntry | private static boolean isNotSREEntry(IRuntimeClasspathEntry entry) {
try {
final File file = new File(entry.getLocation());
if (file.isDirectory()) {
return !SARLRuntime.isUnpackedSRE(file);
} else if (file.canRead()) {
return !SARLRuntime.isPackedSRE(file);
}
} catch (Throwable e) {
SARLEcli... | java | private static boolean isNotSREEntry(IRuntimeClasspathEntry entry) {
try {
final File file = new File(entry.getLocation());
if (file.isDirectory()) {
return !SARLRuntime.isUnpackedSRE(file);
} else if (file.canRead()) {
return !SARLRuntime.isPackedSRE(file);
}
} catch (Throwable e) {
SARLEcli... | [
"private",
"static",
"boolean",
"isNotSREEntry",
"(",
"IRuntimeClasspathEntry",
"entry",
")",
"{",
"try",
"{",
"final",
"File",
"file",
"=",
"new",
"File",
"(",
"entry",
".",
"getLocation",
"(",
")",
")",
";",
"if",
"(",
"file",
".",
"isDirectory",
"(",
... | Replies if the given classpath entry is a SRE.
@param entry the entry.
@return <code>true</code> if the entry points to a SRE;
<code>false</code> otherwise. | [
"Replies",
"if",
"the",
"given",
"classpath",
"entry",
"is",
"a",
"SRE",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java#L562-L574 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/executors/JdkExecutorService.java | JdkExecutorService.createTask | @SuppressWarnings("static-method")
protected Runnable createTask(Runnable runnable) {
if (runnable instanceof JanusRunnable) {
return runnable;
}
return new JanusRunnable(runnable);
} | java | @SuppressWarnings("static-method")
protected Runnable createTask(Runnable runnable) {
if (runnable instanceof JanusRunnable) {
return runnable;
}
return new JanusRunnable(runnable);
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"Runnable",
"createTask",
"(",
"Runnable",
"runnable",
")",
"{",
"if",
"(",
"runnable",
"instanceof",
"JanusRunnable",
")",
"{",
"return",
"runnable",
";",
"}",
"return",
"new",
"JanusRunnable",
... | Create a task with the given runnable.
@param runnable the runnable.
@return the task. | [
"Create",
"a",
"task",
"with",
"the",
"given",
"runnable",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/executors/JdkExecutorService.java#L154-L160 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/executors/JdkExecutorService.java | JdkExecutorService.createTask | @SuppressWarnings("static-method")
protected <T> Callable<T> createTask(Callable<T> callable) {
if (callable instanceof JanusCallable<?>) {
return callable;
}
return new JanusCallable<>(callable);
} | java | @SuppressWarnings("static-method")
protected <T> Callable<T> createTask(Callable<T> callable) {
if (callable instanceof JanusCallable<?>) {
return callable;
}
return new JanusCallable<>(callable);
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"<",
"T",
">",
"Callable",
"<",
"T",
">",
"createTask",
"(",
"Callable",
"<",
"T",
">",
"callable",
")",
"{",
"if",
"(",
"callable",
"instanceof",
"JanusCallable",
"<",
"?",
">",
")",
"... | Create a task with the given callable.
@param <T> the type of the returned value.
@param callable the callable.
@return the task. | [
"Create",
"a",
"task",
"with",
"the",
"given",
"callable",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/executors/JdkExecutorService.java#L168-L174 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/SARLAgentLaunchConfigurationDelegate.java | SARLAgentLaunchConfigurationDelegate.verifyAgentName | protected void verifyAgentName(ILaunchConfiguration configuration) throws CoreException {
final String name = getAgentName(configuration);
if (name == null) {
abort(
io.sarl.eclipse.launching.dialog.Messages.MainLaunchConfigurationTab_2,
null,
SARLEclipseConfig.ERR_UNSPECIFIED_AGENT_NAME);
}
} | java | protected void verifyAgentName(ILaunchConfiguration configuration) throws CoreException {
final String name = getAgentName(configuration);
if (name == null) {
abort(
io.sarl.eclipse.launching.dialog.Messages.MainLaunchConfigurationTab_2,
null,
SARLEclipseConfig.ERR_UNSPECIFIED_AGENT_NAME);
}
} | [
"protected",
"void",
"verifyAgentName",
"(",
"ILaunchConfiguration",
"configuration",
")",
"throws",
"CoreException",
"{",
"final",
"String",
"name",
"=",
"getAgentName",
"(",
"configuration",
")",
";",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"abort",
"(",
... | Verifies a main type name is specified by the given launch configuration,
and returns the main type name.
@param configuration launch configuration
@throws CoreException if unable to retrieve the attribute or the attribute is
unspecified | [
"Verifies",
"a",
"main",
"type",
"name",
"is",
"specified",
"by",
"the",
"given",
"launch",
"configuration",
"and",
"returns",
"the",
"main",
"type",
"name",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/SARLAgentLaunchConfigurationDelegate.java#L152-L160 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlAgentBuilderImpl.java | SarlAgentBuilderImpl.addSarlInterface | public ISarlInterfaceBuilder addSarlInterface(String name) {
ISarlInterfaceBuilder builder = this.iSarlInterfaceBuilderProvider.get();
builder.eInit(getSarlAgent(), name, getTypeResolutionContext());
return builder;
} | java | public ISarlInterfaceBuilder addSarlInterface(String name) {
ISarlInterfaceBuilder builder = this.iSarlInterfaceBuilderProvider.get();
builder.eInit(getSarlAgent(), name, getTypeResolutionContext());
return builder;
} | [
"public",
"ISarlInterfaceBuilder",
"addSarlInterface",
"(",
"String",
"name",
")",
"{",
"ISarlInterfaceBuilder",
"builder",
"=",
"this",
".",
"iSarlInterfaceBuilderProvider",
".",
"get",
"(",
")",
";",
"builder",
".",
"eInit",
"(",
"getSarlAgent",
"(",
")",
",",
... | Create a SarlInterface.
@param name the name of the SarlInterface.
@return the builder. | [
"Create",
"a",
"SarlInterface",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlAgentBuilderImpl.java#L248-L252 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlAgentBuilderImpl.java | SarlAgentBuilderImpl.addSarlEnumeration | public ISarlEnumerationBuilder addSarlEnumeration(String name) {
ISarlEnumerationBuilder builder = this.iSarlEnumerationBuilderProvider.get();
builder.eInit(getSarlAgent(), name, getTypeResolutionContext());
return builder;
} | java | public ISarlEnumerationBuilder addSarlEnumeration(String name) {
ISarlEnumerationBuilder builder = this.iSarlEnumerationBuilderProvider.get();
builder.eInit(getSarlAgent(), name, getTypeResolutionContext());
return builder;
} | [
"public",
"ISarlEnumerationBuilder",
"addSarlEnumeration",
"(",
"String",
"name",
")",
"{",
"ISarlEnumerationBuilder",
"builder",
"=",
"this",
".",
"iSarlEnumerationBuilderProvider",
".",
"get",
"(",
")",
";",
"builder",
".",
"eInit",
"(",
"getSarlAgent",
"(",
")",
... | Create a SarlEnumeration.
@param name the name of the SarlEnumeration.
@return the builder. | [
"Create",
"a",
"SarlEnumeration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlAgentBuilderImpl.java#L261-L265 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlAgentBuilderImpl.java | SarlAgentBuilderImpl.addSarlAnnotationType | public ISarlAnnotationTypeBuilder addSarlAnnotationType(String name) {
ISarlAnnotationTypeBuilder builder = this.iSarlAnnotationTypeBuilderProvider.get();
builder.eInit(getSarlAgent(), name, getTypeResolutionContext());
return builder;
} | java | public ISarlAnnotationTypeBuilder addSarlAnnotationType(String name) {
ISarlAnnotationTypeBuilder builder = this.iSarlAnnotationTypeBuilderProvider.get();
builder.eInit(getSarlAgent(), name, getTypeResolutionContext());
return builder;
} | [
"public",
"ISarlAnnotationTypeBuilder",
"addSarlAnnotationType",
"(",
"String",
"name",
")",
"{",
"ISarlAnnotationTypeBuilder",
"builder",
"=",
"this",
".",
"iSarlAnnotationTypeBuilderProvider",
".",
"get",
"(",
")",
";",
"builder",
".",
"eInit",
"(",
"getSarlAgent",
... | Create a SarlAnnotationType.
@param name the name of the SarlAnnotationType.
@return the builder. | [
"Create",
"a",
"SarlAnnotationType",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlAgentBuilderImpl.java#L274-L278 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/AgentTraitData.java | AgentTraitData.removeTask | public void removeTask(AgentTask task) {
final Iterator<WeakReference<AgentTask>> iterator = this.tasks.iterator();
while (iterator.hasNext()) {
final WeakReference<AgentTask> reference = iterator.next();
final AgentTask knownTask = reference.get();
if (knownTask == null) {
iterator.remove();
} else... | java | public void removeTask(AgentTask task) {
final Iterator<WeakReference<AgentTask>> iterator = this.tasks.iterator();
while (iterator.hasNext()) {
final WeakReference<AgentTask> reference = iterator.next();
final AgentTask knownTask = reference.get();
if (knownTask == null) {
iterator.remove();
} else... | [
"public",
"void",
"removeTask",
"(",
"AgentTask",
"task",
")",
"{",
"final",
"Iterator",
"<",
"WeakReference",
"<",
"AgentTask",
">",
">",
"iterator",
"=",
"this",
".",
"tasks",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext",
"(... | Remove task.
@param task the task. | [
"Remove",
"task",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/AgentTraitData.java#L66-L78 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/acceptors/MultiModification.java | MultiModification.bind | public void bind(Class<?> type, Class<? extends SARLSemanticModification> modification) {
this.modificationTypes.put(type, modification);
} | java | public void bind(Class<?> type, Class<? extends SARLSemanticModification> modification) {
this.modificationTypes.put(type, modification);
} | [
"public",
"void",
"bind",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Class",
"<",
"?",
"extends",
"SARLSemanticModification",
">",
"modification",
")",
"{",
"this",
".",
"modificationTypes",
".",
"put",
"(",
"type",
",",
"modification",
")",
";",
"}"
] | Add a semantic modification related to the given element type.
@param type the type of the element.
@param modification the modification | [
"Add",
"a",
"semantic",
"modification",
"related",
"to",
"the",
"given",
"element",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/acceptors/MultiModification.java#L73-L75 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java | JavaInlineExpressionCompiler._generate | @SuppressWarnings("static-method")
protected Boolean _generate(CharSequence expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
output.appendStringConstant(expression.toString());
return Boolean.TRUE;
} | java | @SuppressWarnings("static-method")
protected Boolean _generate(CharSequence expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
output.appendStringConstant(expression.toString());
return Boolean.TRUE;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"Boolean",
"_generate",
"(",
"CharSequence",
"expression",
",",
"XExpression",
"parentExpression",
",",
"XtendExecutable",
"feature",
",",
"InlineAnnotationTreeAppendable",
"output",
")",
"{",
"output",
... | Append the inline code for the given character sequence.
@param expression the expression of the operation.
@param parentExpression is the expression that contains this one, or {@code null} if the current expression is
the root expression.
@param feature the feature that contains the expression.
@param output the outp... | [
"Append",
"the",
"inline",
"code",
"for",
"the",
"given",
"character",
"sequence",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java#L276-L281 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java | JavaInlineExpressionCompiler._generate | @SuppressWarnings("static-method")
protected Boolean _generate(Number expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
final Class<?> type = ReflectionUtil.getRawType(expression.getClass());
if (Byte.class.equals(type) || byte.class.equals(type)) {
o... | java | @SuppressWarnings("static-method")
protected Boolean _generate(Number expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
final Class<?> type = ReflectionUtil.getRawType(expression.getClass());
if (Byte.class.equals(type) || byte.class.equals(type)) {
o... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"Boolean",
"_generate",
"(",
"Number",
"expression",
",",
"XExpression",
"parentExpression",
",",
"XtendExecutable",
"feature",
",",
"InlineAnnotationTreeAppendable",
"output",
")",
"{",
"final",
"Clas... | Append the inline code for the given number value.
@param expression the expression of the operation.
@param parentExpression is the expression that contains this one, or {@code null} if the current expression is
the root expression.
@param feature the feature that contains the expression.
@param output the output.
@r... | [
"Append",
"the",
"inline",
"code",
"for",
"the",
"given",
"number",
"value",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java#L308-L322 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java | JavaInlineExpressionCompiler._generate | @SuppressWarnings("static-method")
protected Boolean _generate(XBooleanLiteral expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
output.appendConstant(Boolean.toString(expression.isIsTrue()));
return Boolean.TRUE;
} | java | @SuppressWarnings("static-method")
protected Boolean _generate(XBooleanLiteral expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
output.appendConstant(Boolean.toString(expression.isIsTrue()));
return Boolean.TRUE;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"Boolean",
"_generate",
"(",
"XBooleanLiteral",
"expression",
",",
"XExpression",
"parentExpression",
",",
"XtendExecutable",
"feature",
",",
"InlineAnnotationTreeAppendable",
"output",
")",
"{",
"output... | Append the inline code for the given XBooleanLiteral.
@param expression the expression of the operation.
@param parentExpression is the expression that contains this one, or {@code null} if the current expression is
the root expression.
@param feature the feature that contains the expression.
@param output the output.... | [
"Append",
"the",
"inline",
"code",
"for",
"the",
"given",
"XBooleanLiteral",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java#L333-L338 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java | JavaInlineExpressionCompiler._generate | protected Boolean _generate(XNullLiteral expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
if (parentExpression == null && feature instanceof XtendFunction) {
final XtendFunction function = (XtendFunction) feature;
output.append("("); //$NON-NLS-1$
... | java | protected Boolean _generate(XNullLiteral expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
if (parentExpression == null && feature instanceof XtendFunction) {
final XtendFunction function = (XtendFunction) feature;
output.append("("); //$NON-NLS-1$
... | [
"protected",
"Boolean",
"_generate",
"(",
"XNullLiteral",
"expression",
",",
"XExpression",
"parentExpression",
",",
"XtendExecutable",
"feature",
",",
"InlineAnnotationTreeAppendable",
"output",
")",
"{",
"if",
"(",
"parentExpression",
"==",
"null",
"&&",
"feature",
... | Append the inline code for the given XNullLiteral.
@param expression the expression of the operation.
@param parentExpression is the expression that contains this one, or {@code null} if the current expression is
the root expression.
@param feature the feature that contains the expression.
@param output the output.
@r... | [
"Append",
"the",
"inline",
"code",
"for",
"the",
"given",
"XNullLiteral",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java#L349-L372 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java | JavaInlineExpressionCompiler._generate | @SuppressWarnings("static-method")
protected Boolean _generate(XNumberLiteral expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
output.appendConstant(expression.getValue());
return Boolean.TRUE;
} | java | @SuppressWarnings("static-method")
protected Boolean _generate(XNumberLiteral expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
output.appendConstant(expression.getValue());
return Boolean.TRUE;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"Boolean",
"_generate",
"(",
"XNumberLiteral",
"expression",
",",
"XExpression",
"parentExpression",
",",
"XtendExecutable",
"feature",
",",
"InlineAnnotationTreeAppendable",
"output",
")",
"{",
"output"... | Append the inline code for the given XNumberLiteral.
@param expression the expression of the operation.
@param parentExpression is the expression that contains this one, or {@code null} if the current expression is
the root expression.
@param feature the feature that contains the expression.
@param output the output.
... | [
"Append",
"the",
"inline",
"code",
"for",
"the",
"given",
"XNumberLiteral",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java#L383-L388 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java | JavaInlineExpressionCompiler._generate | @SuppressWarnings("static-method")
protected Boolean _generate(XStringLiteral expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
output.appendStringConstant(expression.getValue());
return Boolean.TRUE;
} | java | @SuppressWarnings("static-method")
protected Boolean _generate(XStringLiteral expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
output.appendStringConstant(expression.getValue());
return Boolean.TRUE;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"Boolean",
"_generate",
"(",
"XStringLiteral",
"expression",
",",
"XExpression",
"parentExpression",
",",
"XtendExecutable",
"feature",
",",
"InlineAnnotationTreeAppendable",
"output",
")",
"{",
"output"... | Append the inline code for the given XStringLiteral.
@param expression the expression of the operation.
@param parentExpression is the expression that contains this one, or {@code null} if the current expression is
the root expression.
@param feature the feature that contains the expression.
@param output the output.
... | [
"Append",
"the",
"inline",
"code",
"for",
"the",
"given",
"XStringLiteral",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java#L399-L404 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java | JavaInlineExpressionCompiler._generate | @SuppressWarnings("static-method")
protected Boolean _generate(XTypeLiteral expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
output.appendTypeConstant(expression.getType());
return Boolean.TRUE;
} | java | @SuppressWarnings("static-method")
protected Boolean _generate(XTypeLiteral expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
output.appendTypeConstant(expression.getType());
return Boolean.TRUE;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"Boolean",
"_generate",
"(",
"XTypeLiteral",
"expression",
",",
"XExpression",
"parentExpression",
",",
"XtendExecutable",
"feature",
",",
"InlineAnnotationTreeAppendable",
"output",
")",
"{",
"output",
... | Append the inline code for the given XTypeLiteral.
@param expression the expression of the operation.
@param parentExpression is the expression that contains this one, or {@code null} if the current expression is
the root expression.
@param feature the feature that contains the expression.
@param output the output.
@r... | [
"Append",
"the",
"inline",
"code",
"for",
"the",
"given",
"XTypeLiteral",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java#L415-L420 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java | JavaInlineExpressionCompiler._generate | protected Boolean _generate(XCastedExpression expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
final InlineAnnotationTreeAppendable child = newAppendable(output.getImportManager());
boolean bool = generate(expression.getTarget(), expression, feature, chi... | java | protected Boolean _generate(XCastedExpression expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
final InlineAnnotationTreeAppendable child = newAppendable(output.getImportManager());
boolean bool = generate(expression.getTarget(), expression, feature, chi... | [
"protected",
"Boolean",
"_generate",
"(",
"XCastedExpression",
"expression",
",",
"XExpression",
"parentExpression",
",",
"XtendExecutable",
"feature",
",",
"InlineAnnotationTreeAppendable",
"output",
")",
"{",
"final",
"InlineAnnotationTreeAppendable",
"child",
"=",
"newAp... | Append the inline code for the given XCastedExpression.
@param expression the expression of the operation.
@param parentExpression is the expression that contains this one, or {@code null} if the current expression is
the root expression.
@param feature the feature that contains the expression.
@param output the outpu... | [
"Append",
"the",
"inline",
"code",
"for",
"the",
"given",
"XCastedExpression",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java#L431-L445 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java | JavaInlineExpressionCompiler._generate | protected Boolean _generate(XReturnExpression expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
return generate(expression.getExpression(), parentExpression, feature, output);
} | java | protected Boolean _generate(XReturnExpression expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
return generate(expression.getExpression(), parentExpression, feature, output);
} | [
"protected",
"Boolean",
"_generate",
"(",
"XReturnExpression",
"expression",
",",
"XExpression",
"parentExpression",
",",
"XtendExecutable",
"feature",
",",
"InlineAnnotationTreeAppendable",
"output",
")",
"{",
"return",
"generate",
"(",
"expression",
".",
"getExpression"... | Append the inline code for the given XReturnLiteral.
@param expression the expression of the operation.
@param parentExpression is the expression that contains this one, or {@code null} if the current expression is
the root expression.
@param feature the feature that contains the expression.
@param output the output.
... | [
"Append",
"the",
"inline",
"code",
"for",
"the",
"given",
"XReturnLiteral",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/JavaInlineExpressionCompiler.java#L481-L484 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java | AbstractSubCodeBuilderFragment.getExportedPackages | public void getExportedPackages(Set<String> exportedPackages) {
if (exportedPackages != null) {
exportedPackages.add(getCodeElementExtractor().getBasePackage());
exportedPackages.add(getCodeElementExtractor().getBuilderPackage());
if (getCodeBuilderConfig().isISourceAppendableEnable()) {
exportedPackages... | java | public void getExportedPackages(Set<String> exportedPackages) {
if (exportedPackages != null) {
exportedPackages.add(getCodeElementExtractor().getBasePackage());
exportedPackages.add(getCodeElementExtractor().getBuilderPackage());
if (getCodeBuilderConfig().isISourceAppendableEnable()) {
exportedPackages... | [
"public",
"void",
"getExportedPackages",
"(",
"Set",
"<",
"String",
">",
"exportedPackages",
")",
"{",
"if",
"(",
"exportedPackages",
"!=",
"null",
")",
"{",
"exportedPackages",
".",
"add",
"(",
"getCodeElementExtractor",
"(",
")",
".",
"getBasePackage",
"(",
... | Fill the given set with the exported packages for this fragment.
@param exportedPackages the set to fill in. | [
"Fill",
"the",
"given",
"set",
"with",
"the",
"exported",
"packages",
"for",
"this",
"fragment",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java#L156-L164 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java | AbstractSubCodeBuilderFragment.getLanguageScriptMemberGetter | @Pure
protected String getLanguageScriptMemberGetter() {
final Grammar grammar = getGrammar();
final AbstractRule scriptRule = GrammarUtil.findRuleForName(grammar, getCodeBuilderConfig().getScriptRuleName());
for (final Assignment assignment : GrammarUtil.containedAssignments(scriptRule)) {
if ((assignment.ge... | java | @Pure
protected String getLanguageScriptMemberGetter() {
final Grammar grammar = getGrammar();
final AbstractRule scriptRule = GrammarUtil.findRuleForName(grammar, getCodeBuilderConfig().getScriptRuleName());
for (final Assignment assignment : GrammarUtil.containedAssignments(scriptRule)) {
if ((assignment.ge... | [
"@",
"Pure",
"protected",
"String",
"getLanguageScriptMemberGetter",
"(",
")",
"{",
"final",
"Grammar",
"grammar",
"=",
"getGrammar",
"(",
")",
";",
"final",
"AbstractRule",
"scriptRule",
"=",
"GrammarUtil",
".",
"findRuleForName",
"(",
"grammar",
",",
"getCodeBui... | Replies the getter function for accessing to the top element collection of the script.
@return the name of the getter function. | [
"Replies",
"the",
"getter",
"function",
"for",
"accessing",
"to",
"the",
"top",
"element",
"collection",
"of",
"the",
"script",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java#L369-L381 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java | AbstractSubCodeBuilderFragment.getXFactoryFor | @Pure
protected TypeReference getXFactoryFor(TypeReference type) {
final String packageName = type.getPackageName();
final Grammar grammar = getGrammar();
TypeReference reference = getXFactoryFor(packageName, grammar);
if (reference != null) {
return reference;
}
for (final Grammar usedGrammar : Gramma... | java | @Pure
protected TypeReference getXFactoryFor(TypeReference type) {
final String packageName = type.getPackageName();
final Grammar grammar = getGrammar();
TypeReference reference = getXFactoryFor(packageName, grammar);
if (reference != null) {
return reference;
}
for (final Grammar usedGrammar : Gramma... | [
"@",
"Pure",
"protected",
"TypeReference",
"getXFactoryFor",
"(",
"TypeReference",
"type",
")",
"{",
"final",
"String",
"packageName",
"=",
"type",
".",
"getPackageName",
"(",
")",
";",
"final",
"Grammar",
"grammar",
"=",
"getGrammar",
"(",
")",
";",
"TypeRefe... | Replies the type for the factory for the given type.
@param type the type of the object to create.
@return the factory. | [
"Replies",
"the",
"type",
"for",
"the",
"factory",
"for",
"the",
"given",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java#L397-L413 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java | AbstractSubCodeBuilderFragment.generateAppenderMembers | @SuppressWarnings("static-method")
protected StringConcatenationClient generateAppenderMembers(String appenderSimpleName,
TypeReference builderInterface, String elementAccessor) {
return new StringConcatenationClient() {
@Override
protected void appendTo(TargetStringConcatenation it) {
it.append("\tpriv... | java | @SuppressWarnings("static-method")
protected StringConcatenationClient generateAppenderMembers(String appenderSimpleName,
TypeReference builderInterface, String elementAccessor) {
return new StringConcatenationClient() {
@Override
protected void appendTo(TargetStringConcatenation it) {
it.append("\tpriv... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"StringConcatenationClient",
"generateAppenderMembers",
"(",
"String",
"appenderSimpleName",
",",
"TypeReference",
"builderInterface",
",",
"String",
"elementAccessor",
")",
"{",
"return",
"new",
"StringCo... | Generate the members related to appenders.
@param appenderSimpleName the simple name of the appender.
@param builderInterface the interface of the code builder to wrap.
@param elementAccessor the code for accessing to the generated element.
@return the code. | [
"Generate",
"the",
"members",
"related",
"to",
"appenders",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java#L442-L479 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java | AbstractSubCodeBuilderFragment.getAorAnArticle | protected static String getAorAnArticle(String word) {
if (Arrays.asList('a', 'e', 'i', 'o', 'u', 'y').contains(Character.toLowerCase(word.charAt(0)))) {
return "an"; //$NON-NLS-1$
}
return "a"; //$NON-NLS-1$
} | java | protected static String getAorAnArticle(String word) {
if (Arrays.asList('a', 'e', 'i', 'o', 'u', 'y').contains(Character.toLowerCase(word.charAt(0)))) {
return "an"; //$NON-NLS-1$
}
return "a"; //$NON-NLS-1$
} | [
"protected",
"static",
"String",
"getAorAnArticle",
"(",
"String",
"word",
")",
"{",
"if",
"(",
"Arrays",
".",
"asList",
"(",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
")",
".",
"contains",
"(",
"Chara... | Replies the "an" or "a" article according to the given word.
<p>This function does not follow the real English grammatical rule, but it is
an acceptable approximation.
@param word the word that follows the article.
@return the article. | [
"Replies",
"the",
"an",
"or",
"a",
"article",
"according",
"to",
"the",
"given",
"word",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java#L631-L636 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java | AbstractSubCodeBuilderFragment.toSingular | protected static String toSingular(String word) {
if (word.endsWith("ies")) { //$NON-NLS-1$
return word.substring(0, word.length() - 3) + "y"; //$NON-NLS-1$
}
if (word.endsWith("s")) { //$NON-NLS-1$
return word.substring(0, word.length() - 1);
}
return word;
} | java | protected static String toSingular(String word) {
if (word.endsWith("ies")) { //$NON-NLS-1$
return word.substring(0, word.length() - 3) + "y"; //$NON-NLS-1$
}
if (word.endsWith("s")) { //$NON-NLS-1$
return word.substring(0, word.length() - 1);
}
return word;
} | [
"protected",
"static",
"String",
"toSingular",
"(",
"String",
"word",
")",
"{",
"if",
"(",
"word",
".",
"endsWith",
"(",
"\"ies\"",
")",
")",
"{",
"//$NON-NLS-1$",
"return",
"word",
".",
"substring",
"(",
"0",
",",
"word",
".",
"length",
"(",
")",
"-",... | Replies the singular version of the word.
<p>This function does not follow the real English grammatical rule, but it is
an acceptable approximation.
@param word the word.
@return the singular word. | [
"Replies",
"the",
"singular",
"version",
"of",
"the",
"word",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java#L646-L654 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java | AbstractSubCodeBuilderFragment.nameMatches | protected static boolean nameMatches(EObject element, String pattern) {
if (element instanceof RuleCall) {
return nameMatches(((RuleCall) element).getRule(), pattern);
}
if (element instanceof AbstractRule) {
final String name = ((AbstractRule) element).getName();
final Pattern compilerPattern = Pattern.... | java | protected static boolean nameMatches(EObject element, String pattern) {
if (element instanceof RuleCall) {
return nameMatches(((RuleCall) element).getRule(), pattern);
}
if (element instanceof AbstractRule) {
final String name = ((AbstractRule) element).getName();
final Pattern compilerPattern = Pattern.... | [
"protected",
"static",
"boolean",
"nameMatches",
"(",
"EObject",
"element",
",",
"String",
"pattern",
")",
"{",
"if",
"(",
"element",
"instanceof",
"RuleCall",
")",
"{",
"return",
"nameMatches",
"(",
"(",
"(",
"RuleCall",
")",
"element",
")",
".",
"getRule",... | Replies if the name of the given element is matching the pattern.
@param element the element.
@param pattern the name pattern.
@return <code>true</code> if the element's name is matching. | [
"Replies",
"if",
"the",
"name",
"of",
"the",
"given",
"element",
"is",
"matching",
"the",
"pattern",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java#L662-L675 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java | AbstractSubCodeBuilderFragment.bindElementDescription | protected void bindElementDescription(BindingFactory factory, CodeElementExtractor.ElementDescription... descriptions) {
for (final CodeElementExtractor.ElementDescription description : descriptions) {
bindTypeReferences(factory,
description.getBuilderInterfaceType(),
description.getBuilderImplementation... | java | protected void bindElementDescription(BindingFactory factory, CodeElementExtractor.ElementDescription... descriptions) {
for (final CodeElementExtractor.ElementDescription description : descriptions) {
bindTypeReferences(factory,
description.getBuilderInterfaceType(),
description.getBuilderImplementation... | [
"protected",
"void",
"bindElementDescription",
"(",
"BindingFactory",
"factory",
",",
"CodeElementExtractor",
".",
"ElementDescription",
"...",
"descriptions",
")",
"{",
"for",
"(",
"final",
"CodeElementExtractor",
".",
"ElementDescription",
"description",
":",
"descripti... | Binds the given descriptions according to the standard policy.
<p>If an custom implementation is defined, it is binded to. Otherwise, the default implementation
is binded.
@param factory the binding factory to use for creating the bindings.
@param descriptions the descriptions to bind to. | [
"Binds",
"the",
"given",
"descriptions",
"according",
"to",
"the",
"standard",
"policy",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java#L707-L714 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java | AbstractSubCodeBuilderFragment.bindTypeReferences | protected void bindTypeReferences(BindingFactory factory, TypeReference interfaceType,
TypeReference implementationType, TypeReference customImplementationType) {
final IFileSystemAccess2 fileSystem = getSrc();
final TypeReference type;
if ((fileSystem.isFile(implementationType.getJavaPath()))
|| (fileSyst... | java | protected void bindTypeReferences(BindingFactory factory, TypeReference interfaceType,
TypeReference implementationType, TypeReference customImplementationType) {
final IFileSystemAccess2 fileSystem = getSrc();
final TypeReference type;
if ((fileSystem.isFile(implementationType.getJavaPath()))
|| (fileSyst... | [
"protected",
"void",
"bindTypeReferences",
"(",
"BindingFactory",
"factory",
",",
"TypeReference",
"interfaceType",
",",
"TypeReference",
"implementationType",
",",
"TypeReference",
"customImplementationType",
")",
"{",
"final",
"IFileSystemAccess2",
"fileSystem",
"=",
"get... | Binds the given references according to the standard policy.
<p>If an custom implementation is defined, it is binded to. Otherwise, the default implementation
is binded.
@param factory the binding factory to use for creating the bindings.
@param interfaceType the type to bind to an implementation type.
@param impleme... | [
"Binds",
"the",
"given",
"references",
"according",
"to",
"the",
"standard",
"policy",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java#L726-L737 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java | AbstractSubCodeBuilderFragment.getMemberRule | protected AbstractRule getMemberRule(CodeElementExtractor.ElementDescription description) {
for (final Assignment assignment : GrammarUtil.containedAssignments(description.getGrammarComponent())) {
if (Objects.equals(getCodeBuilderConfig().getMemberCollectionExtensionGrammarName(), assignment.getFeature())) {
... | java | protected AbstractRule getMemberRule(CodeElementExtractor.ElementDescription description) {
for (final Assignment assignment : GrammarUtil.containedAssignments(description.getGrammarComponent())) {
if (Objects.equals(getCodeBuilderConfig().getMemberCollectionExtensionGrammarName(), assignment.getFeature())) {
... | [
"protected",
"AbstractRule",
"getMemberRule",
"(",
"CodeElementExtractor",
".",
"ElementDescription",
"description",
")",
"{",
"for",
"(",
"final",
"Assignment",
"assignment",
":",
"GrammarUtil",
".",
"containedAssignments",
"(",
"description",
".",
"getGrammarComponent",... | Replies the rule used for defining the members of the given element.
@param description description of the container.
@return the rule that is defining the members. | [
"Replies",
"the",
"rule",
"used",
"for",
"defining",
"the",
"members",
"of",
"the",
"given",
"element",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/AbstractSubCodeBuilderFragment.java#L744-L753 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java | MavenHelper.getConfig | public String getConfig(String key) throws MojoExecutionException {
ResourceBundle resource = null;
try {
resource = ResourceBundle.getBundle(
"io/sarl/maven/compiler/config", //$NON-NLS-1$
java.util.Locale.getDefault(),
MavenHelper.class.getClassLoader());
} catch (MissingResourceException e) {... | java | public String getConfig(String key) throws MojoExecutionException {
ResourceBundle resource = null;
try {
resource = ResourceBundle.getBundle(
"io/sarl/maven/compiler/config", //$NON-NLS-1$
java.util.Locale.getDefault(),
MavenHelper.class.getClassLoader());
} catch (MissingResourceException e) {... | [
"public",
"String",
"getConfig",
"(",
"String",
"key",
")",
"throws",
"MojoExecutionException",
"{",
"ResourceBundle",
"resource",
"=",
"null",
";",
"try",
"{",
"resource",
"=",
"ResourceBundle",
".",
"getBundle",
"(",
"\"io/sarl/maven/compiler/config\"",
",",
"//$N... | Extract the value from the hard-coded configuration.
@param key the key of the configuration entry.
@return the value.
@throws MojoExecutionException on error. | [
"Extract",
"the",
"value",
"from",
"the",
"hard",
"-",
"coded",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L152-L168 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java | MavenHelper.loadPlugin | public PluginDescriptor loadPlugin(Plugin plugin)
throws MojoExecutionException {
try {
final Object repositorySessionObject = this.getRepositorySessionMethod.invoke(this.session);
return (PluginDescriptor) this.loadPluginMethod.invoke(
this.buildPluginManager,
plugin,
getSession().getCurrentP... | java | public PluginDescriptor loadPlugin(Plugin plugin)
throws MojoExecutionException {
try {
final Object repositorySessionObject = this.getRepositorySessionMethod.invoke(this.session);
return (PluginDescriptor) this.loadPluginMethod.invoke(
this.buildPluginManager,
plugin,
getSession().getCurrentP... | [
"public",
"PluginDescriptor",
"loadPlugin",
"(",
"Plugin",
"plugin",
")",
"throws",
"MojoExecutionException",
"{",
"try",
"{",
"final",
"Object",
"repositorySessionObject",
"=",
"this",
".",
"getRepositorySessionMethod",
".",
"invoke",
"(",
"this",
".",
"session",
"... | Load the given plugin.
@param plugin the plugin to load.
@return the descriptor of the plugin.
@throws MojoExecutionException if something bad append. | [
"Load",
"the",
"given",
"plugin",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L176-L189 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java | MavenHelper.executeMojo | public void executeMojo(MojoExecution mojo) throws MojoExecutionException, MojoFailureException {
try {
this.buildPluginManager.executeMojo(this.session, mojo);
} catch (PluginConfigurationException
| PluginManagerException e) {
throw new MojoFailureException(e.getLocalizedMessage(), e);
}
} | java | public void executeMojo(MojoExecution mojo) throws MojoExecutionException, MojoFailureException {
try {
this.buildPluginManager.executeMojo(this.session, mojo);
} catch (PluginConfigurationException
| PluginManagerException e) {
throw new MojoFailureException(e.getLocalizedMessage(), e);
}
} | [
"public",
"void",
"executeMojo",
"(",
"MojoExecution",
"mojo",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"try",
"{",
"this",
".",
"buildPluginManager",
".",
"executeMojo",
"(",
"this",
".",
"session",
",",
"mojo",
")",
";",
"}",
... | Execute the given mojo.
@param mojo the mojo to execute.
@throws MojoExecutionException if the mojo cannot be run properly.
@throws MojoFailureException if the build failed. | [
"Execute",
"the",
"given",
"mojo",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L197-L204 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java | MavenHelper.toDependency | @SuppressWarnings("static-method")
public Dependency toDependency(Artifact artifact) {
final Dependency result = new Dependency();
result.setArtifactId(artifact.getArtifactId());
result.setClassifier(artifact.getClassifier());
result.setGroupId(artifact.getGroupId());
result.setOptional(artifact.isOptional()... | java | @SuppressWarnings("static-method")
public Dependency toDependency(Artifact artifact) {
final Dependency result = new Dependency();
result.setArtifactId(artifact.getArtifactId());
result.setClassifier(artifact.getClassifier());
result.setGroupId(artifact.getGroupId());
result.setOptional(artifact.isOptional()... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"public",
"Dependency",
"toDependency",
"(",
"Artifact",
"artifact",
")",
"{",
"final",
"Dependency",
"result",
"=",
"new",
"Dependency",
"(",
")",
";",
"result",
".",
"setArtifactId",
"(",
"artifact",
".",... | Convert an artifact to a dependency.
@param artifact the artifact to convert.
@return the result of the conversion. | [
"Convert",
"an",
"artifact",
"to",
"a",
"dependency",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L211-L222 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java | MavenHelper.getPluginDependencies | public synchronized Map<String, Dependency> getPluginDependencies() throws MojoExecutionException {
if (this.pluginDependencies == null) {
final String groupId = getConfig("plugin.groupId"); //$NON-NLS-1$
final String artifactId = getConfig("plugin.artifactId"); //$NON-NLS-1$
final String pluginArtifactKey =... | java | public synchronized Map<String, Dependency> getPluginDependencies() throws MojoExecutionException {
if (this.pluginDependencies == null) {
final String groupId = getConfig("plugin.groupId"); //$NON-NLS-1$
final String artifactId = getConfig("plugin.artifactId"); //$NON-NLS-1$
final String pluginArtifactKey =... | [
"public",
"synchronized",
"Map",
"<",
"String",
",",
"Dependency",
">",
"getPluginDependencies",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"this",
".",
"pluginDependencies",
"==",
"null",
")",
"{",
"final",
"String",
"groupId",
"=",
"getConfi... | Build the map of dependencies for the current plugin.
@return the artifact.
@throws MojoExecutionException if the current plugin cannot be determined. | [
"Build",
"the",
"map",
"of",
"dependencies",
"for",
"the",
"current",
"plugin",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L229-L247 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java | MavenHelper.resolve | public Set<Artifact> resolve(String groupId, String artifactId) throws MojoExecutionException {
final ArtifactResolutionRequest request = new ArtifactResolutionRequest();
request.setResolveRoot(true);
request.setResolveTransitively(true);
request.setLocalRepository(getSession().getLocalRepository());
request.... | java | public Set<Artifact> resolve(String groupId, String artifactId) throws MojoExecutionException {
final ArtifactResolutionRequest request = new ArtifactResolutionRequest();
request.setResolveRoot(true);
request.setResolveTransitively(true);
request.setLocalRepository(getSession().getLocalRepository());
request.... | [
"public",
"Set",
"<",
"Artifact",
">",
"resolve",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
")",
"throws",
"MojoExecutionException",
"{",
"final",
"ArtifactResolutionRequest",
"request",
"=",
"new",
"ArtifactResolutionRequest",
"(",
")",
";",
"request",... | Resolve the artifacts with the given key.
@param groupId the group identifier.
@param artifactId the artifact identifier.
@return the discovered artifacts.
@throws MojoExecutionException if resolution cannot be done.
@since 0.8 | [
"Resolve",
"the",
"artifacts",
"with",
"the",
"given",
"key",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L268-L284 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java | MavenHelper.createArtifact | public Artifact createArtifact(String groupId, String artifactId) {
return this.repositorySystem.createArtifact(groupId, artifactId, "RELEASE", "jar"); //$NON-NLS-1$ //$NON-NLS-2$
} | java | public Artifact createArtifact(String groupId, String artifactId) {
return this.repositorySystem.createArtifact(groupId, artifactId, "RELEASE", "jar"); //$NON-NLS-1$ //$NON-NLS-2$
} | [
"public",
"Artifact",
"createArtifact",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
")",
"{",
"return",
"this",
".",
"repositorySystem",
".",
"createArtifact",
"(",
"groupId",
",",
"artifactId",
",",
"\"RELEASE\"",
",",
"\"jar\"",
")",
";",
"//$NON-NL... | Create an instance of artifact with a version range that corresponds to all versions.
@param groupId the group identifier.
@param artifactId the artifact identifier.
@return the artifact descriptor.
@since 0.8 | [
"Create",
"an",
"instance",
"of",
"artifact",
"with",
"a",
"version",
"range",
"that",
"corresponds",
"to",
"all",
"versions",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L293-L295 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java | MavenHelper.resolveDependencies | public Set<Artifact> resolveDependencies(String artifactId, boolean plugins) throws MojoExecutionException {
final Artifact pluginArtifact;
if (plugins) {
pluginArtifact = getSession().getCurrentProject().getPluginArtifactMap().get(artifactId);
} else {
pluginArtifact = getSession().getCurrentProject().getA... | java | public Set<Artifact> resolveDependencies(String artifactId, boolean plugins) throws MojoExecutionException {
final Artifact pluginArtifact;
if (plugins) {
pluginArtifact = getSession().getCurrentProject().getPluginArtifactMap().get(artifactId);
} else {
pluginArtifact = getSession().getCurrentProject().getA... | [
"public",
"Set",
"<",
"Artifact",
">",
"resolveDependencies",
"(",
"String",
"artifactId",
",",
"boolean",
"plugins",
")",
"throws",
"MojoExecutionException",
"{",
"final",
"Artifact",
"pluginArtifact",
";",
"if",
"(",
"plugins",
")",
"{",
"pluginArtifact",
"=",
... | Replies the dependencies for the given artifact.
@param artifactId the artifact identifier.
@param plugins indicates if the map of the plugin artifacts must be explore (if true) or the dependency
artifacts (if false).
@return the dependencies.
@throws MojoExecutionException if the resolution cannot be done. | [
"Replies",
"the",
"dependencies",
"for",
"the",
"given",
"artifact",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L305-L339 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java | MavenHelper.getPluginDependencyVersion | public String getPluginDependencyVersion(String groupId, String artifactId) throws MojoExecutionException {
final Map<String, Dependency> deps = getPluginDependencies();
final String key = ArtifactUtils.versionlessKey(groupId, artifactId);
this.log.debug("COMPONENT DEPENDENCIES(getPluginVersionFromDependencies):"... | java | public String getPluginDependencyVersion(String groupId, String artifactId) throws MojoExecutionException {
final Map<String, Dependency> deps = getPluginDependencies();
final String key = ArtifactUtils.versionlessKey(groupId, artifactId);
this.log.debug("COMPONENT DEPENDENCIES(getPluginVersionFromDependencies):"... | [
"public",
"String",
"getPluginDependencyVersion",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
")",
"throws",
"MojoExecutionException",
"{",
"final",
"Map",
"<",
"String",
",",
"Dependency",
">",
"deps",
"=",
"getPluginDependencies",
"(",
")",
";",
"fina... | Replies the version of the given plugin that is specified in the POM of the
plugin in which this mojo is located.
@param groupId the identifier of the group.
@param artifactId thidentifier of the artifact.
@return the version, never <code>null</code>
@throws MojoExecutionException if the plugin was not found. | [
"Replies",
"the",
"version",
"of",
"the",
"given",
"plugin",
"that",
"is",
"specified",
"in",
"the",
"POM",
"of",
"the",
"plugin",
"in",
"which",
"this",
"mojo",
"is",
"located",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L349-L363 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java | MavenHelper.toXpp3Dom | @SuppressWarnings("static-method")
public Xpp3Dom toXpp3Dom(String content, Log logger) {
if (content != null && !content.isEmpty()) {
try (StringReader sr = new StringReader(content)) {
return Xpp3DomBuilder.build(sr);
} catch (Exception exception) {
if (logger != null) {
logger.debug(exception);... | java | @SuppressWarnings("static-method")
public Xpp3Dom toXpp3Dom(String content, Log logger) {
if (content != null && !content.isEmpty()) {
try (StringReader sr = new StringReader(content)) {
return Xpp3DomBuilder.build(sr);
} catch (Exception exception) {
if (logger != null) {
logger.debug(exception);... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"public",
"Xpp3Dom",
"toXpp3Dom",
"(",
"String",
"content",
",",
"Log",
"logger",
")",
"{",
"if",
"(",
"content",
"!=",
"null",
"&&",
"!",
"content",
".",
"isEmpty",
"(",
")",
")",
"{",
"try",
"(",
... | Parse the given string for extracting an XML tree.
@param content the text to parse.
@param logger the logger to use for printing out the parsing errors. May be {@code null}.
@return the XML tree, or {@code null} if empty.
@since 0.8 | [
"Parse",
"the",
"given",
"string",
"for",
"extracting",
"an",
"XML",
"tree",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L391-L403 | train |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/configs/CompilerConfigModule.java | CompilerConfigModule.providesJavaBatchCompiler | @SuppressWarnings("static-method")
@Provides
@Singleton
public IJavaBatchCompiler providesJavaBatchCompiler(Injector injector, Provider<SarlConfig> config) {
final SarlConfig cfg = config.get();
final IJavaBatchCompiler compiler = cfg.getCompiler().getJavaCompiler().newCompilerInstance();
injector.injectMember... | java | @SuppressWarnings("static-method")
@Provides
@Singleton
public IJavaBatchCompiler providesJavaBatchCompiler(Injector injector, Provider<SarlConfig> config) {
final SarlConfig cfg = config.get();
final IJavaBatchCompiler compiler = cfg.getCompiler().getJavaCompiler().newCompilerInstance();
injector.injectMember... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"@",
"Provides",
"@",
"Singleton",
"public",
"IJavaBatchCompiler",
"providesJavaBatchCompiler",
"(",
"Injector",
"injector",
",",
"Provider",
"<",
"SarlConfig",
">",
"config",
")",
"{",
"final",
"SarlConfig",
"... | Provide a Java batch compiler based on the Bootique configuration.
@param injector the injector.
@param config the bootique configuration.
@return the batch compiler.
@since 0.8 | [
"Provide",
"a",
"Java",
"batch",
"compiler",
"based",
"on",
"the",
"Bootique",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/configs/CompilerConfigModule.java#L190-L198 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/AgentLifeCycleSupport.java | AgentLifeCycleSupport.uninstallSkillsPreStage | private static void uninstallSkillsPreStage(Iterable<? extends Skill> skills) {
try {
// Use reflection to ignore the "private/protected" access right.
for (final Skill s : skills) {
SREutils.doSkillUninstallation(s, UninstallationStage.PRE_DESTROY_EVENT);
}
} catch (RuntimeException e) {
throw e;
... | java | private static void uninstallSkillsPreStage(Iterable<? extends Skill> skills) {
try {
// Use reflection to ignore the "private/protected" access right.
for (final Skill s : skills) {
SREutils.doSkillUninstallation(s, UninstallationStage.PRE_DESTROY_EVENT);
}
} catch (RuntimeException e) {
throw e;
... | [
"private",
"static",
"void",
"uninstallSkillsPreStage",
"(",
"Iterable",
"<",
"?",
"extends",
"Skill",
">",
"skills",
")",
"{",
"try",
"{",
"// Use reflection to ignore the \"private/protected\" access right.",
"for",
"(",
"final",
"Skill",
"s",
":",
"skills",
")",
... | Run the uninstallation functions of the skills for the pre stage of the uninstallation process.
<p>This function is run before the handlers for {@link Destroy} are invoked.
@param skills the skills to uninstall.
@see #uninstallSkillsFinalStage(Agent) | [
"Run",
"the",
"uninstallation",
"functions",
"of",
"the",
"skills",
"for",
"the",
"pre",
"stage",
"of",
"the",
"uninstallation",
"process",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/AgentLifeCycleSupport.java#L174-L185 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/AgentLifeCycleSupport.java | AgentLifeCycleSupport.uninstallSkillsFinalStage | private static void uninstallSkillsFinalStage(Iterable<? extends Skill> skills) {
try {
// Use reflection to ignore the "private/protected" access right.
for (final Skill s : skills) {
SREutils.doSkillUninstallation(s, UninstallationStage.POST_DESTROY_EVENT);
}
} catch (RuntimeException e) {
throw e... | java | private static void uninstallSkillsFinalStage(Iterable<? extends Skill> skills) {
try {
// Use reflection to ignore the "private/protected" access right.
for (final Skill s : skills) {
SREutils.doSkillUninstallation(s, UninstallationStage.POST_DESTROY_EVENT);
}
} catch (RuntimeException e) {
throw e... | [
"private",
"static",
"void",
"uninstallSkillsFinalStage",
"(",
"Iterable",
"<",
"?",
"extends",
"Skill",
">",
"skills",
")",
"{",
"try",
"{",
"// Use reflection to ignore the \"private/protected\" access right.",
"for",
"(",
"final",
"Skill",
"s",
":",
"skills",
")",
... | Run the uninstallation functions of the skills for the final stage of the uninstallation process.
<p>This function is run after the handlers for {@link Destroy} are invoked.
@param skills the skills to uninstall.
@see #uninstallSkillsPreStage(Agent) | [
"Run",
"the",
"uninstallation",
"functions",
"of",
"the",
"skills",
"for",
"the",
"final",
"stage",
"of",
"the",
"uninstallation",
"process",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/AgentLifeCycleSupport.java#L194-L205 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/hazelcast/HazelcastKernelDiscoveryService.java | HazelcastKernelDiscoveryService.fireKernelDiscovered | protected void fireKernelDiscovered(URI uri) {
this.logger.getKernelLogger().info(MessageFormat.format(Messages.HazelcastKernelDiscoveryService_0, uri, getCurrentKernel()));
for (final KernelDiscoveryServiceListener listener : this.listeners.getListeners(KernelDiscoveryServiceListener.class)) {
listener.kernelDi... | java | protected void fireKernelDiscovered(URI uri) {
this.logger.getKernelLogger().info(MessageFormat.format(Messages.HazelcastKernelDiscoveryService_0, uri, getCurrentKernel()));
for (final KernelDiscoveryServiceListener listener : this.listeners.getListeners(KernelDiscoveryServiceListener.class)) {
listener.kernelDi... | [
"protected",
"void",
"fireKernelDiscovered",
"(",
"URI",
"uri",
")",
"{",
"this",
".",
"logger",
".",
"getKernelLogger",
"(",
")",
".",
"info",
"(",
"MessageFormat",
".",
"format",
"(",
"Messages",
".",
"HazelcastKernelDiscoveryService_0",
",",
"uri",
",",
"ge... | Notifies the listeners about the discovering of a kernel.
@param uri URI of the discovered kernel. | [
"Notifies",
"the",
"listeners",
"about",
"the",
"discovering",
"of",
"a",
"kernel",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/hazelcast/HazelcastKernelDiscoveryService.java#L173-L178 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/hazelcast/HazelcastKernelDiscoveryService.java | HazelcastKernelDiscoveryService.fireKernelDisconnected | protected void fireKernelDisconnected(URI uri) {
this.logger.getKernelLogger().info(MessageFormat.format(Messages.HazelcastKernelDiscoveryService_1, uri, getCurrentKernel()));
for (final KernelDiscoveryServiceListener listener : this.listeners.getListeners(KernelDiscoveryServiceListener.class)) {
listener.kernel... | java | protected void fireKernelDisconnected(URI uri) {
this.logger.getKernelLogger().info(MessageFormat.format(Messages.HazelcastKernelDiscoveryService_1, uri, getCurrentKernel()));
for (final KernelDiscoveryServiceListener listener : this.listeners.getListeners(KernelDiscoveryServiceListener.class)) {
listener.kernel... | [
"protected",
"void",
"fireKernelDisconnected",
"(",
"URI",
"uri",
")",
"{",
"this",
".",
"logger",
".",
"getKernelLogger",
"(",
")",
".",
"info",
"(",
"MessageFormat",
".",
"format",
"(",
"Messages",
".",
"HazelcastKernelDiscoveryService_1",
",",
"uri",
",",
"... | Notifies the listeners about the killing of a kernel.
@param uri URI of the disconnected kernel. | [
"Notifies",
"the",
"listeners",
"about",
"the",
"killing",
"of",
"a",
"kernel",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/hazelcast/HazelcastKernelDiscoveryService.java#L185-L190 | train |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/configs/SarlConfig.java | SarlConfig.getConfiguration | public static SarlConfig getConfiguration(ConfigurationFactory configFactory) {
assert configFactory != null;
return configFactory.config(SarlConfig.class, PREFIX);
} | java | public static SarlConfig getConfiguration(ConfigurationFactory configFactory) {
assert configFactory != null;
return configFactory.config(SarlConfig.class, PREFIX);
} | [
"public",
"static",
"SarlConfig",
"getConfiguration",
"(",
"ConfigurationFactory",
"configFactory",
")",
"{",
"assert",
"configFactory",
"!=",
"null",
";",
"return",
"configFactory",
".",
"config",
"(",
"SarlConfig",
".",
"class",
",",
"PREFIX",
")",
";",
"}"
] | Replies the configuration for SARLC.
@param configFactory the general configuration factory.
@return the SARLC configuration. | [
"Replies",
"the",
"configuration",
"for",
"SARLC",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/configs/SarlConfig.java#L108-L111 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java | AbstractSarlMojo.unix2os | protected static File unix2os(String filename) {
File file = null;
for (final String base : filename.split(Pattern.quote("/"))) { //$NON-NLS-1$
if (file == null) {
file = new File(base);
} else {
file = new File(file, base);
}
}
return file;
} | java | protected static File unix2os(String filename) {
File file = null;
for (final String base : filename.split(Pattern.quote("/"))) { //$NON-NLS-1$
if (file == null) {
file = new File(base);
} else {
file = new File(file, base);
}
}
return file;
} | [
"protected",
"static",
"File",
"unix2os",
"(",
"String",
"filename",
")",
"{",
"File",
"file",
"=",
"null",
";",
"for",
"(",
"final",
"String",
"base",
":",
"filename",
".",
"split",
"(",
"Pattern",
".",
"quote",
"(",
"\"/\"",
")",
")",
")",
"{",
"//... | Create a file from a unix-like representation of the filename.
@param filename the unix-like filename.
@return the file. | [
"Create",
"a",
"file",
"from",
"a",
"unix",
"-",
"like",
"representation",
"of",
"the",
"filename",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java#L137-L147 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java | AbstractSarlMojo.makeAbsolute | protected File makeAbsolute(File file) {
if (!file.isAbsolute()) {
final File basedir = this.mavenHelper.getSession().getCurrentProject().getBasedir();
return new File(basedir, file.getPath()).getAbsoluteFile();
}
return file;
} | java | protected File makeAbsolute(File file) {
if (!file.isAbsolute()) {
final File basedir = this.mavenHelper.getSession().getCurrentProject().getBasedir();
return new File(basedir, file.getPath()).getAbsoluteFile();
}
return file;
} | [
"protected",
"File",
"makeAbsolute",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"!",
"file",
".",
"isAbsolute",
"(",
")",
")",
"{",
"final",
"File",
"basedir",
"=",
"this",
".",
"mavenHelper",
".",
"getSession",
"(",
")",
".",
"getCurrentProject",
"(",
... | Make absolute the given filename, relatively to the project's folder.
@param file the file to convert.
@return the absolute filename. | [
"Make",
"absolute",
"the",
"given",
"filename",
"relatively",
"to",
"the",
"project",
"s",
"folder",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java#L154-L160 | train |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java | AbstractSarlMojo.executeMojo | protected void executeMojo(
String groupId, String artifactId,
String version, String goal,
String configuration,
Dependency... dependencies) throws MojoExecutionException, MojoFailureException {
final Plugin plugin = new Plugin();
plugin.setArtifactId(artifactId);
plugin.setGroupId(groupId);
plugin... | java | protected void executeMojo(
String groupId, String artifactId,
String version, String goal,
String configuration,
Dependency... dependencies) throws MojoExecutionException, MojoFailureException {
final Plugin plugin = new Plugin();
plugin.setArtifactId(artifactId);
plugin.setGroupId(groupId);
plugin... | [
"protected",
"void",
"executeMojo",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
",",
"String",
"goal",
",",
"String",
"configuration",
",",
"Dependency",
"...",
"dependencies",
")",
"throws",
"MojoExecutionException",
",",
"Moj... | Execute another MOJO.
@param groupId identifier of the MOJO plugin group.
@param artifactId identifier of the MOJO plugin artifact.
@param version version of the MOJO plugin version.
@param goal the goal to run.
@param configuration the XML code for the configuration.
@param dependencies the dependencies of the plugin... | [
"Execute",
"another",
"MOJO",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java#L231-L273 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java | AbstractDocumentationMojo.internalExecute | protected String internalExecute() {
getLog().info(Messages.AbstractDocumentationMojo_1);
final Map<File, File> files = getFiles();
getLog().info(MessageFormat.format(Messages.AbstractDocumentationMojo_2, files.size()));
return internalExecute(files);
} | java | protected String internalExecute() {
getLog().info(Messages.AbstractDocumentationMojo_1);
final Map<File, File> files = getFiles();
getLog().info(MessageFormat.format(Messages.AbstractDocumentationMojo_2, files.size()));
return internalExecute(files);
} | [
"protected",
"String",
"internalExecute",
"(",
")",
"{",
"getLog",
"(",
")",
".",
"info",
"(",
"Messages",
".",
"AbstractDocumentationMojo_1",
")",
";",
"final",
"Map",
"<",
"File",
",",
"File",
">",
"files",
"=",
"getFiles",
"(",
")",
";",
"getLog",
"("... | Internal run.
@return the error message | [
"Internal",
"run",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java#L242-L247 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java | AbstractDocumentationMojo.formatErrorMessage | protected String formatErrorMessage(File inputFile, Throwable exception) {
File filename;
int lineno = 0;
final boolean addExceptionName;
if (exception instanceof ParsingException) {
addExceptionName = false;
final ParsingException pexception = (ParsingException) exception;
final File file = pexception... | java | protected String formatErrorMessage(File inputFile, Throwable exception) {
File filename;
int lineno = 0;
final boolean addExceptionName;
if (exception instanceof ParsingException) {
addExceptionName = false;
final ParsingException pexception = (ParsingException) exception;
final File file = pexception... | [
"protected",
"String",
"formatErrorMessage",
"(",
"File",
"inputFile",
",",
"Throwable",
"exception",
")",
"{",
"File",
"filename",
";",
"int",
"lineno",
"=",
"0",
";",
"final",
"boolean",
"addExceptionName",
";",
"if",
"(",
"exception",
"instanceof",
"ParsingEx... | Format the error message.
@param inputFile the input file.
@param exception the error.
@return the error message. | [
"Format",
"the",
"error",
"message",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java#L309-L351 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java | AbstractDocumentationMojo.createLanguageParser | @SuppressWarnings("checkstyle:npathcomplexity")
protected AbstractMarkerLanguageParser createLanguageParser(File inputFile) throws MojoExecutionException, IOException {
final AbstractMarkerLanguageParser parser;
if (isFileExtension(inputFile, MarkdownParser.MARKDOWN_FILE_EXTENSIONS)) {
parser = this.injector.ge... | java | @SuppressWarnings("checkstyle:npathcomplexity")
protected AbstractMarkerLanguageParser createLanguageParser(File inputFile) throws MojoExecutionException, IOException {
final AbstractMarkerLanguageParser parser;
if (isFileExtension(inputFile, MarkdownParser.MARKDOWN_FILE_EXTENSIONS)) {
parser = this.injector.ge... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:npathcomplexity\"",
")",
"protected",
"AbstractMarkerLanguageParser",
"createLanguageParser",
"(",
"File",
"inputFile",
")",
"throws",
"MojoExecutionException",
",",
"IOException",
"{",
"final",
"AbstractMarkerLanguageParser",
"parser... | Create a parser for the given file.
@param inputFile the file to be parsed.
@return the parser.
@throws MojoExecutionException if the parser cannot be created.
@throws IOException if a classpath entry cannot be found. | [
"Create",
"a",
"parser",
"for",
"the",
"given",
"file",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java#L378-L429 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java | AbstractDocumentationMojo.getFiles | protected Map<File, File> getFiles() {
final Map<File, File> files = new TreeMap<>();
for (final String rootName : this.inferredSourceDirectories) {
File root = FileSystem.convertStringToFile(rootName);
if (!root.isAbsolute()) {
root = FileSystem.makeAbsolute(root, this.baseDirectory);
}
getLog().de... | java | protected Map<File, File> getFiles() {
final Map<File, File> files = new TreeMap<>();
for (final String rootName : this.inferredSourceDirectories) {
File root = FileSystem.convertStringToFile(rootName);
if (!root.isAbsolute()) {
root = FileSystem.makeAbsolute(root, this.baseDirectory);
}
getLog().de... | [
"protected",
"Map",
"<",
"File",
",",
"File",
">",
"getFiles",
"(",
")",
"{",
"final",
"Map",
"<",
"File",
",",
"File",
">",
"files",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"String",
"rootName",
":",
"this",
".",
"inferred... | Replies the source files.
@return the map from the source files to the corresponding source folders. | [
"Replies",
"the",
"source",
"files",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java#L463-L478 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java | AbstractDocumentationMojo.toPackageName | protected static String toPackageName(String rootPackage, File packageName) {
final StringBuilder name = new StringBuilder();
File tmp = packageName;
while (tmp != null) {
final String elementName = tmp.getName();
if (!Strings.equal(FileSystem.CURRENT_DIRECTORY, elementName)
&& !Strings.equal(FileSyst... | java | protected static String toPackageName(String rootPackage, File packageName) {
final StringBuilder name = new StringBuilder();
File tmp = packageName;
while (tmp != null) {
final String elementName = tmp.getName();
if (!Strings.equal(FileSystem.CURRENT_DIRECTORY, elementName)
&& !Strings.equal(FileSyst... | [
"protected",
"static",
"String",
"toPackageName",
"(",
"String",
"rootPackage",
",",
"File",
"packageName",
")",
"{",
"final",
"StringBuilder",
"name",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"File",
"tmp",
"=",
"packageName",
";",
"while",
"(",
"tmp",
"... | Convert a file to a package name.
@param rootPackage an additional root package.
@param packageName the file.
@return the package name. | [
"Convert",
"a",
"file",
"to",
"a",
"package",
"name",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java#L491-L512 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.