Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
5,300
void (AntDomElement element) { if (!found.get()) { super.visitAntDomElement(element); } }
visitAntDomElement
5,301
void (AntDomCustomElement element) { final Class clazz = element.getDefinitionClass(); if (clazz != null && AntCustomTask.class.getName().equals(clazz.getName())) { found.set(true); } else { super.visitAntDomElement(element); } }
visitAntDomCustomElement
5,302
String () { return PluginPathManager.getPluginHomePath("ant") + "/tests/data/highlighting/"; }
getTestDataPath
5,303
LocalInspectionTool[] () { return new LocalInspectionTool[]{ new AntDuplicateTargetsInspection(), new AntResolveInspection(), new XmlPathReferenceInspection() }; }
configureLocalInspectionTools
5,304
void (final String string) { myString = string; }
setString
5,305
String () { return myString; }
getString
5,306
void (final int integer) { myInteger = integer; }
setInteger
5,307
int () { return myInteger; }
getInteger
5,308
void (final boolean aBoolean) { myBoolean = aBoolean; }
setBoolean
5,309
boolean () { return myBoolean; }
getBoolean
5,310
String () { return myPropertyName; }
getPropertyName
5,311
void (String propertyName) { myPropertyName = propertyName.trim(); }
setPropertyName
5,312
String () { return myPropertyValue; }
getPropertyValue
5,313
void (String propertyValue) { myPropertyValue = propertyValue; }
setPropertyValue
5,314
void (Element element) { myPropertyName = element.getAttributeValue(NAME); myPropertyValue = element.getAttributeValue(VALUE); }
readExternal
5,315
void (Element element) { element.setAttribute(NAME, getPropertyName()); element.setAttribute(VALUE, getPropertyValue()); }
writeExternal
5,316
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BuildFileProperty that = (BuildFileProperty)o; return Objects.equals(myPropertyName, that.myPropertyName) && Objects.equals(myPropertyValue, that.myPropertyValue); }
equals
5,317
int () { return 31 * (myPropertyName != null ? myPropertyName.hashCode() : 0) + (myPropertyValue != null ? myPropertyValue.hashCode() : 0); }
hashCode
5,318
BuildFileProperty () { try { return (BuildFileProperty)super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } }
clone
5,319
JpsAntArtifactExtension (JpsArtifact artifact, ArtifactBuildPhase buildPhase) { switch (buildPhase) { case PRE_PROCESSING: return JpsAntExtensionService.getPreprocessingExtension(artifact); case POST_PROCESSING: return JpsAntExtensionService.getPostprocessingExtension(artifact); default: return null; } }
getBuildExtension
5,320
void (@NotNull ProcessEvent event, @NotNull Key outputType) { if (outputType == ProcessOutputTypes.STDERR) { errorOutput.append(event.getText()); } }
onTextAvailable
5,321
void (@NotNull ProcessEvent event) { int exitCode = event.getExitCode(); if (exitCode != 0) { context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.ERROR, errorOutput.toString())); String message = AntJpsBundle.message("target.finished.with.exit.code", targetName, buildFilePath, exitCode); context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.ERROR, message)); hasErrors.set(true); } }
processTerminated
5,322
void (CompileContext context, final @NlsSafe String text) { context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.ERROR, AntJpsBundle.message("cannot.run.target", myExtension.getTargetName(), text))); }
reportError
5,323
JpsAntArtifactExtension (@NotNull JpsArtifact artifact) { return artifact.getContainer().getChild(JpsAntArtifactExtensionImpl.PREPROCESSING_ROLE); }
getPreprocessingExtension
5,324
JpsAntArtifactExtension (@NotNull JpsArtifact artifact) { return artifact.getContainer().getChild(JpsAntArtifactExtensionImpl.POSTPROCESSING_ROLE); }
getPostprocessingExtension
5,325
void (JpsGlobal global, JpsAntInstallation antInstallation) { global.getContainer().getOrSetChild(JpsAntInstallationImpl.COLLECTION_ROLE).addChild(antInstallation); }
addAntInstallation
5,326
JpsAntBuildFileOptions (@NotNull JpsProject project, @NotNull String buildFileUrl) { JpsAntConfiguration configuration = getAntConfiguration(project); if (configuration != null) { return configuration.getOptions(buildFileUrl); } return new JpsAntBuildFileOptionsImpl(); }
getOptions
5,327
JpsAntConfiguration (JpsProject project) { return project.getContainer().getChild(JpsAntConfigurationImpl.ROLE); }
getAntConfiguration
5,328
JpsAntConfiguration (@NotNull JpsProject project) { JpsAntConfiguration configuration = getAntConfiguration(project); if (configuration != null) { return configuration; } JpsAntConfigurationImpl antConfiguration = new JpsAntConfigurationImpl(new HashMap<>(), null); return project.getContainer().setChild(JpsAntConfigurationImpl.ROLE, antConfiguration); }
getOrCreateAntConfiguration
5,329
JpsAntInstallation () { String antPath = System.getProperty(BUNDLED_ANT_PATH_PROPERTY); File antHome; if (antPath != null) { antHome = new File(antPath); } else { final String appHome = PathManager.getHomePath(false); if (appHome == null) { LOG.debug("idea.home.path and " + BUNDLED_ANT_PATH_PROPERTY + " aren't specified, bundled Ant won't be configured"); return null; } antHome = new File(appHome, "lib" + File.separator + "ant"); if (!antHome.exists()) { File communityAntHome = new File(appHome, "community" + File.separator + "lib" + File.separator + "ant"); if (communityAntHome.exists()) { antHome = communityAntHome; } } } if (!antHome.exists()) { LOG.debug("Bundled Ant not found at " + antHome.getAbsolutePath()); return null; } String antLib = new File(antHome, "lib").getAbsolutePath(); return new JpsAntInstallationImpl(antHome, "Bundled Ant", Collections.emptyList(), Collections.singletonList(antLib)); }
getBundledAntInstallation
5,330
JpsAntInstallation (@NotNull JpsModel model, @NotNull String buildFileUrl) { JpsAntBuildFileOptions options = getOptions(model.getProject(), buildFileUrl); String antInstallationName; if (options.isUseProjectDefaultAnt()) { JpsAntConfiguration antConfiguration = getAntConfiguration(model.getProject()); antInstallationName = antConfiguration != null ? antConfiguration.getProjectDefaultAntName() : null; } else { antInstallationName = options.getAntInstallationName(); } if (antInstallationName == null) return getBundledAntInstallation(); return findAntInstallation(model, antInstallationName); }
getAntInstallationForBuildFile
5,331
JpsAntInstallation (@NotNull JpsModel model, @NotNull String antInstallationName) { JpsElementCollection<JpsAntInstallation> antInstallations = model.getGlobal().getContainer().getChild(JpsAntInstallationImpl.COLLECTION_ROLE); if (antInstallations != null) { for (JpsAntInstallation installation : antInstallations.getElements()) { if (antInstallationName.equals(installation.getName())) { return installation; } } LOG.debug("Ant installation '" + antInstallationName + "' not found"); } else { LOG.debug("Ant installations weren't loaded"); } return null; }
findAntInstallation
5,332
JpsAntInstallationImpl () { return new JpsAntInstallationImpl(myAntHome, myName, myClasspath, myJarDirectories); }
createCopy
5,333
String () { return myName; }
getName
5,334
void (@NotNull JpsAntInstallationImpl modified) { }
applyChanges
5,335
File () { return myAntHome; }
getAntHome
5,336
List<String> () { return getClasspath(myClasspath, myJarDirectories); }
getClasspath
5,337
List<String> (final List<String> classpath, final List<String> jarDirectories) { List<String> result = new ArrayList<>(classpath); for (String directory : jarDirectories) { addAllJarsFromDirectory(result, new File(directory)); } return result; }
getClasspath
5,338
void (List<? super String> classpath, final File dir) { File[] files = dir.listFiles(); if (files != null) { for (File file : files) { if (StringUtil.endsWithIgnoreCase(file.getName(), ".jar")) { classpath.add(file.getAbsolutePath()); } } } }
addAllJarsFromDirectory
5,339
JpsAntConfigurationImpl () { return new JpsAntConfigurationImpl(myOptionsMap, myProjectDefaultAntName); }
createCopy
5,340
void (@Nullable String projectDefaultAntName) { myProjectDefaultAntName = projectDefaultAntName; }
setProjectDefaultAntName
5,341
String () { return myProjectDefaultAntName; }
getProjectDefaultAntName
5,342
void (@NotNull JpsAntConfigurationImpl modified) { }
applyChanges
5,343
Collection<JpsAntBuildFileOptions> () { return myOptionsMap.values(); }
getOptionsForAllBuildFiles
5,344
JpsAntBuildFileOptions (@NotNull String buildFileUrl) { JpsAntBuildFileOptions options = myOptionsMap.get(buildFileUrl); if (options != null) { return options; } return new JpsAntBuildFileOptionsImpl(); }
getOptions
5,345
void (int maxStackSize) { myMaxStackSize = maxStackSize; }
setMaxStackSize
5,346
void (String antCommandLineParameters) { myAntCommandLineParameters = antCommandLineParameters; }
setAntCommandLineParameters
5,347
void (boolean useProjectDefaultAnt) { myUseProjectDefaultAnt = useProjectDefaultAnt; }
setUseProjectDefaultAnt
5,348
String () { return myAntInstallationName; }
getAntInstallationName
5,349
void (String antInstallationName) { myAntInstallationName = antInstallationName; }
setAntInstallationName
5,350
void (@NotNull String path) { myClasspath.add(path); }
addJarPath
5,351
void (@NotNull String directoryPath) { myJarDirectories.add(directoryPath); }
addJarDirectory
5,352
void (int maxHeapSize) { myMaxHeapSize = maxHeapSize; }
setMaxHeapSize
5,353
void (String customJdkName) { myCustomJdkName = customJdkName; }
setCustomJdkName
5,354
int () { return myMaxHeapSize; }
getMaxHeapSize
5,355
int () { return myMaxStackSize; }
getMaxStackSize
5,356
String () { return myCustomJdkName; }
getCustomJdkName
5,357
String () { return myAntCommandLineParameters; }
getAntCommandLineParameters
5,358
boolean () { return myUseProjectDefaultAnt; }
isUseProjectDefaultAnt
5,359
List<String> () { return JpsAntInstallationImpl.getClasspath(myClasspath, myJarDirectories); }
getAdditionalClasspath
5,360
void (@NotNull String name, @NotNull String value) { myProperties.add(new BuildFileProperty(name, value)); }
addProperty
5,361
List<BuildFileProperty> () { return myProperties; }
getProperties
5,362
JpsAntArtifactExtension (@Nullable Element optionsTag) { return new JpsAntArtifactExtensionImpl( optionsTag != null ? XmlSerializer.deserialize(optionsTag, AntArtifactExtensionProperties.class) : null); }
loadExtension
5,363
String (Element buildFileTag, final String childName) { Element child = buildFileTag.getChild(childName); return child != null ? child.getAttributeValue("value") : null; }
getValueAttribute
5,364
void (@NotNull JpsGlobal global, @NotNull Element componentTag) { for (Element antTag : JDOMUtil.getChildren(componentTag.getChild("registeredAnts"), "ant")) { String name = getValueAttribute(antTag, "name"); String homeDir = getValueAttribute(antTag, "homeDir"); List<String> classpath = new ArrayList<>(); List<String> jarDirectories = new ArrayList<>(); for (Element classpathItemTag : JDOMUtil.getChildren(antTag.getChild("classpath"), "classpathItem")) { String fileUrl = classpathItemTag.getAttributeValue("path"); String dirUrl = classpathItemTag.getAttributeValue("dir"); if (fileUrl != null) { classpath.add(JpsPathUtil.urlToPath(fileUrl)); } else if (dirUrl != null) { jarDirectories.add(JpsPathUtil.urlToPath(dirUrl)); } } if (name != null && homeDir != null) { JpsAntExtensionService.addAntInstallation(global, new JpsAntInstallationImpl(new File(homeDir), name, classpath, jarDirectories)); } } }
loadExtension
5,365
void (@NotNull JpsProject project, @NotNull Element componentTag) { Map<String, JpsAntBuildFileOptions> optionsMap = new HashMap<>(); for (Element buildFileTag : JDOMUtil.getChildren(componentTag, "buildFile")) { String url = buildFileTag.getAttributeValue("url"); JpsAntBuildFileOptionsImpl options = new JpsAntBuildFileOptionsImpl(); options.setMaxHeapSize(StringUtil.parseInt(getValueAttribute(buildFileTag, "maximumHeapSize"), 128)); options.setMaxStackSize(StringUtil.parseInt(getValueAttribute(buildFileTag, "maximumStackSize"), 2)); options.setCustomJdkName(getValueAttribute(buildFileTag, "customJdkName")); Element antReference = buildFileTag.getChild("antReference"); if (antReference != null) { options.setUseProjectDefaultAnt(Boolean.parseBoolean(antReference.getAttributeValue("projectDefault"))); options.setAntInstallationName(antReference.getAttributeValue("name")); } for (Element classpathEntry : JDOMUtil.getChildren(buildFileTag.getChild("additionalClassPath"), "entry")) { String fileUrl = classpathEntry.getAttributeValue("path"); String dirUrl = classpathEntry.getAttributeValue("dir"); if (fileUrl != null) { options.addJarPath(JpsPathUtil.urlToPath(fileUrl)); } else if (dirUrl != null) { options.addJarDirectory(JpsPathUtil.urlToPath(dirUrl)); } } for (Element propertyTag : JDOMUtil.getChildren(buildFileTag.getChild("properties"), "property")) { String name = propertyTag.getAttributeValue("name"); String value = propertyTag.getAttributeValue("value"); if (name != null && value != null) { options.addProperty(name, value); } } optionsMap.put(url, options); } Element defaultAnt = componentTag.getChild("defaultAnt"); String projectDefaultAntName; if (defaultAnt != null) { projectDefaultAntName = defaultAnt.getAttributeValue("name"); } else { projectDefaultAntName = null; } project.getContainer().setChild(JpsAntConfigurationImpl.ROLE, new JpsAntConfigurationImpl(optionsMap, projectDefaultAntName)); }
loadExtension
5,366
void (@NotNull JpsProject project, @NotNull Element componentTag) { for (Element buildFileTag : JDOMUtil.getChildren(componentTag, "buildFile")) { String commandLine = getValueAttribute(buildFileTag, "antCommandLine"); String url = buildFileTag.getAttributeValue("url"); if (!StringUtil.isEmpty(commandLine)) { JpsAntConfiguration configuration = project.getContainer().getChild(JpsAntConfigurationImpl.ROLE); if (configuration != null) { configuration.getOptions(url).setAntCommandLineParameters(commandLine); } } } }
loadExtension
5,367
JpsAntArtifactExtensionImpl () { return new JpsAntArtifactExtensionImpl(this); }
createCopy
5,368
AntArtifactExtensionProperties () { return myProperties; }
getProperties
5,369
boolean () { return myProperties.myEnabled; }
isEnabled
5,370
String () { return myProperties.myFileUrl; }
getFileUrl
5,371
String () { return myProperties.myTargetName; }
getTargetName
5,372
JpsArtifact () { return (JpsArtifact)myParent; }
getArtifact
5,373
List<BuildFileProperty> () { final List<BuildFileProperty> properties = new ArrayList<>(); properties.add(new BuildFileProperty(ARTIFACT_OUTPUT_PATH_PROPERTY, getArtifact().getOutputPath())); properties.addAll(myProperties.myUserProperties); return properties; }
getAntProperties
5,374
String () { return PathManagerEx.findFileUnderProjectHome("plugins/ant/jps-plugin/testData", getClass()).getAbsolutePath(); }
getTestDataRootPath
5,375
AntIntrospector (Class c) { final AntIntrospector antIntrospector = new AntIntrospector(c); return antIntrospector.myHelper == null? null : antIntrospector; }
getInstance
5,376
Set<String> () { final List<Method> methods = invokeMethod("getExtensionPoints", true); if (ContainerUtil.isEmpty(methods)) { return Collections.emptySet(); } return methods.stream().map(Method::getParameterTypes).flatMap(Arrays::stream).map(Class::getName).collect(Collectors.toSet()); }
getExtensionPointTypes
5,377
Enumeration<String> () { return invokeMethod("getNestedElements", false); }
getNestedElements
5,378
Class (String name) { try { return invokeMethod("getElementType", false, name); } catch (RuntimeException e) { return null; } }
getElementType
5,379
Enumeration<String> () { return invokeMethod("getAttributes", false); }
getAttributes
5,380
Class (final String attr) { try { return invokeMethod("getAttributeType", false, attr); } catch (RuntimeException e) { return null; } }
getAttributeType
5,381
boolean () { try { final Object isContainer = invokeMethod("isContainer", true); if (isContainer != null) { return Boolean.TRUE.equals(isContainer); } final ClassLoader loader = myTypeClass.getClassLoader(); try { final Class<?> containerClass = loader != null? loader.loadClass(TaskContainer.class.getName()) : TaskContainer.class; return containerClass.isAssignableFrom(myTypeClass); } catch (ClassNotFoundException ignored) { } } catch (RuntimeException e) { LOG.info(e); } return false; }
isContainer
5,382
Object (final Class aClass) { Object result = null; synchronized (ourCache) { result = ourCache.get(aClass); } if (result == null) { result = ourNullObject; Class<?> helperClass = null; try { final ClassLoader loader = aClass.getClassLoader(); helperClass = loader != null? loader.loadClass(IntrospectionHelper.class.getName()) : IntrospectionHelper.class; final Method getHelperMethod = helperClass.getMethod("getHelper", Class.class); result = getHelperMethod.invoke(null, aClass); } catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException e) { LOG.info(e); } catch (InvocationTargetException ignored) { } synchronized (ourCache) { if (helperClass != null) { clearAntStaticCache(helperClass); } ourCache.put(aClass, result); } } scheduleCacheCleaning(); return result == ourNullObject? null : result; }
getHelper
5,383
void (final Class<?> helperClass) { // for ant 1.7, there is a dedicated method for cache clearing try { helperClass.getDeclaredMethod("clearCache").invoke(null); } catch (Throwable e) { try { // assume it is older version of ant Map helpersCollection = ReflectionUtil.getField(helperClass, null, null, "helpers"); if (helpersCollection != null) { helpersCollection.clear(); } } catch (Throwable _e) { // ignore. } } }
clearAntStaticCache
5,384
void () { ourCacheCleaner.cancelAllRequests(); ourCacheCleaner.addRequest(() -> { synchronized (ourCache) { ourCache.clear(); } }, CACHE_CLEAN_TIMEOUT); }
scheduleCacheCleaning
5,385
boolean (@NotNull final PsiFile file) { return XmlUtil.isAntFile(file); }
isForceHighlightParents
5,386
int () { return VERSION; }
getVersion
5,387
KeyDescriptor<Integer> () { return EnumeratorIntegerDescriptor.INSTANCE; }
getKeyDescriptor
5,388
boolean (@NotNull VirtualFile file) { return file.isInLocalFileSystem(); }
acceptInput
5,389
boolean () { return true; }
dependsOnFileContent
5,390
void (final VirtualFile file, final Project project, final boolean value) { if (file.isValid() && ForcedAntFileAttribute.isAntFile(file) != value) { ForcedAntFileAttribute.forceAntFile(file, value); TransactionGuard.getInstance().assertWriteSafeContext(ModalityState.defaultModalityState()); ModalityUiUtil.invokeLaterIfNeeded(ModalityState.defaultModalityState(), project.getDisposed(), () -> PsiManager.getInstance(project).dropPsiCaches()); } }
markFileAsAntFile
5,391
AntDomProject (PsiFile psiFile) { if (psiFile instanceof XmlFile) { final DomManager domManager = DomManager.getDomManager(psiFile.getProject()); final DomFileElement<AntDomProject> fileElement = domManager.getFileElement((XmlFile)psiFile, AntDomProject.class); return fileElement != null? fileElement.getRootElement() : null; } return null; }
getAntDomProject
5,392
AntDomProject (PsiFile psiFile) { if (psiFile instanceof XmlFile) { final DomManager domManager = DomManager.getDomManager(psiFile.getProject()); DomFileElement<AntDomProject> fileElement = domManager.getFileElement((XmlFile)psiFile, AntDomProject.class); if (fileElement == null) { ForcedAntFileAttribute.forceAntFile(psiFile.getVirtualFile(), true); fileElement = domManager.getFileElement((XmlFile)psiFile, AntDomProject.class); } return fileElement != null? fileElement.getRootElement() : null; } return null; }
getAntDomProjectForceAntFile
5,393
AntDomAntlib (PsiFile psiFile) { if (psiFile instanceof XmlFile) { final DomManager domManager = DomManager.getDomManager(psiFile.getProject()); final DomFileElement<AntDomAntlib> fileElement = domManager.getFileElement((XmlFile)psiFile, AntDomAntlib.class); return fileElement != null? fileElement.getRootElement() : null; } return null; }
getAntLib
5,394
AntDomElement (XmlTag xmlTag) { final DomElement domElement = DomManager.getDomManager(xmlTag.getProject()).getDomElement(xmlTag); return domElement instanceof AntDomElement? (AntDomElement)domElement : null; }
getAntDomElement
5,395
AntDomElement (ConvertContext context) { return context.getInvocationElement().getParentOfType(AntDomElement.class, false); }
getInvocationAntDomElement
5,396
boolean (VirtualFile file) { String id = ForcedBuildFileAttribute.getFrameworkIdOfBuildFile(file); return ANT_ID.equals(id) || (StringUtil.isEmpty(id) && isAntFileOld(file)); }
isAntFile
5,397
boolean (VirtualFile file) { String id = ForcedBuildFileAttribute.getFrameworkIdOfBuildFile(file); return StringUtil.isEmpty(id) || ANT_ID.equals(id); }
mayBeAntFile
5,398
boolean (VirtualFile file) { if (file instanceof NewVirtualFile) { try (DataInputStream is = ourAttribute.readFileAttribute(file)) { if (is != null) { return is.readBoolean(); } return false; } catch (IOException e) { LOG.error(e); } } return Boolean.TRUE.equals(file.getUserData(ourAntFileMarker)); }
isAntFileOld
5,399
void (VirtualFile file, boolean value) { ForcedBuildFileAttribute.forceFileToFramework(file, ANT_ID, value); }
forceAntFile