code
stringlengths
73
34.1k
label
stringclasses
1 value
protected void generateJvmElements(ResourceSet resourceSet, IProgressMonitor progress) { assert progress != null; progress.subTask(Messages.SarlBatchCompiler_21); getLogger().info(Messages.SarlBatchCompiler_21); final List<Resource> originalResources = resourceSet.getResources(); final List<Resource> toBeRes...
java
@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity", "checkstyle:nestedifdepth"}) protected List<Issue> validate(ResourceSet resourceSet, Collection<Resource> validResources, IProgressMonitor progress) { assert progress != null; progress.subTask(Messages.SarlBatchCompiler_38); getL...
java
@SuppressWarnings("static-method") protected boolean isSourceFile(Resource resource) { if (resource instanceof BatchLinkableResource) { return !((BatchLinkableResource) resource).isLoadedFromStorage(); } return false; }
java
protected boolean preCompileStubs(File sourceDirectory, File classDirectory, IProgressMonitor progress) { assert progress != null; progress.subTask(Messages.SarlBatchCompiler_50); return runJavaCompiler(classDirectory, Collections.singletonList(sourceDirectory), getClassPath(), false, false, progress); }
java
protected boolean preCompileJava(File sourceDirectory, File classDirectory, IProgressMonitor progress) { assert progress != null; progress.subTask(Messages.SarlBatchCompiler_51); return runJavaCompiler(classDirectory, getSourcePaths(), Iterables.concat(Collections.singleton(sourceDirectory), getClassPath()), ...
java
protected boolean postCompileJava(IProgressMonitor progress) { assert progress != null; progress.subTask(Messages.SarlBatchCompiler_52); final File classOutputPath = getClassOutputPath(); if (classOutputPath == null) { getLogger().info(Messages.SarlBatchCompiler_24); return true; } getLogger().info(Me...
java
@SuppressWarnings({ "resource" }) protected boolean runJavaCompiler(File classDirectory, Iterable<File> sourcePathDirectories, Iterable<File> classPathEntries, boolean enableCompilerOutput, boolean enableOptimization, IProgressMonitor progress) { String encoding = this.encodingProvider.getDefaultEncoding(); ...
java
protected File createStubs(ResourceSet resourceSet, IProgressMonitor progress) { assert progress != null; progress.subTask(Messages.SarlBatchCompiler_53); final File outputDirectory = createTempDir(STUB_FOLDER_PREFIX); if (progress.isCanceled()) { return null; } if (getLogger().isDebugEnabled()) { get...
java
protected void loadSARLFiles(ResourceSet resourceSet, IProgressMonitor progress) { assert progress != null; progress.subTask(Messages.SarlBatchCompiler_54); this.encodingProvider.setDefaultEncoding(getFileEncoding()); final NameBasedFilter nameBasedFilter = new NameBasedFilter(); nameBasedFilter.setExtension(...
java
protected File createTempDir(String namePrefix) { final File tempDir = new File(getTempDirectory(), namePrefix); cleanFolder(tempDir, ACCEPT_ALL_FILTER, true, true); if (!tempDir.mkdirs()) { throw new RuntimeException(MessageFormat.format(Messages.SarlBatchCompiler_8, tempDir.getAbsolutePath())); } this.te...
java
protected boolean cleanFolder(File parentFolder, FileFilter filter, boolean continueOnError, boolean deleteParentFolder) { try { if (getLogger().isDebugEnabled()) { getLogger().debug(Messages.SarlBatchCompiler_9, parentFolder.toString()); } return Files.cleanFolder(parentFolder, null, continueOnError,...
java
protected boolean checkConfiguration(IProgressMonitor progress) { assert progress != null; progress.subTask(Messages.SarlBatchCompiler_55); final File output = getOutputPath(); if (getLogger().isDebugEnabled()) { getLogger().debug(Messages.SarlBatchCompiler_35, output); } if (output == null) { reportI...
java
@SuppressWarnings("static-method") protected ClassLoader createClassLoader(Iterable<File> jarsAndFolders, ClassLoader parentClassLoader) { return new URLClassLoader(Iterables.toArray(Iterables.transform(jarsAndFolders, from -> { try { final URL url = from.toURI().toURL(); assert url != null; return ur...
java
protected void destroyClassLoader(ClassLoader classLoader) { if (classLoader instanceof Closeable) { try { ((Closeable) classLoader).close(); } catch (Exception e) { reportInternalWarning(Messages.SarlBatchCompiler_18, e); } } }
java
public void setWarningSeverity(String warningId, Severity severity) { if (!Strings.isEmpty(warningId) && severity != null) { this.issueSeverityProvider.setSeverity(warningId, severity); } }
java
protected EventListener addListener(ADDRESST key, EventListener value) { synchronized (mutex()) { return this.listeners.put(key, value); } }
java
protected SynchronizedSet<ADDRESST> getAdresses() { final Object mutex = mutex(); synchronized (mutex) { return Collections3.synchronizedSet(this.listeners.keySet(), mutex); } }
java
public SynchronizedCollection<EventListener> getListeners() { final Object mutex = mutex(); synchronized (mutex) { return Collections3.synchronizedCollection(this.listeners.values(), mutex); } }
java
protected Set<Entry<ADDRESST, EventListener>> listenersEntrySet() { final Object mutex = mutex(); synchronized (mutex) { return Collections3.synchronizedSet(this.listeners.entrySet(), mutex); } }
java
private void searchAndLaunch(String mode, Object... scope) { final ElementDescription element = searchAndSelect(true, scope); if (element != null) { try { launch(element.projectName, element.elementName, mode); } catch (CoreException e) { SARLEclipsePlugin.getDefault().openError(getShell(), io.s...
java
protected void launch(String projectName, String fullyQualifiedName, String mode) throws CoreException { final List<ILaunchConfiguration> configs = getCandidates(projectName, fullyQualifiedName); ILaunchConfiguration config = null; final int count = configs.size(); if (count == 1) { config = configs.get(0...
java
@Pure protected URI computeUnusedUri(ResourceSet resourceSet) { String name = "__synthetic"; for (int i = 0; i < Integer.MAX_VALUE; ++i) { URI syntheticUri = URI.createURI(name + i + "." + getScriptFileExtension()); if (resourceSet.getResource(syntheticUri, false) == null) { return syntheticUri; } }...
java
@Pure protected Resource createResource(ResourceSet resourceSet) { URI uri = computeUnusedUri(resourceSet); Resource resource = getResourceFactory().createResource(uri); resourceSet.getResources().add(resource); return resource; }
java
@Pure protected Injector getInjector() { if (this.builderInjector == null) { ImportManager importManager = this.importManagerProvider.get(); this.builderInjector = createOverridingInjector(this.originalInjector, new CodeBuilderModule(importManager)); } return builderInjector; }
java
@Pure public IExpressionBuilder getGuard() { IExpressionBuilder exprBuilder = this.expressionProvider.get(); exprBuilder.eInit(getSarlBehaviorUnit(), new Procedures.Procedure1<XExpression>() { public void apply(XExpression expr) { getSarlBehaviorUnit().setGuard(expr); } }, getTypeResolutionContext(...
java
public IBlockExpressionBuilder getExpression() { IBlockExpressionBuilder block = this.blockExpressionProvider.get(); block.eInit(getTypeResolutionContext()); XBlockExpression expr = block.getXBlockExpression(); this.sarlBehaviorUnit.setExpression(expr); return block; }
java
protected IStatus validateNameAgainstOtherSREs(String name) { IStatus nameStatus = SARLEclipsePlugin.getDefault().createOkStatus(); if (isDuplicateName(name)) { nameStatus = SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR, ISREInstall.CODE_NAME, Messages.SREInstallWizard_1); } else { fin...
java
protected void setPageStatus(IStatus status) { this.status = status == null ? SARLEclipsePlugin.getDefault().createOkStatus() : status; }
java
private boolean isDuplicateName(String name) { if (this.existingNames != null) { final String newName = Strings.nullToEmpty(name); for (final String existingName : this.existingNames) { if (newName.equals(existingName)) { return true; } } } return false; }
java
void setExistingNames(String... names) { this.existingNames = names; for (int i = 0; i < this.existingNames.length; ++i) { this.existingNames[i] = Strings.nullToEmpty(this.existingNames[i]); } }
java
protected void updatePageStatus() { if (this.status.isOK()) { setMessage(null, IMessageProvider.NONE); } else { switch (this.status.getSeverity()) { case IStatus.ERROR: setMessage(this.status.getMessage(), IMessageProvider.ERROR); break; case IStatus.INFO: setMessage(this.status.getMessage()...
java
public String toActionId() { final StringBuilder b = new StringBuilder(); b.append(getActionName()); for (final String type : this.signature) { b.append("_"); //$NON-NLS-1$ for (final char c : type.replaceAll("(\\[\\])|\\*", "Array").toCharArray()) { //$NON-NLS-1$//$NON-NLS-2$ if (Character.isJavaIdenti...
java
public final void emit(UUID eventSource, Event event, Scope<Address> scope) { assert event != null; ensureEventSource(eventSource, event); assert getSpaceID().equals(event.getSource().getSpaceID()) : "The source address must belong to this space"; //$NON-NLS-1$ try { final Scope<Address> scopeInstance = (sco...
java
protected void ensureEventSource(UUID eventSource, Event event) { if (event.getSource() == null) { if (eventSource != null) { event.setSource(new Address(getSpaceID(), eventSource)); } else { throw new AssertionError("Every event must have a source"); //$NON-NLS-1$ } } }
java
protected void doEmit(Event event, Scope<? super Address> scope) { assert scope != null; assert event != null; final UniqueAddressParticipantRepository<Address> particips = getParticipantInternalDataStructure(); final SynchronizedCollection<EventListener> listeners = particips.getListeners(); synchronized (li...
java
public static Object undelegate(Object object) { Object obj = object; while (obj instanceof Delegator) { obj = ((Delegator<?>) obj).getDelegatedObject(); } return obj; }
java
protected void formatRegion(IXtextDocument document, int offset, int length) { try { final int startLineIndex = document.getLineOfOffset(previousSiblingChar(document, offset)); final int endLineIndex = document.getLineOfOffset(offset + length); int regionLength = 0; for (int i = startLineIndex; i <= endLi...
java
@Pure public static ServiceLoader<SREBootstrap> getServiceLoader(boolean onlyInstalledInJRE) { synchronized (SRE.class) { ServiceLoader<SREBootstrap> sl = loader == null ? null : loader.get(); if (sl == null) { if (onlyInstalledInJRE) { sl = ServiceLoader.loadInstalled(SREBootstrap.class); } el...
java
public static Set<URL> getBootstrappedLibraries() { final String name = PREFIX + SREBootstrap.class.getName(); final Set<URL> result = new TreeSet<>(); try { final Enumeration<URL> enumr = ClassLoader.getSystemResources(name); while (enumr.hasMoreElements()) { final URL url = enumr.nextElement(); if...
java
@Pure public static SREBootstrap getBootstrap() { synchronized (SRE.class) { if (currentSRE == null) { final Iterator<SREBootstrap> iterator = getServiceLoader().iterator(); if (iterator.hasNext()) { currentSRE = iterator.next(); } else { currentSRE = new VoidSREBootstrap(); } } re...
java
protected String _signature(XCastedExpression castExpression, boolean typeAtEnd) { if (castExpression instanceof SarlCastedExpression) { final JvmOperation delegate = ((SarlCastedExpression) castExpression).getFeature(); if (delegate != null) { return _signature(delegate, typeAtEnd); } } return Messa...
java
protected String getTypeName(JvmType type) { if (type != null) { if (type instanceof JvmDeclaredType) { final ITypeReferenceOwner owner = new StandardTypeReferenceOwner(this.services, type); return owner.toLightweightTypeReference(type).getHumanReadableName(); } return type.getSimpleName(); } ret...
java
protected static ISREInstall getSREInstallFor(ILaunchConfiguration configuration, ILaunchConfigurationAccessor configAccessor, IJavaProjectAccessor projectAccessor) throws CoreException { assert configAccessor != null; assert projectAccessor != null; final ISREInstall sre; if (configAccessor.getUseProject...
java
private static ISREInstall getProjectSpecificSRE(ILaunchConfiguration configuration, boolean verify, IJavaProjectAccessor projectAccessor) throws CoreException { assert projectAccessor != null; final IJavaProject jprj = projectAccessor.get(configuration); if (jprj != null) { final IProject prj = jprj.getPro...
java
protected static String join(String... values) { final StringBuilder buffer = new StringBuilder(); for (final String value : values) { if (!Strings.isNullOrEmpty(value)) { if (buffer.length() > 0) { buffer.append(" "); //$NON-NLS-1$ } buffer.append(value); } } return buffer.toString(); }
java
private IRuntimeClasspathEntry[] getOrComputeUnresolvedSARLRuntimeClasspath(ILaunchConfiguration configuration) throws CoreException { // Get the buffered entries IRuntimeClasspathEntry[] entries = null; synchronized (this) { if (this.unresolvedClasspathEntries != null) { entries = this.unresolvedClassp...
java
public static IRuntimeClasspathEntry[] computeUnresolvedSARLRuntimeClasspath(ILaunchConfiguration configuration, ILaunchConfigurationAccessor configAccessor, IJavaProjectAccessor projectAccessor) throws CoreException { // Get the classpath from the configuration. final IRuntimeClasspathEntry[] entries = JavaR...
java
private static List<IRuntimeClasspathEntry> getSREClasspathEntries( ILaunchConfiguration configuration, ILaunchConfigurationAccessor configAccessor, IJavaProjectAccessor projectAccessor) throws CoreException { final ISREInstall sre = getSREInstallFor(configuration, configAccessor, projectAccessor); return ...
java
private static boolean isNotSREEntry(IRuntimeClasspathEntry entry) { try { final File file = new File(entry.getLocation()); if (file.isDirectory()) { return !SARLRuntime.isUnpackedSRE(file); } else if (file.canRead()) { return !SARLRuntime.isPackedSRE(file); } } catch (Throwable e) { SARLEcli...
java
@SuppressWarnings("static-method") protected Runnable createTask(Runnable runnable) { if (runnable instanceof JanusRunnable) { return runnable; } return new JanusRunnable(runnable); }
java
@SuppressWarnings("static-method") protected <T> Callable<T> createTask(Callable<T> callable) { if (callable instanceof JanusCallable<?>) { return callable; } return new JanusCallable<>(callable); }
java
protected void verifyAgentName(ILaunchConfiguration configuration) throws CoreException { final String name = getAgentName(configuration); if (name == null) { abort( io.sarl.eclipse.launching.dialog.Messages.MainLaunchConfigurationTab_2, null, SARLEclipseConfig.ERR_UNSPECIFIED_AGENT_NAME); } }
java
public ISarlInterfaceBuilder addSarlInterface(String name) { ISarlInterfaceBuilder builder = this.iSarlInterfaceBuilderProvider.get(); builder.eInit(getSarlAgent(), name, getTypeResolutionContext()); return builder; }
java
public ISarlEnumerationBuilder addSarlEnumeration(String name) { ISarlEnumerationBuilder builder = this.iSarlEnumerationBuilderProvider.get(); builder.eInit(getSarlAgent(), name, getTypeResolutionContext()); return builder; }
java
public ISarlAnnotationTypeBuilder addSarlAnnotationType(String name) { ISarlAnnotationTypeBuilder builder = this.iSarlAnnotationTypeBuilderProvider.get(); builder.eInit(getSarlAgent(), name, getTypeResolutionContext()); return builder; }
java
public void removeTask(AgentTask task) { final Iterator<WeakReference<AgentTask>> iterator = this.tasks.iterator(); while (iterator.hasNext()) { final WeakReference<AgentTask> reference = iterator.next(); final AgentTask knownTask = reference.get(); if (knownTask == null) { iterator.remove(); } else...
java
public void bind(Class<?> type, Class<? extends SARLSemanticModification> modification) { this.modificationTypes.put(type, modification); }
java
@SuppressWarnings("static-method") protected Boolean _generate(CharSequence expression, XExpression parentExpression, XtendExecutable feature, InlineAnnotationTreeAppendable output) { output.appendStringConstant(expression.toString()); return Boolean.TRUE; }
java
@SuppressWarnings("static-method") protected Boolean _generate(Number expression, XExpression parentExpression, XtendExecutable feature, InlineAnnotationTreeAppendable output) { final Class<?> type = ReflectionUtil.getRawType(expression.getClass()); if (Byte.class.equals(type) || byte.class.equals(type)) { o...
java
@SuppressWarnings("static-method") protected Boolean _generate(XBooleanLiteral expression, XExpression parentExpression, XtendExecutable feature, InlineAnnotationTreeAppendable output) { output.appendConstant(Boolean.toString(expression.isIsTrue())); return Boolean.TRUE; }
java
protected Boolean _generate(XNullLiteral expression, XExpression parentExpression, XtendExecutable feature, InlineAnnotationTreeAppendable output) { if (parentExpression == null && feature instanceof XtendFunction) { final XtendFunction function = (XtendFunction) feature; output.append("("); //$NON-NLS-1$ ...
java
@SuppressWarnings("static-method") protected Boolean _generate(XNumberLiteral expression, XExpression parentExpression, XtendExecutable feature, InlineAnnotationTreeAppendable output) { output.appendConstant(expression.getValue()); return Boolean.TRUE; }
java
@SuppressWarnings("static-method") protected Boolean _generate(XStringLiteral expression, XExpression parentExpression, XtendExecutable feature, InlineAnnotationTreeAppendable output) { output.appendStringConstant(expression.getValue()); return Boolean.TRUE; }
java
@SuppressWarnings("static-method") protected Boolean _generate(XTypeLiteral expression, XExpression parentExpression, XtendExecutable feature, InlineAnnotationTreeAppendable output) { output.appendTypeConstant(expression.getType()); return Boolean.TRUE; }
java
protected Boolean _generate(XCastedExpression expression, XExpression parentExpression, XtendExecutable feature, InlineAnnotationTreeAppendable output) { final InlineAnnotationTreeAppendable child = newAppendable(output.getImportManager()); boolean bool = generate(expression.getTarget(), expression, feature, chi...
java
protected Boolean _generate(XReturnExpression expression, XExpression parentExpression, XtendExecutable feature, InlineAnnotationTreeAppendable output) { return generate(expression.getExpression(), parentExpression, feature, output); }
java
public void getExportedPackages(Set<String> exportedPackages) { if (exportedPackages != null) { exportedPackages.add(getCodeElementExtractor().getBasePackage()); exportedPackages.add(getCodeElementExtractor().getBuilderPackage()); if (getCodeBuilderConfig().isISourceAppendableEnable()) { exportedPackages...
java
@Pure protected String getLanguageScriptMemberGetter() { final Grammar grammar = getGrammar(); final AbstractRule scriptRule = GrammarUtil.findRuleForName(grammar, getCodeBuilderConfig().getScriptRuleName()); for (final Assignment assignment : GrammarUtil.containedAssignments(scriptRule)) { if ((assignment.ge...
java
@Pure protected TypeReference getXFactoryFor(TypeReference type) { final String packageName = type.getPackageName(); final Grammar grammar = getGrammar(); TypeReference reference = getXFactoryFor(packageName, grammar); if (reference != null) { return reference; } for (final Grammar usedGrammar : Gramma...
java
@SuppressWarnings("static-method") protected StringConcatenationClient generateAppenderMembers(String appenderSimpleName, TypeReference builderInterface, String elementAccessor) { return new StringConcatenationClient() { @Override protected void appendTo(TargetStringConcatenation it) { it.append("\tpriv...
java
protected static String getAorAnArticle(String word) { if (Arrays.asList('a', 'e', 'i', 'o', 'u', 'y').contains(Character.toLowerCase(word.charAt(0)))) { return "an"; //$NON-NLS-1$ } return "a"; //$NON-NLS-1$ }
java
protected static String toSingular(String word) { if (word.endsWith("ies")) { //$NON-NLS-1$ return word.substring(0, word.length() - 3) + "y"; //$NON-NLS-1$ } if (word.endsWith("s")) { //$NON-NLS-1$ return word.substring(0, word.length() - 1); } return word; }
java
protected static boolean nameMatches(EObject element, String pattern) { if (element instanceof RuleCall) { return nameMatches(((RuleCall) element).getRule(), pattern); } if (element instanceof AbstractRule) { final String name = ((AbstractRule) element).getName(); final Pattern compilerPattern = Pattern....
java
protected void bindElementDescription(BindingFactory factory, CodeElementExtractor.ElementDescription... descriptions) { for (final CodeElementExtractor.ElementDescription description : descriptions) { bindTypeReferences(factory, description.getBuilderInterfaceType(), description.getBuilderImplementation...
java
protected void bindTypeReferences(BindingFactory factory, TypeReference interfaceType, TypeReference implementationType, TypeReference customImplementationType) { final IFileSystemAccess2 fileSystem = getSrc(); final TypeReference type; if ((fileSystem.isFile(implementationType.getJavaPath())) || (fileSyst...
java
protected AbstractRule getMemberRule(CodeElementExtractor.ElementDescription description) { for (final Assignment assignment : GrammarUtil.containedAssignments(description.getGrammarComponent())) { if (Objects.equals(getCodeBuilderConfig().getMemberCollectionExtensionGrammarName(), assignment.getFeature())) { ...
java
public String getConfig(String key) throws MojoExecutionException { ResourceBundle resource = null; try { resource = ResourceBundle.getBundle( "io/sarl/maven/compiler/config", //$NON-NLS-1$ java.util.Locale.getDefault(), MavenHelper.class.getClassLoader()); } catch (MissingResourceException e) {...
java
public PluginDescriptor loadPlugin(Plugin plugin) throws MojoExecutionException { try { final Object repositorySessionObject = this.getRepositorySessionMethod.invoke(this.session); return (PluginDescriptor) this.loadPluginMethod.invoke( this.buildPluginManager, plugin, getSession().getCurrentP...
java
public void executeMojo(MojoExecution mojo) throws MojoExecutionException, MojoFailureException { try { this.buildPluginManager.executeMojo(this.session, mojo); } catch (PluginConfigurationException | PluginManagerException e) { throw new MojoFailureException(e.getLocalizedMessage(), e); } }
java
@SuppressWarnings("static-method") public Dependency toDependency(Artifact artifact) { final Dependency result = new Dependency(); result.setArtifactId(artifact.getArtifactId()); result.setClassifier(artifact.getClassifier()); result.setGroupId(artifact.getGroupId()); result.setOptional(artifact.isOptional()...
java
public synchronized Map<String, Dependency> getPluginDependencies() throws MojoExecutionException { if (this.pluginDependencies == null) { final String groupId = getConfig("plugin.groupId"); //$NON-NLS-1$ final String artifactId = getConfig("plugin.artifactId"); //$NON-NLS-1$ final String pluginArtifactKey =...
java
public Set<Artifact> resolve(String groupId, String artifactId) throws MojoExecutionException { final ArtifactResolutionRequest request = new ArtifactResolutionRequest(); request.setResolveRoot(true); request.setResolveTransitively(true); request.setLocalRepository(getSession().getLocalRepository()); request....
java
public Artifact createArtifact(String groupId, String artifactId) { return this.repositorySystem.createArtifact(groupId, artifactId, "RELEASE", "jar"); //$NON-NLS-1$ //$NON-NLS-2$ }
java
public Set<Artifact> resolveDependencies(String artifactId, boolean plugins) throws MojoExecutionException { final Artifact pluginArtifact; if (plugins) { pluginArtifact = getSession().getCurrentProject().getPluginArtifactMap().get(artifactId); } else { pluginArtifact = getSession().getCurrentProject().getA...
java
public String getPluginDependencyVersion(String groupId, String artifactId) throws MojoExecutionException { final Map<String, Dependency> deps = getPluginDependencies(); final String key = ArtifactUtils.versionlessKey(groupId, artifactId); this.log.debug("COMPONENT DEPENDENCIES(getPluginVersionFromDependencies):"...
java
@SuppressWarnings("static-method") public Xpp3Dom toXpp3Dom(String content, Log logger) { if (content != null && !content.isEmpty()) { try (StringReader sr = new StringReader(content)) { return Xpp3DomBuilder.build(sr); } catch (Exception exception) { if (logger != null) { logger.debug(exception);...
java
@SuppressWarnings("static-method") @Provides @Singleton public IJavaBatchCompiler providesJavaBatchCompiler(Injector injector, Provider<SarlConfig> config) { final SarlConfig cfg = config.get(); final IJavaBatchCompiler compiler = cfg.getCompiler().getJavaCompiler().newCompilerInstance(); injector.injectMember...
java
private static void uninstallSkillsPreStage(Iterable<? extends Skill> skills) { try { // Use reflection to ignore the "private/protected" access right. for (final Skill s : skills) { SREutils.doSkillUninstallation(s, UninstallationStage.PRE_DESTROY_EVENT); } } catch (RuntimeException e) { throw e; ...
java
private static void uninstallSkillsFinalStage(Iterable<? extends Skill> skills) { try { // Use reflection to ignore the "private/protected" access right. for (final Skill s : skills) { SREutils.doSkillUninstallation(s, UninstallationStage.POST_DESTROY_EVENT); } } catch (RuntimeException e) { throw e...
java
protected void fireKernelDiscovered(URI uri) { this.logger.getKernelLogger().info(MessageFormat.format(Messages.HazelcastKernelDiscoveryService_0, uri, getCurrentKernel())); for (final KernelDiscoveryServiceListener listener : this.listeners.getListeners(KernelDiscoveryServiceListener.class)) { listener.kernelDi...
java
protected void fireKernelDisconnected(URI uri) { this.logger.getKernelLogger().info(MessageFormat.format(Messages.HazelcastKernelDiscoveryService_1, uri, getCurrentKernel())); for (final KernelDiscoveryServiceListener listener : this.listeners.getListeners(KernelDiscoveryServiceListener.class)) { listener.kernel...
java
public static SarlConfig getConfiguration(ConfigurationFactory configFactory) { assert configFactory != null; return configFactory.config(SarlConfig.class, PREFIX); }
java
protected static File unix2os(String filename) { File file = null; for (final String base : filename.split(Pattern.quote("/"))) { //$NON-NLS-1$ if (file == null) { file = new File(base); } else { file = new File(file, base); } } return file; }
java
protected File makeAbsolute(File file) { if (!file.isAbsolute()) { final File basedir = this.mavenHelper.getSession().getCurrentProject().getBasedir(); return new File(basedir, file.getPath()).getAbsoluteFile(); } return file; }
java
protected void executeMojo( String groupId, String artifactId, String version, String goal, String configuration, Dependency... dependencies) throws MojoExecutionException, MojoFailureException { final Plugin plugin = new Plugin(); plugin.setArtifactId(artifactId); plugin.setGroupId(groupId); plugin...
java
protected String internalExecute() { getLog().info(Messages.AbstractDocumentationMojo_1); final Map<File, File> files = getFiles(); getLog().info(MessageFormat.format(Messages.AbstractDocumentationMojo_2, files.size())); return internalExecute(files); }
java
protected String formatErrorMessage(File inputFile, Throwable exception) { File filename; int lineno = 0; final boolean addExceptionName; if (exception instanceof ParsingException) { addExceptionName = false; final ParsingException pexception = (ParsingException) exception; final File file = pexception...
java
@SuppressWarnings("checkstyle:npathcomplexity") protected AbstractMarkerLanguageParser createLanguageParser(File inputFile) throws MojoExecutionException, IOException { final AbstractMarkerLanguageParser parser; if (isFileExtension(inputFile, MarkdownParser.MARKDOWN_FILE_EXTENSIONS)) { parser = this.injector.ge...
java
protected Map<File, File> getFiles() { final Map<File, File> files = new TreeMap<>(); for (final String rootName : this.inferredSourceDirectories) { File root = FileSystem.convertStringToFile(rootName); if (!root.isAbsolute()) { root = FileSystem.makeAbsolute(root, this.baseDirectory); } getLog().de...
java
protected static String toPackageName(String rootPackage, File packageName) { final StringBuilder name = new StringBuilder(); File tmp = packageName; while (tmp != null) { final String elementName = tmp.getName(); if (!Strings.equal(FileSystem.CURRENT_DIRECTORY, elementName) && !Strings.equal(FileSyst...
java