code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
@SuppressWarnings("checkstyle:npathcomplexity")
private void createImplicitActionReturnType(XtextResource resource, IAcceptor<? super ICodeMining> acceptor) {
final List<XtendFunction> actions = EcoreUtil2.eAllOfType(resource.getContents().get(0), XtendFunction.class);
for (final XtendFunction action : actions) {... | java |
public Set<String> getPureKeywords() {
Set<String> kws = this.pureSarlKeywords == null ? null : this.pureSarlKeywords.get();
if (kws == null) {
kws = new HashSet<>();
kws.add(getAsKeyword());
kws.add(getRequiresKeyword());
kws.add(getWithKeyword());
kws.add(getItKeyword());
kws.add(getArtifactKeyw... | java |
public String protectKeyword(String text) {
if (!Strings.isEmpty(text) && isKeyword(text)) {
return "^" + text;
}
return text;
} | java |
@Check
public void checkImportsMapping(XImportDeclaration importDeclaration) {
final JvmDeclaredType type = importDeclaration.getImportedType();
doTypeMappingCheck(importDeclaration, type, this.typeErrorHandler1);
} | java |
public static void importMavenProject(IWorkspaceRoot workspaceRoot, String projectName,
boolean addSarlSpecificSourceFolders, IProgressMonitor monitor) {
// XXX: The m2e plugin seems to have an issue for creating a fresh project with the SARL plugin as an extension.
// Solution: Create a simple project, and swit... | java |
static List<IMavenProjectImportResult> runFixedImportJob(boolean addSarlSpecificSourceFolders,
Collection<MavenProjectInfo> projectInfos,
ProjectImportConfiguration importConfiguration, IProjectCreationListener projectCreationListener,
IProgressMonitor monitor) throws CoreException {
final List<IMavenProject... | java |
static void forceSimplePom(File projectDir, IProgressMonitor monitor) throws IOException {
final File pomFile = new File(projectDir, POM_FILE);
if (pomFile.exists()) {
final SubMonitor submon = SubMonitor.convert(monitor, 4);
final File savedPomFile = new File(projectDir, POM_BACKUP_FILE);
if (savedPomFile... | java |
public final Set<String> getBundleDependencies() {
final Set<String> bundles = new TreeSet<>();
updateBundleList(bundles);
return bundles;
} | java |
@SuppressWarnings("static-method")
@Pure
@Inline(value = "$1.getCaller()", imported = Capacities.class, constantExpression = true)
protected AgentTrait getCaller() {
return Capacities.getCaller();
} | java |
void unregisterUse() {
final int value = this.uses.decrementAndGet();
if (value == 0) {
uninstall(UninstallationStage.PRE_DESTROY_EVENT);
uninstall(UninstallationStage.POST_DESTROY_EVENT);
}
} | java |
protected void generateIFormalParameterBuilder() {
final TypeReference builder = getFormalParameterBuilderInterface();
final StringConcatenationClient content = new StringConcatenationClient() {
@Override
protected void appendTo(TargetStringConcatenation it) {
it.append("/** Builder of a " + getLanguageNa... | java |
protected void generateFormalParameterAppender() {
final CodeElementExtractor.ElementDescription parameter = getCodeElementExtractor().getFormalParameter();
final String accessor = "get" //$NON-NLS-1$
+ Strings.toFirstUpper(parameter.getElementType().getSimpleName()) + "()"; //$NON-NLS-1$
final TypeReference ... | java |
protected void fireContextCreated(AgentContext context) {
final ContextRepositoryListener[] ilisteners = this.listeners.getListeners(ContextRepositoryListener.class);
this.logger.getKernelLogger().info(MessageFormat.format(Messages.StandardContextSpaceService_0, context.getID()));
for (final ContextRepositoryList... | java |
protected void fireContextDestroyed(AgentContext context) {
final ContextRepositoryListener[] ilisteners = this.listeners.getListeners(ContextRepositoryListener.class);
this.logger.getKernelLogger().info(MessageFormat.format(Messages.StandardContextSpaceService_1, context.getID()));
for (final ContextRepositoryLi... | java |
protected void removeDefaultSpaceDefinition(SpaceID spaceID) {
AgentContext context = null;
synchronized (mutex()) {
context = this.contexts.remove(spaceID.getContextID());
}
if (context != null) {
fireContextDestroyed(context);
}
} | java |
public void addRequirement(String requirement) {
if (!Strings.isEmpty(requirement)) {
if (this.requirements == null) {
this.requirements = new ArrayList<>();
}
this.requirements.add(requirement);
}
} | java |
@SuppressWarnings("static-method")
protected boolean generateOptions(IStyleAppendable it) {
it.appendNl("\\newif\\ifusesarlcolors\\usesarlcolorstrue"); //$NON-NLS-1$
it.appendNl("\\DeclareOption{sarlcolors}{\\global\\usesarlcolorstrue}"); //$NON-NLS-1$
it.appendNl("\\DeclareOption{nosarlcolors}{\\global\\usesarl... | java |
@Inject
public void setKey(@Named(NetworkConfig.AES_KEY) String key) throws Exception {
final byte[] raw = key.getBytes(NetworkConfig.getStringEncodingCharset());
final int keySize = raw.length;
if ((keySize % 16) == 0 || (keySize % 24) == 0 || (keySize % 32) == 0) {
this.skeySpec = new SecretKeySpec(raw, "AE... | java |
@SuppressWarnings("static-method")
protected void getLinkForPrimitive(Content link, LinkInfo linkInfo, Type type) {
link.addContent(type.typeName());
} | java |
protected void getLinkForAnnotationType(Content link, LinkInfo linkInfo, Type type) {
link.addContent(getTypeAnnotationLinks(linkInfo));
linkInfo.type = type.asAnnotatedType().underlyingType();
link.addContent(getLink(linkInfo));
} | java |
protected void getLinkForWildcard(Content link, LinkInfo linkInfo, Type type) {
linkInfo.isTypeBound = true;
link.addContent("?"); //$NON-NLS-1$
final WildcardType wildcardType = type.asWildcardType();
final Type[] extendsBounds = wildcardType.extendsBounds();
final SARLFeatureAccess kw = Utils.getKeywords();... | java |
protected void getLinkForTypeVariable(Content link, LinkInfo linkInfo, Type type) {
link.addContent(getTypeAnnotationLinks(linkInfo));
linkInfo.isTypeBound = true;
final Doc owner = type.asTypeVariable().owner();
if ((!linkInfo.excludeTypeParameterLinks) && owner instanceof ClassDoc) {
linkInfo.classDoc = (C... | java |
protected void setBoundsLinkInfo(LinkInfo linkInfo, Type bound) {
Reflect.callProc(this, LinkFactory.class, "setBoundsLinkInfo", //$NON-NLS-1$
new Class<?>[]{LinkInfo.class, Type.class},
linkInfo, bound);
} | java |
protected Content getLinkForClass(Content link, LinkInfo linkInfo, Type type) {
if (linkInfo.isTypeBound && linkInfo.excludeTypeBoundsLinks) {
//Since we are excluding type parameter links, we should not
//be linking to the type bound.
link.addContent(type.typeName());
link.addContent(getTypeParameterLink... | java |
protected void updateLinkLabel(LinkInfo linkInfo) {
if (linkInfo.type != null && linkInfo instanceof LinkInfoImpl) {
final LinkInfoImpl impl = (LinkInfoImpl) linkInfo;
final ClassDoc classdoc = linkInfo.type.asClassDoc();
if (classdoc != null) {
final SARLFeatureAccess kw = Utils.getKeywords();
final... | java |
protected Content createProcedureLambdaLabel(LinkInfoImpl linkInfo) {
final ParameterizedType type = linkInfo.type.asParameterizedType();
if (type != null) {
final Type[] arguments = type.typeArguments();
if (arguments != null && arguments.length > 0) {
return createLambdaLabel(linkInfo, arguments, argume... | java |
@SuppressWarnings("static-method")
@Provides
@Singleton
public CompilerCommand provideSarlcCompilerCommand(Provider<SarlBatchCompiler> compiler,
Provider<SarlConfig> configuration, Provider<PathDetector> pathDetector,
Provider<ProgressBarConfig> commandConfig) {
return new CompilerCommand(compiler, configura... | java |
@SuppressWarnings("static-method")
@Provides
@Singleton
public ProgressBarConfig getProgressBarConfig(ConfigurationFactory configFactory, Injector injector) {
final ProgressBarConfig config = ProgressBarConfig.getConfiguration(configFactory);
injector.injectMembers(config);
return config;
} | java |
public static JvmType filterActiveProcessorType(JvmType type, CommonTypeComputationServices services) {
if (AccessorsProcessor.class.getName().equals(type.getQualifiedName())) {
return services.getTypeReferences().findDeclaredType(SarlAccessorsProcessor.class, type);
}
return type;
} | java |
public ImageDescriptor forAgent(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.AGENT, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | java |
public ImageDescriptor forBehavior(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.BEHAVIOR, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | java |
public ImageDescriptor forCapacity(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.CAPACITY, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | java |
public ImageDescriptor forSkill(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.SKILL, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | java |
public ImageDescriptor forEvent(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.EVENT, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | java |
public ImageDescriptor forBehaviorUnit() {
return getDecorated(getTypeImageDescriptor(
SarlElementType.BEHAVIOR_UNIT, false, false,
toFlags(JvmVisibility.PUBLIC), USE_LIGHT_ICONS), 0);
} | java |
public ImageDescriptor forStaticConstructor() {
return getDecorated(
getMethodImageDescriptor(false, toFlags(JvmVisibility.PUBLIC)),
JavaElementImageDescriptor.CONSTRUCTOR | JavaElementImageDescriptor.STATIC);
} | java |
public static URL getPomTemplateLocation() {
final URL url = Resources.getResource(NewSarlProjectWizard.class, POM_TEMPLATE_BASENAME);
assert url != null;
return url;
} | java |
protected boolean validateSARLSpecificElements(IJavaProject javaProject) {
// Check if the "SARL" generation directory is a source folder.
final IPath outputPath = SARLPreferences.getSARLOutputPathFor(javaProject.getProject());
if (outputPath == null) {
final String message = MessageFormat.format(
Messag... | java |
protected void createDefaultMavenPom(IJavaProject project, String compilerCompliance) {
// Get the template resource.
final URL templateUrl = getPomTemplateLocation();
if (templateUrl != null) {
final String compliance = Strings.isNullOrEmpty(compilerCompliance) ? SARLVersion.MINIMAL_JDK_VERSION : compilerComp... | java |
@SuppressWarnings("static-method")
protected String getDefaultMavenGroupId() {
final String userdomain = System.getenv("userdomain"); //$NON-NLS-1$
if (Strings.isNullOrEmpty(userdomain)) {
return "com.foo"; //$NON-NLS-1$
}
final String[] elements = userdomain.split(Pattern.quote(".")); //$NON-NLS-1$
final... | java |
IWorkbenchPart getActivePart() {
final IWorkbenchWindow activeWindow = getWorkbench().getActiveWorkbenchWindow();
if (activeWindow != null) {
final IWorkbenchPage activePage = activeWindow.getActivePage();
if (activePage != null) {
return activePage.getActivePart();
}
}
return null;
} | java |
public static String getCurrentClasspath() {
final StringBuilder path = new StringBuilder();
for (final URL url : getCurrentClassLoader().getURLs()) {
if (path.length() > 0) {
path.append(File.pathSeparator);
}
final File file = FileSystem.convertURLToFile(url);
if (file != null) {
path.append(f... | java |
private static URLClassLoader getCurrentClassLoader() {
synchronized (Boot.class) {
if (dynamicClassLoader == null) {
final ClassLoader cl = ClassLoader.getSystemClassLoader();
if (cl instanceof URLClassLoader) {
dynamicClassLoader = (URLClassLoader) cl;
} else {
dynamicClassLoader = URLClass... | java |
@SuppressWarnings("checkstyle:nestedifdepth")
public static void addToSystemClasspath(String entries) {
if (!Strings.isNullOrEmpty(entries)) {
final List<URL> cp = new ArrayList<>();
final String[] individualEntries = entries.split(Pattern.quote(File.pathSeparator));
for (final String entry : individualEntr... | java |
public static void main(String[] args) {
try {
Object[] freeArgs = parseCommandLine(args);
if (JanusConfig.getSystemPropertyAsBoolean(JanusConfig.JANUS_LOGO_SHOW_NAME,
JanusConfig.JANUS_LOGO_SHOW.booleanValue())) {
showJanusLogo();
}
if (freeArgs.length == 0) {
showError(Messages.Boot_3, nu... | java |
public static Options getOptions() {
final Options options = new Options();
options.addOption(CLI_OPTION_CLASSPATH_SHORT, CLI_OPTION_CLASSPATH_LONG, true,
Messages.Boot_24);
options.addOption(CLI_OPTION_EMBEDDED_SHORT, CLI_OPTION_EMBEDDED_LONG, false,
Messages.Boot_5);
options.addOption(CLI_OPTION_BO... | java |
@SuppressWarnings("checkstyle:regexp")
public static void showError(String message, Throwable exception) {
try (PrintWriter logger = new PrintWriter(getConsoleLogger())) {
if (message != null && !message.isEmpty()) {
logger.println(message);
} else if (exception != null) {
exception.printStackTrace(log... | java |
public static String getProgramName() {
String programName = JanusConfig.getSystemProperty(JanusConfig.JANUS_PROGRAM_NAME, null);
if (Strings.isNullOrEmpty(programName)) {
programName = JanusConfig.JANUS_PROGRAM_NAME_VALUE;
}
return programName;
} | java |
@SuppressWarnings("checkstyle:regexp")
public static void showDefaults() {
final Properties defaultValues = new Properties();
JanusConfig.getDefaultValues(defaultValues);
NetworkConfig.getDefaultValues(defaultValues);
try (OutputStream os = getConsoleLogger()) {
defaultValues.storeToXML(os, null);
os.flu... | java |
@SuppressWarnings({ "resource" })
public static void showClasspath() {
final String cp = getCurrentClasspath();
if (!Strings.isNullOrEmpty(cp)) {
final PrintStream ps = getConsoleLogger();
for (final String entry : cp.split(Pattern.quote(File.pathSeparator))) {
ps.println(entry);
}
ps.flush();
}
... | java |
public static void showVersion(boolean exit) {
try (PrintWriter logger = new PrintWriter(getConsoleLogger())) {
logger.println(MessageFormat.format(Messages.Boot_26, JanusVersion.JANUS_RELEASE_VERSION));
logger.println(MessageFormat.format(Messages.Boot_27, SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING));
... | java |
@SuppressWarnings("checkstyle:regexp")
public static void showCommandLineArguments(String[] args) {
try (PrintStream os = getConsoleLogger()) {
for (int i = 0; i < args.length; ++i) {
os.println(i + ": " //$NON-NLS-1$
+ args[i]);
}
os.flush();
} catch (Throwable e) {
e.printStackTrace();
}
... | java |
public static void setBootAgentTypeContextUUID() {
System.setProperty(JanusConfig.BOOT_DEFAULT_CONTEXT_ID_NAME, Boolean.TRUE.toString());
System.setProperty(JanusConfig.RANDOM_DEFAULT_CONTEXT_ID_NAME, Boolean.FALSE.toString());
} | java |
public static void setDefaultContextUUID() {
System.setProperty(JanusConfig.BOOT_DEFAULT_CONTEXT_ID_NAME, Boolean.FALSE.toString());
System.setProperty(JanusConfig.RANDOM_DEFAULT_CONTEXT_ID_NAME, Boolean.FALSE.toString());
} | java |
public static Integer getSarlClassification(ProgramElementDoc type) {
final AnnotationDesc annotation = Utils.findFirst(type.annotations(), it ->
qualifiedNameEquals(it.annotationType().qualifiedTypeName(), getKeywords().getSarlElementTypeAnnotationName()));
if (annotation != null) {
final ElementValuePair[]... | java |
public static String fixHiddenMember(String name) {
return name.replaceAll(Pattern.quote(HIDDEN_MEMBER_CHARACTER),
Matcher.quoteReplacement(HIDDEN_MEMBER_REPLACEMENT_CHARACTER));
} | java |
public static boolean qualifiedNameEquals(String s1, String s2) {
if (isNullOrEmpty(s1)) {
return isNullOrEmpty(s2);
}
if (!s1.equals(s2)) {
final String simple1 = simpleName(s1);
final String simple2 = simpleName(s2);
return simpleNameEquals(simple1, simple2);
}
return true;
} | java |
public static String simpleName(String name) {
if (name == null) {
return null;
}
final int index = name.lastIndexOf('.');
if (index > 0) {
return name.substring(index + 1);
}
return name;
} | java |
public static Throwable getCause(Throwable thr) {
Throwable cause = thr.getCause();
while (cause != null && cause != thr && cause != cause.getCause() && cause.getCause() != null) {
cause = cause.getCause();
}
return cause == null ? thr : cause;
} | java |
public static void performCopy(String filename, SarlConfiguration configuration) {
if (filename.isEmpty()) {
return;
}
try {
final DocFile fromfile = DocFile.createFileForInput(configuration, filename);
final DocPath path = DocPath.create(fromfile.getName());
final DocFile toFile = DocFile.createFile... | java |
public static <T> com.sun.tools.javac.util.List<T> emptyList() {
return com.sun.tools.javac.util.List.from(Collections.emptyList());
} | java |
@SuppressWarnings("unchecked")
public static <T> T[] toArray(T[] source, Collection<? extends T> newContent) {
final Object array = Array.newInstance(source.getClass().getComponentType(), newContent.size());
int i = 0;
for (final T element : newContent) {
Array.set(array, i, element);
++i;
}
return (T[... | java |
protected IPreferenceStoreAccess getPreferenceStoreAccess() {
if (this.preferenceStoreAccess == null) {
final Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL);
this.preferenceStoreAccess = injector.getInstance(IPreferenceStoreAccess.class);
}
return this.preferenc... | java |
public IPreferenceStore getWritablePreferenceStore(Object context) {
if (this.preferenceStore == null) {
this.preferenceStore = getPreferenceStoreAccess().getWritablePreferenceStore(context);
}
return this.preferenceStore;
} | java |
public static String getSystemProperty(String name, String defaultValue) {
String value;
value = System.getProperty(name, null);
if (value != null) {
return value;
}
value = System.getenv(name);
if (value != null) {
return value;
}
... | java |
public static boolean getSystemPropertyAsBoolean(String name, boolean defaultValue) {
final String value = getSystemProperty(name, null);
if (value != null) {
try {
return Boolean.parseBoolean(value);
} catch (Throwable exception) {
//
... | java |
public static float getSystemPropertyAsFloat(String name, float defaultValue) {
final String value = getSystemProperty(name, null);
if (value != null) {
try {
return Float.parseFloat(value);
} catch (Throwable exception) {
//
}
... | java |
public static <S extends Enum<S>> S getSystemPropertyAsEnum(Class<S> type, String name) {
return getSystemPropertyAsEnum(type, name, null);
} | java |
protected boolean isSarlFile(IPackageFragment packageFragment, String filename) {
if (isFileExists(packageFragment, filename, this.sarlFileExtension)) {
return true;
}
final IJavaProject project = getPackageFragmentRoot().getJavaProject();
if (project != null) {
try {
final String packageName = packag... | java |
protected static boolean isFileExists(IPackageFragment packageFragment, String filename, String extension) {
if (packageFragment != null) {
final IResource resource = packageFragment.getResource();
if (resource instanceof IFolder) {
final IFolder folder = (IFolder) resource;
if (folder.getFile(filename ... | java |
protected void init(IStructuredSelection selection) {
final IJavaElement elem = this.fieldInitializer.getSelectedResource(selection);
initContainerPage(elem);
initTypePage(elem);
//
try {
getRootSuperType();
reinitSuperClass();
} catch (Throwable exception) {
//
}
//
try {
getRootSuperInte... | java |
protected Composite createCommonControls(Composite parent) {
initializeDialogUnits(parent);
final Composite composite = SWTFactory.createComposite(
parent,
parent.getFont(),
COLUMNS, 1,
GridData.FILL_HORIZONTAL);
createContainerControls(composite, COLUMNS);
createPackageControls(composite, COLUM... | java |
protected final int asyncCreateType() {
final int[] size = {0};
final IRunnableWithProgress op = new WorkspaceModifyOperation() {
@Override
protected void execute(IProgressMonitor monitor)
throws CoreException, InvocationTargetException, InterruptedException {
size[0] = createSARLType(monitor);
}
... | java |
protected void readSettings() {
boolean createConstructors = false;
boolean createUnimplemented = true;
boolean createEventHandlers = true;
boolean createLifecycleFunctions = true;
final IDialogSettings dialogSettings = getDialogSettings();
if (dialogSettings != null) {
final IDialogSettings section = di... | java |
protected void saveSettings() {
final IDialogSettings dialogSettings = getDialogSettings();
if (dialogSettings != null) {
IDialogSettings section = dialogSettings.getSection(getName());
if (section == null) {
section = dialogSettings.addNewSection(getName());
}
section.put(SETTINGS_CREATECONSTR, isC... | java |
protected void createMethodStubControls(Composite composite, int columns,
boolean enableConstructors, boolean enableInherited, boolean defaultEvents,
boolean lifecycleFunctions) {
this.isConstructorCreationEnabled = enableConstructors;
this.isInheritedCreationEnabled = enableInherited;
this.isDefaultEventGe... | java |
protected boolean isCreateStandardEventHandlers() {
int idx = 0;
if (this.isConstructorCreationEnabled) {
++idx;
}
if (this.isInheritedCreationEnabled) {
++idx;
}
return this.isDefaultEventGenerated && this.methodStubsButtons.isSelected(idx);
} | java |
protected boolean isCreateStandardLifecycleFunctions() {
int idx = 0;
if (this.isConstructorCreationEnabled) {
++idx;
}
if (this.isInheritedCreationEnabled) {
++idx;
}
if (this.isDefaultEventGenerated) {
++idx;
}
return this.isDefaultLifecycleFunctionsGenerated && this.methodStubsButtons.isSele... | java |
protected void setMethodStubSelection(boolean createConstructors, boolean createInherited,
boolean createEventHandlers, boolean createLifecycleFunctions, boolean canBeModified) {
if (this.methodStubsButtons != null) {
int idx = 0;
if (this.isConstructorCreationEnabled) {
this.methodStubsButtons.setSelect... | java |
@SuppressWarnings("static-method")
protected AbstractSuperTypeSelectionDialog<?> createSuperClassSelectionDialog(
Shell parent, IRunnableContext context, IJavaProject project, SarlSpecificTypeSelectionExtension extension,
boolean multi) {
return null;
} | java |
protected boolean createStandardSARLEventTemplates(String elementTypeName,
Function1<? super String, ? extends ISarlBehaviorUnitBuilder> behaviorUnitAdder,
Procedure1<? super String> usesAdder) {
if (!isCreateStandardEventHandlers()) {
return false;
}
Object type;
try {
type = getTypeFinder().findTy... | java |
protected boolean createStandardSARLLifecycleFunctionTemplates(String elementTypeName,
Function1<? super String, ? extends ISarlActionBuilder> actionAdder,
Procedure1<? super String> usesAdder) {
if (!isCreateStandardLifecycleFunctions()) {
return false;
}
usesAdder.apply(LOGGING_CAPACITY_NAME);
ISar... | java |
public static IProject getProject(Resource resource) {
ProjectAdapter adapter = (ProjectAdapter) EcoreUtil.getAdapter(resource.getResourceSet().eAdapters(), ProjectAdapter.class);
if (adapter == null) {
final String platformString = resource.getURI().toPlatformString(true);
final IProject project = ResourcesP... | java |
protected MavenImportWizardPage getMavenImportWizardPage() {
if (this.mainPageBuffer == null) {
try {
final Field field = MavenImportWizard.class.getDeclaredField("page"); //$NON-NLS-1$
field.setAccessible(true);
this.mainPageBuffer = (MavenImportWizardPage) field.get(this);
} catch (Exception excep... | java |
protected WorkspaceJob createImportJob(Collection<MavenProjectInfo> projects) {
final WorkspaceJob job = new ImportMavenSarlProjectsJob(projects, this.workingSets, this.importConfiguration);
job.setRule(MavenPlugin.getProjectConfigurationManager().getRule());
return job;
} | java |
public static Version parseVersion(String version) {
if (!Strings.isNullOrEmpty(version)) {
try {
return Version.parseVersion(version);
} catch (Throwable exception) {
//
}
}
return null;
} | java |
public static int compareVersionToRange(Version version, Version minVersion, Version maxVersion) {
assert minVersion == null || maxVersion == null || minVersion.compareTo(maxVersion) < 0;
if (version == null) {
return Integer.MIN_VALUE;
}
if (minVersion != null && compareVersionsNoQualifier(version, minVersi... | java |
public static <T> int compareTo(Comparable<T> object1, T object2) {
if (object1 == object2) {
return 0;
}
if (object1 == null) {
return Integer.MIN_VALUE;
}
if (object2 == null) {
return Integer.MAX_VALUE;
}
assert object1 != null && object2 != null;
return object1.compareTo(object2);
} | java |
public static String getNameWithTypeParameters(IType type) {
assert type != null;
final String superName = type.getFullyQualifiedName('.');
if (!JavaModelUtil.is50OrHigher(type.getJavaProject())) {
return superName;
}
try {
final ITypeParameter[] typeParameters = type.getTypeParameters();
if (typePar... | java |
public static IClasspathEntry newLibraryEntry(Bundle bundle, IPath precomputedBundlePath, BundleURLMappings javadocURLs) {
assert bundle != null;
final IPath bundlePath;
if (precomputedBundlePath == null) {
bundlePath = BundleUtil.getBundlePath(bundle);
} else {
bundlePath = precomputedBundlePath;
}
f... | java |
@SuppressWarnings("static-method")
protected BQRuntime createRuntime(String... args) {
SARLStandaloneSetup.doPreSetup();
final BQRuntime runtime = Bootique.app(args).autoLoadModules().createRuntime();
SARLStandaloneSetup.doPostSetup(runtime.getInstance(Injector.class));
return runtime;
} | java |
public int runCompiler(String... args) {
try {
final BQRuntime runtime = createRuntime(args);
final CommandOutcome outcome = runtime.run();
if (!outcome.isSuccess() && outcome.getException() != null) {
Logger.getRootLogger().error(outcome.getMessage(), outcome.getException());
}
return outcome.getE... | java |
public List<HelpOption> getOptions() {
final BQRuntime runtime = createRuntime();
final ApplicationMetadata application = runtime.getInstance(ApplicationMetadata.class);
final HelpOptions helpOptions = new HelpOptions();
application.getCommands().forEach(c -> {
helpOptions.add(c.asOption());
c.getOptions... | java |
protected void addAnnotations(ExecutableMemberDoc member, Content htmlTree) {
WriterUtils.addAnnotations(member, htmlTree, this.configuration, this.writer);
} | java |
public static void setCurrentPreferenceKey(String key) {
LOCK.lock();
try {
currentPreferenceKey = (Strings.isNullOrEmpty(key)) ? DEFAULT_PREFERENCE_KEY : key;
} finally {
LOCK.unlock();
}
} | java |
public static void fireSREChanged(PropertyChangeEvent event) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).sreChanged(event);
}
} | java |
public static void fireSREAdded(ISREInstall installation) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).sreAdded(installation);
}
} | java |
public static void fireSRERemoved(ISREInstall installation) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).sreRemoved(installation);
}
} | java |
public static ISREInstall getSREFromId(String id) {
if (Strings.isNullOrEmpty(id)) {
return null;
}
initializeSREs();
LOCK.lock();
try {
return ALL_SRE_INSTALLS.get(id);
} finally {
LOCK.unlock();
}
} | java |
@SuppressWarnings("checkstyle:npathcomplexity")
public static void setSREInstalls(ISREInstall[] sres, IProgressMonitor monitor) throws CoreException {
final SubMonitor mon = SubMonitor.convert(monitor,
io.sarl.eclipse.runtime.Messages.SARLRuntime_0,
sres.length * 2 + ALL_SRE_INSTALLS.size());
initializeSRE... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.