Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
---|---|---|
300 | void (File d) { if (d.isDirectory()) { for (File file : d.listFiles()) { deleteRecursively(file); } } if (!d.delete()) { throw new BuildException("Unable to delete file " + d.getAbsolutePath()); } } | deleteRecursively |
301 | void (FileSet set) { children.add(new FileSetContainer(set)); } | addFileset |
302 | void (ZipFileSet set) { children.add(new FileSetContainer(set)); } | addZipfileset |
303 | void (DirContainer container) { children.add(container); } | addDir |
304 | void (JarContainer container) { children.add(container); } | addJar |
305 | void (ZipContainer container) { children.add(container); } | addZip |
306 | void (RenamedFileContainer container) { children.add(container); } | addRenamedFile |
307 | void (ExtractedDirContent content) { children.add(content); } | addExtractedDir |
308 | void (Container container) { children.add(container); } | addContainer |
309 | void (Content content) { children.add(content); } | addContent |
310 | void (IdeaModule module) { children.add(new FileSetContainer(module)); } | addModule |
311 | void (IdeaModuleTests module) { children.add(new FileSetContainer(module)); } | addModuleTests |
312 | List<Content> () { return children; } | getChildren |
313 | void (String excludes) { this.excludes = excludes; } | setExcludes |
314 | void (String includes) { this.includes = includes; } | setIncludes |
315 | List<LayoutFileSet> (TempFileFactory temp) { Set<LayoutFileSet> result = new LinkedHashSet<>(); for (Content child : children) { for (LayoutFileSet set : child.build(temp)) { result.add(createCopy(set)); } } ArrayList<LayoutFileSet> list = new ArrayList<>(result); for (LayoutFileSet set : list) { if (includes != null) { set.setIncludes(includes); } if (excludes != null) { set.setExcludes(excludes); } } return list; } | build |
316 | LayoutFileSet (FileSet set) { if (set instanceof IdeaModule) { return new IdeaModule((IdeaModule) set); } if (set instanceof IdeaModuleTests) { return new IdeaModuleTests((IdeaModuleTests) set); } if (set instanceof ZipFileSet) { return new LayoutFileSet((ZipFileSet) set.clone()); } else { return new LayoutFileSet((FileSet) set.clone()); } } | createCopy |
317 | Zip () { String version = Main.getAntVersion(); Jar task; if (version != null && (version.contains("1.8.0") || version.contains("1.8.1"))) { task = new PatchedJar(); } else { task = new Jar(); } task.setTaskName("jar"); task.setWhenmanifestonly((Zip.WhenEmpty)EnumeratedAttribute.getInstance(Zip.WhenEmpty.class, "skip")); return task; } | createTask |
318 | void (boolean flag) { ((Jar) task).setIndex(flag); } | setIndex |
319 | void (String manifestEncoding) { ((Jar) task).setManifestEncoding(manifestEncoding); } | setManifestEncoding |
320 | void (File manifestFile) { ((Jar) task).setManifest(manifestFile); } | setManifest |
321 | void (Jar.FilesetManifestConfig config) { ((Jar) task).setFilesetmanifest(config); } | setFilesetmanifest |
322 | void (Zip.WhenEmpty we) { ((Jar)task).setWhenmanifestonly(we); } | setWhenmanifestonly |
323 | void (ZipFileSet fs) { ((Jar) task).addMetainf(fs); } | addMetainf |
324 | String () { return "module." + getName() + ".output.test"; } | getOutputDirProperty |
325 | String () { return "test"; } | getKind |
326 | String () { return "production"; } | getKind |
327 | String () { return "module." + getName() + ".output.main"; } | getOutputDirProperty |
328 | String () { return name; } | getName |
329 | void (String name) { this.name = name; setDir(getOutputDir()); } | setName |
330 | File () { String adhoc = getProject().getProperty(getOutputDirProperty()); return adhoc != null ? new File(adhoc) : null; } | getOutputDir |
331 | boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IdeaModule that = (IdeaModule) o; return getDir(getProject()).equals(that.getDir(getProject())); } | equals |
332 | int () { return getDir(getProject()).hashCode(); } | hashCode |
333 | void (String filePath) { this.filePath = filePath; } | setFilePath |
334 | void (String newName) { this.newName = newName; } | setNewName |
335 | List<LayoutFileSet> (TempFileFactory temp) { final LayoutFileSet fileSet = new LayoutFileSet(); final File destFile = temp.allocateTempFile(newName); copyTask.setProject(getProject()); copyTask.setFile(new File(filePath.replace('/', File.separatorChar))); copyTask.setTofile(destFile); copyTask.perform(); fileSet.setFile(destFile); return Collections.singletonList(fileSet); } | build |
336 | void (String jarPath) { this.jarPath = jarPath; } | setJarPath |
337 | void (String pathInJar) { this.pathInJar = pathInJar; } | setPathInJar |
338 | List<LayoutFileSet> (TempFileFactory temp) { final File outputDir = temp.allocateTempFile("extractedDir"); expandTask.setProject(getProject()); expandTask.setSrc(new File(jarPath.replace('/', File.separatorChar))); File target = outputDir; if (!pathInJar.endsWith("/")) { pathInJar += "/"; } if (pathInJar.startsWith("/")) { pathInJar = pathInJar.substring(1); } if (pathInJar.length() > 0) { final PatternSet patternSet = new PatternSet(); patternSet.createInclude().setName(pathInJar + "**"); expandTask.addPatternset(patternSet); target = new File(outputDir, pathInJar.replace('/', File.separatorChar)); } expandTask.setDest(outputDir); expandTask.perform(); final LayoutFileSet fileSet = new LayoutFileSet(); fileSet.setDir(target); return Collections.singletonList(fileSet); } | build |
339 | String () { return name; } | getName |
340 | void (String name) { this.name = name; } | setName |
341 | List<LayoutFileSet> (TempFileFactory temp) { List<LayoutFileSet> built = super.build(temp); File dest = temp.allocateTempFile(name); task.setProject(getProject()); task.setDestFile(dest); for (LayoutFileSet set : built) { task.addZipfileset(set); } LayoutFileSet result = new LayoutFileSet(); result.setFile(dest); task.perform(); return Collections.singletonList(result); } | build |
342 | Zip () { Zip task = new Zip(); task.setTaskName("zip"); return task; } | createTask |
343 | void (boolean compress) { task.setCompress(compress); } | setCompress |
344 | void (boolean f) { task.setFilesonly(f); } | setFilesonly |
345 | void (Zip.Duplicate df) { task.setDuplicate(df); } | setDuplicate |
346 | void (String encoding) { task.setEncoding(encoding); } | setEncoding |
347 | void (File baseDir) { task.setBasedir(baseDir); } | setBasedir |
348 | List<LayoutFileSet> (TempFileFactory temp) { List<LayoutFileSet> built = super.build(temp); for (LayoutFileSet set : built) { copySet(set); } return Collections.emptyList(); } | build |
349 | void (LayoutFileSet set) { Copy task = new Copy(); task.setTaskName("copy"); task.setProject(getProject()); String prefix = set.getPrefix(getProject()); File target = prefix.length() > 0 ? new File(destDirectory, prefix + "/") : destDirectory; target.mkdirs(); task.setTodir(target); LayoutFileSet unprefixed = (LayoutFileSet) set.clone(); unprefixed.setPrefix(""); task.addFileset(unprefixed); task.perform(); } | copySet |
350 | List<LayoutFileSet> (TempFileFactory temp) { return Collections.singletonList(Container.createCopy(fileSet)); } | build |
351 | void (String name) { dirName = name; } | setName |
352 | List<LayoutFileSet> (TempFileFactory temp) { List<LayoutFileSet> unprefixed = super.build(temp); List<LayoutFileSet> prefixed = new ArrayList<>(); for (LayoutFileSet set : unprefixed) { LayoutFileSet copy = createCopy(set); copy.setPrefix(dirName + "/" + set.getPrefix(getProject())); prefixed.add(copy); } return prefixed; } | build |
353 | Resource[][] (ResourceCollection[] rcs) { Resource[][] manifests = new Resource[rcs.length][]; for (int i = 0; i < rcs.length; i++) { Resource[][] resources = null; if (rcs[i] instanceof FileSet) { resources = grabResources(new FileSet[] {(FileSet) rcs[i]}); } else { resources = grabNonFileSetResources(new ResourceCollection[] { rcs[i] }); } for (int j = 0; j < resources[0].length; j++) { String name = resources[0][j].getName().replace('\\', '/'); if (rcs[i] instanceof ArchiveFileSet) { ArchiveFileSet afs = (ArchiveFileSet) rcs[i]; if (!"".equals(afs.getFullpath(getProject()))) { name = afs.getFullpath(getProject()); } else if (!"".equals(afs.getPrefix(getProject()))) { String prefix = afs.getPrefix(getProject()); if (!prefix.endsWith("/") && !prefix.endsWith("\\")) { prefix += "/"; } name = prefix + name; } } if (name.equalsIgnoreCase(MANIFEST_NAME)) { manifests[i] = new Resource[] {resources[0][j]}; break; } } if (manifests[i] == null) { manifests[i] = new Resource[0]; } } return manifests; } | grabManifests |
354 | boolean (final @NotNull CharSequence filename) { synchronized (myMatcher) { myMatcher.reset(filename); return myMatcher.matches(); } } | matches |
355 | boolean (final @NotNull CharSequence filename) { return Strings.endsWith(filename, mySuffix); } | matches |
356 | boolean (final @NotNull CharSequence filename) { return Strings.startsWith(filename, 0, myPrefix); } | matches |
357 | boolean (final @NotNull CharSequence filename) { return Strings.contains(filename, myInfix); } | matches |
358 | MaskMatcher (final @NotNull String pattern) { int len = pattern.length(); if (len > 1 && pattern.indexOf('?') < 0) { if (pattern.charAt(0) == '*' && pattern.indexOf('*', 1) < 0) { return new SuffixMatcher(pattern.substring(1)); } if (pattern.indexOf('*') == len - 1) { return new PrefixMatcher(pattern.substring(0, len - 1)); } if (len > 2 && pattern.charAt(0) == '*' && pattern.indexOf('*', 1) == len - 1) { return new InfixMatcher(pattern.substring(1, len - 1)); } } return new RegexpMatcher(pattern); } | createMatcher |
359 | boolean (@NotNull CharSequence fileName) { return myMatcher.matches(fileName); } | acceptsCharSequence |
360 | String () { return myPattern; } | getPresentableString |
361 | boolean (final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final WildcardFileNameMatcher that = (WildcardFileNameMatcher)o; return myPattern.equals(that.myPattern); } | equals |
362 | int () { return myPattern.hashCode(); } | hashCode |
363 | String () { return myPattern; } | getPattern |
364 | String () { return myPattern; } | toString |
365 | Set<String> () { return Collections.unmodifiableSet(masks); } | getIgnoreMasks |
366 | void (@NotNull String list) { clearPatterns(); StringTokenizer tokenizer = new StringTokenizer(list, ";"); while (tokenizer.hasMoreTokens()) { addIgnoreMask(tokenizer.nextToken()); } } | setIgnoreMasks |
367 | boolean (@NotNull CharSequence fileName) { if (ignorePatterns.findAssociatedFileType(fileName) == Boolean.TRUE) { return true; } //Quite a hack, but still we need to have some name, which //won't be caught by VFS for sure. return StringUtilRt.endsWith(fileName, FileUtil.ASYNC_DELETE_EXTENSION); } | isIgnored |
368 | T (@NotNull FileNameMatcher matcher, @NotNull T type) { if (matcher instanceof ExtensionFileNameMatcher) { String extension = ((ExtensionFileNameMatcher)matcher).getExtension(); return myExtensionMappings.put(extension, type); } if (matcher instanceof ExactFileNameMatcher) { ExactFileNameMatcher exactFileNameMatcher = (ExactFileNameMatcher)matcher; Map<CharSequence, T> mapToUse = exactFileNameMatcher.isIgnoreCase() ? myExactFileNameAnyCaseMappings : myExactFileNameMappings; return mapToUse.put(exactFileNameMatcher.getFileName(), type); } int i = ContainerUtil.indexOf(myMatchingMappings, p -> p.first.equals(matcher)); if (i == -1) { myMatchingMappings.add(Pair.create(matcher, type)); return null; } Pair<FileNameMatcher, T> old = myMatchingMappings.get(i); myMatchingMappings.set(i, Pair.create(matcher, type)); return Pair.getSecond(old); } | addAssociation |
369 | T (@NotNull @NonNls CharSequence fileName) { if (!myExactFileNameMappings.isEmpty()) { T t = myExactFileNameMappings.get(fileName); if (t != null) return t; } if (!myExactFileNameAnyCaseMappings.isEmpty()) { // even hash lookup with case-insensitive hasher is costly for isIgnored checks during compile T t = myExactFileNameAnyCaseMappings.get(fileName); if (t != null) return t; } for (Pair<FileNameMatcher, T> mapping : myMatchingMappings) { if (mapping.getFirst().acceptsCharSequence(fileName)) return mapping.getSecond(); } return findByExtension(FileUtilRt.getExtension(fileName)); } | findAssociatedFileType |
370 | FileTypeAssocTable<T> () { return new FileTypeAssocTable<>( myExtensionMappings, myExactFileNameMappings, myExactFileNameAnyCaseMappings, myConcurrentCharSequenceMapBuilder, myHashBangMap, myMatchingMappings ); } | copy |
371 | List<FileNameMatcher> (@NotNull T type) { List<FileNameMatcher> result = new ArrayList<>(); for (Pair<FileNameMatcher, T> mapping : myMatchingMappings) { if (type.equals(mapping.getSecond())) { result.add(mapping.getFirst()); } } for (Map.Entry<CharSequence, T> entry : myExactFileNameMappings.entrySet()) { if (type.equals(entry.getValue())) { result.add(new ExactFileNameMatcher(entry.getKey().toString(), false)); } } for (Map.Entry<CharSequence, T> entry : myExactFileNameAnyCaseMappings.entrySet()) { if (type.equals(entry.getValue())) { result.add(new ExactFileNameMatcher(entry.getKey().toString(), true)); } } for (Map.Entry<CharSequence, T> entry : myExtensionMappings.entrySet()) { if (type.equals(entry.getValue())) { result.add(new ExtensionFileNameMatcher(entry.getKey().toString())); } } return result; } | getAssociations |
372 | List<String> (@NotNull T type) { return myHashBangMap.entrySet().stream() .filter(e -> e.getValue().equals(type)) .map(e -> e.getKey()) .collect(Collectors.toList()); } | getHashBangPatterns |
373 | boolean (Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } FileTypeAssocTable<?> that = (FileTypeAssocTable<?>)o; return myExtensionMappings.equals(that.myExtensionMappings) && myMatchingMappings.equals(that.myMatchingMappings) && myExactFileNameMappings.equals(that.myExactFileNameMappings) && myHashBangMap.equals(that.myHashBangMap) && myExactFileNameAnyCaseMappings.equals(that.myExactFileNameAnyCaseMappings); } | equals |
374 | int () { int result = myExtensionMappings.hashCode(); result = 31 * result + myMatchingMappings.hashCode(); result = 31 * result + myHashBangMap.hashCode(); result = 31 * result + myExactFileNameMappings.hashCode(); result = 31 * result + myExactFileNameAnyCaseMappings.hashCode(); return result; } | hashCode |
375 | String () { return "FileTypeAssocTable. myExtensionMappings="+myExtensionMappings+";\n" +"myExactFileNameMappings="+myExactFileNameMappings+";\n" +"myExactFileNameAnyCaseMappings="+myExactFileNameAnyCaseMappings+";\n" +"myMatchingMappings="+myMatchingMappings+";\n" +"myHashBangMap="+myHashBangMap+";"; } | toString |
376 | void () { myHashBangMap.clear(); myMatchingMappings.clear(); myExtensionMappings.clear(); myExactFileNameMappings.clear(); myExactFileNameAnyCaseMappings.clear(); } | clear |
377 | boolean () { return checksumVerificationEnabled; } | isSha256ChecksumVerificationEnabled |
378 | boolean () { return bindRepositoryEnabled; } | isBindRepositoryEnabled |
379 | void (boolean value) { checksumVerificationEnabled = value; } | setSha256ChecksumVerificationEnabled |
380 | void (boolean value) { bindRepositoryEnabled = value; } | setBindRepositoryEnabled |
381 | JpsDependencyResolverConfigurationImpl () { return new JpsDependencyResolverConfigurationImpl(this); } | createCopy |
382 | void (@NotNull JpsDependencyResolverConfigurationImpl modified) { this.checksumVerificationEnabled = modified.checksumVerificationEnabled; this.bindRepositoryEnabled = modified.bindRepositoryEnabled; } | applyChanges |
383 | JpsDependencyResolverConfiguration (@NotNull JpsProject project) { JpsDependencyResolverConfiguration config = getDependencyResolverConfiguration(project); if (config == null) { config = project.getContainer().setChild(JpsDependencyResolverConfigurationImpl.ROLE, new JpsDependencyResolverConfigurationImpl()); } return config; } | getOrCreateDependencyResolverConfiguration |
384 | JpsPluginManager () { return JpsServiceManager.getInstance().getService(JpsPluginManager.class); } | getInstance |
385 | Object () { return myDataLock; } | getDataLock |
386 | void (@NotNull JpsElementContainerEx modified) { final Collection<JpsElementChildRole<?>> roles = new ArrayList<>(); synchronized (myDataLock) { roles.addAll(myElements.keySet()); } for (JpsElementChildRole<?> role : roles) { applyChanges(role, modified); } roles.clear(); synchronized (modified.getDataLock()) { roles.addAll(modified.getElementsMap().keySet()); } synchronized (myDataLock) { roles.removeAll(myElements.keySet()); } for (JpsElementChildRole<?> role : roles) { applyChanges(role, modified); } } | applyChanges |
387 | JavaModuleIndex (@NotNull JpsCompilerExcludes excludes) { return new JavaModuleIndexImpl(excludes); } | create |
388 | JpsJavaProjectExtensionImpl () { return new JpsJavaProjectExtensionImpl(this); } | createCopy |
389 | String () { return myOutputUrl; } | getOutputUrl |
390 | void (String outputUrl) { if (!Objects.equals(myOutputUrl, outputUrl)) { myOutputUrl = outputUrl; fireElementChanged(); } } | setOutputUrl |
391 | LanguageLevel () { return myLanguageLevel; } | getLanguageLevel |
392 | void (LanguageLevel languageLevel) { if (!Comparing.equal(myLanguageLevel, languageLevel)) { myLanguageLevel = languageLevel; fireElementChanged(); } } | setLanguageLevel |
393 | void (@NotNull JpsJavaProjectExtensionImpl modified) { setLanguageLevel(modified.myLanguageLevel); setOutputUrl(modified.myOutputUrl); } | applyChanges |
394 | boolean () { return myExported; } | isExported |
395 | void (boolean exported) { if (myExported != exported) { myExported = exported; fireElementChanged(); } } | setExported |
396 | JpsJavaDependencyScope () { return myScope; } | getScope |
397 | void (@NotNull JpsJavaDependencyScope scope) { if (!scope.equals(myScope)) { myScope = scope; fireElementChanged(); } } | setScope |
398 | JpsJavaDependencyExtensionImpl () { return new JpsJavaDependencyExtensionImpl(this); } | createCopy |
399 | void (@NotNull JpsJavaDependencyExtensionImpl modified) { setExported(modified.myExported); setScope(modified.myScope); } | applyChanges |