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.ui/src/io/sarl/lang/ui/codemining/SARLCodeMiningProvider.java | SARLCodeMiningProvider.createImplicitActionReturnType | @SuppressWarnings("checkstyle:npathcomplexity")
private void createImplicitActionReturnType(XtextResource resource, IAcceptor<? super ICodeMining> acceptor) {
final List<XtendFunction> actions = EcoreUtil2.eAllOfType(resource.getContents().get(0), XtendFunction.class);
for (final XtendFunction action : actions) {... | java | @SuppressWarnings("checkstyle:npathcomplexity")
private void createImplicitActionReturnType(XtextResource resource, IAcceptor<? super ICodeMining> acceptor) {
final List<XtendFunction> actions = EcoreUtil2.eAllOfType(resource.getContents().get(0), XtendFunction.class);
for (final XtendFunction action : actions) {... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:npathcomplexity\"",
")",
"private",
"void",
"createImplicitActionReturnType",
"(",
"XtextResource",
"resource",
",",
"IAcceptor",
"<",
"?",
"super",
"ICodeMining",
">",
"acceptor",
")",
"{",
"final",
"List",
"<",
"XtendFunct... | Add an annotation when the action's return type is implicit and inferred by the SARL compiler.
@param resource the resource to parse.
@param acceptor the code mining acceptor. | [
"Add",
"an",
"annotation",
"when",
"the",
"action",
"s",
"return",
"type",
"is",
"implicit",
"and",
"inferred",
"by",
"the",
"SARL",
"compiler",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/codemining/SARLCodeMiningProvider.java#L252-L298 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/services/SARLGrammarKeywordAccess.java | SARLGrammarKeywordAccess.getPureKeywords | public Set<String> getPureKeywords() {
Set<String> kws = this.pureSarlKeywords == null ? null : this.pureSarlKeywords.get();
if (kws == null) {
kws = new HashSet<>();
kws.add(getAsKeyword());
kws.add(getRequiresKeyword());
kws.add(getWithKeyword());
kws.add(getItKeyword());
kws.add(getArtifactKeyw... | java | public Set<String> getPureKeywords() {
Set<String> kws = this.pureSarlKeywords == null ? null : this.pureSarlKeywords.get();
if (kws == null) {
kws = new HashSet<>();
kws.add(getAsKeyword());
kws.add(getRequiresKeyword());
kws.add(getWithKeyword());
kws.add(getItKeyword());
kws.add(getArtifactKeyw... | [
"public",
"Set",
"<",
"String",
">",
"getPureKeywords",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"kws",
"=",
"this",
".",
"pureSarlKeywords",
"==",
"null",
"?",
"null",
":",
"this",
".",
"pureSarlKeywords",
".",
"get",
"(",
")",
";",
"if",
"(",
"kws... | Replies the pure SARL keywords.
Pure SARL keywords are SARL keywords that are not Java keywords.
@return the pure SARL keywords. | [
"Replies",
"the",
"pure",
"SARL",
"keywords",
".",
"Pure",
"SARL",
"keywords",
"are",
"SARL",
"keywords",
"that",
"are",
"not",
"Java",
"keywords",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/services/SARLGrammarKeywordAccess.java#L946-L977 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/services/SARLGrammarKeywordAccess.java | SARLGrammarKeywordAccess.protectKeyword | public String protectKeyword(String text) {
if (!Strings.isEmpty(text) && isKeyword(text)) {
return "^" + text;
}
return text;
} | java | public String protectKeyword(String text) {
if (!Strings.isEmpty(text) && isKeyword(text)) {
return "^" + text;
}
return text;
} | [
"public",
"String",
"protectKeyword",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isEmpty",
"(",
"text",
")",
"&&",
"isKeyword",
"(",
"text",
")",
")",
"{",
"return",
"\"^\"",
"+",
"text",
";",
"}",
"return",
"text",
";",
"}"
] | Protect the given text if it is a keyword.
@param text the text to protect.
@return the protected text. | [
"Protect",
"the",
"given",
"text",
"if",
"it",
"is",
"a",
"keyword",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/services/SARLGrammarKeywordAccess.java#L993-L998 | train |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/validator/PyValidator.java | PyValidator.checkImportsMapping | @Check
public void checkImportsMapping(XImportDeclaration importDeclaration) {
final JvmDeclaredType type = importDeclaration.getImportedType();
doTypeMappingCheck(importDeclaration, type, this.typeErrorHandler1);
} | java | @Check
public void checkImportsMapping(XImportDeclaration importDeclaration) {
final JvmDeclaredType type = importDeclaration.getImportedType();
doTypeMappingCheck(importDeclaration, type, this.typeErrorHandler1);
} | [
"@",
"Check",
"public",
"void",
"checkImportsMapping",
"(",
"XImportDeclaration",
"importDeclaration",
")",
"{",
"final",
"JvmDeclaredType",
"type",
"=",
"importDeclaration",
".",
"getImportedType",
"(",
")",
";",
"doTypeMappingCheck",
"(",
"importDeclaration",
",",
"... | Check that import mapping are known.
@param importDeclaration the declaration. | [
"Check",
"that",
"import",
"mapping",
"are",
"known",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/validator/PyValidator.java#L148-L152 | train |
sarl/sarl | main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/MavenImportUtils.java | MavenImportUtils.importMavenProject | public static void importMavenProject(IWorkspaceRoot workspaceRoot, String projectName,
boolean addSarlSpecificSourceFolders, IProgressMonitor monitor) {
// XXX: The m2e plugin seems to have an issue for creating a fresh project with the SARL plugin as an extension.
// Solution: Create a simple project, and swit... | java | public static void importMavenProject(IWorkspaceRoot workspaceRoot, String projectName,
boolean addSarlSpecificSourceFolders, IProgressMonitor monitor) {
// XXX: The m2e plugin seems to have an issue for creating a fresh project with the SARL plugin as an extension.
// Solution: Create a simple project, and swit... | [
"public",
"static",
"void",
"importMavenProject",
"(",
"IWorkspaceRoot",
"workspaceRoot",
",",
"String",
"projectName",
",",
"boolean",
"addSarlSpecificSourceFolders",
",",
"IProgressMonitor",
"monitor",
")",
"{",
"// XXX: The m2e plugin seems to have an issue for creating a fres... | Create a fresh Maven project from existing files, assuming a pom file exists.
<p>If the Maven project is associated to an existing {@code IProject}, then the source folders
must be configured before the call to this function.
@param workspaceRoot the workspace root.
@param projectName the name of the project that is ... | [
"Create",
"a",
"fresh",
"Maven",
"project",
"from",
"existing",
"files",
"assuming",
"a",
"pom",
"file",
"exists",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/MavenImportUtils.java#L84-L110 | train |
sarl/sarl | main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/MavenImportUtils.java | MavenImportUtils.runFixedImportJob | static List<IMavenProjectImportResult> runFixedImportJob(boolean addSarlSpecificSourceFolders,
Collection<MavenProjectInfo> projectInfos,
ProjectImportConfiguration importConfiguration, IProjectCreationListener projectCreationListener,
IProgressMonitor monitor) throws CoreException {
final List<IMavenProject... | java | static List<IMavenProjectImportResult> runFixedImportJob(boolean addSarlSpecificSourceFolders,
Collection<MavenProjectInfo> projectInfos,
ProjectImportConfiguration importConfiguration, IProjectCreationListener projectCreationListener,
IProgressMonitor monitor) throws CoreException {
final List<IMavenProject... | [
"static",
"List",
"<",
"IMavenProjectImportResult",
">",
"runFixedImportJob",
"(",
"boolean",
"addSarlSpecificSourceFolders",
",",
"Collection",
"<",
"MavenProjectInfo",
">",
"projectInfos",
",",
"ProjectImportConfiguration",
"importConfiguration",
",",
"IProjectCreationListene... | Run the job that execute a fixed import of a Maven project.
@param addSarlSpecificSourceFolders indicates if the source folders that are specific to SARL should be added.
@param projectInfos the list of descriptions for each project to import.
@param importConfiguration the import configuration.
@param projectCreation... | [
"Run",
"the",
"job",
"that",
"execute",
"a",
"fixed",
"import",
"of",
"a",
"Maven",
"project",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/MavenImportUtils.java#L123-L156 | train |
sarl/sarl | main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/MavenImportUtils.java | MavenImportUtils.forceSimplePom | static void forceSimplePom(File projectDir, IProgressMonitor monitor) throws IOException {
final File pomFile = new File(projectDir, POM_FILE);
if (pomFile.exists()) {
final SubMonitor submon = SubMonitor.convert(monitor, 4);
final File savedPomFile = new File(projectDir, POM_BACKUP_FILE);
if (savedPomFile... | java | static void forceSimplePom(File projectDir, IProgressMonitor monitor) throws IOException {
final File pomFile = new File(projectDir, POM_FILE);
if (pomFile.exists()) {
final SubMonitor submon = SubMonitor.convert(monitor, 4);
final File savedPomFile = new File(projectDir, POM_BACKUP_FILE);
if (savedPomFile... | [
"static",
"void",
"forceSimplePom",
"(",
"File",
"projectDir",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"IOException",
"{",
"final",
"File",
"pomFile",
"=",
"new",
"File",
"(",
"projectDir",
",",
"POM_FILE",
")",
";",
"if",
"(",
"pomFile",
".",
"ex... | Force the pom file of a project to be "simple".
@param projectDir the folder in which the pom file is located.
@param monitor the progress monitor.
@throws IOException if the pom file cannot be changed. | [
"Force",
"the",
"pom",
"file",
"of",
"a",
"project",
"to",
"be",
"simple",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/MavenImportUtils.java#L186-L210 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/buildpath/AbstractSARLBasedClasspathContainer.java | AbstractSARLBasedClasspathContainer.getBundleDependencies | public final Set<String> getBundleDependencies() {
final Set<String> bundles = new TreeSet<>();
updateBundleList(bundles);
return bundles;
} | java | public final Set<String> getBundleDependencies() {
final Set<String> bundles = new TreeSet<>();
updateBundleList(bundles);
return bundles;
} | [
"public",
"final",
"Set",
"<",
"String",
">",
"getBundleDependencies",
"(",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"bundles",
"=",
"new",
"TreeSet",
"<>",
"(",
")",
";",
"updateBundleList",
"(",
"bundles",
")",
";",
"return",
"bundles",
";",
"}"
] | Replies the list of the symbolic names of the bundle dependencies.
@return the bundle symbolic names of the dependencies. | [
"Replies",
"the",
"list",
"of",
"the",
"symbolic",
"names",
"of",
"the",
"bundle",
"dependencies",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/buildpath/AbstractSARLBasedClasspathContainer.java#L71-L75 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/Skill.java | Skill.getCaller | @SuppressWarnings("static-method")
@Pure
@Inline(value = "$1.getCaller()", imported = Capacities.class, constantExpression = true)
protected AgentTrait getCaller() {
return Capacities.getCaller();
} | java | @SuppressWarnings("static-method")
@Pure
@Inline(value = "$1.getCaller()", imported = Capacities.class, constantExpression = true)
protected AgentTrait getCaller() {
return Capacities.getCaller();
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"$1.getCaller()\"",
",",
"imported",
"=",
"Capacities",
".",
"class",
",",
"constantExpression",
"=",
"true",
")",
"protected",
"AgentTrait",
"getCaller",
"(... | Replies the caller of the capacity functions.
<p>The replied value has a meaning inside the skills' functions that
are implemented the capacities' functions.
@return the caller, or {@code null} if the caller is unknown (assuming that the caller is the agent itself).
@since 0.7 | [
"Replies",
"the",
"caller",
"of",
"the",
"capacity",
"functions",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/Skill.java#L75-L80 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/Skill.java | Skill.unregisterUse | void unregisterUse() {
final int value = this.uses.decrementAndGet();
if (value == 0) {
uninstall(UninstallationStage.PRE_DESTROY_EVENT);
uninstall(UninstallationStage.POST_DESTROY_EVENT);
}
} | java | void unregisterUse() {
final int value = this.uses.decrementAndGet();
if (value == 0) {
uninstall(UninstallationStage.PRE_DESTROY_EVENT);
uninstall(UninstallationStage.POST_DESTROY_EVENT);
}
} | [
"void",
"unregisterUse",
"(",
")",
"{",
"final",
"int",
"value",
"=",
"this",
".",
"uses",
".",
"decrementAndGet",
"(",
")",
";",
"if",
"(",
"value",
"==",
"0",
")",
"{",
"uninstall",
"(",
"UninstallationStage",
".",
"PRE_DESTROY_EVENT",
")",
";",
"unins... | Mark this skill as release by one user. | [
"Mark",
"this",
"skill",
"as",
"release",
"by",
"one",
"user",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/Skill.java#L93-L99 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/FormalParameterBuilderFragment.java | FormalParameterBuilderFragment.generateIFormalParameterBuilder | protected void generateIFormalParameterBuilder() {
final TypeReference builder = getFormalParameterBuilderInterface();
final StringConcatenationClient content = new StringConcatenationClient() {
@Override
protected void appendTo(TargetStringConcatenation it) {
it.append("/** Builder of a " + getLanguageNa... | java | protected void generateIFormalParameterBuilder() {
final TypeReference builder = getFormalParameterBuilderInterface();
final StringConcatenationClient content = new StringConcatenationClient() {
@Override
protected void appendTo(TargetStringConcatenation it) {
it.append("/** Builder of a " + getLanguageNa... | [
"protected",
"void",
"generateIFormalParameterBuilder",
"(",
")",
"{",
"final",
"TypeReference",
"builder",
"=",
"getFormalParameterBuilderInterface",
"(",
")",
";",
"final",
"StringConcatenationClient",
"content",
"=",
"new",
"StringConcatenationClient",
"(",
")",
"{",
... | Generate the formal parameter builder interface. | [
"Generate",
"the",
"formal",
"parameter",
"builder",
"interface",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/FormalParameterBuilderFragment.java#L100-L125 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/FormalParameterBuilderFragment.java | FormalParameterBuilderFragment.generateFormalParameterAppender | protected void generateFormalParameterAppender() {
final CodeElementExtractor.ElementDescription parameter = getCodeElementExtractor().getFormalParameter();
final String accessor = "get" //$NON-NLS-1$
+ Strings.toFirstUpper(parameter.getElementType().getSimpleName()) + "()"; //$NON-NLS-1$
final TypeReference ... | java | protected void generateFormalParameterAppender() {
final CodeElementExtractor.ElementDescription parameter = getCodeElementExtractor().getFormalParameter();
final String accessor = "get" //$NON-NLS-1$
+ Strings.toFirstUpper(parameter.getElementType().getSimpleName()) + "()"; //$NON-NLS-1$
final TypeReference ... | [
"protected",
"void",
"generateFormalParameterAppender",
"(",
")",
"{",
"final",
"CodeElementExtractor",
".",
"ElementDescription",
"parameter",
"=",
"getCodeElementExtractor",
"(",
")",
".",
"getFormalParameter",
"(",
")",
";",
"final",
"String",
"accessor",
"=",
"\"g... | Generate the formal parameter appender. | [
"Generate",
"the",
"formal",
"parameter",
"appender",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/FormalParameterBuilderFragment.java#L163-L197 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/StandardContextSpaceService.java | StandardContextSpaceService.fireContextCreated | protected void fireContextCreated(AgentContext context) {
final ContextRepositoryListener[] ilisteners = this.listeners.getListeners(ContextRepositoryListener.class);
this.logger.getKernelLogger().info(MessageFormat.format(Messages.StandardContextSpaceService_0, context.getID()));
for (final ContextRepositoryList... | java | protected void fireContextCreated(AgentContext context) {
final ContextRepositoryListener[] ilisteners = this.listeners.getListeners(ContextRepositoryListener.class);
this.logger.getKernelLogger().info(MessageFormat.format(Messages.StandardContextSpaceService_0, context.getID()));
for (final ContextRepositoryList... | [
"protected",
"void",
"fireContextCreated",
"(",
"AgentContext",
"context",
")",
"{",
"final",
"ContextRepositoryListener",
"[",
"]",
"ilisteners",
"=",
"this",
".",
"listeners",
".",
"getListeners",
"(",
"ContextRepositoryListener",
".",
"class",
")",
";",
"this",
... | Notifies the listeners about a context creation.
@param context reference to the created context. | [
"Notifies",
"the",
"listeners",
"about",
"a",
"context",
"creation",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/StandardContextSpaceService.java#L309-L315 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/StandardContextSpaceService.java | StandardContextSpaceService.fireContextDestroyed | protected void fireContextDestroyed(AgentContext context) {
final ContextRepositoryListener[] ilisteners = this.listeners.getListeners(ContextRepositoryListener.class);
this.logger.getKernelLogger().info(MessageFormat.format(Messages.StandardContextSpaceService_1, context.getID()));
for (final ContextRepositoryLi... | java | protected void fireContextDestroyed(AgentContext context) {
final ContextRepositoryListener[] ilisteners = this.listeners.getListeners(ContextRepositoryListener.class);
this.logger.getKernelLogger().info(MessageFormat.format(Messages.StandardContextSpaceService_1, context.getID()));
for (final ContextRepositoryLi... | [
"protected",
"void",
"fireContextDestroyed",
"(",
"AgentContext",
"context",
")",
"{",
"final",
"ContextRepositoryListener",
"[",
"]",
"ilisteners",
"=",
"this",
".",
"listeners",
".",
"getListeners",
"(",
"ContextRepositoryListener",
".",
"class",
")",
";",
"this",... | Notifies the listeners about a context destruction.
@param context reference to the destroyed context. | [
"Notifies",
"the",
"listeners",
"about",
"a",
"context",
"destruction",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/StandardContextSpaceService.java#L322-L328 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/StandardContextSpaceService.java | StandardContextSpaceService.removeDefaultSpaceDefinition | protected void removeDefaultSpaceDefinition(SpaceID spaceID) {
AgentContext context = null;
synchronized (mutex()) {
context = this.contexts.remove(spaceID.getContextID());
}
if (context != null) {
fireContextDestroyed(context);
}
} | java | protected void removeDefaultSpaceDefinition(SpaceID spaceID) {
AgentContext context = null;
synchronized (mutex()) {
context = this.contexts.remove(spaceID.getContextID());
}
if (context != null) {
fireContextDestroyed(context);
}
} | [
"protected",
"void",
"removeDefaultSpaceDefinition",
"(",
"SpaceID",
"spaceID",
")",
"{",
"AgentContext",
"context",
"=",
"null",
";",
"synchronized",
"(",
"mutex",
"(",
")",
")",
"{",
"context",
"=",
"this",
".",
"contexts",
".",
"remove",
"(",
"spaceID",
"... | Update the internal data structure when a default space was removed.
@param spaceID identifier of the space to remove. | [
"Update",
"the",
"internal",
"data",
"structure",
"when",
"a",
"default",
"space",
"was",
"removed",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/StandardContextSpaceService.java#L378-L386 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/latex/LaTeXListingsGenerator2.java | LaTeXListingsGenerator2.addRequirement | public void addRequirement(String requirement) {
if (!Strings.isEmpty(requirement)) {
if (this.requirements == null) {
this.requirements = new ArrayList<>();
}
this.requirements.add(requirement);
}
} | java | public void addRequirement(String requirement) {
if (!Strings.isEmpty(requirement)) {
if (this.requirements == null) {
this.requirements = new ArrayList<>();
}
this.requirements.add(requirement);
}
} | [
"public",
"void",
"addRequirement",
"(",
"String",
"requirement",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isEmpty",
"(",
"requirement",
")",
")",
"{",
"if",
"(",
"this",
".",
"requirements",
"==",
"null",
")",
"{",
"this",
".",
"requirements",
"=",
... | Add a TeX requirement.
@param requirement the name of the TeX package. | [
"Add",
"a",
"TeX",
"requirement",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/latex/LaTeXListingsGenerator2.java#L255-L262 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/latex/LaTeXListingsGenerator2.java | LaTeXListingsGenerator2.generateOptions | @SuppressWarnings("static-method")
protected boolean generateOptions(IStyleAppendable it) {
it.appendNl("\\newif\\ifusesarlcolors\\usesarlcolorstrue"); //$NON-NLS-1$
it.appendNl("\\DeclareOption{sarlcolors}{\\global\\usesarlcolorstrue}"); //$NON-NLS-1$
it.appendNl("\\DeclareOption{nosarlcolors}{\\global\\usesarl... | java | @SuppressWarnings("static-method")
protected boolean generateOptions(IStyleAppendable it) {
it.appendNl("\\newif\\ifusesarlcolors\\usesarlcolorstrue"); //$NON-NLS-1$
it.appendNl("\\DeclareOption{sarlcolors}{\\global\\usesarlcolorstrue}"); //$NON-NLS-1$
it.appendNl("\\DeclareOption{nosarlcolors}{\\global\\usesarl... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"boolean",
"generateOptions",
"(",
"IStyleAppendable",
"it",
")",
"{",
"it",
".",
"appendNl",
"(",
"\"\\\\newif\\\\ifusesarlcolors\\\\usesarlcolorstrue\"",
")",
";",
"//$NON-NLS-1$",
"it",
".",
"append... | Generate the optional extensions.
@param it the target.
@return {@code true} if options are generated.
@since 0.6 | [
"Generate",
"the",
"optional",
"extensions",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/latex/LaTeXListingsGenerator2.java#L430-L436 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/network/AESEventEncrypter.java | AESEventEncrypter.setKey | @Inject
public void setKey(@Named(NetworkConfig.AES_KEY) String key) throws Exception {
final byte[] raw = key.getBytes(NetworkConfig.getStringEncodingCharset());
final int keySize = raw.length;
if ((keySize % 16) == 0 || (keySize % 24) == 0 || (keySize % 32) == 0) {
this.skeySpec = new SecretKeySpec(raw, "AE... | java | @Inject
public void setKey(@Named(NetworkConfig.AES_KEY) String key) throws Exception {
final byte[] raw = key.getBytes(NetworkConfig.getStringEncodingCharset());
final int keySize = raw.length;
if ((keySize % 16) == 0 || (keySize % 24) == 0 || (keySize % 32) == 0) {
this.skeySpec = new SecretKeySpec(raw, "AE... | [
"@",
"Inject",
"public",
"void",
"setKey",
"(",
"@",
"Named",
"(",
"NetworkConfig",
".",
"AES_KEY",
")",
"String",
"key",
")",
"throws",
"Exception",
"{",
"final",
"byte",
"[",
"]",
"raw",
"=",
"key",
".",
"getBytes",
"(",
"NetworkConfig",
".",
"getStrin... | Change the encryption key.
@param key injected encryption key.
@throws Exception - when the given key is invalid. | [
"Change",
"the",
"encryption",
"key",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/network/AESEventEncrypter.java#L62-L73 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java | SarlLinkFactory.getLinkForPrimitive | @SuppressWarnings("static-method")
protected void getLinkForPrimitive(Content link, LinkInfo linkInfo, Type type) {
link.addContent(type.typeName());
} | java | @SuppressWarnings("static-method")
protected void getLinkForPrimitive(Content link, LinkInfo linkInfo, Type type) {
link.addContent(type.typeName());
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"void",
"getLinkForPrimitive",
"(",
"Content",
"link",
",",
"LinkInfo",
"linkInfo",
",",
"Type",
"type",
")",
"{",
"link",
".",
"addContent",
"(",
"type",
".",
"typeName",
"(",
")",
")",
";... | Build the link for the primitive.
@param link the link.
@param linkInfo the information on the link.
@param type the type. | [
"Build",
"the",
"link",
"for",
"the",
"primitive",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java#L64-L67 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java | SarlLinkFactory.getLinkForAnnotationType | protected void getLinkForAnnotationType(Content link, LinkInfo linkInfo, Type type) {
link.addContent(getTypeAnnotationLinks(linkInfo));
linkInfo.type = type.asAnnotatedType().underlyingType();
link.addContent(getLink(linkInfo));
} | java | protected void getLinkForAnnotationType(Content link, LinkInfo linkInfo, Type type) {
link.addContent(getTypeAnnotationLinks(linkInfo));
linkInfo.type = type.asAnnotatedType().underlyingType();
link.addContent(getLink(linkInfo));
} | [
"protected",
"void",
"getLinkForAnnotationType",
"(",
"Content",
"link",
",",
"LinkInfo",
"linkInfo",
",",
"Type",
"type",
")",
"{",
"link",
".",
"addContent",
"(",
"getTypeAnnotationLinks",
"(",
"linkInfo",
")",
")",
";",
"linkInfo",
".",
"type",
"=",
"type",... | Build the link for the annotation type.
@param link the link.
@param linkInfo the information on the link.
@param type the type. | [
"Build",
"the",
"link",
"for",
"the",
"annotation",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java#L75-L79 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java | SarlLinkFactory.getLinkForWildcard | protected void getLinkForWildcard(Content link, LinkInfo linkInfo, Type type) {
linkInfo.isTypeBound = true;
link.addContent("?"); //$NON-NLS-1$
final WildcardType wildcardType = type.asWildcardType();
final Type[] extendsBounds = wildcardType.extendsBounds();
final SARLFeatureAccess kw = Utils.getKeywords();... | java | protected void getLinkForWildcard(Content link, LinkInfo linkInfo, Type type) {
linkInfo.isTypeBound = true;
link.addContent("?"); //$NON-NLS-1$
final WildcardType wildcardType = type.asWildcardType();
final Type[] extendsBounds = wildcardType.extendsBounds();
final SARLFeatureAccess kw = Utils.getKeywords();... | [
"protected",
"void",
"getLinkForWildcard",
"(",
"Content",
"link",
",",
"LinkInfo",
"linkInfo",
",",
"Type",
"type",
")",
"{",
"linkInfo",
".",
"isTypeBound",
"=",
"true",
";",
"link",
".",
"addContent",
"(",
"\"?\"",
")",
";",
"//$NON-NLS-1$",
"final",
"Wil... | Build the link for the wildcard.
@param link the link.
@param linkInfo the information on the link.
@param type the type. | [
"Build",
"the",
"link",
"for",
"the",
"wildcard",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java#L87-L106 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java | SarlLinkFactory.getLinkForTypeVariable | protected void getLinkForTypeVariable(Content link, LinkInfo linkInfo, Type type) {
link.addContent(getTypeAnnotationLinks(linkInfo));
linkInfo.isTypeBound = true;
final Doc owner = type.asTypeVariable().owner();
if ((!linkInfo.excludeTypeParameterLinks) && owner instanceof ClassDoc) {
linkInfo.classDoc = (C... | java | protected void getLinkForTypeVariable(Content link, LinkInfo linkInfo, Type type) {
link.addContent(getTypeAnnotationLinks(linkInfo));
linkInfo.isTypeBound = true;
final Doc owner = type.asTypeVariable().owner();
if ((!linkInfo.excludeTypeParameterLinks) && owner instanceof ClassDoc) {
linkInfo.classDoc = (C... | [
"protected",
"void",
"getLinkForTypeVariable",
"(",
"Content",
"link",
",",
"LinkInfo",
"linkInfo",
",",
"Type",
"type",
")",
"{",
"link",
".",
"addContent",
"(",
"getTypeAnnotationLinks",
"(",
"linkInfo",
")",
")",
";",
"linkInfo",
".",
"isTypeBound",
"=",
"t... | Build the link for the type variable.
@param link the link.
@param linkInfo the information on the link.
@param type the type. | [
"Build",
"the",
"link",
"for",
"the",
"type",
"variable",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java#L114-L138 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java | SarlLinkFactory.setBoundsLinkInfo | protected void setBoundsLinkInfo(LinkInfo linkInfo, Type bound) {
Reflect.callProc(this, LinkFactory.class, "setBoundsLinkInfo", //$NON-NLS-1$
new Class<?>[]{LinkInfo.class, Type.class},
linkInfo, bound);
} | java | protected void setBoundsLinkInfo(LinkInfo linkInfo, Type bound) {
Reflect.callProc(this, LinkFactory.class, "setBoundsLinkInfo", //$NON-NLS-1$
new Class<?>[]{LinkInfo.class, Type.class},
linkInfo, bound);
} | [
"protected",
"void",
"setBoundsLinkInfo",
"(",
"LinkInfo",
"linkInfo",
",",
"Type",
"bound",
")",
"{",
"Reflect",
".",
"callProc",
"(",
"this",
",",
"LinkFactory",
".",
"class",
",",
"\"setBoundsLinkInfo\"",
",",
"//$NON-NLS-1$",
"new",
"Class",
"<",
"?",
">",... | Change the bounds into the link info.
@param linkInfo the link info.
@param bound the new bounds. | [
"Change",
"the",
"bounds",
"into",
"the",
"link",
"info",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java#L145-L149 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java | SarlLinkFactory.getLinkForClass | protected Content getLinkForClass(Content link, LinkInfo linkInfo, Type type) {
if (linkInfo.isTypeBound && linkInfo.excludeTypeBoundsLinks) {
//Since we are excluding type parameter links, we should not
//be linking to the type bound.
link.addContent(type.typeName());
link.addContent(getTypeParameterLink... | java | protected Content getLinkForClass(Content link, LinkInfo linkInfo, Type type) {
if (linkInfo.isTypeBound && linkInfo.excludeTypeBoundsLinks) {
//Since we are excluding type parameter links, we should not
//be linking to the type bound.
link.addContent(type.typeName());
link.addContent(getTypeParameterLink... | [
"protected",
"Content",
"getLinkForClass",
"(",
"Content",
"link",
",",
"LinkInfo",
"linkInfo",
",",
"Type",
"type",
")",
"{",
"if",
"(",
"linkInfo",
".",
"isTypeBound",
"&&",
"linkInfo",
".",
"excludeTypeBoundsLinks",
")",
"{",
"//Since we are excluding type parame... | Build the link for the class.
@param link the link.
@param linkInfo the information on the link.
@param type the type.
@return the content. | [
"Build",
"the",
"link",
"for",
"the",
"class",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java#L158-L173 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java | SarlLinkFactory.updateLinkLabel | protected void updateLinkLabel(LinkInfo linkInfo) {
if (linkInfo.type != null && linkInfo instanceof LinkInfoImpl) {
final LinkInfoImpl impl = (LinkInfoImpl) linkInfo;
final ClassDoc classdoc = linkInfo.type.asClassDoc();
if (classdoc != null) {
final SARLFeatureAccess kw = Utils.getKeywords();
final... | java | protected void updateLinkLabel(LinkInfo linkInfo) {
if (linkInfo.type != null && linkInfo instanceof LinkInfoImpl) {
final LinkInfoImpl impl = (LinkInfoImpl) linkInfo;
final ClassDoc classdoc = linkInfo.type.asClassDoc();
if (classdoc != null) {
final SARLFeatureAccess kw = Utils.getKeywords();
final... | [
"protected",
"void",
"updateLinkLabel",
"(",
"LinkInfo",
"linkInfo",
")",
"{",
"if",
"(",
"linkInfo",
".",
"type",
"!=",
"null",
"&&",
"linkInfo",
"instanceof",
"LinkInfoImpl",
")",
"{",
"final",
"LinkInfoImpl",
"impl",
"=",
"(",
"LinkInfoImpl",
")",
"linkInfo... | Update the label of the given link with the SARL notation for lambdas.
@param linkInfo the link information to update. | [
"Update",
"the",
"label",
"of",
"the",
"given",
"link",
"with",
"the",
"SARL",
"notation",
"for",
"lambdas",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java#L243-L257 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java | SarlLinkFactory.createProcedureLambdaLabel | protected Content createProcedureLambdaLabel(LinkInfoImpl linkInfo) {
final ParameterizedType type = linkInfo.type.asParameterizedType();
if (type != null) {
final Type[] arguments = type.typeArguments();
if (arguments != null && arguments.length > 0) {
return createLambdaLabel(linkInfo, arguments, argume... | java | protected Content createProcedureLambdaLabel(LinkInfoImpl linkInfo) {
final ParameterizedType type = linkInfo.type.asParameterizedType();
if (type != null) {
final Type[] arguments = type.typeArguments();
if (arguments != null && arguments.length > 0) {
return createLambdaLabel(linkInfo, arguments, argume... | [
"protected",
"Content",
"createProcedureLambdaLabel",
"(",
"LinkInfoImpl",
"linkInfo",
")",
"{",
"final",
"ParameterizedType",
"type",
"=",
"linkInfo",
".",
"type",
".",
"asParameterizedType",
"(",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"final",
... | Create the label for a procedure lambda.
@param linkInfo the type.
@return the label. | [
"Create",
"the",
"label",
"for",
"a",
"procedure",
"lambda",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java#L268-L277 | train |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/commands/CompilerCommandModule.java | CompilerCommandModule.provideSarlcCompilerCommand | @SuppressWarnings("static-method")
@Provides
@Singleton
public CompilerCommand provideSarlcCompilerCommand(Provider<SarlBatchCompiler> compiler,
Provider<SarlConfig> configuration, Provider<PathDetector> pathDetector,
Provider<ProgressBarConfig> commandConfig) {
return new CompilerCommand(compiler, configura... | java | @SuppressWarnings("static-method")
@Provides
@Singleton
public CompilerCommand provideSarlcCompilerCommand(Provider<SarlBatchCompiler> compiler,
Provider<SarlConfig> configuration, Provider<PathDetector> pathDetector,
Provider<ProgressBarConfig> commandConfig) {
return new CompilerCommand(compiler, configura... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"@",
"Provides",
"@",
"Singleton",
"public",
"CompilerCommand",
"provideSarlcCompilerCommand",
"(",
"Provider",
"<",
"SarlBatchCompiler",
">",
"compiler",
",",
"Provider",
"<",
"SarlConfig",
">",
"configuration",
... | Provide the command for running the compiler.
@param compiler the compiler.
@param configuration the SARLC configuration.
@param pathDetector the detector of paths.
@param commandConfig the configuration of the command.
@return the command. | [
"Provide",
"the",
"command",
"for",
"running",
"the",
"compiler",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/commands/CompilerCommandModule.java#L77-L84 | train |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/commands/CompilerCommandModule.java | CompilerCommandModule.getProgressBarConfig | @SuppressWarnings("static-method")
@Provides
@Singleton
public ProgressBarConfig getProgressBarConfig(ConfigurationFactory configFactory, Injector injector) {
final ProgressBarConfig config = ProgressBarConfig.getConfiguration(configFactory);
injector.injectMembers(config);
return config;
} | java | @SuppressWarnings("static-method")
@Provides
@Singleton
public ProgressBarConfig getProgressBarConfig(ConfigurationFactory configFactory, Injector injector) {
final ProgressBarConfig config = ProgressBarConfig.getConfiguration(configFactory);
injector.injectMembers(config);
return config;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"@",
"Provides",
"@",
"Singleton",
"public",
"ProgressBarConfig",
"getProgressBarConfig",
"(",
"ConfigurationFactory",
"configFactory",
",",
"Injector",
"injector",
")",
"{",
"final",
"ProgressBarConfig",
"config",
... | Replies the instance of the compiler command configuration.
@param configFactory accessor to the bootique factory.
@param injector the current injector.
@return the compiler command configuration accessor. | [
"Replies",
"the",
"instance",
"of",
"the",
"compiler",
"command",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/commands/CompilerCommandModule.java#L92-L99 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/macro/SarlProcessorInstanceForJvmTypeProvider.java | SarlProcessorInstanceForJvmTypeProvider.filterActiveProcessorType | public static JvmType filterActiveProcessorType(JvmType type, CommonTypeComputationServices services) {
if (AccessorsProcessor.class.getName().equals(type.getQualifiedName())) {
return services.getTypeReferences().findDeclaredType(SarlAccessorsProcessor.class, type);
}
return type;
} | java | public static JvmType filterActiveProcessorType(JvmType type, CommonTypeComputationServices services) {
if (AccessorsProcessor.class.getName().equals(type.getQualifiedName())) {
return services.getTypeReferences().findDeclaredType(SarlAccessorsProcessor.class, type);
}
return type;
} | [
"public",
"static",
"JvmType",
"filterActiveProcessorType",
"(",
"JvmType",
"type",
",",
"CommonTypeComputationServices",
"services",
")",
"{",
"if",
"(",
"AccessorsProcessor",
".",
"class",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"type",
".",
"getQualifiedN... | Filter the type in order to create the correct processor.
@param type the type of the processor specified into the {@code @Active} annotation.
@param services the type services of the framework.
@return the real type of the processor to instance. | [
"Filter",
"the",
"type",
"in",
"order",
"to",
"create",
"the",
"correct",
"processor",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/macro/SarlProcessorInstanceForJvmTypeProvider.java#L59-L64 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java | SARLImages.forAgent | public ImageDescriptor forAgent(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.AGENT, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | java | public ImageDescriptor forAgent(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.AGENT, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | [
"public",
"ImageDescriptor",
"forAgent",
"(",
"JvmVisibility",
"visibility",
",",
"int",
"flags",
")",
"{",
"return",
"getDecorated",
"(",
"getTypeImageDescriptor",
"(",
"SarlElementType",
".",
"AGENT",
",",
"false",
",",
"false",
",",
"toFlags",
"(",
"visibility"... | Replies the image descriptor for the "agents".
@param visibility the visibility of the agent.
@param flags the mark flags. See {@link JavaElementImageDescriptor#setAdornments(int)} for
a description of the available flags.
@return the image descriptor for the agents. | [
"Replies",
"the",
"image",
"descriptor",
"for",
"the",
"agents",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java#L127-L130 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java | SARLImages.forBehavior | public ImageDescriptor forBehavior(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.BEHAVIOR, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | java | public ImageDescriptor forBehavior(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.BEHAVIOR, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | [
"public",
"ImageDescriptor",
"forBehavior",
"(",
"JvmVisibility",
"visibility",
",",
"int",
"flags",
")",
"{",
"return",
"getDecorated",
"(",
"getTypeImageDescriptor",
"(",
"SarlElementType",
".",
"BEHAVIOR",
",",
"false",
",",
"false",
",",
"toFlags",
"(",
"visib... | Replies the image descriptor for the "behaviors".
@param visibility the visibility of the behavior.
@param flags the mark flags. See {@link JavaElementImageDescriptor#setAdornments(int)} for
a description of the available flags.
@return the image descriptor for the behaviors. | [
"Replies",
"the",
"image",
"descriptor",
"for",
"the",
"behaviors",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java#L139-L142 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java | SARLImages.forCapacity | public ImageDescriptor forCapacity(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.CAPACITY, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | java | public ImageDescriptor forCapacity(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.CAPACITY, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | [
"public",
"ImageDescriptor",
"forCapacity",
"(",
"JvmVisibility",
"visibility",
",",
"int",
"flags",
")",
"{",
"return",
"getDecorated",
"(",
"getTypeImageDescriptor",
"(",
"SarlElementType",
".",
"CAPACITY",
",",
"false",
",",
"false",
",",
"toFlags",
"(",
"visib... | Replies the image descriptor for the "capacities".
@param visibility the visibility of the capacity.
@param flags the mark flags. See {@link JavaElementImageDescriptor#setAdornments(int)} for
a description of the available flags.
@return the image descriptor for the capacities. | [
"Replies",
"the",
"image",
"descriptor",
"for",
"the",
"capacities",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java#L151-L154 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java | SARLImages.forSkill | public ImageDescriptor forSkill(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.SKILL, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | java | public ImageDescriptor forSkill(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.SKILL, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | [
"public",
"ImageDescriptor",
"forSkill",
"(",
"JvmVisibility",
"visibility",
",",
"int",
"flags",
")",
"{",
"return",
"getDecorated",
"(",
"getTypeImageDescriptor",
"(",
"SarlElementType",
".",
"SKILL",
",",
"false",
",",
"false",
",",
"toFlags",
"(",
"visibility"... | Replies the image descriptor for the "skills".
@param visibility the visibility of the skill.
@param flags the mark flags. See {@link JavaElementImageDescriptor#setAdornments(int)} for
a description of the available flags.
@return the image descriptor for the skills. | [
"Replies",
"the",
"image",
"descriptor",
"for",
"the",
"skills",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java#L163-L166 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java | SARLImages.forEvent | public ImageDescriptor forEvent(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.EVENT, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | java | public ImageDescriptor forEvent(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.EVENT, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | [
"public",
"ImageDescriptor",
"forEvent",
"(",
"JvmVisibility",
"visibility",
",",
"int",
"flags",
")",
"{",
"return",
"getDecorated",
"(",
"getTypeImageDescriptor",
"(",
"SarlElementType",
".",
"EVENT",
",",
"false",
",",
"false",
",",
"toFlags",
"(",
"visibility"... | Replies the image descriptor for the "events".
@param visibility the visibility of the event.
@param flags the mark flags. See {@link JavaElementImageDescriptor#setAdornments(int)} for
a description of the available flags.
@return the image descriptor for the events. | [
"Replies",
"the",
"image",
"descriptor",
"for",
"the",
"events",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java#L175-L178 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java | SARLImages.forBehaviorUnit | public ImageDescriptor forBehaviorUnit() {
return getDecorated(getTypeImageDescriptor(
SarlElementType.BEHAVIOR_UNIT, false, false,
toFlags(JvmVisibility.PUBLIC), USE_LIGHT_ICONS), 0);
} | java | public ImageDescriptor forBehaviorUnit() {
return getDecorated(getTypeImageDescriptor(
SarlElementType.BEHAVIOR_UNIT, false, false,
toFlags(JvmVisibility.PUBLIC), USE_LIGHT_ICONS), 0);
} | [
"public",
"ImageDescriptor",
"forBehaviorUnit",
"(",
")",
"{",
"return",
"getDecorated",
"(",
"getTypeImageDescriptor",
"(",
"SarlElementType",
".",
"BEHAVIOR_UNIT",
",",
"false",
",",
"false",
",",
"toFlags",
"(",
"JvmVisibility",
".",
"PUBLIC",
")",
",",
"USE_LI... | Replies the image descriptor for the "behavior units".
@return the image descriptor for the behavior units. | [
"Replies",
"the",
"image",
"descriptor",
"for",
"the",
"behavior",
"units",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java#L184-L188 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java | SARLImages.forStaticConstructor | public ImageDescriptor forStaticConstructor() {
return getDecorated(
getMethodImageDescriptor(false, toFlags(JvmVisibility.PUBLIC)),
JavaElementImageDescriptor.CONSTRUCTOR | JavaElementImageDescriptor.STATIC);
} | java | public ImageDescriptor forStaticConstructor() {
return getDecorated(
getMethodImageDescriptor(false, toFlags(JvmVisibility.PUBLIC)),
JavaElementImageDescriptor.CONSTRUCTOR | JavaElementImageDescriptor.STATIC);
} | [
"public",
"ImageDescriptor",
"forStaticConstructor",
"(",
")",
"{",
"return",
"getDecorated",
"(",
"getMethodImageDescriptor",
"(",
"false",
",",
"toFlags",
"(",
"JvmVisibility",
".",
"PUBLIC",
")",
")",
",",
"JavaElementImageDescriptor",
".",
"CONSTRUCTOR",
"|",
"J... | Replies the image descriptor for the "static constructors".
@return the image descriptor for the agents.
@since 0.6 | [
"Replies",
"the",
"image",
"descriptor",
"for",
"the",
"static",
"constructors",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java#L236-L240 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java | NewSarlProjectWizard.getPomTemplateLocation | public static URL getPomTemplateLocation() {
final URL url = Resources.getResource(NewSarlProjectWizard.class, POM_TEMPLATE_BASENAME);
assert url != null;
return url;
} | java | public static URL getPomTemplateLocation() {
final URL url = Resources.getResource(NewSarlProjectWizard.class, POM_TEMPLATE_BASENAME);
assert url != null;
return url;
} | [
"public",
"static",
"URL",
"getPomTemplateLocation",
"(",
")",
"{",
"final",
"URL",
"url",
"=",
"Resources",
".",
"getResource",
"(",
"NewSarlProjectWizard",
".",
"class",
",",
"POM_TEMPLATE_BASENAME",
")",
";",
"assert",
"url",
"!=",
"null",
";",
"return",
"u... | Replies the location of a template for the pom files.
@return the location. Should be never {@code null}.
@since 0.8
@see #POM_TEMPLATE_BASENAME | [
"Replies",
"the",
"location",
"of",
"a",
"template",
"for",
"the",
"pom",
"files",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java#L128-L132 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java | NewSarlProjectWizard.validateSARLSpecificElements | protected boolean validateSARLSpecificElements(IJavaProject javaProject) {
// Check if the "SARL" generation directory is a source folder.
final IPath outputPath = SARLPreferences.getSARLOutputPathFor(javaProject.getProject());
if (outputPath == null) {
final String message = MessageFormat.format(
Messag... | java | protected boolean validateSARLSpecificElements(IJavaProject javaProject) {
// Check if the "SARL" generation directory is a source folder.
final IPath outputPath = SARLPreferences.getSARLOutputPathFor(javaProject.getProject());
if (outputPath == null) {
final String message = MessageFormat.format(
Messag... | [
"protected",
"boolean",
"validateSARLSpecificElements",
"(",
"IJavaProject",
"javaProject",
")",
"{",
"// Check if the \"SARL\" generation directory is a source folder.",
"final",
"IPath",
"outputPath",
"=",
"SARLPreferences",
".",
"getSARLOutputPathFor",
"(",
"javaProject",
".",... | Validate the SARL properties of the new projects.
@param javaProject the created element
@return validity | [
"Validate",
"the",
"SARL",
"properties",
"of",
"the",
"new",
"projects",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java#L202-L224 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java | NewSarlProjectWizard.createDefaultMavenPom | protected void createDefaultMavenPom(IJavaProject project, String compilerCompliance) {
// Get the template resource.
final URL templateUrl = getPomTemplateLocation();
if (templateUrl != null) {
final String compliance = Strings.isNullOrEmpty(compilerCompliance) ? SARLVersion.MINIMAL_JDK_VERSION : compilerComp... | java | protected void createDefaultMavenPom(IJavaProject project, String compilerCompliance) {
// Get the template resource.
final URL templateUrl = getPomTemplateLocation();
if (templateUrl != null) {
final String compliance = Strings.isNullOrEmpty(compilerCompliance) ? SARLVersion.MINIMAL_JDK_VERSION : compilerComp... | [
"protected",
"void",
"createDefaultMavenPom",
"(",
"IJavaProject",
"project",
",",
"String",
"compilerCompliance",
")",
"{",
"// Get the template resource.",
"final",
"URL",
"templateUrl",
"=",
"getPomTemplateLocation",
"(",
")",
";",
"if",
"(",
"templateUrl",
"!=",
"... | Create the default Maven pom file for the project.
<p>Even if the project has not the Maven nature when it is created with this wizard,
the pom file is created in order to let the developer to switch to the Maven nature easily.
@param project the new project.
@param compilerCompliance the Java version that is support... | [
"Create",
"the",
"default",
"Maven",
"pom",
"file",
"for",
"the",
"project",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java#L292-L325 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java | NewSarlProjectWizard.getDefaultMavenGroupId | @SuppressWarnings("static-method")
protected String getDefaultMavenGroupId() {
final String userdomain = System.getenv("userdomain"); //$NON-NLS-1$
if (Strings.isNullOrEmpty(userdomain)) {
return "com.foo"; //$NON-NLS-1$
}
final String[] elements = userdomain.split(Pattern.quote(".")); //$NON-NLS-1$
final... | java | @SuppressWarnings("static-method")
protected String getDefaultMavenGroupId() {
final String userdomain = System.getenv("userdomain"); //$NON-NLS-1$
if (Strings.isNullOrEmpty(userdomain)) {
return "com.foo"; //$NON-NLS-1$
}
final String[] elements = userdomain.split(Pattern.quote(".")); //$NON-NLS-1$
final... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"String",
"getDefaultMavenGroupId",
"(",
")",
"{",
"final",
"String",
"userdomain",
"=",
"System",
".",
"getenv",
"(",
"\"userdomain\"",
")",
";",
"//$NON-NLS-1$",
"if",
"(",
"Strings",
".",
"i... | Replies the default group id for a maven project.
@return the default group id, never {@code null} nor empty string. | [
"Replies",
"the",
"default",
"group",
"id",
"for",
"a",
"maven",
"project",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java#L331-L346 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java | NewSarlProjectWizard.getActivePart | IWorkbenchPart getActivePart() {
final IWorkbenchWindow activeWindow = getWorkbench().getActiveWorkbenchWindow();
if (activeWindow != null) {
final IWorkbenchPage activePage = activeWindow.getActivePage();
if (activePage != null) {
return activePage.getActivePart();
}
}
return null;
} | java | IWorkbenchPart getActivePart() {
final IWorkbenchWindow activeWindow = getWorkbench().getActiveWorkbenchWindow();
if (activeWindow != null) {
final IWorkbenchPage activePage = activeWindow.getActivePage();
if (activePage != null) {
return activePage.getActivePart();
}
}
return null;
} | [
"IWorkbenchPart",
"getActivePart",
"(",
")",
"{",
"final",
"IWorkbenchWindow",
"activeWindow",
"=",
"getWorkbench",
"(",
")",
".",
"getActiveWorkbenchWindow",
"(",
")",
";",
"if",
"(",
"activeWindow",
"!=",
"null",
")",
"{",
"final",
"IWorkbenchPage",
"activePage"... | Replies the active part in the workbench.
@return the active part. | [
"Replies",
"the",
"active",
"part",
"in",
"the",
"workbench",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java#L352-L361 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.getCurrentClasspath | public static String getCurrentClasspath() {
final StringBuilder path = new StringBuilder();
for (final URL url : getCurrentClassLoader().getURLs()) {
if (path.length() > 0) {
path.append(File.pathSeparator);
}
final File file = FileSystem.convertURLToFile(url);
if (file != null) {
path.append(f... | java | public static String getCurrentClasspath() {
final StringBuilder path = new StringBuilder();
for (final URL url : getCurrentClassLoader().getURLs()) {
if (path.length() > 0) {
path.append(File.pathSeparator);
}
final File file = FileSystem.convertURLToFile(url);
if (file != null) {
path.append(f... | [
"public",
"static",
"String",
"getCurrentClasspath",
"(",
")",
"{",
"final",
"StringBuilder",
"path",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"final",
"URL",
"url",
":",
"getCurrentClassLoader",
"(",
")",
".",
"getURLs",
"(",
")",
")",
"{",... | Replies the current class path.
@return the current class path.
@since 0.7 | [
"Replies",
"the",
"current",
"class",
"path",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L360-L372 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.getCurrentClassLoader | private static URLClassLoader getCurrentClassLoader() {
synchronized (Boot.class) {
if (dynamicClassLoader == null) {
final ClassLoader cl = ClassLoader.getSystemClassLoader();
if (cl instanceof URLClassLoader) {
dynamicClassLoader = (URLClassLoader) cl;
} else {
dynamicClassLoader = URLClass... | java | private static URLClassLoader getCurrentClassLoader() {
synchronized (Boot.class) {
if (dynamicClassLoader == null) {
final ClassLoader cl = ClassLoader.getSystemClassLoader();
if (cl instanceof URLClassLoader) {
dynamicClassLoader = (URLClassLoader) cl;
} else {
dynamicClassLoader = URLClass... | [
"private",
"static",
"URLClassLoader",
"getCurrentClassLoader",
"(",
")",
"{",
"synchronized",
"(",
"Boot",
".",
"class",
")",
"{",
"if",
"(",
"dynamicClassLoader",
"==",
"null",
")",
"{",
"final",
"ClassLoader",
"cl",
"=",
"ClassLoader",
".",
"getSystemClassLoa... | Replies the current class loader.
@return the current class loader.
@since 0.7 | [
"Replies",
"the",
"current",
"class",
"loader",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L380-L392 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.addToSystemClasspath | @SuppressWarnings("checkstyle:nestedifdepth")
public static void addToSystemClasspath(String entries) {
if (!Strings.isNullOrEmpty(entries)) {
final List<URL> cp = new ArrayList<>();
final String[] individualEntries = entries.split(Pattern.quote(File.pathSeparator));
for (final String entry : individualEntr... | java | @SuppressWarnings("checkstyle:nestedifdepth")
public static void addToSystemClasspath(String entries) {
if (!Strings.isNullOrEmpty(entries)) {
final List<URL> cp = new ArrayList<>();
final String[] individualEntries = entries.split(Pattern.quote(File.pathSeparator));
for (final String entry : individualEntr... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:nestedifdepth\"",
")",
"public",
"static",
"void",
"addToSystemClasspath",
"(",
"String",
"entries",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isNullOrEmpty",
"(",
"entries",
")",
")",
"{",
"final",
"List",
"<",
"UR... | Add the given entries to the system classpath.
@param entries the new classpath entries. The format of the value is the same as for the <code>-cp</code>
command-line option of the <code>java</code> tool. | [
"Add",
"the",
"given",
"entries",
"to",
"the",
"system",
"classpath",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L399-L430 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.main | public static void main(String[] args) {
try {
Object[] freeArgs = parseCommandLine(args);
if (JanusConfig.getSystemPropertyAsBoolean(JanusConfig.JANUS_LOGO_SHOW_NAME,
JanusConfig.JANUS_LOGO_SHOW.booleanValue())) {
showJanusLogo();
}
if (freeArgs.length == 0) {
showError(Messages.Boot_3, nu... | java | public static void main(String[] args) {
try {
Object[] freeArgs = parseCommandLine(args);
if (JanusConfig.getSystemPropertyAsBoolean(JanusConfig.JANUS_LOGO_SHOW_NAME,
JanusConfig.JANUS_LOGO_SHOW.booleanValue())) {
showJanusLogo();
}
if (freeArgs.length == 0) {
showError(Messages.Boot_3, nu... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"Object",
"[",
"]",
"freeArgs",
"=",
"parseCommandLine",
"(",
"args",
")",
";",
"if",
"(",
"JanusConfig",
".",
"getSystemPropertyAsBoolean",
"(",
"JanusConfig",
".",... | Main function that is parsing the command line and launching the first agent.
@param args command line arguments
@see #startJanus(Class, Object...) | [
"Main",
"function",
"that",
"is",
"parsing",
"the",
"command",
"line",
"and",
"launching",
"the",
"first",
"agent",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L477-L511 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.getOptions | public static Options getOptions() {
final Options options = new Options();
options.addOption(CLI_OPTION_CLASSPATH_SHORT, CLI_OPTION_CLASSPATH_LONG, true,
Messages.Boot_24);
options.addOption(CLI_OPTION_EMBEDDED_SHORT, CLI_OPTION_EMBEDDED_LONG, false,
Messages.Boot_5);
options.addOption(CLI_OPTION_BO... | java | public static Options getOptions() {
final Options options = new Options();
options.addOption(CLI_OPTION_CLASSPATH_SHORT, CLI_OPTION_CLASSPATH_LONG, true,
Messages.Boot_24);
options.addOption(CLI_OPTION_EMBEDDED_SHORT, CLI_OPTION_EMBEDDED_LONG, false,
Messages.Boot_5);
options.addOption(CLI_OPTION_BO... | [
"public",
"static",
"Options",
"getOptions",
"(",
")",
"{",
"final",
"Options",
"options",
"=",
"new",
"Options",
"(",
")",
";",
"options",
".",
"addOption",
"(",
"CLI_OPTION_CLASSPATH_SHORT",
",",
"CLI_OPTION_CLASSPATH_LONG",
",",
"true",
",",
"Messages",
".",
... | Replies the command line options supported by this boot class.
@return the command line options. | [
"Replies",
"the",
"command",
"line",
"options",
"supported",
"by",
"this",
"boot",
"class",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L542-L616 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.showError | @SuppressWarnings("checkstyle:regexp")
public static void showError(String message, Throwable exception) {
try (PrintWriter logger = new PrintWriter(getConsoleLogger())) {
if (message != null && !message.isEmpty()) {
logger.println(message);
} else if (exception != null) {
exception.printStackTrace(log... | java | @SuppressWarnings("checkstyle:regexp")
public static void showError(String message, Throwable exception) {
try (PrintWriter logger = new PrintWriter(getConsoleLogger())) {
if (message != null && !message.isEmpty()) {
logger.println(message);
} else if (exception != null) {
exception.printStackTrace(log... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:regexp\"",
")",
"public",
"static",
"void",
"showError",
"(",
"String",
"message",
",",
"Throwable",
"exception",
")",
"{",
"try",
"(",
"PrintWriter",
"logger",
"=",
"new",
"PrintWriter",
"(",
"getConsoleLogger",
"(",
... | Show an error message, and exit.
<p>This function never returns.
@param message the description of the error.
@param exception the cause of the error. | [
"Show",
"an",
"error",
"message",
"and",
"exit",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L626-L639 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.getProgramName | public static String getProgramName() {
String programName = JanusConfig.getSystemProperty(JanusConfig.JANUS_PROGRAM_NAME, null);
if (Strings.isNullOrEmpty(programName)) {
programName = JanusConfig.JANUS_PROGRAM_NAME_VALUE;
}
return programName;
} | java | public static String getProgramName() {
String programName = JanusConfig.getSystemProperty(JanusConfig.JANUS_PROGRAM_NAME, null);
if (Strings.isNullOrEmpty(programName)) {
programName = JanusConfig.JANUS_PROGRAM_NAME_VALUE;
}
return programName;
} | [
"public",
"static",
"String",
"getProgramName",
"(",
")",
"{",
"String",
"programName",
"=",
"JanusConfig",
".",
"getSystemProperty",
"(",
"JanusConfig",
".",
"JANUS_PROGRAM_NAME",
",",
"null",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"programN... | Replies the name of the program.
@return the name of the program. | [
"Replies",
"the",
"name",
"of",
"the",
"program",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L667-L673 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.showDefaults | @SuppressWarnings("checkstyle:regexp")
public static void showDefaults() {
final Properties defaultValues = new Properties();
JanusConfig.getDefaultValues(defaultValues);
NetworkConfig.getDefaultValues(defaultValues);
try (OutputStream os = getConsoleLogger()) {
defaultValues.storeToXML(os, null);
os.flu... | java | @SuppressWarnings("checkstyle:regexp")
public static void showDefaults() {
final Properties defaultValues = new Properties();
JanusConfig.getDefaultValues(defaultValues);
NetworkConfig.getDefaultValues(defaultValues);
try (OutputStream os = getConsoleLogger()) {
defaultValues.storeToXML(os, null);
os.flu... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:regexp\"",
")",
"public",
"static",
"void",
"showDefaults",
"(",
")",
"{",
"final",
"Properties",
"defaultValues",
"=",
"new",
"Properties",
"(",
")",
";",
"JanusConfig",
".",
"getDefaultValues",
"(",
"defaultValues",
")... | Show the default values of the system properties. This function never returns. | [
"Show",
"the",
"default",
"values",
"of",
"the",
"system",
"properties",
".",
"This",
"function",
"never",
"returns",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L678-L690 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.showClasspath | @SuppressWarnings({ "resource" })
public static void showClasspath() {
final String cp = getCurrentClasspath();
if (!Strings.isNullOrEmpty(cp)) {
final PrintStream ps = getConsoleLogger();
for (final String entry : cp.split(Pattern.quote(File.pathSeparator))) {
ps.println(entry);
}
ps.flush();
}
... | java | @SuppressWarnings({ "resource" })
public static void showClasspath() {
final String cp = getCurrentClasspath();
if (!Strings.isNullOrEmpty(cp)) {
final PrintStream ps = getConsoleLogger();
for (final String entry : cp.split(Pattern.quote(File.pathSeparator))) {
ps.println(entry);
}
ps.flush();
}
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"resource\"",
"}",
")",
"public",
"static",
"void",
"showClasspath",
"(",
")",
"{",
"final",
"String",
"cp",
"=",
"getCurrentClasspath",
"(",
")",
";",
"if",
"(",
"!",
"Strings",
".",
"isNullOrEmpty",
"(",
"cp",
")",
... | Show the classpath of the system properties. This function never returns. | [
"Show",
"the",
"classpath",
"of",
"the",
"system",
"properties",
".",
"This",
"function",
"never",
"returns",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L695-L706 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.showVersion | public static void showVersion(boolean exit) {
try (PrintWriter logger = new PrintWriter(getConsoleLogger())) {
logger.println(MessageFormat.format(Messages.Boot_26, JanusVersion.JANUS_RELEASE_VERSION));
logger.println(MessageFormat.format(Messages.Boot_27, SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING));
... | java | public static void showVersion(boolean exit) {
try (PrintWriter logger = new PrintWriter(getConsoleLogger())) {
logger.println(MessageFormat.format(Messages.Boot_26, JanusVersion.JANUS_RELEASE_VERSION));
logger.println(MessageFormat.format(Messages.Boot_27, SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING));
... | [
"public",
"static",
"void",
"showVersion",
"(",
"boolean",
"exit",
")",
"{",
"try",
"(",
"PrintWriter",
"logger",
"=",
"new",
"PrintWriter",
"(",
"getConsoleLogger",
"(",
")",
")",
")",
"{",
"logger",
".",
"println",
"(",
"MessageFormat",
".",
"format",
"(... | Show the version of Janus.
@param exit if {@code true}, this function never returns. | [
"Show",
"the",
"version",
"of",
"Janus",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L713-L722 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.showCommandLineArguments | @SuppressWarnings("checkstyle:regexp")
public static void showCommandLineArguments(String[] args) {
try (PrintStream os = getConsoleLogger()) {
for (int i = 0; i < args.length; ++i) {
os.println(i + ": " //$NON-NLS-1$
+ args[i]);
}
os.flush();
} catch (Throwable e) {
e.printStackTrace();
}
... | java | @SuppressWarnings("checkstyle:regexp")
public static void showCommandLineArguments(String[] args) {
try (PrintStream os = getConsoleLogger()) {
for (int i = 0; i < args.length; ++i) {
os.println(i + ": " //$NON-NLS-1$
+ args[i]);
}
os.flush();
} catch (Throwable e) {
e.printStackTrace();
}
... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:regexp\"",
")",
"public",
"static",
"void",
"showCommandLineArguments",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"(",
"PrintStream",
"os",
"=",
"getConsoleLogger",
"(",
")",
")",
"{",
"for",
"(",
"int",
"i... | Show the command line arguments. This function never returns.
@param args the command line arguments. | [
"Show",
"the",
"command",
"line",
"arguments",
".",
"This",
"function",
"never",
"returns",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L729-L741 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.setBootAgentTypeContextUUID | public static void setBootAgentTypeContextUUID() {
System.setProperty(JanusConfig.BOOT_DEFAULT_CONTEXT_ID_NAME, Boolean.TRUE.toString());
System.setProperty(JanusConfig.RANDOM_DEFAULT_CONTEXT_ID_NAME, Boolean.FALSE.toString());
} | java | public static void setBootAgentTypeContextUUID() {
System.setProperty(JanusConfig.BOOT_DEFAULT_CONTEXT_ID_NAME, Boolean.TRUE.toString());
System.setProperty(JanusConfig.RANDOM_DEFAULT_CONTEXT_ID_NAME, Boolean.FALSE.toString());
} | [
"public",
"static",
"void",
"setBootAgentTypeContextUUID",
"(",
")",
"{",
"System",
".",
"setProperty",
"(",
"JanusConfig",
".",
"BOOT_DEFAULT_CONTEXT_ID_NAME",
",",
"Boolean",
".",
"TRUE",
".",
"toString",
"(",
")",
")",
";",
"System",
".",
"setProperty",
"(",
... | Force the Janus platform to use a default context identifier that tis build upon the classname of the boot agent. It means
that the UUID is always the same for a given classname.
<p>This function is equivalent to the command line option <code>-B</code>.
@since 2.0.2.0
@see JanusConfig#BOOT_DEFAULT_CONTEXT_ID_NAME
@se... | [
"Force",
"the",
"Janus",
"platform",
"to",
"use",
"a",
"default",
"context",
"identifier",
"that",
"tis",
"build",
"upon",
"the",
"classname",
"of",
"the",
"boot",
"agent",
".",
"It",
"means",
"that",
"the",
"UUID",
"is",
"always",
"the",
"same",
"for",
... | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L792-L795 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.setDefaultContextUUID | public static void setDefaultContextUUID() {
System.setProperty(JanusConfig.BOOT_DEFAULT_CONTEXT_ID_NAME, Boolean.FALSE.toString());
System.setProperty(JanusConfig.RANDOM_DEFAULT_CONTEXT_ID_NAME, Boolean.FALSE.toString());
} | java | public static void setDefaultContextUUID() {
System.setProperty(JanusConfig.BOOT_DEFAULT_CONTEXT_ID_NAME, Boolean.FALSE.toString());
System.setProperty(JanusConfig.RANDOM_DEFAULT_CONTEXT_ID_NAME, Boolean.FALSE.toString());
} | [
"public",
"static",
"void",
"setDefaultContextUUID",
"(",
")",
"{",
"System",
".",
"setProperty",
"(",
"JanusConfig",
".",
"BOOT_DEFAULT_CONTEXT_ID_NAME",
",",
"Boolean",
".",
"FALSE",
".",
"toString",
"(",
")",
")",
";",
"System",
".",
"setProperty",
"(",
"Ja... | Force the Janus platform to use the identifier hard-coded in the source code for its default context.
<p>This function is equivalent to the command line option <code>-W</code>.
<p>This function must be called before launching the Janus platform.
@since 2.0.2.0
@see JanusConfig#BOOT_DEFAULT_CONTEXT_ID_NAME
@see Janus... | [
"Force",
"the",
"Janus",
"platform",
"to",
"use",
"the",
"identifier",
"hard",
"-",
"coded",
"in",
"the",
"source",
"code",
"for",
"its",
"default",
"context",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L808-L811 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java | Utils.getSarlClassification | public static Integer getSarlClassification(ProgramElementDoc type) {
final AnnotationDesc annotation = Utils.findFirst(type.annotations(), it ->
qualifiedNameEquals(it.annotationType().qualifiedTypeName(), getKeywords().getSarlElementTypeAnnotationName()));
if (annotation != null) {
final ElementValuePair[]... | java | public static Integer getSarlClassification(ProgramElementDoc type) {
final AnnotationDesc annotation = Utils.findFirst(type.annotations(), it ->
qualifiedNameEquals(it.annotationType().qualifiedTypeName(), getKeywords().getSarlElementTypeAnnotationName()));
if (annotation != null) {
final ElementValuePair[]... | [
"public",
"static",
"Integer",
"getSarlClassification",
"(",
"ProgramElementDoc",
"type",
")",
"{",
"final",
"AnnotationDesc",
"annotation",
"=",
"Utils",
".",
"findFirst",
"(",
"type",
".",
"annotations",
"(",
")",
",",
"it",
"->",
"qualifiedNameEquals",
"(",
"... | Replies the SARL element type of the given type.
@param type the type.
@return the SARL element type, or {@code null} if unknown. | [
"Replies",
"the",
"SARL",
"element",
"type",
"of",
"the",
"given",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java#L269-L279 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java | Utils.fixHiddenMember | public static String fixHiddenMember(String name) {
return name.replaceAll(Pattern.quote(HIDDEN_MEMBER_CHARACTER),
Matcher.quoteReplacement(HIDDEN_MEMBER_REPLACEMENT_CHARACTER));
} | java | public static String fixHiddenMember(String name) {
return name.replaceAll(Pattern.quote(HIDDEN_MEMBER_CHARACTER),
Matcher.quoteReplacement(HIDDEN_MEMBER_REPLACEMENT_CHARACTER));
} | [
"public",
"static",
"String",
"fixHiddenMember",
"(",
"String",
"name",
")",
"{",
"return",
"name",
".",
"replaceAll",
"(",
"Pattern",
".",
"quote",
"(",
"HIDDEN_MEMBER_CHARACTER",
")",
",",
"Matcher",
".",
"quoteReplacement",
"(",
"HIDDEN_MEMBER_REPLACEMENT_CHARACT... | Replies a fixed version of the given name assuming
that it is an hidden action, and reformating
the reserved text.
<p>An hidden action is an action that is generated by the SARL
compiler, and that cannot be defined by the SARL user.
@param name the name to fix.
@return the fixed name. | [
"Replies",
"a",
"fixed",
"version",
"of",
"the",
"given",
"name",
"assuming",
"that",
"it",
"is",
"an",
"hidden",
"action",
"and",
"reformating",
"the",
"reserved",
"text",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java#L303-L306 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java | Utils.qualifiedNameEquals | public static boolean qualifiedNameEquals(String s1, String s2) {
if (isNullOrEmpty(s1)) {
return isNullOrEmpty(s2);
}
if (!s1.equals(s2)) {
final String simple1 = simpleName(s1);
final String simple2 = simpleName(s2);
return simpleNameEquals(simple1, simple2);
}
return true;
} | java | public static boolean qualifiedNameEquals(String s1, String s2) {
if (isNullOrEmpty(s1)) {
return isNullOrEmpty(s2);
}
if (!s1.equals(s2)) {
final String simple1 = simpleName(s1);
final String simple2 = simpleName(s2);
return simpleNameEquals(simple1, simple2);
}
return true;
} | [
"public",
"static",
"boolean",
"qualifiedNameEquals",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"if",
"(",
"isNullOrEmpty",
"(",
"s1",
")",
")",
"{",
"return",
"isNullOrEmpty",
"(",
"s2",
")",
";",
"}",
"if",
"(",
"!",
"s1",
".",
"equals",
... | Replies if the given qualified names are equal.
<p>Because the Javadoc tool cannot create the fully qualified name, this function
also test simple names.
@param s1 the first string.
@param s2 the first string.
@return {@code true} if the strings are equal. | [
"Replies",
"if",
"the",
"given",
"qualified",
"names",
"are",
"equal",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java#L344-L354 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java | Utils.simpleName | public static String simpleName(String name) {
if (name == null) {
return null;
}
final int index = name.lastIndexOf('.');
if (index > 0) {
return name.substring(index + 1);
}
return name;
} | java | public static String simpleName(String name) {
if (name == null) {
return null;
}
final int index = name.lastIndexOf('.');
if (index > 0) {
return name.substring(index + 1);
}
return name;
} | [
"public",
"static",
"String",
"simpleName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"int",
"index",
"=",
"name",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"index... | Replies the simple name for the given name.
@param name the name.
@return the simple name. | [
"Replies",
"the",
"simple",
"name",
"for",
"the",
"given",
"name",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java#L374-L383 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java | Utils.getCause | public static Throwable getCause(Throwable thr) {
Throwable cause = thr.getCause();
while (cause != null && cause != thr && cause != cause.getCause() && cause.getCause() != null) {
cause = cause.getCause();
}
return cause == null ? thr : cause;
} | java | public static Throwable getCause(Throwable thr) {
Throwable cause = thr.getCause();
while (cause != null && cause != thr && cause != cause.getCause() && cause.getCause() != null) {
cause = cause.getCause();
}
return cause == null ? thr : cause;
} | [
"public",
"static",
"Throwable",
"getCause",
"(",
"Throwable",
"thr",
")",
"{",
"Throwable",
"cause",
"=",
"thr",
".",
"getCause",
"(",
")",
";",
"while",
"(",
"cause",
"!=",
"null",
"&&",
"cause",
"!=",
"thr",
"&&",
"cause",
"!=",
"cause",
".",
"getCa... | Replies the cause of the given exception.
@param thr the exception.
@return the cause. | [
"Replies",
"the",
"cause",
"of",
"the",
"given",
"exception",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java#L390-L396 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java | Utils.performCopy | public static void performCopy(String filename, SarlConfiguration configuration) {
if (filename.isEmpty()) {
return;
}
try {
final DocFile fromfile = DocFile.createFileForInput(configuration, filename);
final DocPath path = DocPath.create(fromfile.getName());
final DocFile toFile = DocFile.createFile... | java | public static void performCopy(String filename, SarlConfiguration configuration) {
if (filename.isEmpty()) {
return;
}
try {
final DocFile fromfile = DocFile.createFileForInput(configuration, filename);
final DocPath path = DocPath.create(fromfile.getName());
final DocFile toFile = DocFile.createFile... | [
"public",
"static",
"void",
"performCopy",
"(",
"String",
"filename",
",",
"SarlConfiguration",
"configuration",
")",
"{",
"if",
"(",
"filename",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"final",
"DocFile",
"fromfile",
"=",
"DocF... | Copy the given file.
@param filename the file to copy.
@param configuration the configuration. | [
"Copy",
"the",
"given",
"file",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java#L403-L425 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java | Utils.emptyList | public static <T> com.sun.tools.javac.util.List<T> emptyList() {
return com.sun.tools.javac.util.List.from(Collections.emptyList());
} | java | public static <T> com.sun.tools.javac.util.List<T> emptyList() {
return com.sun.tools.javac.util.List.from(Collections.emptyList());
} | [
"public",
"static",
"<",
"T",
">",
"com",
".",
"sun",
".",
"tools",
".",
"javac",
".",
"util",
".",
"List",
"<",
"T",
">",
"emptyList",
"(",
")",
"{",
"return",
"com",
".",
"sun",
".",
"tools",
".",
"javac",
".",
"util",
".",
"List",
".",
"from... | Create an empty Java list.
@param <T> the type of the elements into the list.
@return the list. | [
"Create",
"an",
"empty",
"Java",
"list",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java#L432-L434 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java | Utils.toArray | @SuppressWarnings("unchecked")
public static <T> T[] toArray(T[] source, Collection<? extends T> newContent) {
final Object array = Array.newInstance(source.getClass().getComponentType(), newContent.size());
int i = 0;
for (final T element : newContent) {
Array.set(array, i, element);
++i;
}
return (T[... | java | @SuppressWarnings("unchecked")
public static <T> T[] toArray(T[] source, Collection<? extends T> newContent) {
final Object array = Array.newInstance(source.getClass().getComponentType(), newContent.size());
int i = 0;
for (final T element : newContent) {
Array.set(array, i, element);
++i;
}
return (T[... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"toArray",
"(",
"T",
"[",
"]",
"source",
",",
"Collection",
"<",
"?",
"extends",
"T",
">",
"newContent",
")",
"{",
"final",
"Object",
"array",
"=",
... | Convert to an array.
@param <T> the type of the elements.
@param source the original array.
@param newContent the new content.
@return the new array. | [
"Convert",
"to",
"an",
"array",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java#L443-L452 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/AbstractPreferenceAccess.java | AbstractPreferenceAccess.getPreferenceStoreAccess | protected IPreferenceStoreAccess getPreferenceStoreAccess() {
if (this.preferenceStoreAccess == null) {
final Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL);
this.preferenceStoreAccess = injector.getInstance(IPreferenceStoreAccess.class);
}
return this.preferenc... | java | protected IPreferenceStoreAccess getPreferenceStoreAccess() {
if (this.preferenceStoreAccess == null) {
final Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL);
this.preferenceStoreAccess = injector.getInstance(IPreferenceStoreAccess.class);
}
return this.preferenc... | [
"protected",
"IPreferenceStoreAccess",
"getPreferenceStoreAccess",
"(",
")",
"{",
"if",
"(",
"this",
".",
"preferenceStoreAccess",
"==",
"null",
")",
"{",
"final",
"Injector",
"injector",
"=",
"LangActivator",
".",
"getInstance",
"(",
")",
".",
"getInjector",
"(",... | Replies the preference accessor.
@return the accessor. | [
"Replies",
"the",
"preference",
"accessor",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/AbstractPreferenceAccess.java#L59-L65 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/AbstractPreferenceAccess.java | AbstractPreferenceAccess.getWritablePreferenceStore | public IPreferenceStore getWritablePreferenceStore(Object context) {
if (this.preferenceStore == null) {
this.preferenceStore = getPreferenceStoreAccess().getWritablePreferenceStore(context);
}
return this.preferenceStore;
} | java | public IPreferenceStore getWritablePreferenceStore(Object context) {
if (this.preferenceStore == null) {
this.preferenceStore = getPreferenceStoreAccess().getWritablePreferenceStore(context);
}
return this.preferenceStore;
} | [
"public",
"IPreferenceStore",
"getWritablePreferenceStore",
"(",
"Object",
"context",
")",
"{",
"if",
"(",
"this",
".",
"preferenceStore",
"==",
"null",
")",
"{",
"this",
".",
"preferenceStore",
"=",
"getPreferenceStoreAccess",
"(",
")",
".",
"getWritablePreferenceS... | Replies the writable preference store to be used for the SARL editor.
@param context the context (project, etc.) or {@code null} if none (global preferences).
@return the modifiable preference store. | [
"Replies",
"the",
"writable",
"preference",
"store",
"to",
"be",
"used",
"for",
"the",
"SARL",
"editor",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/AbstractPreferenceAccess.java#L72-L77 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java | JanusConfig.getSystemProperty | public static String getSystemProperty(String name, String defaultValue) {
String value;
value = System.getProperty(name, null);
if (value != null) {
return value;
}
value = System.getenv(name);
if (value != null) {
return value;
}
... | java | public static String getSystemProperty(String name, String defaultValue) {
String value;
value = System.getProperty(name, null);
if (value != null) {
return value;
}
value = System.getenv(name);
if (value != null) {
return value;
}
... | [
"public",
"static",
"String",
"getSystemProperty",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
";",
"value",
"=",
"System",
".",
"getProperty",
"(",
"name",
",",
"null",
")",
";",
"if",
"(",
"value",
"!=",
"null",
"... | Replies the value of the system property.
@param name
- name of the property.
@param defaultValue
- value to reply if the these is no property found
@return the value, or defaultValue. | [
"Replies",
"the",
"value",
"of",
"the",
"system",
"property",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java#L320-L331 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java | JanusConfig.getSystemPropertyAsBoolean | public static boolean getSystemPropertyAsBoolean(String name, boolean defaultValue) {
final String value = getSystemProperty(name, null);
if (value != null) {
try {
return Boolean.parseBoolean(value);
} catch (Throwable exception) {
//
... | java | public static boolean getSystemPropertyAsBoolean(String name, boolean defaultValue) {
final String value = getSystemProperty(name, null);
if (value != null) {
try {
return Boolean.parseBoolean(value);
} catch (Throwable exception) {
//
... | [
"public",
"static",
"boolean",
"getSystemPropertyAsBoolean",
"(",
"String",
"name",
",",
"boolean",
"defaultValue",
")",
"{",
"final",
"String",
"value",
"=",
"getSystemProperty",
"(",
"name",
",",
"null",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{"... | Replies the value of the boolean system property.
@param name
- name of the property.
@param defaultValue
- value to reply if the these is no property found
@return the value, or defaultValue. | [
"Replies",
"the",
"value",
"of",
"the",
"boolean",
"system",
"property",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java#L353-L363 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java | JanusConfig.getSystemPropertyAsFloat | public static float getSystemPropertyAsFloat(String name, float defaultValue) {
final String value = getSystemProperty(name, null);
if (value != null) {
try {
return Float.parseFloat(value);
} catch (Throwable exception) {
//
}
... | java | public static float getSystemPropertyAsFloat(String name, float defaultValue) {
final String value = getSystemProperty(name, null);
if (value != null) {
try {
return Float.parseFloat(value);
} catch (Throwable exception) {
//
}
... | [
"public",
"static",
"float",
"getSystemPropertyAsFloat",
"(",
"String",
"name",
",",
"float",
"defaultValue",
")",
"{",
"final",
"String",
"value",
"=",
"getSystemProperty",
"(",
"name",
",",
"null",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"t... | Replies the value of the single precision floating point value system property.
@param name
- name of the property.
@param defaultValue
- value to reply if the these is no property found
@return the value, or defaultValue. | [
"Replies",
"the",
"value",
"of",
"the",
"single",
"precision",
"floating",
"point",
"value",
"system",
"property",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java#L417-L427 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java | JanusConfig.getSystemPropertyAsEnum | public static <S extends Enum<S>> S getSystemPropertyAsEnum(Class<S> type, String name) {
return getSystemPropertyAsEnum(type, name, null);
} | java | public static <S extends Enum<S>> S getSystemPropertyAsEnum(Class<S> type, String name) {
return getSystemPropertyAsEnum(type, name, null);
} | [
"public",
"static",
"<",
"S",
"extends",
"Enum",
"<",
"S",
">",
">",
"S",
"getSystemPropertyAsEnum",
"(",
"Class",
"<",
"S",
">",
"type",
",",
"String",
"name",
")",
"{",
"return",
"getSystemPropertyAsEnum",
"(",
"type",
",",
"name",
",",
"null",
")",
... | Replies the value of the enumeration system property.
@param <S>
- type of the enumeration to read.
@param type
- type of the enumeration.
@param name
- name of the property.
@return the value, or <code>null</code> if no property found. | [
"Replies",
"the",
"value",
"of",
"the",
"enumeration",
"system",
"property",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java#L440-L442 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.isSarlFile | protected boolean isSarlFile(IPackageFragment packageFragment, String filename) {
if (isFileExists(packageFragment, filename, this.sarlFileExtension)) {
return true;
}
final IJavaProject project = getPackageFragmentRoot().getJavaProject();
if (project != null) {
try {
final String packageName = packag... | java | protected boolean isSarlFile(IPackageFragment packageFragment, String filename) {
if (isFileExists(packageFragment, filename, this.sarlFileExtension)) {
return true;
}
final IJavaProject project = getPackageFragmentRoot().getJavaProject();
if (project != null) {
try {
final String packageName = packag... | [
"protected",
"boolean",
"isSarlFile",
"(",
"IPackageFragment",
"packageFragment",
",",
"String",
"filename",
")",
"{",
"if",
"(",
"isFileExists",
"(",
"packageFragment",
",",
"filename",
",",
"this",
".",
"sarlFileExtension",
")",
")",
"{",
"return",
"true",
";"... | Replies if the given filename is a SARL script or a generated Java file.
@param packageFragment the package in which the file should be search for.
@param filename the filename to test.
@return <code>true</code> if a file (SALR or Java) with the given name exists. | [
"Replies",
"if",
"the",
"given",
"filename",
"is",
"a",
"SARL",
"script",
"or",
"a",
"generated",
"Java",
"file",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L347-L366 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.isFileExists | protected static boolean isFileExists(IPackageFragment packageFragment, String filename, String extension) {
if (packageFragment != null) {
final IResource resource = packageFragment.getResource();
if (resource instanceof IFolder) {
final IFolder folder = (IFolder) resource;
if (folder.getFile(filename ... | java | protected static boolean isFileExists(IPackageFragment packageFragment, String filename, String extension) {
if (packageFragment != null) {
final IResource resource = packageFragment.getResource();
if (resource instanceof IFolder) {
final IFolder folder = (IFolder) resource;
if (folder.getFile(filename ... | [
"protected",
"static",
"boolean",
"isFileExists",
"(",
"IPackageFragment",
"packageFragment",
",",
"String",
"filename",
",",
"String",
"extension",
")",
"{",
"if",
"(",
"packageFragment",
"!=",
"null",
")",
"{",
"final",
"IResource",
"resource",
"=",
"packageFrag... | Replies if the given filename is a SARL script in the given package.
@param packageFragment the package in which the file should be search for.
@param filename the filename to test.
@param extension the filename extension to search for.
@return <code>true</code> if a file (SARL or Java) with the given name exists. | [
"Replies",
"if",
"the",
"given",
"filename",
"is",
"a",
"SARL",
"script",
"in",
"the",
"given",
"package",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L375-L386 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.init | protected void init(IStructuredSelection selection) {
final IJavaElement elem = this.fieldInitializer.getSelectedResource(selection);
initContainerPage(elem);
initTypePage(elem);
//
try {
getRootSuperType();
reinitSuperClass();
} catch (Throwable exception) {
//
}
//
try {
getRootSuperInte... | java | protected void init(IStructuredSelection selection) {
final IJavaElement elem = this.fieldInitializer.getSelectedResource(selection);
initContainerPage(elem);
initTypePage(elem);
//
try {
getRootSuperType();
reinitSuperClass();
} catch (Throwable exception) {
//
}
//
try {
getRootSuperInte... | [
"protected",
"void",
"init",
"(",
"IStructuredSelection",
"selection",
")",
"{",
"final",
"IJavaElement",
"elem",
"=",
"this",
".",
"fieldInitializer",
".",
"getSelectedResource",
"(",
"selection",
")",
";",
"initContainerPage",
"(",
"elem",
")",
";",
"initTypePag... | Invoked by the wizard for initializing the page with the given selection.
@param selection the current selection. | [
"Invoked",
"by",
"the",
"wizard",
"for",
"initializing",
"the",
"page",
"with",
"the",
"given",
"selection",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L445-L465 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.createCommonControls | protected Composite createCommonControls(Composite parent) {
initializeDialogUnits(parent);
final Composite composite = SWTFactory.createComposite(
parent,
parent.getFont(),
COLUMNS, 1,
GridData.FILL_HORIZONTAL);
createContainerControls(composite, COLUMNS);
createPackageControls(composite, COLUM... | java | protected Composite createCommonControls(Composite parent) {
initializeDialogUnits(parent);
final Composite composite = SWTFactory.createComposite(
parent,
parent.getFont(),
COLUMNS, 1,
GridData.FILL_HORIZONTAL);
createContainerControls(composite, COLUMNS);
createPackageControls(composite, COLUM... | [
"protected",
"Composite",
"createCommonControls",
"(",
"Composite",
"parent",
")",
"{",
"initializeDialogUnits",
"(",
"parent",
")",
";",
"final",
"Composite",
"composite",
"=",
"SWTFactory",
".",
"createComposite",
"(",
"parent",
",",
"parent",
".",
"getFont",
"(... | Create the components that are common to the creation of all
the SARL elements.
<p>You should invoke this from the {@link #createControl(Composite)} of
the child class.
@param parent the component in which the common controls are added.
@return the created composite. | [
"Create",
"the",
"components",
"that",
"are",
"common",
"to",
"the",
"creation",
"of",
"all",
"the",
"SARL",
"elements",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L675-L687 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.asyncCreateType | protected final int asyncCreateType() {
final int[] size = {0};
final IRunnableWithProgress op = new WorkspaceModifyOperation() {
@Override
protected void execute(IProgressMonitor monitor)
throws CoreException, InvocationTargetException, InterruptedException {
size[0] = createSARLType(monitor);
}
... | java | protected final int asyncCreateType() {
final int[] size = {0};
final IRunnableWithProgress op = new WorkspaceModifyOperation() {
@Override
protected void execute(IProgressMonitor monitor)
throws CoreException, InvocationTargetException, InterruptedException {
size[0] = createSARLType(monitor);
}
... | [
"protected",
"final",
"int",
"asyncCreateType",
"(",
")",
"{",
"final",
"int",
"[",
"]",
"size",
"=",
"{",
"0",
"}",
";",
"final",
"IRunnableWithProgress",
"op",
"=",
"new",
"WorkspaceModifyOperation",
"(",
")",
"{",
"@",
"Override",
"protected",
"void",
"... | Create the type from the data gathered in the wizard.
@return the size of the created file. | [
"Create",
"the",
"type",
"from",
"the",
"data",
"gathered",
"in",
"the",
"wizard",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L708-L728 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.readSettings | protected void readSettings() {
boolean createConstructors = false;
boolean createUnimplemented = true;
boolean createEventHandlers = true;
boolean createLifecycleFunctions = true;
final IDialogSettings dialogSettings = getDialogSettings();
if (dialogSettings != null) {
final IDialogSettings section = di... | java | protected void readSettings() {
boolean createConstructors = false;
boolean createUnimplemented = true;
boolean createEventHandlers = true;
boolean createLifecycleFunctions = true;
final IDialogSettings dialogSettings = getDialogSettings();
if (dialogSettings != null) {
final IDialogSettings section = di... | [
"protected",
"void",
"readSettings",
"(",
")",
"{",
"boolean",
"createConstructors",
"=",
"false",
";",
"boolean",
"createUnimplemented",
"=",
"true",
";",
"boolean",
"createEventHandlers",
"=",
"true",
";",
"boolean",
"createLifecycleFunctions",
"=",
"true",
";",
... | Read the settings of the dialog box. | [
"Read",
"the",
"settings",
"of",
"the",
"dialog",
"box",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L939-L956 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.saveSettings | protected void saveSettings() {
final IDialogSettings dialogSettings = getDialogSettings();
if (dialogSettings != null) {
IDialogSettings section = dialogSettings.getSection(getName());
if (section == null) {
section = dialogSettings.addNewSection(getName());
}
section.put(SETTINGS_CREATECONSTR, isC... | java | protected void saveSettings() {
final IDialogSettings dialogSettings = getDialogSettings();
if (dialogSettings != null) {
IDialogSettings section = dialogSettings.getSection(getName());
if (section == null) {
section = dialogSettings.addNewSection(getName());
}
section.put(SETTINGS_CREATECONSTR, isC... | [
"protected",
"void",
"saveSettings",
"(",
")",
"{",
"final",
"IDialogSettings",
"dialogSettings",
"=",
"getDialogSettings",
"(",
")",
";",
"if",
"(",
"dialogSettings",
"!=",
"null",
")",
"{",
"IDialogSettings",
"section",
"=",
"dialogSettings",
".",
"getSection",
... | Save the settings of the dialog box. | [
"Save",
"the",
"settings",
"of",
"the",
"dialog",
"box",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L960-L972 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.createMethodStubControls | protected void createMethodStubControls(Composite composite, int columns,
boolean enableConstructors, boolean enableInherited, boolean defaultEvents,
boolean lifecycleFunctions) {
this.isConstructorCreationEnabled = enableConstructors;
this.isInheritedCreationEnabled = enableInherited;
this.isDefaultEventGe... | java | protected void createMethodStubControls(Composite composite, int columns,
boolean enableConstructors, boolean enableInherited, boolean defaultEvents,
boolean lifecycleFunctions) {
this.isConstructorCreationEnabled = enableConstructors;
this.isInheritedCreationEnabled = enableInherited;
this.isDefaultEventGe... | [
"protected",
"void",
"createMethodStubControls",
"(",
"Composite",
"composite",
",",
"int",
"columns",
",",
"boolean",
"enableConstructors",
",",
"boolean",
"enableInherited",
",",
"boolean",
"defaultEvents",
",",
"boolean",
"lifecycleFunctions",
")",
"{",
"this",
"."... | Create the controls related to the behavior units to generate.
@param composite the container of the controls.
@param columns the number of columns.
@param enableConstructors indicates if the constructor creation is enable.
@param enableInherited indicates if the inherited operation creation is enable.
@param defaultE... | [
"Create",
"the",
"controls",
"related",
"to",
"the",
"behavior",
"units",
"to",
"generate",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L994-L1030 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.isCreateStandardEventHandlers | protected boolean isCreateStandardEventHandlers() {
int idx = 0;
if (this.isConstructorCreationEnabled) {
++idx;
}
if (this.isInheritedCreationEnabled) {
++idx;
}
return this.isDefaultEventGenerated && this.methodStubsButtons.isSelected(idx);
} | java | protected boolean isCreateStandardEventHandlers() {
int idx = 0;
if (this.isConstructorCreationEnabled) {
++idx;
}
if (this.isInheritedCreationEnabled) {
++idx;
}
return this.isDefaultEventGenerated && this.methodStubsButtons.isSelected(idx);
} | [
"protected",
"boolean",
"isCreateStandardEventHandlers",
"(",
")",
"{",
"int",
"idx",
"=",
"0",
";",
"if",
"(",
"this",
".",
"isConstructorCreationEnabled",
")",
"{",
"++",
"idx",
";",
"}",
"if",
"(",
"this",
".",
"isInheritedCreationEnabled",
")",
"{",
"++"... | Returns the current selection state of the 'Create standard event handlers'
checkbox.
@return the selection state of the 'Create standard event handlers' checkbox | [
"Returns",
"the",
"current",
"selection",
"state",
"of",
"the",
"Create",
"standard",
"event",
"handlers",
"checkbox",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L1061-L1070 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.isCreateStandardLifecycleFunctions | protected boolean isCreateStandardLifecycleFunctions() {
int idx = 0;
if (this.isConstructorCreationEnabled) {
++idx;
}
if (this.isInheritedCreationEnabled) {
++idx;
}
if (this.isDefaultEventGenerated) {
++idx;
}
return this.isDefaultLifecycleFunctionsGenerated && this.methodStubsButtons.isSele... | java | protected boolean isCreateStandardLifecycleFunctions() {
int idx = 0;
if (this.isConstructorCreationEnabled) {
++idx;
}
if (this.isInheritedCreationEnabled) {
++idx;
}
if (this.isDefaultEventGenerated) {
++idx;
}
return this.isDefaultLifecycleFunctionsGenerated && this.methodStubsButtons.isSele... | [
"protected",
"boolean",
"isCreateStandardLifecycleFunctions",
"(",
")",
"{",
"int",
"idx",
"=",
"0",
";",
"if",
"(",
"this",
".",
"isConstructorCreationEnabled",
")",
"{",
"++",
"idx",
";",
"}",
"if",
"(",
"this",
".",
"isInheritedCreationEnabled",
")",
"{",
... | Returns the current selection state of the 'Create standard lifecycle functions'
checkbox.
@return the selection state of the 'Create standard lifecycle functions' checkbox | [
"Returns",
"the",
"current",
"selection",
"state",
"of",
"the",
"Create",
"standard",
"lifecycle",
"functions",
"checkbox",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L1078-L1090 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.setMethodStubSelection | protected void setMethodStubSelection(boolean createConstructors, boolean createInherited,
boolean createEventHandlers, boolean createLifecycleFunctions, boolean canBeModified) {
if (this.methodStubsButtons != null) {
int idx = 0;
if (this.isConstructorCreationEnabled) {
this.methodStubsButtons.setSelect... | java | protected void setMethodStubSelection(boolean createConstructors, boolean createInherited,
boolean createEventHandlers, boolean createLifecycleFunctions, boolean canBeModified) {
if (this.methodStubsButtons != null) {
int idx = 0;
if (this.isConstructorCreationEnabled) {
this.methodStubsButtons.setSelect... | [
"protected",
"void",
"setMethodStubSelection",
"(",
"boolean",
"createConstructors",
",",
"boolean",
"createInherited",
",",
"boolean",
"createEventHandlers",
",",
"boolean",
"createLifecycleFunctions",
",",
"boolean",
"canBeModified",
")",
"{",
"if",
"(",
"this",
".",
... | Sets the selection state of the method stub checkboxes.
@param createConstructors initial selection state of the 'Create Constructors' checkbox.
@param createInherited initial selection state of the 'Create inherited abstract methods' checkbox.
@param createEventHandlers initial selection state of the 'Create standard... | [
"Sets",
"the",
"selection",
"state",
"of",
"the",
"method",
"stub",
"checkboxes",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L1102-L1124 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.createSuperClassSelectionDialog | @SuppressWarnings("static-method")
protected AbstractSuperTypeSelectionDialog<?> createSuperClassSelectionDialog(
Shell parent, IRunnableContext context, IJavaProject project, SarlSpecificTypeSelectionExtension extension,
boolean multi) {
return null;
} | java | @SuppressWarnings("static-method")
protected AbstractSuperTypeSelectionDialog<?> createSuperClassSelectionDialog(
Shell parent, IRunnableContext context, IJavaProject project, SarlSpecificTypeSelectionExtension extension,
boolean multi) {
return null;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"AbstractSuperTypeSelectionDialog",
"<",
"?",
">",
"createSuperClassSelectionDialog",
"(",
"Shell",
"parent",
",",
"IRunnableContext",
"context",
",",
"IJavaProject",
"project",
",",
"SarlSpecificTypeSelec... | Create an instanceof the super-class selection dialog.
@param parent the parent.
@param context the execution context.
@param project the Java project.
@param extension the extension to give to the dialog box.
@param multi indicates if the selection could be done on multiple elements.
@return the dialog, or <code>null... | [
"Create",
"an",
"instanceof",
"the",
"super",
"-",
"class",
"selection",
"dialog",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L1135-L1140 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.createStandardSARLEventTemplates | protected boolean createStandardSARLEventTemplates(String elementTypeName,
Function1<? super String, ? extends ISarlBehaviorUnitBuilder> behaviorUnitAdder,
Procedure1<? super String> usesAdder) {
if (!isCreateStandardEventHandlers()) {
return false;
}
Object type;
try {
type = getTypeFinder().findTy... | java | protected boolean createStandardSARLEventTemplates(String elementTypeName,
Function1<? super String, ? extends ISarlBehaviorUnitBuilder> behaviorUnitAdder,
Procedure1<? super String> usesAdder) {
if (!isCreateStandardEventHandlers()) {
return false;
}
Object type;
try {
type = getTypeFinder().findTy... | [
"protected",
"boolean",
"createStandardSARLEventTemplates",
"(",
"String",
"elementTypeName",
",",
"Function1",
"<",
"?",
"super",
"String",
",",
"?",
"extends",
"ISarlBehaviorUnitBuilder",
">",
"behaviorUnitAdder",
",",
"Procedure1",
"<",
"?",
"super",
"String",
">",... | Create the default standard SARL event templates.
@param elementTypeName the name of the element type.
@param behaviorUnitAdder the adder of behavior unit.
@param usesAdder the adder of uses statement.
@return {@code true} if the units are added; {@code false} otherwise.
@since 0.5 | [
"Create",
"the",
"default",
"standard",
"SARL",
"event",
"templates",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L1214-L1286 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java | AbstractNewSarlElementWizardPage.createStandardSARLLifecycleFunctionTemplates | protected boolean createStandardSARLLifecycleFunctionTemplates(String elementTypeName,
Function1<? super String, ? extends ISarlActionBuilder> actionAdder,
Procedure1<? super String> usesAdder) {
if (!isCreateStandardLifecycleFunctions()) {
return false;
}
usesAdder.apply(LOGGING_CAPACITY_NAME);
ISar... | java | protected boolean createStandardSARLLifecycleFunctionTemplates(String elementTypeName,
Function1<? super String, ? extends ISarlActionBuilder> actionAdder,
Procedure1<? super String> usesAdder) {
if (!isCreateStandardLifecycleFunctions()) {
return false;
}
usesAdder.apply(LOGGING_CAPACITY_NAME);
ISar... | [
"protected",
"boolean",
"createStandardSARLLifecycleFunctionTemplates",
"(",
"String",
"elementTypeName",
",",
"Function1",
"<",
"?",
"super",
"String",
",",
"?",
"extends",
"ISarlActionBuilder",
">",
"actionAdder",
",",
"Procedure1",
"<",
"?",
"super",
"String",
">",... | Create the default standard lifecycle function templates.
@param elementTypeName the name of the element type.
@param actionAdder the adder of actions.
@param usesAdder the adder of uses statement.
@return {@code true} if the units are added; {@code false} otherwise.
@since 0.5 | [
"Create",
"the",
"default",
"standard",
"lifecycle",
"function",
"templates",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/elements/AbstractNewSarlElementWizardPage.java#L1296-L1322 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/compiler/ProjectAdapter.java | ProjectAdapter.getProject | public static IProject getProject(Resource resource) {
ProjectAdapter adapter = (ProjectAdapter) EcoreUtil.getAdapter(resource.getResourceSet().eAdapters(), ProjectAdapter.class);
if (adapter == null) {
final String platformString = resource.getURI().toPlatformString(true);
final IProject project = ResourcesP... | java | public static IProject getProject(Resource resource) {
ProjectAdapter adapter = (ProjectAdapter) EcoreUtil.getAdapter(resource.getResourceSet().eAdapters(), ProjectAdapter.class);
if (adapter == null) {
final String platformString = resource.getURI().toPlatformString(true);
final IProject project = ResourcesP... | [
"public",
"static",
"IProject",
"getProject",
"(",
"Resource",
"resource",
")",
"{",
"ProjectAdapter",
"adapter",
"=",
"(",
"ProjectAdapter",
")",
"EcoreUtil",
".",
"getAdapter",
"(",
"resource",
".",
"getResourceSet",
"(",
")",
".",
"eAdapters",
"(",
")",
","... | Get the project associated to the resource.
@param resource the resource
@return the project. | [
"Get",
"the",
"project",
"associated",
"to",
"the",
"resource",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/compiler/ProjectAdapter.java#L69-L78 | train |
sarl/sarl | main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/ImportMavenSarlProjectWizard.java | ImportMavenSarlProjectWizard.getMavenImportWizardPage | protected MavenImportWizardPage getMavenImportWizardPage() {
if (this.mainPageBuffer == null) {
try {
final Field field = MavenImportWizard.class.getDeclaredField("page"); //$NON-NLS-1$
field.setAccessible(true);
this.mainPageBuffer = (MavenImportWizardPage) field.get(this);
} catch (Exception excep... | java | protected MavenImportWizardPage getMavenImportWizardPage() {
if (this.mainPageBuffer == null) {
try {
final Field field = MavenImportWizard.class.getDeclaredField("page"); //$NON-NLS-1$
field.setAccessible(true);
this.mainPageBuffer = (MavenImportWizardPage) field.get(this);
} catch (Exception excep... | [
"protected",
"MavenImportWizardPage",
"getMavenImportWizardPage",
"(",
")",
"{",
"if",
"(",
"this",
".",
"mainPageBuffer",
"==",
"null",
")",
"{",
"try",
"{",
"final",
"Field",
"field",
"=",
"MavenImportWizard",
".",
"class",
".",
"getDeclaredField",
"(",
"\"pag... | Replies the main configuration page.
@return the main configuration page. | [
"Replies",
"the",
"main",
"configuration",
"page",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/ImportMavenSarlProjectWizard.java#L65-L76 | train |
sarl/sarl | main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/ImportMavenSarlProjectWizard.java | ImportMavenSarlProjectWizard.createImportJob | protected WorkspaceJob createImportJob(Collection<MavenProjectInfo> projects) {
final WorkspaceJob job = new ImportMavenSarlProjectsJob(projects, this.workingSets, this.importConfiguration);
job.setRule(MavenPlugin.getProjectConfigurationManager().getRule());
return job;
} | java | protected WorkspaceJob createImportJob(Collection<MavenProjectInfo> projects) {
final WorkspaceJob job = new ImportMavenSarlProjectsJob(projects, this.workingSets, this.importConfiguration);
job.setRule(MavenPlugin.getProjectConfigurationManager().getRule());
return job;
} | [
"protected",
"WorkspaceJob",
"createImportJob",
"(",
"Collection",
"<",
"MavenProjectInfo",
">",
"projects",
")",
"{",
"final",
"WorkspaceJob",
"job",
"=",
"new",
"ImportMavenSarlProjectsJob",
"(",
"projects",
",",
"this",
".",
"workingSets",
",",
"this",
".",
"im... | Create the import job.
@param projects the projects to import.
@return the import job. | [
"Create",
"the",
"import",
"job",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/ImportMavenSarlProjectWizard.java#L154-L158 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java | Utilities.parseVersion | public static Version parseVersion(String version) {
if (!Strings.isNullOrEmpty(version)) {
try {
return Version.parseVersion(version);
} catch (Throwable exception) {
//
}
}
return null;
} | java | public static Version parseVersion(String version) {
if (!Strings.isNullOrEmpty(version)) {
try {
return Version.parseVersion(version);
} catch (Throwable exception) {
//
}
}
return null;
} | [
"public",
"static",
"Version",
"parseVersion",
"(",
"String",
"version",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isNullOrEmpty",
"(",
"version",
")",
")",
"{",
"try",
"{",
"return",
"Version",
".",
"parseVersion",
"(",
"version",
")",
";",
"}",
"catch... | Null-safe version parser.
@param version the version string.
@return the version. | [
"Null",
"-",
"safe",
"version",
"parser",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java#L62-L71 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java | Utilities.compareVersionToRange | public static int compareVersionToRange(Version version, Version minVersion, Version maxVersion) {
assert minVersion == null || maxVersion == null || minVersion.compareTo(maxVersion) < 0;
if (version == null) {
return Integer.MIN_VALUE;
}
if (minVersion != null && compareVersionsNoQualifier(version, minVersi... | java | public static int compareVersionToRange(Version version, Version minVersion, Version maxVersion) {
assert minVersion == null || maxVersion == null || minVersion.compareTo(maxVersion) < 0;
if (version == null) {
return Integer.MIN_VALUE;
}
if (minVersion != null && compareVersionsNoQualifier(version, minVersi... | [
"public",
"static",
"int",
"compareVersionToRange",
"(",
"Version",
"version",
",",
"Version",
"minVersion",
",",
"Version",
"maxVersion",
")",
"{",
"assert",
"minVersion",
"==",
"null",
"||",
"maxVersion",
"==",
"null",
"||",
"minVersion",
".",
"compareTo",
"("... | Null-safe compare a version number to a range of version numbers.
<p>The minVersion must be strictly lower to the maxVersion. Otherwise
the behavior is not predictible.
@param version the version to compare to the range; must not be <code>null</code>.
@param minVersion the minimal version in the range (inclusive); co... | [
"Null",
"-",
"safe",
"compare",
"a",
"version",
"number",
"to",
"a",
"range",
"of",
"version",
"numbers",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java#L85-L97 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java | Utilities.compareTo | public static <T> int compareTo(Comparable<T> object1, T object2) {
if (object1 == object2) {
return 0;
}
if (object1 == null) {
return Integer.MIN_VALUE;
}
if (object2 == null) {
return Integer.MAX_VALUE;
}
assert object1 != null && object2 != null;
return object1.compareTo(object2);
} | java | public static <T> int compareTo(Comparable<T> object1, T object2) {
if (object1 == object2) {
return 0;
}
if (object1 == null) {
return Integer.MIN_VALUE;
}
if (object2 == null) {
return Integer.MAX_VALUE;
}
assert object1 != null && object2 != null;
return object1.compareTo(object2);
} | [
"public",
"static",
"<",
"T",
">",
"int",
"compareTo",
"(",
"Comparable",
"<",
"T",
">",
"object1",
",",
"T",
"object2",
")",
"{",
"if",
"(",
"object1",
"==",
"object2",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"object1",
"==",
"null",
")",
... | Null-safe comparison.
@param <T> - type of the comparable element.
@param object1 the first object.
@param object2 the second object.
@return Negative number if a lower than b.
Positive number if a greater than b.
<code>0</code> if a is equal to b. | [
"Null",
"-",
"safe",
"comparison",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java#L126-L138 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java | Utilities.getNameWithTypeParameters | public static String getNameWithTypeParameters(IType type) {
assert type != null;
final String superName = type.getFullyQualifiedName('.');
if (!JavaModelUtil.is50OrHigher(type.getJavaProject())) {
return superName;
}
try {
final ITypeParameter[] typeParameters = type.getTypeParameters();
if (typePar... | java | public static String getNameWithTypeParameters(IType type) {
assert type != null;
final String superName = type.getFullyQualifiedName('.');
if (!JavaModelUtil.is50OrHigher(type.getJavaProject())) {
return superName;
}
try {
final ITypeParameter[] typeParameters = type.getTypeParameters();
if (typePar... | [
"public",
"static",
"String",
"getNameWithTypeParameters",
"(",
"IType",
"type",
")",
"{",
"assert",
"type",
"!=",
"null",
";",
"final",
"String",
"superName",
"=",
"type",
".",
"getFullyQualifiedName",
"(",
"'",
"'",
")",
";",
"if",
"(",
"!",
"JavaModelUtil... | Replies the fully qualified name with generic parameters.
@param type the type. Never <code>null</code>.
@return the qualified name. | [
"Replies",
"the",
"fully",
"qualified",
"name",
"with",
"generic",
"parameters",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java#L145-L170 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java | Utilities.newLibraryEntry | public static IClasspathEntry newLibraryEntry(Bundle bundle, IPath precomputedBundlePath, BundleURLMappings javadocURLs) {
assert bundle != null;
final IPath bundlePath;
if (precomputedBundlePath == null) {
bundlePath = BundleUtil.getBundlePath(bundle);
} else {
bundlePath = precomputedBundlePath;
}
f... | java | public static IClasspathEntry newLibraryEntry(Bundle bundle, IPath precomputedBundlePath, BundleURLMappings javadocURLs) {
assert bundle != null;
final IPath bundlePath;
if (precomputedBundlePath == null) {
bundlePath = BundleUtil.getBundlePath(bundle);
} else {
bundlePath = precomputedBundlePath;
}
f... | [
"public",
"static",
"IClasspathEntry",
"newLibraryEntry",
"(",
"Bundle",
"bundle",
",",
"IPath",
"precomputedBundlePath",
",",
"BundleURLMappings",
"javadocURLs",
")",
"{",
"assert",
"bundle",
"!=",
"null",
";",
"final",
"IPath",
"bundlePath",
";",
"if",
"(",
"pre... | Create the classpath library linked to the bundle with the given name.
@param bundle the bundle to point to. Never <code>null</code>.
@param precomputedBundlePath the path to the bundle that is already available. If <code>null</code>,
the path is computed from the bundle with {@link BundleUtil}.
@param javadocURLs the... | [
"Create",
"the",
"classpath",
"library",
"linked",
"to",
"the",
"bundle",
"with",
"the",
"given",
"name",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java#L181-L221 | train |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/BootiqueSarlcMain.java | BootiqueSarlcMain.createRuntime | @SuppressWarnings("static-method")
protected BQRuntime createRuntime(String... args) {
SARLStandaloneSetup.doPreSetup();
final BQRuntime runtime = Bootique.app(args).autoLoadModules().createRuntime();
SARLStandaloneSetup.doPostSetup(runtime.getInstance(Injector.class));
return runtime;
} | java | @SuppressWarnings("static-method")
protected BQRuntime createRuntime(String... args) {
SARLStandaloneSetup.doPreSetup();
final BQRuntime runtime = Bootique.app(args).autoLoadModules().createRuntime();
SARLStandaloneSetup.doPostSetup(runtime.getInstance(Injector.class));
return runtime;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"BQRuntime",
"createRuntime",
"(",
"String",
"...",
"args",
")",
"{",
"SARLStandaloneSetup",
".",
"doPreSetup",
"(",
")",
";",
"final",
"BQRuntime",
"runtime",
"=",
"Bootique",
".",
"app",
"(",... | Create the compiler runtime.
@param args the command line arguments.
@return the runtime. | [
"Create",
"the",
"compiler",
"runtime",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/BootiqueSarlcMain.java#L55-L61 | train |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/BootiqueSarlcMain.java | BootiqueSarlcMain.runCompiler | public int runCompiler(String... args) {
try {
final BQRuntime runtime = createRuntime(args);
final CommandOutcome outcome = runtime.run();
if (!outcome.isSuccess() && outcome.getException() != null) {
Logger.getRootLogger().error(outcome.getMessage(), outcome.getException());
}
return outcome.getE... | java | public int runCompiler(String... args) {
try {
final BQRuntime runtime = createRuntime(args);
final CommandOutcome outcome = runtime.run();
if (!outcome.isSuccess() && outcome.getException() != null) {
Logger.getRootLogger().error(outcome.getMessage(), outcome.getException());
}
return outcome.getE... | [
"public",
"int",
"runCompiler",
"(",
"String",
"...",
"args",
")",
"{",
"try",
"{",
"final",
"BQRuntime",
"runtime",
"=",
"createRuntime",
"(",
"args",
")",
";",
"final",
"CommandOutcome",
"outcome",
"=",
"runtime",
".",
"run",
"(",
")",
";",
"if",
"(",
... | Run the batch compiler.
<p>This function runs the compiler and exits with the return code.
@param args the command line arguments.
@return the exit code. | [
"Run",
"the",
"batch",
"compiler",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/BootiqueSarlcMain.java#L70-L89 | train |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/BootiqueSarlcMain.java | BootiqueSarlcMain.getOptions | public List<HelpOption> getOptions() {
final BQRuntime runtime = createRuntime();
final ApplicationMetadata application = runtime.getInstance(ApplicationMetadata.class);
final HelpOptions helpOptions = new HelpOptions();
application.getCommands().forEach(c -> {
helpOptions.add(c.asOption());
c.getOptions... | java | public List<HelpOption> getOptions() {
final BQRuntime runtime = createRuntime();
final ApplicationMetadata application = runtime.getInstance(ApplicationMetadata.class);
final HelpOptions helpOptions = new HelpOptions();
application.getCommands().forEach(c -> {
helpOptions.add(c.asOption());
c.getOptions... | [
"public",
"List",
"<",
"HelpOption",
">",
"getOptions",
"(",
")",
"{",
"final",
"BQRuntime",
"runtime",
"=",
"createRuntime",
"(",
")",
";",
"final",
"ApplicationMetadata",
"application",
"=",
"runtime",
".",
"getInstance",
"(",
"ApplicationMetadata",
".",
"clas... | Replies the options of the program.
@return the options of the program. | [
"Replies",
"the",
"options",
"of",
"the",
"program",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/BootiqueSarlcMain.java#L95-L108 | train |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/writers/SarlConstructorWriter.java | SarlConstructorWriter.addAnnotations | protected void addAnnotations(ExecutableMemberDoc member, Content htmlTree) {
WriterUtils.addAnnotations(member, htmlTree, this.configuration, this.writer);
} | java | protected void addAnnotations(ExecutableMemberDoc member, Content htmlTree) {
WriterUtils.addAnnotations(member, htmlTree, this.configuration, this.writer);
} | [
"protected",
"void",
"addAnnotations",
"(",
"ExecutableMemberDoc",
"member",
",",
"Content",
"htmlTree",
")",
"{",
"WriterUtils",
".",
"addAnnotations",
"(",
"member",
",",
"htmlTree",
",",
"this",
".",
"configuration",
",",
"this",
".",
"writer",
")",
";",
"}... | Add annotations, except the reserved annotations.
@param member the members.
@param htmlTree the output. | [
"Add",
"annotations",
"except",
"the",
"reserved",
"annotations",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/writers/SarlConstructorWriter.java#L82-L84 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.setCurrentPreferenceKey | public static void setCurrentPreferenceKey(String key) {
LOCK.lock();
try {
currentPreferenceKey = (Strings.isNullOrEmpty(key)) ? DEFAULT_PREFERENCE_KEY : key;
} finally {
LOCK.unlock();
}
} | java | public static void setCurrentPreferenceKey(String key) {
LOCK.lock();
try {
currentPreferenceKey = (Strings.isNullOrEmpty(key)) ? DEFAULT_PREFERENCE_KEY : key;
} finally {
LOCK.unlock();
}
} | [
"public",
"static",
"void",
"setCurrentPreferenceKey",
"(",
"String",
"key",
")",
"{",
"LOCK",
".",
"lock",
"(",
")",
";",
"try",
"{",
"currentPreferenceKey",
"=",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"key",
")",
")",
"?",
"DEFAULT_PREFERENCE_KEY",
":"... | Change the key used for storing the SARL runtime configuration
into the preferences.
<p>If the given key is <code>null</code> or empty, the preference key
is reset to the {@link #DEFAULT_PREFERENCE_KEY}.
@param key the new key or <code>null</code>. | [
"Change",
"the",
"key",
"used",
"for",
"storing",
"the",
"SARL",
"runtime",
"configuration",
"into",
"the",
"preferences",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L154-L161 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.fireSREChanged | public static void fireSREChanged(PropertyChangeEvent event) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).sreChanged(event);
}
} | java | public static void fireSREChanged(PropertyChangeEvent event) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).sreChanged(event);
}
} | [
"public",
"static",
"void",
"fireSREChanged",
"(",
"PropertyChangeEvent",
"event",
")",
"{",
"for",
"(",
"final",
"Object",
"listener",
":",
"SRE_LISTENERS",
".",
"getListeners",
"(",
")",
")",
"{",
"(",
"(",
"ISREInstallChangedListener",
")",
"listener",
")",
... | Notifies all SRE install changed listeners of the given property change.
@param event event describing the change. | [
"Notifies",
"all",
"SRE",
"install",
"changed",
"listeners",
"of",
"the",
"given",
"property",
"change",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L188-L192 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.fireSREAdded | public static void fireSREAdded(ISREInstall installation) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).sreAdded(installation);
}
} | java | public static void fireSREAdded(ISREInstall installation) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).sreAdded(installation);
}
} | [
"public",
"static",
"void",
"fireSREAdded",
"(",
"ISREInstall",
"installation",
")",
"{",
"for",
"(",
"final",
"Object",
"listener",
":",
"SRE_LISTENERS",
".",
"getListeners",
"(",
")",
")",
"{",
"(",
"(",
"ISREInstallChangedListener",
")",
"listener",
")",
".... | Notifies all SRE install changed listeners of the addition of a SRE.
@param installation the installed SRE. | [
"Notifies",
"all",
"SRE",
"install",
"changed",
"listeners",
"of",
"the",
"addition",
"of",
"a",
"SRE",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L199-L203 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.fireSRERemoved | public static void fireSRERemoved(ISREInstall installation) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).sreRemoved(installation);
}
} | java | public static void fireSRERemoved(ISREInstall installation) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).sreRemoved(installation);
}
} | [
"public",
"static",
"void",
"fireSRERemoved",
"(",
"ISREInstall",
"installation",
")",
"{",
"for",
"(",
"final",
"Object",
"listener",
":",
"SRE_LISTENERS",
".",
"getListeners",
"(",
")",
")",
"{",
"(",
"(",
"ISREInstallChangedListener",
")",
"listener",
")",
... | Notifies all SRE install changed listeners of the removed of a SRE.
@param installation the removed SRE. | [
"Notifies",
"all",
"SRE",
"install",
"changed",
"listeners",
"of",
"the",
"removed",
"of",
"a",
"SRE",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L210-L214 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.getSREFromId | public static ISREInstall getSREFromId(String id) {
if (Strings.isNullOrEmpty(id)) {
return null;
}
initializeSREs();
LOCK.lock();
try {
return ALL_SRE_INSTALLS.get(id);
} finally {
LOCK.unlock();
}
} | java | public static ISREInstall getSREFromId(String id) {
if (Strings.isNullOrEmpty(id)) {
return null;
}
initializeSREs();
LOCK.lock();
try {
return ALL_SRE_INSTALLS.get(id);
} finally {
LOCK.unlock();
}
} | [
"public",
"static",
"ISREInstall",
"getSREFromId",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"id",
")",
")",
"{",
"return",
"null",
";",
"}",
"initializeSREs",
"(",
")",
";",
"LOCK",
".",
"lock",
"(",
")",
";",
"... | Return the SRE corresponding to the specified Id.
@param id the id that specifies an instance of ISREInstall
@return the SRE corresponding to the specified Id, or <code>null</code>. | [
"Return",
"the",
"SRE",
"corresponding",
"to",
"the",
"specified",
"Id",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L222-L233 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.setSREInstalls | @SuppressWarnings("checkstyle:npathcomplexity")
public static void setSREInstalls(ISREInstall[] sres, IProgressMonitor monitor) throws CoreException {
final SubMonitor mon = SubMonitor.convert(monitor,
io.sarl.eclipse.runtime.Messages.SARLRuntime_0,
sres.length * 2 + ALL_SRE_INSTALLS.size());
initializeSRE... | java | @SuppressWarnings("checkstyle:npathcomplexity")
public static void setSREInstalls(ISREInstall[] sres, IProgressMonitor monitor) throws CoreException {
final SubMonitor mon = SubMonitor.convert(monitor,
io.sarl.eclipse.runtime.Messages.SARLRuntime_0,
sres.length * 2 + ALL_SRE_INSTALLS.size());
initializeSRE... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:npathcomplexity\"",
")",
"public",
"static",
"void",
"setSREInstalls",
"(",
"ISREInstall",
"[",
"]",
"sres",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"CoreException",
"{",
"final",
"SubMonitor",
"mon",
"=",
"SubM... | Sets the installed SREs.
@param sres The installed SREs.
@param monitor the progress monitor to use for reporting progress to the user. It is the caller's responsibility
to call done() on the given monitor. Accepts <code>null</code>, indicating that no progress should be
reported and that the operation cannot be cance... | [
"Sets",
"the",
"installed",
"SREs",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L281-L334 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.