repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java | SARLProjectConfigurator.safeRefresh | @SuppressWarnings("static-method")
protected void safeRefresh(IProject project, IProgressMonitor monitor) {
try {
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
} catch (CoreException exception) {
SARLEclipsePlugin.getDefault().log(exception);
}
} | java | @SuppressWarnings("static-method")
protected void safeRefresh(IProject project, IProgressMonitor monitor) {
try {
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
} catch (CoreException exception) {
SARLEclipsePlugin.getDefault().log(exception);
}
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"void",
"safeRefresh",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
")",
"{",
"try",
"{",
"project",
".",
"refreshLocal",
"(",
"IResource",
".",
"DEPTH_INFINITE",
",",
"monitor... | Refresh the project file hierarchy.
@param project the project.
@param monitor the progress monitor. | [
"Refresh",
"the",
"project",
"file",
"hierarchy",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java#L197-L204 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java | SARLProjectConfigurator.getSARLProjectSourceFolders | public static String[] getSARLProjectSourceFolders() {
return new String[] {
SARLConfig.FOLDER_SOURCE_SARL,
SARLConfig.FOLDER_SOURCE_JAVA,
SARLConfig.FOLDER_RESOURCES,
SARLConfig.FOLDER_TEST_SOURCE_SARL,
SARLConfig.FOLDER_SOURCE_GENERATED,
SARLConfig.FOLDER_TEST_SOURCE_GENERATED,
};
} | java | public static String[] getSARLProjectSourceFolders() {
return new String[] {
SARLConfig.FOLDER_SOURCE_SARL,
SARLConfig.FOLDER_SOURCE_JAVA,
SARLConfig.FOLDER_RESOURCES,
SARLConfig.FOLDER_TEST_SOURCE_SARL,
SARLConfig.FOLDER_SOURCE_GENERATED,
SARLConfig.FOLDER_TEST_SOURCE_GENERATED,
};
} | [
"public",
"static",
"String",
"[",
"]",
"getSARLProjectSourceFolders",
"(",
")",
"{",
"return",
"new",
"String",
"[",
"]",
"{",
"SARLConfig",
".",
"FOLDER_SOURCE_SARL",
",",
"SARLConfig",
".",
"FOLDER_SOURCE_JAVA",
",",
"SARLConfig",
".",
"FOLDER_RESOURCES",
",",
... | Replies the list of the standard source folders for a SARL project.
@return the list of the standard source folders.
@since 0.8 | [
"Replies",
"the",
"list",
"of",
"the",
"standard",
"source",
"folders",
"for",
"a",
"SARL",
"project",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java#L211-L220 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java | SARLProjectConfigurator.configureSARLProject | public static void configureSARLProject(IProject project, boolean addNatures,
boolean configureJavaNature, boolean createFolders, IProgressMonitor monitor) {
try {
final SubMonitor subMonitor = SubMonitor.convert(monitor, 11);
// Add Natures
final IStatus status = Status.OK_STATUS;
if (addNatures) {
... | java | public static void configureSARLProject(IProject project, boolean addNatures,
boolean configureJavaNature, boolean createFolders, IProgressMonitor monitor) {
try {
final SubMonitor subMonitor = SubMonitor.convert(monitor, 11);
// Add Natures
final IStatus status = Status.OK_STATUS;
if (addNatures) {
... | [
"public",
"static",
"void",
"configureSARLProject",
"(",
"IProject",
"project",
",",
"boolean",
"addNatures",
",",
"boolean",
"configureJavaNature",
",",
"boolean",
"createFolders",
",",
"IProgressMonitor",
"monitor",
")",
"{",
"try",
"{",
"final",
"SubMonitor",
"su... | Configure the SARL project.
<p>This function does the following:<ul>
<li>Add the SARL nature to the project;</li>
<li>Create the standard SARL folders if {@code createFolders} is evaluated to true;</li>
<li>Set the output configuration of the project from the
{@link SARLPreferences#setSpecificSARLConfigurationFor(IPro... | [
"Configure",
"the",
"SARL",
"project",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java#L253-L309 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java | SARLProjectConfigurator.configureSARLSourceFolders | public static void configureSARLSourceFolders(IProject project, boolean createFolders, IProgressMonitor monitor) {
try {
final SubMonitor subMonitor = SubMonitor.convert(monitor, 8);
final OutParameter<IFolder[]> sourceFolders = new OutParameter<>();
final OutParameter<IFolder[]> testSourceFolders = new Out... | java | public static void configureSARLSourceFolders(IProject project, boolean createFolders, IProgressMonitor monitor) {
try {
final SubMonitor subMonitor = SubMonitor.convert(monitor, 8);
final OutParameter<IFolder[]> sourceFolders = new OutParameter<>();
final OutParameter<IFolder[]> testSourceFolders = new Out... | [
"public",
"static",
"void",
"configureSARLSourceFolders",
"(",
"IProject",
"project",
",",
"boolean",
"createFolders",
",",
"IProgressMonitor",
"monitor",
")",
"{",
"try",
"{",
"final",
"SubMonitor",
"subMonitor",
"=",
"SubMonitor",
".",
"convert",
"(",
"monitor",
... | Configure the source folders for a SARL project.
@param project the project.
@param createFolders indicates if the folders must be created or not.
@param monitor the monitor.
@since 0.8
@see #addSarlNatures(IProject, IProgressMonitor)
@see #configureSARLProject(IProject, boolean, boolean, boolean, IProgressMonitor) | [
"Configure",
"the",
"source",
"folders",
"for",
"a",
"SARL",
"project",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java#L369-L403 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java | SARLProjectConfigurator.getDefaultSourceClassPathEntries | public static List<IClasspathEntry> getDefaultSourceClassPathEntries(IPath projectFolder) {
final IPath srcJava = projectFolder.append(
Path.fromPortableString(SARLConfig.FOLDER_SOURCE_JAVA));
final IClasspathEntry srcJavaEntry = JavaCore.newSourceEntry(srcJava.makeAbsolute());
final IPath srcSarl = projectF... | java | public static List<IClasspathEntry> getDefaultSourceClassPathEntries(IPath projectFolder) {
final IPath srcJava = projectFolder.append(
Path.fromPortableString(SARLConfig.FOLDER_SOURCE_JAVA));
final IClasspathEntry srcJavaEntry = JavaCore.newSourceEntry(srcJava.makeAbsolute());
final IPath srcSarl = projectF... | [
"public",
"static",
"List",
"<",
"IClasspathEntry",
">",
"getDefaultSourceClassPathEntries",
"(",
"IPath",
"projectFolder",
")",
"{",
"final",
"IPath",
"srcJava",
"=",
"projectFolder",
".",
"append",
"(",
"Path",
".",
"fromPortableString",
"(",
"SARLConfig",
".",
... | Replies the default source entries for a SARL project.
@param projectFolder the folder of the project.
@return the classpath entries. | [
"Replies",
"the",
"default",
"source",
"entries",
"for",
"a",
"SARL",
"project",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java#L410-L440 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java | SARLProjectConfigurator.collectProjectFoldersFromDirectory | @SuppressWarnings("checkstyle:npathcomplexity")
protected void collectProjectFoldersFromDirectory(Collection<File> folders, File directory,
Set<String> directoriesVisited, boolean nestedProjects, IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return;
}
monitor.subTask(NLS.bind(
Messages.SARLPr... | java | @SuppressWarnings("checkstyle:npathcomplexity")
protected void collectProjectFoldersFromDirectory(Collection<File> folders, File directory,
Set<String> directoriesVisited, boolean nestedProjects, IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return;
}
monitor.subTask(NLS.bind(
Messages.SARLPr... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:npathcomplexity\"",
")",
"protected",
"void",
"collectProjectFoldersFromDirectory",
"(",
"Collection",
"<",
"File",
">",
"folders",
",",
"File",
"directory",
",",
"Set",
"<",
"String",
">",
"directoriesVisited",
",",
"boolea... | Collect the list of SARL project folders that are under directory into files.
@param folders the list of folders to fill in.
@param directory the directory to explore.
@param directoriesVisited Set of canonical paths of directories, used as recursion guard.
@param nestedProjects whether to look for nested projects.
@p... | [
"Collect",
"the",
"list",
"of",
"SARL",
"project",
"folders",
"that",
"are",
"under",
"directory",
"into",
"files",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java#L618-L675 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java | SARLProjectConfigurator.addNatures | public static IStatus addNatures(IProject project, IProgressMonitor monitor, String... natureIdentifiers) {
if (project != null && natureIdentifiers != null && natureIdentifiers.length > 0) {
try {
final SubMonitor subMonitor = SubMonitor.convert(monitor, natureIdentifiers.length + 2);
final IProjectDescri... | java | public static IStatus addNatures(IProject project, IProgressMonitor monitor, String... natureIdentifiers) {
if (project != null && natureIdentifiers != null && natureIdentifiers.length > 0) {
try {
final SubMonitor subMonitor = SubMonitor.convert(monitor, natureIdentifiers.length + 2);
final IProjectDescri... | [
"public",
"static",
"IStatus",
"addNatures",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
",",
"String",
"...",
"natureIdentifiers",
")",
"{",
"if",
"(",
"project",
"!=",
"null",
"&&",
"natureIdentifiers",
"!=",
"null",
"&&",
"natureIdentifiers"... | Add the natures to the given project.
@param project the project.
@param monitor the monitor.
@param natureIdentifiers the identifiers of the natures to add to the project.
@return the status if the operation.
@since 0.8 | [
"Add",
"the",
"natures",
"to",
"the",
"given",
"project",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java#L714-L744 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java | SARLProjectConfigurator.addSarlNatures | public static IStatus addSarlNatures(IProject project, IProgressMonitor monitor) {
return addNatures(project, monitor, getSarlNatures());
} | java | public static IStatus addSarlNatures(IProject project, IProgressMonitor monitor) {
return addNatures(project, monitor, getSarlNatures());
} | [
"public",
"static",
"IStatus",
"addSarlNatures",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
")",
"{",
"return",
"addNatures",
"(",
"project",
",",
"monitor",
",",
"getSarlNatures",
"(",
")",
")",
";",
"}"
] | Add the SARL natures to the given project.
@param project the project.
@param monitor the monitor.
@return the status if the operation. | [
"Add",
"the",
"SARL",
"natures",
"to",
"the",
"given",
"project",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java#L760-L762 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java | Jdt2Ecore.getAnnotation | public IAnnotation getAnnotation(IAnnotatable element, String qualifiedName) {
if (element != null) {
try {
final int separator = qualifiedName.lastIndexOf('.');
final String simpleName;
if (separator >= 0 && separator < (qualifiedName.length() - 1)) {
simpleName = qualifiedName.substring(separato... | java | public IAnnotation getAnnotation(IAnnotatable element, String qualifiedName) {
if (element != null) {
try {
final int separator = qualifiedName.lastIndexOf('.');
final String simpleName;
if (separator >= 0 && separator < (qualifiedName.length() - 1)) {
simpleName = qualifiedName.substring(separato... | [
"public",
"IAnnotation",
"getAnnotation",
"(",
"IAnnotatable",
"element",
",",
"String",
"qualifiedName",
")",
"{",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"try",
"{",
"final",
"int",
"separator",
"=",
"qualifiedName",
".",
"lastIndexOf",
"(",
"'",
"'"... | Replies the annotation with the given qualified name.
@param element the annoted element.
@param qualifiedName the qualified name of the element.
@return the annotation, or <code>null</code> if the element is not annoted. | [
"Replies",
"the",
"annotation",
"with",
"the",
"given",
"qualified",
"name",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java#L335-L356 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java | Jdt2Ecore.getJvmConstructor | public JvmConstructor getJvmConstructor(IMethod constructor, XtendTypeDeclaration context)
throws JavaModelException {
if (constructor.isConstructor()) {
final JvmType type = this.typeReferences.findDeclaredType(
constructor.getDeclaringType().getFullyQualifiedName(),
context);
if (type instanceof ... | java | public JvmConstructor getJvmConstructor(IMethod constructor, XtendTypeDeclaration context)
throws JavaModelException {
if (constructor.isConstructor()) {
final JvmType type = this.typeReferences.findDeclaredType(
constructor.getDeclaringType().getFullyQualifiedName(),
context);
if (type instanceof ... | [
"public",
"JvmConstructor",
"getJvmConstructor",
"(",
"IMethod",
"constructor",
",",
"XtendTypeDeclaration",
"context",
")",
"throws",
"JavaModelException",
"{",
"if",
"(",
"constructor",
".",
"isConstructor",
"(",
")",
")",
"{",
"final",
"JvmType",
"type",
"=",
"... | Create the JvmConstructor for the given JDT constructor.
@param constructor the JDT constructor.
@param context the context of the constructor.
@return the JvmConstructor
@throws JavaModelException if the Java model is invalid. | [
"Create",
"the",
"JvmConstructor",
"for",
"the",
"given",
"JDT",
"constructor",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java#L365-L387 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java | Jdt2Ecore.createFormalParametersWith | protected IFormalParameterBuilder[] createFormalParametersWith(
ParameterBuilder parameterBuilder,
IMethod operation) throws JavaModelException, IllegalArgumentException {
final boolean isVarargs = Flags.isVarargs(operation.getFlags());
final ILocalVariable[] rawParameters = operation.getParameters();
final... | java | protected IFormalParameterBuilder[] createFormalParametersWith(
ParameterBuilder parameterBuilder,
IMethod operation) throws JavaModelException, IllegalArgumentException {
final boolean isVarargs = Flags.isVarargs(operation.getFlags());
final ILocalVariable[] rawParameters = operation.getParameters();
final... | [
"protected",
"IFormalParameterBuilder",
"[",
"]",
"createFormalParametersWith",
"(",
"ParameterBuilder",
"parameterBuilder",
",",
"IMethod",
"operation",
")",
"throws",
"JavaModelException",
",",
"IllegalArgumentException",
"{",
"final",
"boolean",
"isVarargs",
"=",
"Flags"... | Create the formal parameters for the given operation.
@param parameterBuilder the code builder.
@param operation the operation that describes the formal parameters.
@return the parameters.
@throws JavaModelException if the Java model is invalid.
@throws IllegalArgumentException if the signature is not syntactically co... | [
"Create",
"the",
"formal",
"parameters",
"for",
"the",
"given",
"operation",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java#L459-L487 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java | Jdt2Ecore.createStandardConstructorsWith | public void createStandardConstructorsWith(
ConstructorBuilder codeBuilder,
Collection<IMethod> superClassConstructors,
XtendTypeDeclaration context) throws JavaModelException {
if (superClassConstructors != null) {
for (final IMethod constructor : superClassConstructors) {
if (!isGeneratedOperation(c... | java | public void createStandardConstructorsWith(
ConstructorBuilder codeBuilder,
Collection<IMethod> superClassConstructors,
XtendTypeDeclaration context) throws JavaModelException {
if (superClassConstructors != null) {
for (final IMethod constructor : superClassConstructors) {
if (!isGeneratedOperation(c... | [
"public",
"void",
"createStandardConstructorsWith",
"(",
"ConstructorBuilder",
"codeBuilder",
",",
"Collection",
"<",
"IMethod",
">",
"superClassConstructors",
",",
"XtendTypeDeclaration",
"context",
")",
"throws",
"JavaModelException",
"{",
"if",
"(",
"superClassConstructo... | Add the given constructors to the Ecore container.
@param codeBuilder the code builder to use.
@param superClassConstructors the constructors defined in the super class.
@param context the context of the constructors.
@throws JavaModelException if the Java model is invalid. | [
"Add",
"the",
"given",
"constructors",
"to",
"the",
"Ecore",
"container",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java#L496-L527 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java | Jdt2Ecore.createActionsWith | public void createActionsWith(
ActionBuilder codeBuilder,
Collection<IMethod> methods,
XtendTypeDeclaration context) throws JavaModelException, IllegalArgumentException {
if (methods != null) {
for (final IMethod operation : methods) {
if (!isGeneratedOperation(operation)) {
final ISarlActionBuil... | java | public void createActionsWith(
ActionBuilder codeBuilder,
Collection<IMethod> methods,
XtendTypeDeclaration context) throws JavaModelException, IllegalArgumentException {
if (methods != null) {
for (final IMethod operation : methods) {
if (!isGeneratedOperation(operation)) {
final ISarlActionBuil... | [
"public",
"void",
"createActionsWith",
"(",
"ActionBuilder",
"codeBuilder",
",",
"Collection",
"<",
"IMethod",
">",
"methods",
",",
"XtendTypeDeclaration",
"context",
")",
"throws",
"JavaModelException",
",",
"IllegalArgumentException",
"{",
"if",
"(",
"methods",
"!="... | Create the operations into the SARL feature container.
@param codeBuilder the builder of the script.
@param methods the operations to create.
@param context the context of the actions. If <code>null</code>, the block of the actions are not generated.
@throws JavaModelException if the Java model is invalid.
@throws Ill... | [
"Create",
"the",
"operations",
"into",
"the",
"SARL",
"feature",
"container",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java#L537-L581 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java | Jdt2Ecore.isSubClassOf | public boolean isSubClassOf(TypeFinder typeFinder, String subClass, String superClass) throws JavaModelException {
final SuperTypeIterator typeIterator = new SuperTypeIterator(typeFinder, false, subClass);
while (typeIterator.hasNext()) {
final IType type = typeIterator.next();
if (Objects.equals(type.getFull... | java | public boolean isSubClassOf(TypeFinder typeFinder, String subClass, String superClass) throws JavaModelException {
final SuperTypeIterator typeIterator = new SuperTypeIterator(typeFinder, false, subClass);
while (typeIterator.hasNext()) {
final IType type = typeIterator.next();
if (Objects.equals(type.getFull... | [
"public",
"boolean",
"isSubClassOf",
"(",
"TypeFinder",
"typeFinder",
",",
"String",
"subClass",
",",
"String",
"superClass",
")",
"throws",
"JavaModelException",
"{",
"final",
"SuperTypeIterator",
"typeIterator",
"=",
"new",
"SuperTypeIterator",
"(",
"typeFinder",
",... | Replies if the given type is a subclass of the second type.
<p>The type finder could be obtained with {@link #toTypeFinder(IJavaProject)}.
@param typeFinder the type finder to be used for finding the type definitions.
@param subClass the name of the sub class.
@param superClass the name of the expected super class.
@... | [
"Replies",
"if",
"the",
"given",
"type",
"is",
"a",
"subclass",
"of",
"the",
"second",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java#L594-L603 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/BehaviorUnitComparator.java | BehaviorUnitComparator.compare | public static int compare(XExpression e1, XExpression e2) {
if (e1 == e2) {
return 0;
}
if (e1 == null) {
return Integer.MIN_VALUE;
}
if (e2 == null) {
return Integer.MAX_VALUE;
}
return e1.toString().compareTo(e2.toString());
} | java | public static int compare(XExpression e1, XExpression e2) {
if (e1 == e2) {
return 0;
}
if (e1 == null) {
return Integer.MIN_VALUE;
}
if (e2 == null) {
return Integer.MAX_VALUE;
}
return e1.toString().compareTo(e2.toString());
} | [
"public",
"static",
"int",
"compare",
"(",
"XExpression",
"e1",
",",
"XExpression",
"e2",
")",
"{",
"if",
"(",
"e1",
"==",
"e2",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"e1",
"==",
"null",
")",
"{",
"return",
"Integer",
".",
"MIN_VALUE",
";",... | Compare two Xtext expressions.
@param e1 the first expression to compare.
@param e2 the second expression to compare.
@return A negative value if <code>e1</code> is
lower than <code>e2</code>, a positive value if
<code>e1</code> is greater than <code>e2</code>,
otherwise <code>0</code>. | [
"Compare",
"two",
"Xtext",
"expressions",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/BehaviorUnitComparator.java#L69-L80 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/config/LaunchConfigurationConfigurator.java | LaunchConfigurationConfigurator.setMainJavaClass | protected static void setMainJavaClass(ILaunchConfigurationWorkingCopy wc, String name) {
wc.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
name);
} | java | protected static void setMainJavaClass(ILaunchConfigurationWorkingCopy wc, String name) {
wc.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
name);
} | [
"protected",
"static",
"void",
"setMainJavaClass",
"(",
"ILaunchConfigurationWorkingCopy",
"wc",
",",
"String",
"name",
")",
"{",
"wc",
".",
"setAttribute",
"(",
"IJavaLaunchConfigurationConstants",
".",
"ATTR_MAIN_TYPE_NAME",
",",
"name",
")",
";",
"}"
] | Change the main java class within the given configuration.
@param wc the configuration to change.
@param name the qualified name of the main Java class.
@since 0.7 | [
"Change",
"the",
"main",
"java",
"class",
"within",
"the",
"given",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/config/LaunchConfigurationConfigurator.java#L201-L205 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/config/LaunchConfigurationConfigurator.java | LaunchConfigurationConfigurator.initLaunchConfiguration | protected ILaunchConfigurationWorkingCopy initLaunchConfiguration(String configurationType, String projectName,
String id, boolean resetJavaMainClass) throws CoreException {
final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
final ILaunchConfigurationType configType = launchManager... | java | protected ILaunchConfigurationWorkingCopy initLaunchConfiguration(String configurationType, String projectName,
String id, boolean resetJavaMainClass) throws CoreException {
final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
final ILaunchConfigurationType configType = launchManager... | [
"protected",
"ILaunchConfigurationWorkingCopy",
"initLaunchConfiguration",
"(",
"String",
"configurationType",
",",
"String",
"projectName",
",",
"String",
"id",
",",
"boolean",
"resetJavaMainClass",
")",
"throws",
"CoreException",
"{",
"final",
"ILaunchManager",
"launchMan... | initialize the launch configuration.
@param configurationType the name of the configuration type to create.
@param projectName the name of the project.
@param id the identifier of the launch configuration.
@param resetJavaMainClass indicates if the JAva main class should be reset from the SRE configuration.
@return th... | [
"initialize",
"the",
"launch",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/config/LaunchConfigurationConfigurator.java#L217-L228 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/SARLFileRenameParticipant.java | SARLFileRenameParticipant.trimFileExtension | protected static String trimFileExtension(String fileName) {
if (fileName.lastIndexOf('.') == -1) {
return fileName;
}
return fileName.substring(0, fileName.lastIndexOf('.'));
} | java | protected static String trimFileExtension(String fileName) {
if (fileName.lastIndexOf('.') == -1) {
return fileName;
}
return fileName.substring(0, fileName.lastIndexOf('.'));
} | [
"protected",
"static",
"String",
"trimFileExtension",
"(",
"String",
"fileName",
")",
"{",
"if",
"(",
"fileName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
"==",
"-",
"1",
")",
"{",
"return",
"fileName",
";",
"}",
"return",
"fileName",
".",
"substring",
"(... | Remove the file extension.
@param fileName the file name.
@return the file name without the extension. | [
"Remove",
"the",
"file",
"extension",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/SARLFileRenameParticipant.java#L118-L123 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/gtk/GtkSourceViewerGenerator2.java | GtkSourceViewerGenerator2.generateMetadata | protected void generateMetadata(IXmlStyleAppendable it) {
it.appendTagWithValue("property", //$NON-NLS-1$
Strings.concat(";", getMimeTypes()), //$NON-NLS-1$
"name", "mimetypes"); //$NON-NLS-1$ //$NON-NLS-2$
final StringBuilder buffer = new StringBuilder();
for (final String fileExtension : getLanguage().... | java | protected void generateMetadata(IXmlStyleAppendable it) {
it.appendTagWithValue("property", //$NON-NLS-1$
Strings.concat(";", getMimeTypes()), //$NON-NLS-1$
"name", "mimetypes"); //$NON-NLS-1$ //$NON-NLS-2$
final StringBuilder buffer = new StringBuilder();
for (final String fileExtension : getLanguage().... | [
"protected",
"void",
"generateMetadata",
"(",
"IXmlStyleAppendable",
"it",
")",
"{",
"it",
".",
"appendTagWithValue",
"(",
"\"property\"",
",",
"//$NON-NLS-1$",
"Strings",
".",
"concat",
"(",
"\";\"",
",",
"getMimeTypes",
"(",
")",
")",
",",
"//$NON-NLS-1$",
"\"... | Generate the metadata section.
@param it the appendable | [
"Generate",
"the",
"metadata",
"section",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/gtk/GtkSourceViewerGenerator2.java#L100-L127 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/gtk/GtkSourceViewerGenerator2.java | GtkSourceViewerGenerator2.generateStyles | @SuppressWarnings("static-method")
protected void generateStyles(IXmlStyleAppendable it) {
it.appendTag("style", //$NON-NLS-1$
"id", "comment", //$NON-NLS-1$ //$NON-NLS-2$
"_name", "Comment", //$NON-NLS-1$ //$NON-NLS-2$
"map-to", "def:comment"); //$NON-NLS-1$ //$NON-NLS-2$
it.appendTag("style", //$NON-... | java | @SuppressWarnings("static-method")
protected void generateStyles(IXmlStyleAppendable it) {
it.appendTag("style", //$NON-NLS-1$
"id", "comment", //$NON-NLS-1$ //$NON-NLS-2$
"_name", "Comment", //$NON-NLS-1$ //$NON-NLS-2$
"map-to", "def:comment"); //$NON-NLS-1$ //$NON-NLS-2$
it.appendTag("style", //$NON-... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"void",
"generateStyles",
"(",
"IXmlStyleAppendable",
"it",
")",
"{",
"it",
".",
"appendTag",
"(",
"\"style\"",
",",
"//$NON-NLS-1$",
"\"id\"",
",",
"\"comment\"",
",",
"//$NON-NLS-1$ //$NON-NLS-2$",... | Generate the style section.
@param it the appendable | [
"Generate",
"the",
"style",
"section",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/gtk/GtkSourceViewerGenerator2.java#L133-L175 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/StandardSREPage.java | StandardSREPage.selectSRE | protected void selectSRE() {
final File file;
if (StandardSREPage.this.workingCopy.getJarFile() != null) {
file = StandardSREPage.this.workingCopy.getJarFile().toFile();
} else {
file = null;
}
final FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
dialog.setText(Messages.StandardSREPage_4);... | java | protected void selectSRE() {
final File file;
if (StandardSREPage.this.workingCopy.getJarFile() != null) {
file = StandardSREPage.this.workingCopy.getJarFile().toFile();
} else {
file = null;
}
final FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
dialog.setText(Messages.StandardSREPage_4);... | [
"protected",
"void",
"selectSRE",
"(",
")",
"{",
"final",
"File",
"file",
";",
"if",
"(",
"StandardSREPage",
".",
"this",
".",
"workingCopy",
".",
"getJarFile",
"(",
")",
"!=",
"null",
")",
"{",
"file",
"=",
"StandardSREPage",
".",
"this",
".",
"workingC... | Ask to the user to selected the SRE. | [
"Ask",
"to",
"the",
"user",
"to",
"selected",
"the",
"SRE",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/StandardSREPage.java#L153-L187 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/StandardSREPage.java | StandardSREPage.initializeFields | private void initializeFields() {
final IPath path = this.workingCopy.getJarFile();
String tooltip = null;
String basename = null;
if (path != null) {
tooltip = path.toOSString();
final IPath tmpPath = path.removeTrailingSeparator();
if (tmpPath != null) {
basename = tmpPath.lastSegment();
}
}... | java | private void initializeFields() {
final IPath path = this.workingCopy.getJarFile();
String tooltip = null;
String basename = null;
if (path != null) {
tooltip = path.toOSString();
final IPath tmpPath = path.removeTrailingSeparator();
if (tmpPath != null) {
basename = tmpPath.lastSegment();
}
}... | [
"private",
"void",
"initializeFields",
"(",
")",
"{",
"final",
"IPath",
"path",
"=",
"this",
".",
"workingCopy",
".",
"getJarFile",
"(",
")",
";",
"String",
"tooltip",
"=",
"null",
";",
"String",
"basename",
"=",
"null",
";",
"if",
"(",
"path",
"!=",
"... | Initialize the dialogs fields. | [
"Initialize",
"the",
"dialogs",
"fields",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sreinstall/StandardSREPage.java#L229-L250 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/BundleUtil.java | BundleUtil.getSourceBundlePath | public static IPath getSourceBundlePath(Bundle bundle, IPath bundleLocation) {
IPath sourcesPath = null;
// Not an essential functionality, make it robust
try {
final IPath srcFolderPath = getSourceRootProjectFolderPath(bundle);
if (srcFolderPath == null) {
//common case, jar file.
final IPath bundl... | java | public static IPath getSourceBundlePath(Bundle bundle, IPath bundleLocation) {
IPath sourcesPath = null;
// Not an essential functionality, make it robust
try {
final IPath srcFolderPath = getSourceRootProjectFolderPath(bundle);
if (srcFolderPath == null) {
//common case, jar file.
final IPath bundl... | [
"public",
"static",
"IPath",
"getSourceBundlePath",
"(",
"Bundle",
"bundle",
",",
"IPath",
"bundleLocation",
")",
"{",
"IPath",
"sourcesPath",
"=",
"null",
";",
"// Not an essential functionality, make it robust",
"try",
"{",
"final",
"IPath",
"srcFolderPath",
"=",
"g... | Replies the source location for the given bundle.
<p>The source location is usually the root folder where the source code of the bundle is located.
<p>We can't use P2Utils and we can't use SimpleConfiguratorManipulator because of
API breakage between 3.5 and 4.2.
So we do a bit EDV (Computer data processing) ;-)
@pa... | [
"Replies",
"the",
"source",
"location",
"for",
"the",
"given",
"bundle",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/BundleUtil.java#L120-L144 | train |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/BundleUtil.java | BundleUtil.getBundlePath | public static IPath getBundlePath(Bundle bundle) {
IPath path = getBinFolderPath(bundle);
if (path == null) {
// common jar file case, no bin folder
try {
path = new Path(FileLocator.getBundleFile(bundle).getAbsolutePath());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return... | java | public static IPath getBundlePath(Bundle bundle) {
IPath path = getBinFolderPath(bundle);
if (path == null) {
// common jar file case, no bin folder
try {
path = new Path(FileLocator.getBundleFile(bundle).getAbsolutePath());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return... | [
"public",
"static",
"IPath",
"getBundlePath",
"(",
"Bundle",
"bundle",
")",
"{",
"IPath",
"path",
"=",
"getBinFolderPath",
"(",
"bundle",
")",
";",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"// common jar file case, no bin folder",
"try",
"{",
"path",
"=",
... | Replies the path of the binary files of the given bundle.
@param bundle the bundle for which the path must be retreived.
@return the path to the binaries of the bundle.
@see #getSourceBundlePath(Bundle, IPath) | [
"Replies",
"the",
"path",
"of",
"the",
"binary",
"files",
"of",
"the",
"given",
"bundle",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/BundleUtil.java#L185-L196 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/FormalParameterBuilderImpl.java | FormalParameterBuilderImpl.setReferenceInto | public void setReferenceInto(XFeatureCall container) {
JvmVoid jvmVoid = this.jvmTypesFactory.createJvmVoid();
if (jvmVoid instanceof InternalEObject) {
final InternalEObject jvmVoidProxy = (InternalEObject) jvmVoid;
final EObject param = getSarlFormalParameter();
final Resource resource = param.eResourc... | java | public void setReferenceInto(XFeatureCall container) {
JvmVoid jvmVoid = this.jvmTypesFactory.createJvmVoid();
if (jvmVoid instanceof InternalEObject) {
final InternalEObject jvmVoidProxy = (InternalEObject) jvmVoid;
final EObject param = getSarlFormalParameter();
final Resource resource = param.eResourc... | [
"public",
"void",
"setReferenceInto",
"(",
"XFeatureCall",
"container",
")",
"{",
"JvmVoid",
"jvmVoid",
"=",
"this",
".",
"jvmTypesFactory",
".",
"createJvmVoid",
"(",
")",
";",
"if",
"(",
"jvmVoid",
"instanceof",
"InternalEObject",
")",
"{",
"final",
"InternalE... | Replies the JvmIdentifiable that corresponds to the formal parameter.
@param container the feature call that is supposed to contains the replied identifiable element. | [
"Replies",
"the",
"JvmIdentifiable",
"that",
"corresponds",
"to",
"the",
"formal",
"parameter",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/FormalParameterBuilderImpl.java#L93-L106 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/FormalParameterBuilderImpl.java | FormalParameterBuilderImpl.setParameterType | public void setParameterType(String type) {
String typeName;
if (Strings.isEmpty(type)) {
typeName = Object.class.getName();
} else {
typeName = type;
}
this.parameter.setParameterType(newTypeRef(this.context, typeName));
} | java | public void setParameterType(String type) {
String typeName;
if (Strings.isEmpty(type)) {
typeName = Object.class.getName();
} else {
typeName = type;
}
this.parameter.setParameterType(newTypeRef(this.context, typeName));
} | [
"public",
"void",
"setParameterType",
"(",
"String",
"type",
")",
"{",
"String",
"typeName",
";",
"if",
"(",
"Strings",
".",
"isEmpty",
"(",
"type",
")",
")",
"{",
"typeName",
"=",
"Object",
".",
"class",
".",
"getName",
"(",
")",
";",
"}",
"else",
"... | Change the type.
@param type the formal parameter type. | [
"Change",
"the",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/FormalParameterBuilderImpl.java#L119-L127 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/FormalParameterBuilderImpl.java | FormalParameterBuilderImpl.getDefaultValue | @Pure
public IExpressionBuilder getDefaultValue() {
if (this.defaultValue == null) {
this.defaultValue = this.expressionProvider.get();
this.defaultValue.eInit(this.parameter, new Procedures.Procedure1<XExpression>() {
public void apply(XExpression it) {
getSarlFormalParameter().setDefaultValue(it);... | java | @Pure
public IExpressionBuilder getDefaultValue() {
if (this.defaultValue == null) {
this.defaultValue = this.expressionProvider.get();
this.defaultValue.eInit(this.parameter, new Procedures.Procedure1<XExpression>() {
public void apply(XExpression it) {
getSarlFormalParameter().setDefaultValue(it);... | [
"@",
"Pure",
"public",
"IExpressionBuilder",
"getDefaultValue",
"(",
")",
"{",
"if",
"(",
"this",
".",
"defaultValue",
"==",
"null",
")",
"{",
"this",
".",
"defaultValue",
"=",
"this",
".",
"expressionProvider",
".",
"get",
"(",
")",
";",
"this",
".",
"d... | Replies the default value of the parameter.
@return the default value builder. | [
"Replies",
"the",
"default",
"value",
"of",
"the",
"parameter",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/FormalParameterBuilderImpl.java#L140-L151 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLAnnotationUtil.java | SARLAnnotationUtil.findAnnotation | @SuppressWarnings("static-method")
public JvmAnnotationReference findAnnotation(JvmAnnotationTarget annotationTarget, String lookupType) {
// avoid creating an empty list for all given targets but check for #eIsSet first
if (annotationTarget.eIsSet(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS)) {
fo... | java | @SuppressWarnings("static-method")
public JvmAnnotationReference findAnnotation(JvmAnnotationTarget annotationTarget, String lookupType) {
// avoid creating an empty list for all given targets but check for #eIsSet first
if (annotationTarget.eIsSet(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS)) {
fo... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"public",
"JvmAnnotationReference",
"findAnnotation",
"(",
"JvmAnnotationTarget",
"annotationTarget",
",",
"String",
"lookupType",
")",
"{",
"// avoid creating an empty list for all given targets but check for #eIsSet first",
... | Find an annotation.
@param annotationTarget the annotation target.
@param lookupType the name of the type to look for.
@return the annotation or {@code null}.
@see AnnotationLookup#findAnnotation(JvmAnnotationTarget, Class) | [
"Find",
"an",
"annotation",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLAnnotationUtil.java#L251-L263 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/DynamicValidationContext.java | DynamicValidationContext.getTempResourceRoots | public List<String> getTempResourceRoots() {
final List<String> tmp = this.tmpResources == null ? Collections.emptyList() : this.tmpResources;
this.tmpResources = null;
return tmp;
} | java | public List<String> getTempResourceRoots() {
final List<String> tmp = this.tmpResources == null ? Collections.emptyList() : this.tmpResources;
this.tmpResources = null;
return tmp;
} | [
"public",
"List",
"<",
"String",
">",
"getTempResourceRoots",
"(",
")",
"{",
"final",
"List",
"<",
"String",
">",
"tmp",
"=",
"this",
".",
"tmpResources",
"==",
"null",
"?",
"Collections",
".",
"emptyList",
"(",
")",
":",
"this",
".",
"tmpResources",
";"... | Replies the temprary root folders for resources.
<p>The temporary resources are forgiven as soon as this function is called.
@return the root folders. | [
"Replies",
"the",
"temprary",
"root",
"folders",
"for",
"resources",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/DynamicValidationContext.java#L133-L137 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/ScriptBuilderFragment.java | ScriptBuilderFragment.generateTopElement | @SuppressWarnings("checkstyle:all")
protected StringConcatenationClient generateTopElement(CodeElementExtractor.ElementDescription description,
boolean forInterface, boolean forAppender) {
final String topElementName = Strings.toFirstUpper(description.getName());
final TypeReference builderType = getCodeElement... | java | @SuppressWarnings("checkstyle:all")
protected StringConcatenationClient generateTopElement(CodeElementExtractor.ElementDescription description,
boolean forInterface, boolean forAppender) {
final String topElementName = Strings.toFirstUpper(description.getName());
final TypeReference builderType = getCodeElement... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:all\"",
")",
"protected",
"StringConcatenationClient",
"generateTopElement",
"(",
"CodeElementExtractor",
".",
"ElementDescription",
"description",
",",
"boolean",
"forInterface",
",",
"boolean",
"forAppender",
")",
"{",
"final",
... | Extract a top element from the grammar.
@param description the description of the top element.
@param forInterface indicates if the generated code is for interfaces.
@param forAppender indicates if the generated code is for appenders.
@return the top element. | [
"Extract",
"a",
"top",
"element",
"from",
"the",
"grammar",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/ScriptBuilderFragment.java#L454-L521 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/ScriptBuilderFragment.java | ScriptBuilderFragment.generateTopElements | protected List<StringConcatenationClient> generateTopElements(boolean forInterface, boolean forAppender) {
final List<StringConcatenationClient> topElements = new ArrayList<>();
for (final CodeElementExtractor.ElementDescription description : getCodeElementExtractor().getTopElements(
getGrammar(), getCodeBuilde... | java | protected List<StringConcatenationClient> generateTopElements(boolean forInterface, boolean forAppender) {
final List<StringConcatenationClient> topElements = new ArrayList<>();
for (final CodeElementExtractor.ElementDescription description : getCodeElementExtractor().getTopElements(
getGrammar(), getCodeBuilde... | [
"protected",
"List",
"<",
"StringConcatenationClient",
">",
"generateTopElements",
"(",
"boolean",
"forInterface",
",",
"boolean",
"forAppender",
")",
"{",
"final",
"List",
"<",
"StringConcatenationClient",
">",
"topElements",
"=",
"new",
"ArrayList",
"<>",
"(",
")"... | Extract top elements from the grammar.
@param forInterface indicates if the generated code is for interfaces.
@param forAppender indicates if the generated code is for appender.
@return the top elements. | [
"Extract",
"top",
"elements",
"from",
"the",
"grammar",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/ScriptBuilderFragment.java#L529-L536 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/ScriptBuilderFragment.java | ScriptBuilderFragment.generateIScriptBuilder | protected void generateIScriptBuilder() {
final List<StringConcatenationClient> topElements = generateTopElements(true, false);
final TypeReference builder = getScriptBuilderInterface();
final StringConcatenationClient content = new StringConcatenationClient() {
@Override
protected void appendTo(TargetStrin... | java | protected void generateIScriptBuilder() {
final List<StringConcatenationClient> topElements = generateTopElements(true, false);
final TypeReference builder = getScriptBuilderInterface();
final StringConcatenationClient content = new StringConcatenationClient() {
@Override
protected void appendTo(TargetStrin... | [
"protected",
"void",
"generateIScriptBuilder",
"(",
")",
"{",
"final",
"List",
"<",
"StringConcatenationClient",
">",
"topElements",
"=",
"generateTopElements",
"(",
"true",
",",
"false",
")",
";",
"final",
"TypeReference",
"builder",
"=",
"getScriptBuilderInterface",... | Generate the script builder interface. | [
"Generate",
"the",
"script",
"builder",
"interface",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/ScriptBuilderFragment.java#L540-L579 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/ScriptBuilderFragment.java | ScriptBuilderFragment.generateScriptSourceAppender | protected void generateScriptSourceAppender() {
final List<StringConcatenationClient> topElements = generateTopElements(false, true);
final TypeReference appender = getCodeElementExtractor().getElementAppenderImpl("Script"); //$NON-NLS-1$
final StringConcatenationClient content = new StringConcatenationClient() {... | java | protected void generateScriptSourceAppender() {
final List<StringConcatenationClient> topElements = generateTopElements(false, true);
final TypeReference appender = getCodeElementExtractor().getElementAppenderImpl("Script"); //$NON-NLS-1$
final StringConcatenationClient content = new StringConcatenationClient() {... | [
"protected",
"void",
"generateScriptSourceAppender",
"(",
")",
"{",
"final",
"List",
"<",
"StringConcatenationClient",
">",
"topElements",
"=",
"generateTopElements",
"(",
"false",
",",
"true",
")",
";",
"final",
"TypeReference",
"appender",
"=",
"getCodeElementExtrac... | Generate the script appender. | [
"Generate",
"the",
"script",
"appender",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/ScriptBuilderFragment.java#L583-L618 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/ScriptBuilderFragment.java | ScriptBuilderFragment.generateScriptBuilderImpl | protected void generateScriptBuilderImpl() {
final List<StringConcatenationClient> topElements = generateTopElements(false, false);
final TypeReference script = getScriptBuilderImpl();
final TypeReference scriptInterface = getScriptBuilderInterface();
final StringConcatenationClient content = new StringConcaten... | java | protected void generateScriptBuilderImpl() {
final List<StringConcatenationClient> topElements = generateTopElements(false, false);
final TypeReference script = getScriptBuilderImpl();
final TypeReference scriptInterface = getScriptBuilderInterface();
final StringConcatenationClient content = new StringConcaten... | [
"protected",
"void",
"generateScriptBuilderImpl",
"(",
")",
"{",
"final",
"List",
"<",
"StringConcatenationClient",
">",
"topElements",
"=",
"generateTopElements",
"(",
"false",
",",
"false",
")",
";",
"final",
"TypeReference",
"script",
"=",
"getScriptBuilderImpl",
... | Generate the script builder default implementation. | [
"Generate",
"the",
"script",
"builder",
"default",
"implementation",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/ScriptBuilderFragment.java#L622-L651 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/ClassFinder.java | ClassFinder.findClass | public static Class<?> findClass(String classname) {
Class<?> type = null;
final ClassLoader loader = ClassLoaderFinder.findClassLoader();
if (loader != null) {
try {
type = loader.loadClass(classname);
} catch (ClassNotFoundException e) {
//
}
}
if (type == null) {
try {
type = ClassF... | java | public static Class<?> findClass(String classname) {
Class<?> type = null;
final ClassLoader loader = ClassLoaderFinder.findClassLoader();
if (loader != null) {
try {
type = loader.loadClass(classname);
} catch (ClassNotFoundException e) {
//
}
}
if (type == null) {
try {
type = ClassF... | [
"public",
"static",
"Class",
"<",
"?",
">",
"findClass",
"(",
"String",
"classname",
")",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"null",
";",
"final",
"ClassLoader",
"loader",
"=",
"ClassLoaderFinder",
".",
"findClassLoader",
"(",
")",
";",
"if",
"(",... | Find the class with a search policy.
@param classname the name of the class.
@return the class. | [
"Find",
"the",
"class",
"with",
"a",
"search",
"policy",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/ClassFinder.java#L49-L77 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.generatePreamble | protected void generatePreamble(IStyleAppendable it) {
clearHilights();
final String nm = getLanguageSimpleName().toLowerCase();
final String cmd = Strings.toFirstUpper(getLanguageSimpleName().toLowerCase()) + "HiLink"; //$NON-NLS-1$
appendComment(it, "Quit when a syntax file was already loaded"); //$NON-NLS-1$... | java | protected void generatePreamble(IStyleAppendable it) {
clearHilights();
final String nm = getLanguageSimpleName().toLowerCase();
final String cmd = Strings.toFirstUpper(getLanguageSimpleName().toLowerCase()) + "HiLink"; //$NON-NLS-1$
appendComment(it, "Quit when a syntax file was already loaded"); //$NON-NLS-1$... | [
"protected",
"void",
"generatePreamble",
"(",
"IStyleAppendable",
"it",
")",
"{",
"clearHilights",
"(",
")",
";",
"final",
"String",
"nm",
"=",
"getLanguageSimpleName",
"(",
")",
".",
"toLowerCase",
"(",
")",
";",
"final",
"String",
"cmd",
"=",
"Strings",
".... | Generate the preamble of the Vim style.
@param it the receiver of the generated elements. | [
"Generate",
"the",
"preamble",
"of",
"the",
"Vim",
"style",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L129-L157 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.generatePostamble | protected void generatePostamble(IStyleAppendable it) {
appendComment(it, "catch errors caused by wrong parenthesis"); //$NON-NLS-1$
appendCmd(it, "syn region sarlParenT transparent matchgroup=sarlParen start=\"(\" end=\")\" contains=@sarlTop,sarlParenT1"); //$NON-NLS-1$
appendCmd(it, "syn region sarlParenT1 tra... | java | protected void generatePostamble(IStyleAppendable it) {
appendComment(it, "catch errors caused by wrong parenthesis"); //$NON-NLS-1$
appendCmd(it, "syn region sarlParenT transparent matchgroup=sarlParen start=\"(\" end=\")\" contains=@sarlTop,sarlParenT1"); //$NON-NLS-1$
appendCmd(it, "syn region sarlParenT1 tra... | [
"protected",
"void",
"generatePostamble",
"(",
"IStyleAppendable",
"it",
")",
"{",
"appendComment",
"(",
"it",
",",
"\"catch errors caused by wrong parenthesis\"",
")",
";",
"//$NON-NLS-1$",
"appendCmd",
"(",
"it",
",",
"\"syn region sarlParenT transparent matchgroup=sarlPare... | Generate the postamble of the Vim style.
@param it the receiver of the generated elements. | [
"Generate",
"the",
"postamble",
"of",
"the",
"Vim",
"style",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L163-L206 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.generatePrimitiveTypes | protected void generatePrimitiveTypes(IStyleAppendable it, Iterable<String> types) {
final Iterator<String> iterator = types.iterator();
if (iterator.hasNext()) {
appendComment(it, "primitive types."); //$NON-NLS-1$
appendMatch(it, "sarlArrayDeclaration", "\\(\\s*\\[\\s*\\]\\)*", true); //$NON-NLS-1$//$NON-NL... | java | protected void generatePrimitiveTypes(IStyleAppendable it, Iterable<String> types) {
final Iterator<String> iterator = types.iterator();
if (iterator.hasNext()) {
appendComment(it, "primitive types."); //$NON-NLS-1$
appendMatch(it, "sarlArrayDeclaration", "\\(\\s*\\[\\s*\\]\\)*", true); //$NON-NLS-1$//$NON-NL... | [
"protected",
"void",
"generatePrimitiveTypes",
"(",
"IStyleAppendable",
"it",
",",
"Iterable",
"<",
"String",
">",
"types",
")",
"{",
"final",
"Iterator",
"<",
"String",
">",
"iterator",
"=",
"types",
".",
"iterator",
"(",
")",
";",
"if",
"(",
"iterator",
... | Generate the keywords for the primitive types.
@param it the receiver of the generated elements.
@param types the primitive types. | [
"Generate",
"the",
"keywords",
"for",
"the",
"primitive",
"types",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L222-L238 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.generateComments | protected void generateComments(IStyleAppendable it) {
appendComment(it, "comments"); //$NON-NLS-1$
appendRegion(it, "sarlComment", "/\\*", "\\*/", "@Spell"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
appendCmd(it, "syn match sarlCommentStar contained \"^\\s*\\*[^/]\"me=e-1"); //$NON-NLS-1$
append... | java | protected void generateComments(IStyleAppendable it) {
appendComment(it, "comments"); //$NON-NLS-1$
appendRegion(it, "sarlComment", "/\\*", "\\*/", "@Spell"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
appendCmd(it, "syn match sarlCommentStar contained \"^\\s*\\*[^/]\"me=e-1"); //$NON-NLS-1$
append... | [
"protected",
"void",
"generateComments",
"(",
"IStyleAppendable",
"it",
")",
"{",
"appendComment",
"(",
"it",
",",
"\"comments\"",
")",
";",
"//$NON-NLS-1$",
"appendRegion",
"(",
"it",
",",
"\"sarlComment\"",
",",
"\"/\\\\*\"",
",",
"\"\\\\*/\"",
",",
"\"@Spell\""... | Generate the Vim comments.
@param it the receiver of the generated elements. | [
"Generate",
"the",
"Vim",
"comments",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L244-L258 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.generateStrings | protected void generateStrings(IStyleAppendable it) {
appendComment(it, "Strings constants"); //$NON-NLS-1$
appendMatch(it, "sarlSpecialError", "\\\\.", true); //$NON-NLS-1$ //$NON-NLS-2$
appendMatch(it, "sarlSpecialCharError", "[^']", true); //$NON-NLS-1$ //$NON-NLS-2$
appendMatch(it, "sarlSpecialChar", "\\\\\... | java | protected void generateStrings(IStyleAppendable it) {
appendComment(it, "Strings constants"); //$NON-NLS-1$
appendMatch(it, "sarlSpecialError", "\\\\.", true); //$NON-NLS-1$ //$NON-NLS-2$
appendMatch(it, "sarlSpecialCharError", "[^']", true); //$NON-NLS-1$ //$NON-NLS-2$
appendMatch(it, "sarlSpecialChar", "\\\\\... | [
"protected",
"void",
"generateStrings",
"(",
"IStyleAppendable",
"it",
")",
"{",
"appendComment",
"(",
"it",
",",
"\"Strings constants\"",
")",
";",
"//$NON-NLS-1$",
"appendMatch",
"(",
"it",
",",
"\"sarlSpecialError\"",
",",
"\"\\\\\\\\.\"",
",",
"true",
")",
";"... | Generate the Vim strings of characters.
@param it the receiver of the generated elements. | [
"Generate",
"the",
"Vim",
"strings",
"of",
"characters",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L264-L276 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.generateNumericConstants | protected void generateNumericConstants(IStyleAppendable it) {
appendComment(it, "numerical constants"); //$NON-NLS-1$
appendMatch(it, "sarlNumber", "[0-9][0-9]*\\.[0-9]\\+([eE][0-9]\\+)\\?[fFdD]\\?"); //$NON-NLS-1$ //$NON-NLS-2$
appendMatch(it, "sarlNumber", "0[xX][0-9a-fA-F]\\+"); //$NON-NLS-1$ //$NON-NLS-2$
... | java | protected void generateNumericConstants(IStyleAppendable it) {
appendComment(it, "numerical constants"); //$NON-NLS-1$
appendMatch(it, "sarlNumber", "[0-9][0-9]*\\.[0-9]\\+([eE][0-9]\\+)\\?[fFdD]\\?"); //$NON-NLS-1$ //$NON-NLS-2$
appendMatch(it, "sarlNumber", "0[xX][0-9a-fA-F]\\+"); //$NON-NLS-1$ //$NON-NLS-2$
... | [
"protected",
"void",
"generateNumericConstants",
"(",
"IStyleAppendable",
"it",
")",
"{",
"appendComment",
"(",
"it",
",",
"\"numerical constants\"",
")",
";",
"//$NON-NLS-1$",
"appendMatch",
"(",
"it",
",",
"\"sarlNumber\"",
",",
"\"[0-9][0-9]*\\\\.[0-9]\\\\+([eE][0-9]\\... | Generate the Vim numeric constants.
@param it the receiver of the generated elements. | [
"Generate",
"the",
"Vim",
"numeric",
"constants",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L282-L290 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.generateAnnotations | protected void generateAnnotations(IStyleAppendable it) {
appendComment(it, "annnotation"); //$NON-NLS-1$
appendMatch(it, "sarlAnnotation", "@[_a-zA-Z][_0-9a-zA-Z]*\\([.$][_a-zA-Z][_0-9a-zA-Z]*\\)*"); //$NON-NLS-1$ //$NON-NLS-2$
appendCluster(it, "sarlAnnotation"); //$NON-NLS-1$
hilight("sarlAnnotation", VimSyn... | java | protected void generateAnnotations(IStyleAppendable it) {
appendComment(it, "annnotation"); //$NON-NLS-1$
appendMatch(it, "sarlAnnotation", "@[_a-zA-Z][_0-9a-zA-Z]*\\([.$][_a-zA-Z][_0-9a-zA-Z]*\\)*"); //$NON-NLS-1$ //$NON-NLS-2$
appendCluster(it, "sarlAnnotation"); //$NON-NLS-1$
hilight("sarlAnnotation", VimSyn... | [
"protected",
"void",
"generateAnnotations",
"(",
"IStyleAppendable",
"it",
")",
"{",
"appendComment",
"(",
"it",
",",
"\"annnotation\"",
")",
";",
"//$NON-NLS-1$",
"appendMatch",
"(",
"it",
",",
"\"sarlAnnotation\"",
",",
"\"@[_a-zA-Z][_0-9a-zA-Z]*\\\\([.$][_a-zA-Z][_0-9a... | Generate the annotations.
@param it the receiver of the generated elements. | [
"Generate",
"the",
"annotations",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L296-L302 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.generateKeywords | protected void generateKeywords(IStyleAppendable it, String family, VimSyntaxGroup color, Iterable<String> keywords) {
appendComment(it, "keywords for the '" + family + "' family."); //$NON-NLS-1$ //$NON-NLS-2$
final Iterator<String> iterator = keywords.iterator();
if (iterator.hasNext()) {
it.append("syn keyw... | java | protected void generateKeywords(IStyleAppendable it, String family, VimSyntaxGroup color, Iterable<String> keywords) {
appendComment(it, "keywords for the '" + family + "' family."); //$NON-NLS-1$ //$NON-NLS-2$
final Iterator<String> iterator = keywords.iterator();
if (iterator.hasNext()) {
it.append("syn keyw... | [
"protected",
"void",
"generateKeywords",
"(",
"IStyleAppendable",
"it",
",",
"String",
"family",
",",
"VimSyntaxGroup",
"color",
",",
"Iterable",
"<",
"String",
">",
"keywords",
")",
"{",
"appendComment",
"(",
"it",
",",
"\"keywords for the '\"",
"+",
"family",
... | Generate the Vim keywords.
@param it the receiver of the generated elements.
@param family the name of the keyword family.
@param color the color to be associated to the elements.
@param keywords the keywords. | [
"Generate",
"the",
"Vim",
"keywords",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L311-L326 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.appendCmd | protected IStyleAppendable appendCmd(IStyleAppendable it, String text) {
return appendCmd(it, true, text);
} | java | protected IStyleAppendable appendCmd(IStyleAppendable it, String text) {
return appendCmd(it, true, text);
} | [
"protected",
"IStyleAppendable",
"appendCmd",
"(",
"IStyleAppendable",
"it",
",",
"String",
"text",
")",
"{",
"return",
"appendCmd",
"(",
"it",
",",
"true",
",",
"text",
")",
";",
"}"
] | Append a Vim command.
@param it the receiver of the generated elements.
@param text the text of the command.
@return {@code it}. | [
"Append",
"a",
"Vim",
"command",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L539-L541 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.generateFileTypeDetectionScript | protected void generateFileTypeDetectionScript(String basename) {
final CharSequence scriptContent = getFileTypeDetectionScript();
if (scriptContent != null) {
final String textualContent = scriptContent.toString();
if (!Strings.isEmpty(textualContent)) {
final byte[] bytes = textualContent.getBytes();
... | java | protected void generateFileTypeDetectionScript(String basename) {
final CharSequence scriptContent = getFileTypeDetectionScript();
if (scriptContent != null) {
final String textualContent = scriptContent.toString();
if (!Strings.isEmpty(textualContent)) {
final byte[] bytes = textualContent.getBytes();
... | [
"protected",
"void",
"generateFileTypeDetectionScript",
"(",
"String",
"basename",
")",
"{",
"final",
"CharSequence",
"scriptContent",
"=",
"getFileTypeDetectionScript",
"(",
")",
";",
"if",
"(",
"scriptContent",
"!=",
"null",
")",
"{",
"final",
"String",
"textualCo... | Generate the script for detecting the SARL files.
@param basename the name of the file to create.
@see #getFileTypeDetectionScript() | [
"Generate",
"the",
"script",
"for",
"detecting",
"the",
"SARL",
"files",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L583-L601 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.getFileTypeDetectionScript | protected CharSequence getFileTypeDetectionScript() {
return concat(
"\" Vim filetype-detection file", //$NON-NLS-1$
"\" Language: " + getLanguageSimpleName(), //$NON-NLS-1$
"\" Version: " + getLanguageVersion(), //$NON-NLS-1$
"", //$NON-NLS-1$
"au BufRead,BufNewFile *." + getLanguage().getFileExt... | java | protected CharSequence getFileTypeDetectionScript() {
return concat(
"\" Vim filetype-detection file", //$NON-NLS-1$
"\" Language: " + getLanguageSimpleName(), //$NON-NLS-1$
"\" Version: " + getLanguageVersion(), //$NON-NLS-1$
"", //$NON-NLS-1$
"au BufRead,BufNewFile *." + getLanguage().getFileExt... | [
"protected",
"CharSequence",
"getFileTypeDetectionScript",
"(",
")",
"{",
"return",
"concat",
"(",
"\"\\\" Vim filetype-detection file\"",
",",
"//$NON-NLS-1$",
"\"\\\" Language: \"",
"+",
"getLanguageSimpleName",
"(",
")",
",",
"//$NON-NLS-1$",
"\"\\\" Version: \"",
"+",
"... | Replies the script for detecting the SARL files.
@return the content of the "ftdetect" script. | [
"Replies",
"the",
"script",
"for",
"detecting",
"the",
"SARL",
"files",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L607-L615 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLBuilderConfigurationBlock.java | SARLBuilderConfigurationBlock.getOutputConfigurations | @Override
protected Set<OutputConfiguration> getOutputConfigurations(IProject project) {
final Set<OutputConfiguration> original = this.configurationProvider.getOutputConfigurations(getProject());
return Sets.filter(original, it -> !ExtraLanguageOutputConfigurations.isExtraLanguageOutputConfiguration(it.getName())... | java | @Override
protected Set<OutputConfiguration> getOutputConfigurations(IProject project) {
final Set<OutputConfiguration> original = this.configurationProvider.getOutputConfigurations(getProject());
return Sets.filter(original, it -> !ExtraLanguageOutputConfigurations.isExtraLanguageOutputConfiguration(it.getName())... | [
"@",
"Override",
"protected",
"Set",
"<",
"OutputConfiguration",
">",
"getOutputConfigurations",
"(",
"IProject",
"project",
")",
"{",
"final",
"Set",
"<",
"OutputConfiguration",
">",
"original",
"=",
"this",
".",
"configurationProvider",
".",
"getOutputConfigurations... | Replies the output configurations for the given project.
<p>This function filters the output configurations in order to never reply one
associated to a extra language output.
@param project the project.
@return the output configurations associated to the given project. | [
"Replies",
"the",
"output",
"configurations",
"for",
"the",
"given",
"project",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLBuilderConfigurationBlock.java#L118-L122 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/AbstractMarkerLanguageParser.java | AbstractMarkerLanguageParser.parseRange | public static IntegerRange parseRange(String stringRange, int minValue) {
final String sepPattern = "[,;\\-:]"; //$NON-NLS-1$
try {
final Matcher matcher = Pattern.compile("^\\s*" //$NON-NLS-1$
+ "(?:(?<left>[0-9]+)\\s*(?:(?<sep1>" + sepPattern + ")\\s*(?<right1>[0-9]+)?)?)" //$NON-NLS-1$ //$NON-NLS-2$
... | java | public static IntegerRange parseRange(String stringRange, int minValue) {
final String sepPattern = "[,;\\-:]"; //$NON-NLS-1$
try {
final Matcher matcher = Pattern.compile("^\\s*" //$NON-NLS-1$
+ "(?:(?<left>[0-9]+)\\s*(?:(?<sep1>" + sepPattern + ")\\s*(?<right1>[0-9]+)?)?)" //$NON-NLS-1$ //$NON-NLS-2$
... | [
"public",
"static",
"IntegerRange",
"parseRange",
"(",
"String",
"stringRange",
",",
"int",
"minValue",
")",
"{",
"final",
"String",
"sepPattern",
"=",
"\"[,;\\\\-:]\"",
";",
"//$NON-NLS-1$",
"try",
"{",
"final",
"Matcher",
"matcher",
"=",
"Pattern",
".",
"compi... | Parse a range of integers.
<p>The supported formats are:<ul>
<li>{@code n} for exactly {@code n},</li>
<li>{@code n-m} for {@code n} to {@code m},</li>
<li>{@code n-} for {@code n} to infinity,</li>
<li>{@code -m} for 1 to {@code n}.</li>
</ul>
@param stringRange the string representation to parse.
@param minValue th... | [
"Parse",
"a",
"range",
"of",
"integers",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/AbstractMarkerLanguageParser.java#L85-L120 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/AbstractMarkerLanguageParser.java | AbstractMarkerLanguageParser.isHtmlFileExtension | public static boolean isHtmlFileExtension(String extension) {
for (final String ext : HTML_FILE_EXTENSIONS) {
if (Strings.equal(ext, extension)) {
return true;
}
}
return false;
} | java | public static boolean isHtmlFileExtension(String extension) {
for (final String ext : HTML_FILE_EXTENSIONS) {
if (Strings.equal(ext, extension)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isHtmlFileExtension",
"(",
"String",
"extension",
")",
"{",
"for",
"(",
"final",
"String",
"ext",
":",
"HTML_FILE_EXTENSIONS",
")",
"{",
"if",
"(",
"Strings",
".",
"equal",
"(",
"ext",
",",
"extension",
")",
")",
"{",
"retur... | Replies if the given extension is for HTML file.
@param extension the extension to test.
@return {@code true} if the extension is for a HTML file. | [
"Replies",
"if",
"the",
"given",
"extension",
"is",
"for",
"HTML",
"file",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/AbstractMarkerLanguageParser.java#L143-L150 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/AbstractMarkerLanguageParser.java | AbstractMarkerLanguageParser.setDocumentParser | @Inject
public void setDocumentParser(SarlDocumentationParser parser) {
assert parser != null;
this.parser = parser;
this.parser.reset();
} | java | @Inject
public void setDocumentParser(SarlDocumentationParser parser) {
assert parser != null;
this.parser = parser;
this.parser.reset();
} | [
"@",
"Inject",
"public",
"void",
"setDocumentParser",
"(",
"SarlDocumentationParser",
"parser",
")",
"{",
"assert",
"parser",
"!=",
"null",
";",
"this",
".",
"parser",
"=",
"parser",
";",
"this",
".",
"parser",
".",
"reset",
"(",
")",
";",
"}"
] | Change the document parser.
@param parser the documentation parser. | [
"Change",
"the",
"document",
"parser",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/AbstractMarkerLanguageParser.java#L156-L161 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/AbstractMarkerLanguageParser.java | AbstractMarkerLanguageParser.getStandardValidationComponents | public Iterable<ValidationComponent> getStandardValidationComponents(File inputFile) {
final ValidationHandler handler = new ValidationHandler();
getDocumentParser().extractValidationComponents(inputFile, handler);
return handler.getComponents();
} | java | public Iterable<ValidationComponent> getStandardValidationComponents(File inputFile) {
final ValidationHandler handler = new ValidationHandler();
getDocumentParser().extractValidationComponents(inputFile, handler);
return handler.getComponents();
} | [
"public",
"Iterable",
"<",
"ValidationComponent",
">",
"getStandardValidationComponents",
"(",
"File",
"inputFile",
")",
"{",
"final",
"ValidationHandler",
"handler",
"=",
"new",
"ValidationHandler",
"(",
")",
";",
"getDocumentParser",
"(",
")",
".",
"extractValidatio... | Extract the validation components from the given file.
@param inputFile the input file.
@return the validation components. | [
"Extract",
"the",
"validation",
"components",
"from",
"the",
"given",
"file",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/AbstractMarkerLanguageParser.java#L268-L272 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/AbstractMarkerLanguageParser.java | AbstractMarkerLanguageParser.getMarkerSpecificValidationComponents | public final List<DynamicValidationComponent> getMarkerSpecificValidationComponents(File inputFile,
File rootFolder,
DynamicValidationContext context) {
return getSpecificValidationComponents(
transform(inputFile, false),
inputFile,
rootFolder,
context);
} | java | public final List<DynamicValidationComponent> getMarkerSpecificValidationComponents(File inputFile,
File rootFolder,
DynamicValidationContext context) {
return getSpecificValidationComponents(
transform(inputFile, false),
inputFile,
rootFolder,
context);
} | [
"public",
"final",
"List",
"<",
"DynamicValidationComponent",
">",
"getMarkerSpecificValidationComponents",
"(",
"File",
"inputFile",
",",
"File",
"rootFolder",
",",
"DynamicValidationContext",
"context",
")",
"{",
"return",
"getSpecificValidationComponents",
"(",
"transfor... | Extract the validation components that are specific to the marker language.
@param inputFile the input file.
@param rootFolder the root folder in which the input file is located.
@param context the generation context.
@return the validation components. | [
"Extract",
"the",
"validation",
"components",
"that",
"are",
"specific",
"to",
"the",
"marker",
"language",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/AbstractMarkerLanguageParser.java#L293-L301 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.eclipse/src/io/janusproject/eclipse/buildpath/JanusClasspathContainer.java | JanusClasspathContainer.getJanusPlatformClasspath | public static IBundleDependencies getJanusPlatformClasspath() {
final Bundle bundle = Platform.getBundle(JanusEclipsePlugin.JANUS_KERNEL_PLUGIN_ID);
return BundleUtil.resolveBundleDependencies(bundle,
new JanusBundleJavadocURLMappings(),
JANUS_ROOT_BUNDLE_NAMES);
} | java | public static IBundleDependencies getJanusPlatformClasspath() {
final Bundle bundle = Platform.getBundle(JanusEclipsePlugin.JANUS_KERNEL_PLUGIN_ID);
return BundleUtil.resolveBundleDependencies(bundle,
new JanusBundleJavadocURLMappings(),
JANUS_ROOT_BUNDLE_NAMES);
} | [
"public",
"static",
"IBundleDependencies",
"getJanusPlatformClasspath",
"(",
")",
"{",
"final",
"Bundle",
"bundle",
"=",
"Platform",
".",
"getBundle",
"(",
"JanusEclipsePlugin",
".",
"JANUS_KERNEL_PLUGIN_ID",
")",
";",
"return",
"BundleUtil",
".",
"resolveBundleDependen... | Replies the standard classpath for running the Janus platform.
@return the classpath. | [
"Replies",
"the",
"standard",
"classpath",
"for",
"running",
"the",
"Janus",
"platform",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.eclipse/src/io/janusproject/eclipse/buildpath/JanusClasspathContainer.java#L93-L98 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/FormalParameterListComparator.java | FormalParameterListComparator.compare | public static int compare(XtendParameter p1, XtendParameter p2) {
if (p1 != p2) {
if (p1 == null) {
return Integer.MIN_VALUE;
}
if (p2 == null) {
return Integer.MAX_VALUE;
}
final JvmTypeReference t1 = p1.getParameterType();
final JvmTypeReference t2 = p2.getParameterType();
if (t1 != t2)... | java | public static int compare(XtendParameter p1, XtendParameter p2) {
if (p1 != p2) {
if (p1 == null) {
return Integer.MIN_VALUE;
}
if (p2 == null) {
return Integer.MAX_VALUE;
}
final JvmTypeReference t1 = p1.getParameterType();
final JvmTypeReference t2 = p2.getParameterType();
if (t1 != t2)... | [
"public",
"static",
"int",
"compare",
"(",
"XtendParameter",
"p1",
",",
"XtendParameter",
"p2",
")",
"{",
"if",
"(",
"p1",
"!=",
"p2",
")",
"{",
"if",
"(",
"p1",
"==",
"null",
")",
"{",
"return",
"Integer",
".",
"MIN_VALUE",
";",
"}",
"if",
"(",
"p... | Compare the two formal parameters.
@param p1 the first parameter to compare.
@param p2 the second parameter to compare.
@return A negative value if <code>p1</code> is
lower than <code>p2</code>, a positive value if
<code>p1</code> is greater than <code>p2</code>,
otherwise <code>0</code>. | [
"Compare",
"the",
"two",
"formal",
"parameters",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/FormalParameterListComparator.java#L74-L99 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java | SarlBehaviorBuilderImpl.addSarlBehaviorUnit | public ISarlBehaviorUnitBuilder addSarlBehaviorUnit(String name) {
ISarlBehaviorUnitBuilder builder = this.iSarlBehaviorUnitBuilderProvider.get();
builder.eInit(getSarlBehavior(), name, getTypeResolutionContext());
return builder;
} | java | public ISarlBehaviorUnitBuilder addSarlBehaviorUnit(String name) {
ISarlBehaviorUnitBuilder builder = this.iSarlBehaviorUnitBuilderProvider.get();
builder.eInit(getSarlBehavior(), name, getTypeResolutionContext());
return builder;
} | [
"public",
"ISarlBehaviorUnitBuilder",
"addSarlBehaviorUnit",
"(",
"String",
"name",
")",
"{",
"ISarlBehaviorUnitBuilder",
"builder",
"=",
"this",
".",
"iSarlBehaviorUnitBuilderProvider",
".",
"get",
"(",
")",
";",
"builder",
".",
"eInit",
"(",
"getSarlBehavior",
"(",
... | Create a SarlBehaviorUnit.
@param name the type of the SarlBehaviorUnit.
@return the builder. | [
"Create",
"a",
"SarlBehaviorUnit",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java#L158-L162 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java | SarlBehaviorBuilderImpl.addVarSarlField | public ISarlFieldBuilder addVarSarlField(String name) {
ISarlFieldBuilder builder = this.iSarlFieldBuilderProvider.get();
builder.eInit(getSarlBehavior(), name, "var", getTypeResolutionContext());
return builder;
} | java | public ISarlFieldBuilder addVarSarlField(String name) {
ISarlFieldBuilder builder = this.iSarlFieldBuilderProvider.get();
builder.eInit(getSarlBehavior(), name, "var", getTypeResolutionContext());
return builder;
} | [
"public",
"ISarlFieldBuilder",
"addVarSarlField",
"(",
"String",
"name",
")",
"{",
"ISarlFieldBuilder",
"builder",
"=",
"this",
".",
"iSarlFieldBuilderProvider",
".",
"get",
"(",
")",
";",
"builder",
".",
"eInit",
"(",
"getSarlBehavior",
"(",
")",
",",
"name",
... | Create a SarlField.
@param name the name of the SarlField.
@return the builder. | [
"Create",
"a",
"SarlField",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java#L171-L175 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java | SarlBehaviorBuilderImpl.addDefSarlAction | public ISarlActionBuilder addDefSarlAction(String name) {
ISarlActionBuilder builder = this.iSarlActionBuilderProvider.get();
builder.eInit(getSarlBehavior(), name, "def", getTypeResolutionContext());
return builder;
} | java | public ISarlActionBuilder addDefSarlAction(String name) {
ISarlActionBuilder builder = this.iSarlActionBuilderProvider.get();
builder.eInit(getSarlBehavior(), name, "def", getTypeResolutionContext());
return builder;
} | [
"public",
"ISarlActionBuilder",
"addDefSarlAction",
"(",
"String",
"name",
")",
"{",
"ISarlActionBuilder",
"builder",
"=",
"this",
".",
"iSarlActionBuilderProvider",
".",
"get",
"(",
")",
";",
"builder",
".",
"eInit",
"(",
"getSarlBehavior",
"(",
")",
",",
"name... | Create a SarlAction.
@param name the name of the SarlAction.
@return the builder. | [
"Create",
"a",
"SarlAction",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java#L203-L207 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java | SarlBehaviorBuilderImpl.addSarlClass | public ISarlClassBuilder addSarlClass(String name) {
ISarlClassBuilder builder = this.iSarlClassBuilderProvider.get();
builder.eInit(getSarlBehavior(), name, getTypeResolutionContext());
return builder;
} | java | public ISarlClassBuilder addSarlClass(String name) {
ISarlClassBuilder builder = this.iSarlClassBuilderProvider.get();
builder.eInit(getSarlBehavior(), name, getTypeResolutionContext());
return builder;
} | [
"public",
"ISarlClassBuilder",
"addSarlClass",
"(",
"String",
"name",
")",
"{",
"ISarlClassBuilder",
"builder",
"=",
"this",
".",
"iSarlClassBuilderProvider",
".",
"get",
"(",
")",
";",
"builder",
".",
"eInit",
"(",
"getSarlBehavior",
"(",
")",
",",
"name",
",... | Create a SarlClass.
@param name the name of the SarlClass.
@return the builder. | [
"Create",
"a",
"SarlClass",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java#L235-L239 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java | SarlBehaviorBuilderImpl.addSarlCapacityUses | public void addSarlCapacityUses(String... name) {
if (name != null && name.length > 0) {
SarlCapacityUses member = SarlFactory.eINSTANCE.createSarlCapacityUses();
this.sarlBehavior.getMembers().add(member);
member.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendMember());
Collection<JvmParameterizedTy... | java | public void addSarlCapacityUses(String... name) {
if (name != null && name.length > 0) {
SarlCapacityUses member = SarlFactory.eINSTANCE.createSarlCapacityUses();
this.sarlBehavior.getMembers().add(member);
member.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendMember());
Collection<JvmParameterizedTy... | [
"public",
"void",
"addSarlCapacityUses",
"(",
"String",
"...",
"name",
")",
"{",
"if",
"(",
"name",
"!=",
"null",
"&&",
"name",
".",
"length",
">",
"0",
")",
"{",
"SarlCapacityUses",
"member",
"=",
"SarlFactory",
".",
"eINSTANCE",
".",
"createSarlCapacityUse... | Create a SarlCapacityUses.
@param name the types referenced by the SarlCapacityUses. | [
"Create",
"a",
"SarlCapacityUses",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java#L283-L296 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java | SarlBehaviorBuilderImpl.addSarlRequiredCapacity | public void addSarlRequiredCapacity(String... name) {
if (name != null && name.length > 0) {
SarlRequiredCapacity member = SarlFactory.eINSTANCE.createSarlRequiredCapacity();
this.sarlBehavior.getMembers().add(member);
member.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendMember());
Collection<JvmPar... | java | public void addSarlRequiredCapacity(String... name) {
if (name != null && name.length > 0) {
SarlRequiredCapacity member = SarlFactory.eINSTANCE.createSarlRequiredCapacity();
this.sarlBehavior.getMembers().add(member);
member.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendMember());
Collection<JvmPar... | [
"public",
"void",
"addSarlRequiredCapacity",
"(",
"String",
"...",
"name",
")",
"{",
"if",
"(",
"name",
"!=",
"null",
"&&",
"name",
".",
"length",
">",
"0",
")",
"{",
"SarlRequiredCapacity",
"member",
"=",
"SarlFactory",
".",
"eINSTANCE",
".",
"createSarlReq... | Create a SarlRequiredCapacity.
@param name the types referenced by the SarlRequiredCapacity. | [
"Create",
"a",
"SarlRequiredCapacity",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorBuilderImpl.java#L301-L314 | train |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/configs/SarlcConfigModule.java | SarlcConfigModule.getSarlcConfig | @SuppressWarnings("static-method")
@Provides
@Singleton
public SarlConfig getSarlcConfig(ConfigurationFactory configFactory, Injector injector) {
final SarlConfig config = SarlConfig.getConfiguration(configFactory);
injector.injectMembers(config);
return config;
} | java | @SuppressWarnings("static-method")
@Provides
@Singleton
public SarlConfig getSarlcConfig(ConfigurationFactory configFactory, Injector injector) {
final SarlConfig config = SarlConfig.getConfiguration(configFactory);
injector.injectMembers(config);
return config;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"@",
"Provides",
"@",
"Singleton",
"public",
"SarlConfig",
"getSarlcConfig",
"(",
"ConfigurationFactory",
"configFactory",
",",
"Injector",
"injector",
")",
"{",
"final",
"SarlConfig",
"config",
"=",
"SarlConfig"... | Replies the instance of the sarl configuration.
@param configFactory accessor to the bootique factory.
@param injector the current injector.
@return the path configuration accessor. | [
"Replies",
"the",
"instance",
"of",
"the",
"sarl",
"configuration",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/configs/SarlcConfigModule.java#L135-L142 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/EcorePackageRenameStrategy.java | EcorePackageRenameStrategy.validatePackageName | public static RefactoringStatus validatePackageName(String newName) {
if (!PACKAGE_NAME_PATTERN.matcher(newName).find()) {
RefactoringStatus.createErrorStatus(MessageFormat.format(Messages.SARLJdtPackageRenameParticipant_0, newName));
}
return new RefactoringStatus();
} | java | public static RefactoringStatus validatePackageName(String newName) {
if (!PACKAGE_NAME_PATTERN.matcher(newName).find()) {
RefactoringStatus.createErrorStatus(MessageFormat.format(Messages.SARLJdtPackageRenameParticipant_0, newName));
}
return new RefactoringStatus();
} | [
"public",
"static",
"RefactoringStatus",
"validatePackageName",
"(",
"String",
"newName",
")",
"{",
"if",
"(",
"!",
"PACKAGE_NAME_PATTERN",
".",
"matcher",
"(",
"newName",
")",
".",
"find",
"(",
")",
")",
"{",
"RefactoringStatus",
".",
"createErrorStatus",
"(",
... | Validate the package name.
@param newName the package name to be validated.
@return the status of the validation. | [
"Validate",
"the",
"package",
"name",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/EcorePackageRenameStrategy.java#L73-L78 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/EcorePackageRenameStrategy.java | EcorePackageRenameStrategy.setPackageName | protected void setPackageName(String newName, ResourceSet resourceSet) {
final EObject object = resourceSet.getEObject(this.uriProvider.apply(resourceSet), true);
if (object instanceof SarlScript) {
((SarlScript) object).setPackage(newName);
} else {
throw new RefactoringException("SARL script not loaded.")... | java | protected void setPackageName(String newName, ResourceSet resourceSet) {
final EObject object = resourceSet.getEObject(this.uriProvider.apply(resourceSet), true);
if (object instanceof SarlScript) {
((SarlScript) object).setPackage(newName);
} else {
throw new RefactoringException("SARL script not loaded.")... | [
"protected",
"void",
"setPackageName",
"(",
"String",
"newName",
",",
"ResourceSet",
"resourceSet",
")",
"{",
"final",
"EObject",
"object",
"=",
"resourceSet",
".",
"getEObject",
"(",
"this",
".",
"uriProvider",
".",
"apply",
"(",
"resourceSet",
")",
",",
"tru... | Change the package name.
@param newName the new name.
@param resourceSet the set of resource to use. | [
"Change",
"the",
"package",
"name",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/EcorePackageRenameStrategy.java#L106-L113 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/EcorePackageRenameStrategy.java | EcorePackageRenameStrategy.getDeclarationTextEdit | protected TextEdit getDeclarationTextEdit(String newName, ResourceSet resourceSet) {
final EObject object = resourceSet.getEObject(this.uriProvider.apply(resourceSet), true);
if (object instanceof SarlScript) {
final ITextRegion region = getOriginalPackageRegion((SarlScript) object);
if (region != null) {
... | java | protected TextEdit getDeclarationTextEdit(String newName, ResourceSet resourceSet) {
final EObject object = resourceSet.getEObject(this.uriProvider.apply(resourceSet), true);
if (object instanceof SarlScript) {
final ITextRegion region = getOriginalPackageRegion((SarlScript) object);
if (region != null) {
... | [
"protected",
"TextEdit",
"getDeclarationTextEdit",
"(",
"String",
"newName",
",",
"ResourceSet",
"resourceSet",
")",
"{",
"final",
"EObject",
"object",
"=",
"resourceSet",
".",
"getEObject",
"(",
"this",
".",
"uriProvider",
".",
"apply",
"(",
"resourceSet",
")",
... | Replies the text update for the rename.
@param newName the new package name.
@param resourceSet the set of resources.
@return the text update. | [
"Replies",
"the",
"text",
"update",
"for",
"the",
"rename",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/EcorePackageRenameStrategy.java#L138-L147 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/EcorePackageRenameStrategy.java | EcorePackageRenameStrategy.getOriginalPackageRegion | protected ITextRegion getOriginalPackageRegion(final SarlScript script) {
return this.locationInFileProvider.getFullTextRegion(script,
XtendPackage.Literals.XTEND_FILE__PACKAGE, 0);
} | java | protected ITextRegion getOriginalPackageRegion(final SarlScript script) {
return this.locationInFileProvider.getFullTextRegion(script,
XtendPackage.Literals.XTEND_FILE__PACKAGE, 0);
} | [
"protected",
"ITextRegion",
"getOriginalPackageRegion",
"(",
"final",
"SarlScript",
"script",
")",
"{",
"return",
"this",
".",
"locationInFileProvider",
".",
"getFullTextRegion",
"(",
"script",
",",
"XtendPackage",
".",
"Literals",
".",
"XTEND_FILE__PACKAGE",
",",
"0"... | Replies the text region that is corresponding to the package name.
@param script the script.
@return the region. | [
"Replies",
"the",
"text",
"region",
"that",
"is",
"corresponding",
"to",
"the",
"package",
"name",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/EcorePackageRenameStrategy.java#L154-L157 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.setOutputLanguage | @Inject
public void setOutputLanguage(@Named(Constants.LANGUAGE_NAME) String outputLanguage) {
if (!Strings.isNullOrEmpty(outputLanguage)) {
final String[] parts = outputLanguage.split("\\.+"); //$NON-NLS-1$
if (parts.length > 0) {
final String simpleName = parts[parts.length - 1];
if (!Strings.i... | java | @Inject
public void setOutputLanguage(@Named(Constants.LANGUAGE_NAME) String outputLanguage) {
if (!Strings.isNullOrEmpty(outputLanguage)) {
final String[] parts = outputLanguage.split("\\.+"); //$NON-NLS-1$
if (parts.length > 0) {
final String simpleName = parts[parts.length - 1];
if (!Strings.i... | [
"@",
"Inject",
"public",
"void",
"setOutputLanguage",
"(",
"@",
"Named",
"(",
"Constants",
".",
"LANGUAGE_NAME",
")",
"String",
"outputLanguage",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isNullOrEmpty",
"(",
"outputLanguage",
")",
")",
"{",
"final",
"Strin... | Change the name of the language.
@param outputLanguage the language name, or {@code null} for ignoring the language name. | [
"Change",
"the",
"name",
"of",
"the",
"language",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L136-L149 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.getFencedCodeBlockFormatter | public static Function2<String, String, String> getFencedCodeBlockFormatter() {
return (languageName, content) -> {
/*final StringBuilder result = new StringBuilder();
result.append("<div class=\\\"highlight"); //$NON-NLS-1$
if (!Strings.isNullOrEmpty(languageName)) {
result.append(" highlight-").ap... | java | public static Function2<String, String, String> getFencedCodeBlockFormatter() {
return (languageName, content) -> {
/*final StringBuilder result = new StringBuilder();
result.append("<div class=\\\"highlight"); //$NON-NLS-1$
if (!Strings.isNullOrEmpty(languageName)) {
result.append(" highlight-").ap... | [
"public",
"static",
"Function2",
"<",
"String",
",",
"String",
",",
"String",
">",
"getFencedCodeBlockFormatter",
"(",
")",
"{",
"return",
"(",
"languageName",
",",
"content",
")",
"->",
"{",
"/*final StringBuilder result = new StringBuilder();\r\n\t\t\tresult.append(\"<d... | Replies the fenced code block formatter.
<p>This code block formatter is usually used by Github.
@return the formatter. | [
"Replies",
"the",
"fenced",
"code",
"block",
"formatter",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L190-L203 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.getBasicCodeBlockFormatter | public static Function2<String, String, String> getBasicCodeBlockFormatter() {
return (languageName, content) -> {
return Pattern.compile("^", Pattern.MULTILINE).matcher(content).replaceAll("\t"); //$NON-NLS-1$ //$NON-NLS-2$
};
} | java | public static Function2<String, String, String> getBasicCodeBlockFormatter() {
return (languageName, content) -> {
return Pattern.compile("^", Pattern.MULTILINE).matcher(content).replaceAll("\t"); //$NON-NLS-1$ //$NON-NLS-2$
};
} | [
"public",
"static",
"Function2",
"<",
"String",
",",
"String",
",",
"String",
">",
"getBasicCodeBlockFormatter",
"(",
")",
"{",
"return",
"(",
"languageName",
",",
"content",
")",
"->",
"{",
"return",
"Pattern",
".",
"compile",
"(",
"\"^\"",
",",
"Pattern",
... | Replies the basic code block formatter.
@return the formatter. | [
"Replies",
"the",
"basic",
"code",
"block",
"formatter",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L209-L213 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.reset | public void reset() {
this.rawPatterns.clear();
this.compiledPatterns.clear();
this.inlineFormat = DEFAULT_INLINE_FORMAT;
this.blockFormat = null;
this.outlineOutputTag = DEFAULT_OUTLINE_OUTPUT_TAG;
this.dynamicNameExtractionPattern = DEFAULT_TAG_NAME_PATTERN;
this.lineContinuation = DEFAULT_LINE_C... | java | public void reset() {
this.rawPatterns.clear();
this.compiledPatterns.clear();
this.inlineFormat = DEFAULT_INLINE_FORMAT;
this.blockFormat = null;
this.outlineOutputTag = DEFAULT_OUTLINE_OUTPUT_TAG;
this.dynamicNameExtractionPattern = DEFAULT_TAG_NAME_PATTERN;
this.lineContinuation = DEFAULT_LINE_C... | [
"public",
"void",
"reset",
"(",
")",
"{",
"this",
".",
"rawPatterns",
".",
"clear",
"(",
")",
";",
"this",
".",
"compiledPatterns",
".",
"clear",
"(",
")",
";",
"this",
".",
"inlineFormat",
"=",
"DEFAULT_INLINE_FORMAT",
";",
"this",
".",
"blockFormat",
"... | Reset to the default settings. | [
"Reset",
"to",
"the",
"default",
"settings",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L244-L252 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.setPattern | public void setPattern(Tag tag, String regex) {
if (Strings.isNullOrEmpty(regex)) {
this.rawPatterns.remove(tag);
this.compiledPatterns.remove(tag);
} else {
this.rawPatterns.put(tag, regex);
this.compiledPatterns.put(tag, Pattern.compile("^\\s*" + regex, PATTERN_COMPILE_OPTIONS)); //$NON-NLS-1$
... | java | public void setPattern(Tag tag, String regex) {
if (Strings.isNullOrEmpty(regex)) {
this.rawPatterns.remove(tag);
this.compiledPatterns.remove(tag);
} else {
this.rawPatterns.put(tag, regex);
this.compiledPatterns.put(tag, Pattern.compile("^\\s*" + regex, PATTERN_COMPILE_OPTIONS)); //$NON-NLS-1$
... | [
"public",
"void",
"setPattern",
"(",
"Tag",
"tag",
",",
"String",
"regex",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"regex",
")",
")",
"{",
"this",
".",
"rawPatterns",
".",
"remove",
"(",
"tag",
")",
";",
"this",
".",
"compiledPattern... | Change the pattern of the tag.
@param tag the tag.
@param regex the regular expression. | [
"Change",
"the",
"pattern",
"of",
"the",
"tag",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L289-L297 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.getPattern | public String getPattern(Tag tag) {
final String pattern = this.rawPatterns.get(tag);
if (pattern == null) {
return tag.getDefaultPattern();
}
return pattern;
} | java | public String getPattern(Tag tag) {
final String pattern = this.rawPatterns.get(tag);
if (pattern == null) {
return tag.getDefaultPattern();
}
return pattern;
} | [
"public",
"String",
"getPattern",
"(",
"Tag",
"tag",
")",
"{",
"final",
"String",
"pattern",
"=",
"this",
".",
"rawPatterns",
".",
"get",
"(",
"tag",
")",
";",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"return",
"tag",
".",
"getDefaultPattern",
"("... | Replies the pattern of the tag.
@param tag the tag.
@return the regular expression pattern. | [
"Replies",
"the",
"pattern",
"of",
"the",
"tag",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L304-L310 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.getTagForPattern | public Tag getTagForPattern(CharSequence text) {
for (final Tag tag : Tag.values()) {
Pattern pattern = this.compiledPatterns.get(tag);
if (pattern == null) {
pattern = Pattern.compile("^\\s*" + getPattern(tag), Pattern.DOTALL); //$NON-NLS-1$
this.compiledPatterns.put(tag, pattern);
}
final... | java | public Tag getTagForPattern(CharSequence text) {
for (final Tag tag : Tag.values()) {
Pattern pattern = this.compiledPatterns.get(tag);
if (pattern == null) {
pattern = Pattern.compile("^\\s*" + getPattern(tag), Pattern.DOTALL); //$NON-NLS-1$
this.compiledPatterns.put(tag, pattern);
}
final... | [
"public",
"Tag",
"getTagForPattern",
"(",
"CharSequence",
"text",
")",
"{",
"for",
"(",
"final",
"Tag",
"tag",
":",
"Tag",
".",
"values",
"(",
")",
")",
"{",
"Pattern",
"pattern",
"=",
"this",
".",
"compiledPatterns",
".",
"get",
"(",
"tag",
")",
";",
... | Replies the tag that is matching the given text.
@param text the text to match.
@return the tag or {@code null}. | [
"Replies",
"the",
"tag",
"that",
"is",
"matching",
"the",
"given",
"text",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L317-L330 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.getLineSeparator | public String getLineSeparator() {
if (Strings.isNullOrEmpty(this.lineSeparator)) {
final String nl = System.getProperty("line.separator"); //$NON-NLS-1$
if (Strings.isNullOrEmpty(nl)) {
return "\n"; //$NON-NLS-1$
}
return nl;
}
return this.lineSeparator;
} | java | public String getLineSeparator() {
if (Strings.isNullOrEmpty(this.lineSeparator)) {
final String nl = System.getProperty("line.separator"); //$NON-NLS-1$
if (Strings.isNullOrEmpty(nl)) {
return "\n"; //$NON-NLS-1$
}
return nl;
}
return this.lineSeparator;
} | [
"public",
"String",
"getLineSeparator",
"(",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"this",
".",
"lineSeparator",
")",
")",
"{",
"final",
"String",
"nl",
"=",
"System",
".",
"getProperty",
"(",
"\"line.separator\"",
")",
";",
"//$NON-NLS-... | Replies the OS-dependent line separator.
@return the line separator from the {@code "line.separator"} property, or {@code "\n"}. | [
"Replies",
"the",
"OS",
"-",
"dependent",
"line",
"separator",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L560-L569 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.extractDynamicName | protected void extractDynamicName(Tag tag, CharSequence name, OutParameter<String> dynamicName) {
if (tag.hasDynamicName()) {
final Pattern pattern = Pattern.compile(getDynamicNameExtractionPattern());
final Matcher matcher = pattern.matcher(name);
if (matcher.matches()) {
dynamicName.set(Strings.nu... | java | protected void extractDynamicName(Tag tag, CharSequence name, OutParameter<String> dynamicName) {
if (tag.hasDynamicName()) {
final Pattern pattern = Pattern.compile(getDynamicNameExtractionPattern());
final Matcher matcher = pattern.matcher(name);
if (matcher.matches()) {
dynamicName.set(Strings.nu... | [
"protected",
"void",
"extractDynamicName",
"(",
"Tag",
"tag",
",",
"CharSequence",
"name",
",",
"OutParameter",
"<",
"String",
">",
"dynamicName",
")",
"{",
"if",
"(",
"tag",
".",
"hasDynamicName",
"(",
")",
")",
"{",
"final",
"Pattern",
"pattern",
"=",
"P... | Extract the dynamic name of that from the raw text.
@param tag the tag to extract for.
@param name the raw text.
@param dynamicName the dynamic name. | [
"Extract",
"the",
"dynamic",
"name",
"of",
"that",
"from",
"the",
"raw",
"text",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L621-L631 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.transform | public String transform(File inputFile) {
final String content;
try (FileReader reader = new FileReader(inputFile)) {
content = read(reader);
} catch (IOException exception) {
reportError(Messages.SarlDocumentationParser_0, exception);
return null;
}
return transform(content, inputFile);
} | java | public String transform(File inputFile) {
final String content;
try (FileReader reader = new FileReader(inputFile)) {
content = read(reader);
} catch (IOException exception) {
reportError(Messages.SarlDocumentationParser_0, exception);
return null;
}
return transform(content, inputFile);
} | [
"public",
"String",
"transform",
"(",
"File",
"inputFile",
")",
"{",
"final",
"String",
"content",
";",
"try",
"(",
"FileReader",
"reader",
"=",
"new",
"FileReader",
"(",
"inputFile",
")",
")",
"{",
"content",
"=",
"read",
"(",
"reader",
")",
";",
"}",
... | Read the given file and transform its content in order to have a raw text.
@param inputFile the input file.
@return the raw file context. | [
"Read",
"the",
"given",
"file",
"and",
"transform",
"its",
"content",
"in",
"order",
"to",
"have",
"a",
"raw",
"text",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L649-L658 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.postProcessing | protected String postProcessing(CharSequence text) {
final String lineContinuation = getLineContinuation();
if (lineContinuation != null) {
final Pattern pattern = Pattern.compile(
"\\s*\\\\[\\n\\r]+\\s*", //$NON-NLS-1$
Pattern.DOTALL);
final Matcher matcher = pattern.matcher(text.toString().t... | java | protected String postProcessing(CharSequence text) {
final String lineContinuation = getLineContinuation();
if (lineContinuation != null) {
final Pattern pattern = Pattern.compile(
"\\s*\\\\[\\n\\r]+\\s*", //$NON-NLS-1$
Pattern.DOTALL);
final Matcher matcher = pattern.matcher(text.toString().t... | [
"protected",
"String",
"postProcessing",
"(",
"CharSequence",
"text",
")",
"{",
"final",
"String",
"lineContinuation",
"=",
"getLineContinuation",
"(",
")",
";",
"if",
"(",
"lineContinuation",
"!=",
"null",
")",
"{",
"final",
"Pattern",
"pattern",
"=",
"Pattern"... | Do a post processing of the text.
@param text the text to post process.
@return the post-processed text. | [
"Do",
"a",
"post",
"processing",
"of",
"the",
"text",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L716-L726 | train |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.formatBlockText | protected static String formatBlockText(String content, String languageName, Function2<String, String, String> blockFormat) {
String replacement = Strings.nullToEmpty(content);
final String[] lines = replacement.trim().split("[\n\r]+"); //$NON-NLS-1$
int minIndent = Integer.MAX_VALUE;
final Pattern wpPatter... | java | protected static String formatBlockText(String content, String languageName, Function2<String, String, String> blockFormat) {
String replacement = Strings.nullToEmpty(content);
final String[] lines = replacement.trim().split("[\n\r]+"); //$NON-NLS-1$
int minIndent = Integer.MAX_VALUE;
final Pattern wpPatter... | [
"protected",
"static",
"String",
"formatBlockText",
"(",
"String",
"content",
",",
"String",
"languageName",
",",
"Function2",
"<",
"String",
",",
"String",
",",
"String",
">",
"blockFormat",
")",
"{",
"String",
"replacement",
"=",
"Strings",
".",
"nullToEmpty",... | Format the given text in order to be suitable for being output as a block.
@param content the text.
@param languageName the name of the output language.
@param blockFormat the formatting template.
@return the formatted text. | [
"Format",
"the",
"given",
"text",
"in",
"order",
"to",
"be",
"suitable",
"for",
"being",
"output",
"as",
"a",
"block",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L1055-L1089 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/DocumentationBuilderFragment.java | DocumentationBuilderFragment.generateInnerDocumentationAdapter | protected void generateInnerDocumentationAdapter() {
final TypeReference adapter = getCodeElementExtractor().getInnerBlockDocumentationAdapter();
final StringConcatenationClient content = new StringConcatenationClient() {
@Override
protected void appendTo(TargetStringConcatenation it) {
it.append("public ... | java | protected void generateInnerDocumentationAdapter() {
final TypeReference adapter = getCodeElementExtractor().getInnerBlockDocumentationAdapter();
final StringConcatenationClient content = new StringConcatenationClient() {
@Override
protected void appendTo(TargetStringConcatenation it) {
it.append("public ... | [
"protected",
"void",
"generateInnerDocumentationAdapter",
"(",
")",
"{",
"final",
"TypeReference",
"adapter",
"=",
"getCodeElementExtractor",
"(",
")",
".",
"getInnerBlockDocumentationAdapter",
"(",
")",
";",
"final",
"StringConcatenationClient",
"content",
"=",
"new",
... | Generate the adapter that supports the inner documentation. | [
"Generate",
"the",
"adapter",
"that",
"supports",
"the",
"inner",
"documentation",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/DocumentationBuilderFragment.java#L224-L275 | train |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/editor/SARLSourceViewerPreferenceAccess.java | SARLSourceViewerPreferenceAccess.setAutoFormattingEnabled | public void setAutoFormattingEnabled(Boolean enable) {
final IPreferenceStore store = getWritablePreferenceStore(null);
if (enable == null) {
store.setToDefault(AUTOFORMATTING_PROPERTY);
} else {
store.setValue(AUTOFORMATTING_PROPERTY, enable.booleanValue());
}
} | java | public void setAutoFormattingEnabled(Boolean enable) {
final IPreferenceStore store = getWritablePreferenceStore(null);
if (enable == null) {
store.setToDefault(AUTOFORMATTING_PROPERTY);
} else {
store.setValue(AUTOFORMATTING_PROPERTY, enable.booleanValue());
}
} | [
"public",
"void",
"setAutoFormattingEnabled",
"(",
"Boolean",
"enable",
")",
"{",
"final",
"IPreferenceStore",
"store",
"=",
"getWritablePreferenceStore",
"(",
"null",
")",
";",
"if",
"(",
"enable",
"==",
"null",
")",
"{",
"store",
".",
"setToDefault",
"(",
"A... | Enable or disable the auto-formatting feature into the SARL editor.
@param enable is {@code true} if it is enabled; {@code false} if it is disable; {@code null}
to restore the default value.
@since 0.8
@see #getWritablePreferenceStore(Object) | [
"Enable",
"or",
"disable",
"the",
"auto",
"-",
"formatting",
"feature",
"into",
"the",
"SARL",
"editor",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/editor/SARLSourceViewerPreferenceAccess.java#L69-L76 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlActionBuilderImpl.java | SarlActionBuilderImpl.setReturnType | public void setReturnType(String type) {
if (!Strings.isEmpty(type)
&& !Objects.equals("void", type)
&& !Objects.equals(Void.class.getName(), type)) {
this.sarlAction.setReturnType(newTypeRef(container, type));
} else {
this.sarlAction.setReturnType(null);
}
} | java | public void setReturnType(String type) {
if (!Strings.isEmpty(type)
&& !Objects.equals("void", type)
&& !Objects.equals(Void.class.getName(), type)) {
this.sarlAction.setReturnType(newTypeRef(container, type));
} else {
this.sarlAction.setReturnType(null);
}
} | [
"public",
"void",
"setReturnType",
"(",
"String",
"type",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isEmpty",
"(",
"type",
")",
"&&",
"!",
"Objects",
".",
"equals",
"(",
"\"void\"",
",",
"type",
")",
"&&",
"!",
"Objects",
".",
"equals",
"(",
"Void",... | Change the return type.
@param type the return type of the member. | [
"Change",
"the",
"return",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlActionBuilderImpl.java#L147-L155 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlActionBuilderImpl.java | SarlActionBuilderImpl.addAnnotation | public void addAnnotation(String type) {
if (!Strings.isEmpty(type)) {
XAnnotation annotation = XAnnotationsFactory.eINSTANCE.createXAnnotation();
annotation.setAnnotationType(newTypeRef(getSarlAction(), type).getType());
getSarlAction().getAnnotations().add(annotation);
}
} | java | public void addAnnotation(String type) {
if (!Strings.isEmpty(type)) {
XAnnotation annotation = XAnnotationsFactory.eINSTANCE.createXAnnotation();
annotation.setAnnotationType(newTypeRef(getSarlAction(), type).getType());
getSarlAction().getAnnotations().add(annotation);
}
} | [
"public",
"void",
"addAnnotation",
"(",
"String",
"type",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isEmpty",
"(",
"type",
")",
")",
"{",
"XAnnotation",
"annotation",
"=",
"XAnnotationsFactory",
".",
"eINSTANCE",
".",
"createXAnnotation",
"(",
")",
";",
"... | Add an annotation.
@param type the qualified name of the annotation | [
"Add",
"an",
"annotation",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlActionBuilderImpl.java#L171-L177 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java | LoggerCreator.useJanusMessageFormat | public static void useJanusMessageFormat() {
final String format = System.getProperty(FORMAT_PROPERTY_KEY, null);
if (format == null || format.isEmpty()) {
System.setProperty(FORMAT_PROPERTY_KEY, JANUS_FORMAT);
}
} | java | public static void useJanusMessageFormat() {
final String format = System.getProperty(FORMAT_PROPERTY_KEY, null);
if (format == null || format.isEmpty()) {
System.setProperty(FORMAT_PROPERTY_KEY, JANUS_FORMAT);
}
} | [
"public",
"static",
"void",
"useJanusMessageFormat",
"(",
")",
"{",
"final",
"String",
"format",
"=",
"System",
".",
"getProperty",
"(",
"FORMAT_PROPERTY_KEY",
",",
"null",
")",
";",
"if",
"(",
"format",
"==",
"null",
"||",
"format",
".",
"isEmpty",
"(",
"... | Change the configuration of the root logger for using the Janus format for the messages. | [
"Change",
"the",
"configuration",
"of",
"the",
"root",
"logger",
"for",
"using",
"the",
"Janus",
"format",
"for",
"the",
"messages",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java#L67-L72 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java | LoggerCreator.createPlatformLogger | public static Logger createPlatformLogger() {
final Logger logger = Logger.getAnonymousLogger();
for (final Handler handler : logger.getHandlers()) {
logger.removeHandler(handler);
}
final Handler stderr = new StandardErrorOutputConsoleHandler();
stderr.setLevel(Level.ALL);
final Handler stdout = new Sta... | java | public static Logger createPlatformLogger() {
final Logger logger = Logger.getAnonymousLogger();
for (final Handler handler : logger.getHandlers()) {
logger.removeHandler(handler);
}
final Handler stderr = new StandardErrorOutputConsoleHandler();
stderr.setLevel(Level.ALL);
final Handler stdout = new Sta... | [
"public",
"static",
"Logger",
"createPlatformLogger",
"(",
")",
"{",
"final",
"Logger",
"logger",
"=",
"Logger",
".",
"getAnonymousLogger",
"(",
")",
";",
"for",
"(",
"final",
"Handler",
"handler",
":",
"logger",
".",
"getHandlers",
"(",
")",
")",
"{",
"lo... | Create a logger with the given name for the platform.
<p>The platform logger has the level {@link Level#ALL}. It override the
output handlers with handlers for the standard output and standard error.
The platform logger is a root logger.
@return the logger. | [
"Create",
"a",
"logger",
"with",
"the",
"given",
"name",
"for",
"the",
"platform",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java#L83-L97 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java | LoggerCreator.getLoggingLevelFromProperties | public static Level getLoggingLevelFromProperties() {
if (levelFromProperties == null) {
final String verboseLevel = JanusConfig.getSystemProperty(JanusConfig.VERBOSE_LEVEL_NAME, JanusConfig.VERBOSE_LEVEL_VALUE);
levelFromProperties = parseLoggingLevel(verboseLevel);
}
return levelFromProperties;
} | java | public static Level getLoggingLevelFromProperties() {
if (levelFromProperties == null) {
final String verboseLevel = JanusConfig.getSystemProperty(JanusConfig.VERBOSE_LEVEL_NAME, JanusConfig.VERBOSE_LEVEL_VALUE);
levelFromProperties = parseLoggingLevel(verboseLevel);
}
return levelFromProperties;
} | [
"public",
"static",
"Level",
"getLoggingLevelFromProperties",
"(",
")",
"{",
"if",
"(",
"levelFromProperties",
"==",
"null",
")",
"{",
"final",
"String",
"verboseLevel",
"=",
"JanusConfig",
".",
"getSystemProperty",
"(",
"JanusConfig",
".",
"VERBOSE_LEVEL_NAME",
","... | Extract the logging level from the system properties.
@return the logging level. | [
"Extract",
"the",
"logging",
"level",
"from",
"the",
"system",
"properties",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java#L126-L132 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java | LoggerCreator.parseLoggingLevel | @SuppressWarnings({ "checkstyle:returncount", "checkstyle:cyclomaticcomplexity" })
public static Level parseLoggingLevel(String level) {
if (level == null) {
return Level.INFO;
}
switch (level.toLowerCase()) {
case "none": //$NON-NLS-1$
case "false": //$NON-NLS-1$
case "0": //$NON-NLS-1$
return Level... | java | @SuppressWarnings({ "checkstyle:returncount", "checkstyle:cyclomaticcomplexity" })
public static Level parseLoggingLevel(String level) {
if (level == null) {
return Level.INFO;
}
switch (level.toLowerCase()) {
case "none": //$NON-NLS-1$
case "false": //$NON-NLS-1$
case "0": //$NON-NLS-1$
return Level... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"checkstyle:returncount\"",
",",
"\"checkstyle:cyclomaticcomplexity\"",
"}",
")",
"public",
"static",
"Level",
"parseLoggingLevel",
"(",
"String",
"level",
")",
"{",
"if",
"(",
"level",
"==",
"null",
")",
"{",
"return",
"Level"... | Extract the logging level from the given string.
@param level
- the string representation of the logging level.
@return the logging level. | [
"Extract",
"the",
"logging",
"level",
"from",
"the",
"given",
"string",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java#L141-L185 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java | LoggerCreator.fromInt | @SuppressWarnings({ "checkstyle:magicnumber", "checkstyle:returncount" })
public static Level fromInt(int num) {
switch (num) {
case 0:
return Level.OFF;
case 1:
return Level.SEVERE;
case 2:
return Level.WARNING;
case 3:
return Level.INFO;
case 4:
return Level.FINE;
case 5:
return Level... | java | @SuppressWarnings({ "checkstyle:magicnumber", "checkstyle:returncount" })
public static Level fromInt(int num) {
switch (num) {
case 0:
return Level.OFF;
case 1:
return Level.SEVERE;
case 2:
return Level.WARNING;
case 3:
return Level.INFO;
case 4:
return Level.FINE;
case 5:
return Level... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"checkstyle:magicnumber\"",
",",
"\"checkstyle:returncount\"",
"}",
")",
"public",
"static",
"Level",
"fromInt",
"(",
"int",
"num",
")",
"{",
"switch",
"(",
"num",
")",
"{",
"case",
"0",
":",
"return",
"Level",
".",
"OFF"... | Convert a numerical representation of logging level to the logging level.
@param num
- the numerical index that corresponds to the given level.
@return the logging level. | [
"Convert",
"a",
"numerical",
"representation",
"of",
"logging",
"level",
"to",
"the",
"logging",
"level",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java#L194-L219 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java | LoggerCreator.toInt | @SuppressWarnings({ "checkstyle:magicnumber", "checkstyle:returncount", "checkstyle:npathcomplexity" })
public static int toInt(Level level) {
if (level == Level.OFF) {
return 0;
}
if (level == Level.SEVERE) {
return 1;
}
if (level == Level.WARNING) {
return 2;
}
if (level == Level.INFO) {
re... | java | @SuppressWarnings({ "checkstyle:magicnumber", "checkstyle:returncount", "checkstyle:npathcomplexity" })
public static int toInt(Level level) {
if (level == Level.OFF) {
return 0;
}
if (level == Level.SEVERE) {
return 1;
}
if (level == Level.WARNING) {
return 2;
}
if (level == Level.INFO) {
re... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"checkstyle:magicnumber\"",
",",
"\"checkstyle:returncount\"",
",",
"\"checkstyle:npathcomplexity\"",
"}",
")",
"public",
"static",
"int",
"toInt",
"(",
"Level",
"level",
")",
"{",
"if",
"(",
"level",
"==",
"Level",
".",
"OFF",... | Convert a logging level to its numerical equivalent.
@param level
- the logging level.
@return the numerical index that corresponds to the given level. | [
"Convert",
"a",
"logging",
"level",
"to",
"its",
"numerical",
"equivalent",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/LoggerCreator.java#L228-L258 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/Services.java | Services.startServices | public static void startServices(IServiceManager manager) {
final List<Service> otherServices = new ArrayList<>();
final List<Service> infraServices = new ArrayList<>();
final LinkedList<DependencyNode> serviceQueue = new LinkedList<>();
final Accessors accessors = new StartingPhaseAccessors();
// Build the ... | java | public static void startServices(IServiceManager manager) {
final List<Service> otherServices = new ArrayList<>();
final List<Service> infraServices = new ArrayList<>();
final LinkedList<DependencyNode> serviceQueue = new LinkedList<>();
final Accessors accessors = new StartingPhaseAccessors();
// Build the ... | [
"public",
"static",
"void",
"startServices",
"(",
"IServiceManager",
"manager",
")",
"{",
"final",
"List",
"<",
"Service",
">",
"otherServices",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"List",
"<",
"Service",
">",
"infraServices",
"=",
"new",
... | Start the services associated to the given service manager.
<p>This starting function supports the {@link DependentService prioritized services}.
@param manager the manager of the services to start. | [
"Start",
"the",
"services",
"associated",
"to",
"the",
"given",
"service",
"manager",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/Services.java#L75-L88 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/Services.java | Services.stopServices | public static void stopServices(IServiceManager manager) {
final List<Service> otherServices = new ArrayList<>();
final List<Service> infraServices = new ArrayList<>();
final LinkedList<DependencyNode> serviceQueue = new LinkedList<>();
final Accessors accessors = new StoppingPhaseAccessors();
// Build the d... | java | public static void stopServices(IServiceManager manager) {
final List<Service> otherServices = new ArrayList<>();
final List<Service> infraServices = new ArrayList<>();
final LinkedList<DependencyNode> serviceQueue = new LinkedList<>();
final Accessors accessors = new StoppingPhaseAccessors();
// Build the d... | [
"public",
"static",
"void",
"stopServices",
"(",
"IServiceManager",
"manager",
")",
"{",
"final",
"List",
"<",
"Service",
">",
"otherServices",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"List",
"<",
"Service",
">",
"infraServices",
"=",
"new",
... | Stop the services associated to the given service manager.
<p>This stopping function supports the {@link DependentService prioritized services}.
@param manager the manager of the services to stop. | [
"Stop",
"the",
"services",
"associated",
"to",
"the",
"given",
"service",
"manager",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/Services.java#L108-L121 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/Services.java | Services.runDependencyGraph | @SuppressWarnings("checkstyle:npathcomplexity")
private static void runDependencyGraph(Queue<DependencyNode> roots, List<Service> infraServices, List<Service> freeServices,
Accessors accessors) {
final boolean async = accessors.isAsyncStateWaitingEnabled();
final Set<Class<? extends Service>> executed = new Tre... | java | @SuppressWarnings("checkstyle:npathcomplexity")
private static void runDependencyGraph(Queue<DependencyNode> roots, List<Service> infraServices, List<Service> freeServices,
Accessors accessors) {
final boolean async = accessors.isAsyncStateWaitingEnabled();
final Set<Class<? extends Service>> executed = new Tre... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:npathcomplexity\"",
")",
"private",
"static",
"void",
"runDependencyGraph",
"(",
"Queue",
"<",
"DependencyNode",
">",
"roots",
",",
"List",
"<",
"Service",
">",
"infraServices",
",",
"List",
"<",
"Service",
">",
"freeSer... | Run the dependency graph for the services.
@param roots filled with the services that have no dependency.
@param infraServices filled with the infrastructure services.
@param freeServices filled with the services that are executed before/after all the dependent services.
@param accessors permits to retreive informatio... | [
"Run",
"the",
"dependency",
"graph",
"for",
"the",
"services",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/Services.java#L280-L309 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/BuiltinCapacityUtil.java | BuiltinCapacityUtil.getContextsOf | public static SynchronizedIterable<AgentContext> getContextsOf(Agent agent) throws Exception {
final ExternalContextAccess skill = SREutils.getInternalSkill(agent, ExternalContextAccess.class);
assert skill != null;
return skill.getAllContexts();
} | java | public static SynchronizedIterable<AgentContext> getContextsOf(Agent agent) throws Exception {
final ExternalContextAccess skill = SREutils.getInternalSkill(agent, ExternalContextAccess.class);
assert skill != null;
return skill.getAllContexts();
} | [
"public",
"static",
"SynchronizedIterable",
"<",
"AgentContext",
">",
"getContextsOf",
"(",
"Agent",
"agent",
")",
"throws",
"Exception",
"{",
"final",
"ExternalContextAccess",
"skill",
"=",
"SREutils",
".",
"getInternalSkill",
"(",
"agent",
",",
"ExternalContextAcces... | Replies the contexts in which the agent is located.
@param agent the agent for which the contexts must be retrieved.
@return the contexts of the agents.
@throws Exception - when it is not possible to retrieve the contexts. | [
"Replies",
"the",
"contexts",
"in",
"which",
"the",
"agent",
"is",
"located",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/BuiltinCapacityUtil.java#L52-L56 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/BuiltinCapacityUtil.java | BuiltinCapacityUtil.getContextIn | public static AgentContext getContextIn(Agent agent) throws Exception {
final InnerContextAccess skill = SREutils.getInternalSkill(agent, InnerContextAccess.class);
if (skill instanceof InnerContextSkill) {
final InnerContextSkill janusSkill = (InnerContextSkill) skill;
if (janusSkill.hasInnerContext()) {
... | java | public static AgentContext getContextIn(Agent agent) throws Exception {
final InnerContextAccess skill = SREutils.getInternalSkill(agent, InnerContextAccess.class);
if (skill instanceof InnerContextSkill) {
final InnerContextSkill janusSkill = (InnerContextSkill) skill;
if (janusSkill.hasInnerContext()) {
... | [
"public",
"static",
"AgentContext",
"getContextIn",
"(",
"Agent",
"agent",
")",
"throws",
"Exception",
"{",
"final",
"InnerContextAccess",
"skill",
"=",
"SREutils",
".",
"getInternalSkill",
"(",
"agent",
",",
"InnerContextAccess",
".",
"class",
")",
";",
"if",
"... | Replies the inner context of the agent, if it was created.
@param agent the agent for which the inner context must be retreived.
@return the inner context, or <code>null</code>.
@throws Exception - when it is not possible to retreive the inner context. | [
"Replies",
"the",
"inner",
"context",
"of",
"the",
"agent",
"if",
"it",
"was",
"created",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/BuiltinCapacityUtil.java#L65-L79 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java | SarlCompiler._toJavaStatement | @SuppressWarnings("static-method")
protected void _toJavaStatement(SarlBreakExpression breakExpression, ITreeAppendable appendable, boolean isReferenced) {
appendable.newLine().append("break;"); //$NON-NLS-1$
} | java | @SuppressWarnings("static-method")
protected void _toJavaStatement(SarlBreakExpression breakExpression, ITreeAppendable appendable, boolean isReferenced) {
appendable.newLine().append("break;"); //$NON-NLS-1$
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"void",
"_toJavaStatement",
"(",
"SarlBreakExpression",
"breakExpression",
",",
"ITreeAppendable",
"appendable",
",",
"boolean",
"isReferenced",
")",
"{",
"appendable",
".",
"newLine",
"(",
")",
".",... | Generate the Java code related to the preparation statements for the break keyword.
@param breakExpression the expression.
@param appendable the output.
@param isReferenced indicates if the expression is referenced. | [
"Generate",
"the",
"Java",
"code",
"related",
"to",
"the",
"preparation",
"statements",
"for",
"the",
"break",
"keyword",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java#L528-L531 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java | SarlCompiler.getReferencedLocalVariable | @SuppressWarnings("static-method")
protected Map<XVariableDeclaration, XFeatureCall> getReferencedLocalVariable(XExpression expression, boolean onlyWritable) {
final Map<XVariableDeclaration, XFeatureCall> localVariables = new TreeMap<>((k1, k2) -> {
return k1.getIdentifier().compareTo(k2.getIdentifier());
});
... | java | @SuppressWarnings("static-method")
protected Map<XVariableDeclaration, XFeatureCall> getReferencedLocalVariable(XExpression expression, boolean onlyWritable) {
final Map<XVariableDeclaration, XFeatureCall> localVariables = new TreeMap<>((k1, k2) -> {
return k1.getIdentifier().compareTo(k2.getIdentifier());
});
... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"Map",
"<",
"XVariableDeclaration",
",",
"XFeatureCall",
">",
"getReferencedLocalVariable",
"(",
"XExpression",
"expression",
",",
"boolean",
"onlyWritable",
")",
"{",
"final",
"Map",
"<",
"XVariable... | Replies all the variables that are referenced into the given expression.
@param expression the expression.
@param onlyWritable if {@code true} only the writable variables are replied. Otherwise, all variables are replied.
@return the referenced variables. | [
"Replies",
"all",
"the",
"variables",
"that",
"are",
"referenced",
"into",
"the",
"given",
"expression",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java#L654-L668 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java | SarlCompiler.isAtLeastJava8 | protected boolean isAtLeastJava8(EObject context) {
return this.generatorConfigProvider.get(EcoreUtil.getRootContainer(context)).getJavaSourceVersion().isAtLeast(JavaVersion.JAVA8);
} | java | protected boolean isAtLeastJava8(EObject context) {
return this.generatorConfigProvider.get(EcoreUtil.getRootContainer(context)).getJavaSourceVersion().isAtLeast(JavaVersion.JAVA8);
} | [
"protected",
"boolean",
"isAtLeastJava8",
"(",
"EObject",
"context",
")",
"{",
"return",
"this",
".",
"generatorConfigProvider",
".",
"get",
"(",
"EcoreUtil",
".",
"getRootContainer",
"(",
"context",
")",
")",
".",
"getJavaSourceVersion",
"(",
")",
".",
"isAtLea... | Replies if the generation is for Java version 8 at least.
@param context the context.
@return {@code true} if Java 8 or newer. | [
"Replies",
"if",
"the",
"generation",
"is",
"for",
"Java",
"version",
"8",
"at",
"least",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java#L675-L677 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java | SarlCompiler._toJavaExpression | protected void _toJavaExpression(SarlAssertExpression assertExpression, ITreeAppendable appendable) {
if (!assertExpression.isIsStatic() && isAtLeastJava8(assertExpression)) {
appendable.append("/* error - couldn't compile nested assert */"); //$NON-NLS-1$
}
} | java | protected void _toJavaExpression(SarlAssertExpression assertExpression, ITreeAppendable appendable) {
if (!assertExpression.isIsStatic() && isAtLeastJava8(assertExpression)) {
appendable.append("/* error - couldn't compile nested assert */"); //$NON-NLS-1$
}
} | [
"protected",
"void",
"_toJavaExpression",
"(",
"SarlAssertExpression",
"assertExpression",
",",
"ITreeAppendable",
"appendable",
")",
"{",
"if",
"(",
"!",
"assertExpression",
".",
"isIsStatic",
"(",
")",
"&&",
"isAtLeastJava8",
"(",
"assertExpression",
")",
")",
"{"... | Generate the Java code related to the expression for the assert keyword.
@param assertExpression the expression.
@param appendable the output. | [
"Generate",
"the",
"Java",
"code",
"related",
"to",
"the",
"expression",
"for",
"the",
"assert",
"keyword",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java#L705-L709 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java | SarlCompiler.jvmOperationCallToJavaExpression | protected void jvmOperationCallToJavaExpression(final XExpression sourceObject, final JvmOperation operation,
XExpression receiver, List<XExpression> arguments, ITreeAppendable appendable) {
String name = null;
assert operation != null;
if (appendable.hasName(operation)) {
name = appendable.getName(operatio... | java | protected void jvmOperationCallToJavaExpression(final XExpression sourceObject, final JvmOperation operation,
XExpression receiver, List<XExpression> arguments, ITreeAppendable appendable) {
String name = null;
assert operation != null;
if (appendable.hasName(operation)) {
name = appendable.getName(operatio... | [
"protected",
"void",
"jvmOperationCallToJavaExpression",
"(",
"final",
"XExpression",
"sourceObject",
",",
"final",
"JvmOperation",
"operation",
",",
"XExpression",
"receiver",
",",
"List",
"<",
"XExpression",
">",
"arguments",
",",
"ITreeAppendable",
"appendable",
")",... | Generate the Java expression for the given JVM operation.
@param sourceObject the object into the source tree that is the source for the call.
@param operation the JVM operation to call.
@param receiver the receiver of the call.
@param arguments the arguments to pass to the called operation.
@param appendable the rece... | [
"Generate",
"the",
"Java",
"expression",
"for",
"the",
"given",
"JVM",
"operation",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java#L835-L869 | train |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java | SarlCompiler.canBeNotStaticAnonymousClass | @SuppressWarnings("static-method")
protected boolean canBeNotStaticAnonymousClass(XClosure closure, LightweightTypeReference typeRef,
JvmOperation operation) {
return !typeRef.isSubtypeOf(Serializable.class);
} | java | @SuppressWarnings("static-method")
protected boolean canBeNotStaticAnonymousClass(XClosure closure, LightweightTypeReference typeRef,
JvmOperation operation) {
return !typeRef.isSubtypeOf(Serializable.class);
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"boolean",
"canBeNotStaticAnonymousClass",
"(",
"XClosure",
"closure",
",",
"LightweightTypeReference",
"typeRef",
",",
"JvmOperation",
"operation",
")",
"{",
"return",
"!",
"typeRef",
".",
"isSubtypeO... | Replies if the given closure could be represented by an not static anonymous class.
@param closure the closure.
@param typeRef the type of the closure.
@param operation the operation to implement.
@return {@code true} if the given closure could be represented by a not-static anonymous class.
@since 0.8.6 | [
"Replies",
"if",
"the",
"given",
"closure",
"could",
"be",
"represented",
"by",
"an",
"not",
"static",
"anonymous",
"class",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java#L1289-L1293 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/AbstractDMultiMapView.java | AbstractDMultiMapView.wrapValues | Collection<V> wrapValues(K key, Collection<V> values) {
final Object backEnd = DataViewDelegate.undelegate(values);
if (backEnd instanceof List<?>) {
return new SingleKeyValueListView(key, (List<V>) values);
}
if (backEnd instanceof Set<?>) {
return new SingleKeyValueSetView(key, (Set<V>) values);
}
t... | java | Collection<V> wrapValues(K key, Collection<V> values) {
final Object backEnd = DataViewDelegate.undelegate(values);
if (backEnd instanceof List<?>) {
return new SingleKeyValueListView(key, (List<V>) values);
}
if (backEnd instanceof Set<?>) {
return new SingleKeyValueSetView(key, (Set<V>) values);
}
t... | [
"Collection",
"<",
"V",
">",
"wrapValues",
"(",
"K",
"key",
",",
"Collection",
"<",
"V",
">",
"values",
")",
"{",
"final",
"Object",
"backEnd",
"=",
"DataViewDelegate",
".",
"undelegate",
"(",
"values",
")",
";",
"if",
"(",
"backEnd",
"instanceof",
"List... | Wrap the given values into a dedicated view.
<p>The replies view may be a {@link SingleKeyValueListView} or a {@link SingleKeyValueSetView} according to the type of the
given values' collection.
@param key the key of the values.
@param values the values.
@return the wrapper. | [
"Wrap",
"the",
"given",
"values",
"into",
"a",
"dedicated",
"view",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/AbstractDMultiMapView.java#L90-L99 | train |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/AbstractDMultiMapView.java | AbstractDMultiMapView.copyValues | @SuppressWarnings({ "unchecked", "checkstyle:illegaltype" })
Collection<V> copyValues(Collection<V> values) {
final Object backEnd = DataViewDelegate.undelegate(values);
if (backEnd instanceof List<?>) {
return Lists.newArrayList(values);
}
if (backEnd instanceof TreeSet<?>) {
TreeSet<V> c = (TreeSet<V>)... | java | @SuppressWarnings({ "unchecked", "checkstyle:illegaltype" })
Collection<V> copyValues(Collection<V> values) {
final Object backEnd = DataViewDelegate.undelegate(values);
if (backEnd instanceof List<?>) {
return Lists.newArrayList(values);
}
if (backEnd instanceof TreeSet<?>) {
TreeSet<V> c = (TreeSet<V>)... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"checkstyle:illegaltype\"",
"}",
")",
"Collection",
"<",
"V",
">",
"copyValues",
"(",
"Collection",
"<",
"V",
">",
"values",
")",
"{",
"final",
"Object",
"backEnd",
"=",
"DataViewDelegate",
".",
"undel... | Copy the given values.
<p>The replies collection may be a {@link List} or a {@link Set} according to the type of the given values' collection.
@param values the values.
@return the copy. | [
"Copy",
"the",
"given",
"values",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/AbstractDMultiMapView.java#L109-L128 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.