Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
---|---|---|
2,500 |
void (int id) { int current; int max; do { current = myMaxTargetId.get(); max = Math.max(id, current); } while (!myMaxTargetId.compareAndSet(current, max)); }
|
markUsedId
|
2,501 |
int () { return myMaxTargetId.incrementAndGet(); }
|
getFreeId
|
2,502 |
void () { FileUtil.delete(myDataPaths.getTargetsDataRoot()); }
|
clean
|
2,503 |
JpsModel () { return myModel; }
|
getModel
|
2,504 |
BuildRootIndexImpl () { return myBuildRootIndex; }
|
getBuildRootIndex
|
2,505 |
BuildDataPaths () { return myDataPaths; }
|
getDataPaths
|
2,506 |
void () { myStampsStorage.wipe(); }
|
clean
|
2,507 |
void () { try { myStampsStorage.close(); } catch (IOException e) { LOG.error(e); FileUtil.delete(myStampsStorage.getStorageRoot()); } }
|
close
|
2,508 |
void (boolean memoryCachesOnly) { try { applyBulkOperation(getChildStorages(), storageOwner -> storageOwner.flush(memoryCachesOnly)); } catch (IOException ignored) { // handled } }
|
flush
|
2,509 |
int (@NotNull String path) { String relativePath = myRelativizer.toRelative(path); // On case-insensitive OS hash calculated from path converted to lower case if (ProjectStamps.PORTABLE_CACHES) { return StringUtil.isEmpty(relativePath) ? 0 : FileUtil.toCanonicalPath(relativePath).hashCode(); } return FileUtil.pathHashCode(relativePath); }
|
pathHashCode
|
2,510 |
long (@NotNull String hashableString) { return Xxh3.hash(hashableString); }
|
getStringHash
|
2,511 |
long (long... values) { return Xxh3.hashLongs(values); }
|
hashLongs
|
2,512 |
String (@NotNull File file) { return myRelativizer.toRelative(file.getAbsolutePath()); }
|
relativePath
|
2,513 |
File (File dataStorageRoot) { return new File(dataStorageRoot, "hashes"); }
|
calcStorageRoot
|
2,514 |
File () { return myFileStampRoot; }
|
getStorageRoot
|
2,515 |
void () { super.force(); myTimestampStorage.force(); }
|
force
|
2,516 |
boolean () { return super.wipe() && myTimestampStorage.wipe(); }
|
wipe
|
2,517 |
String () { return "FileStamp{" + "myHash=" + myHash + ", myTimestamp=" + myTimestamp + '}'; }
|
toString
|
2,518 |
String () { return userName; }
|
getUserName
|
2,519 |
String () { return password; }
|
getPassword
|
2,520 |
List<String> () { return Collections.emptyList(); }
|
getCompilableFileExtensions
|
2,521 |
String () { return getBuilderName(); }
|
getPresentableName
|
2,522 |
void (CompileContext context) { JpsLibraryResolveGuard.init(context); }
|
buildStarted
|
2,523 |
void (CompileContext context, ModuleChunk chunk) { try { resolveMissingDependencies(context, chunk.getModules(), BuildTargetChunk.forModulesChunk(chunk)); } catch (Exception e) { context.putUserData(RESOLVE_ERROR_KEY, e); } }
|
chunkBuildStarted
|
2,524 |
ExitCode (CompileContext context, ModuleChunk chunk, DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget> dirtyFilesHolder, OutputConsumer outputConsumer) { final Exception error = context.getUserData(RESOLVE_ERROR_KEY); if (error != null) { return reportError(context, chunk.getPresentableShortName(), error); } return ExitCode.OK; }
|
build
|
2,525 |
ExitCode (CompileContext context, String placePresentableName, Exception error) { @Nls StringBuilder builder = new StringBuilder().append(JpsBuildBundle.message("build.message.error.resolving.dependencies.for", placePresentableName)); Throwable th = error; final Set<Throwable> processed = new HashSet<>(); final Set<String> detailsMessage = new HashSet<>(); while (th != null && processed.add(th)) { String details = th.getMessage(); if (th instanceof UnknownHostException) { details = JpsBuildBundle.message("build.message.unknown.host.0", details); // hack for UnknownHostException } if (details != null && detailsMessage.add(details)) { builder.append(":\n").append(details); } th = th.getCause(); } final String msg = builder.toString(); LOG.info(msg, error); context.processMessage(new CompilerMessage(getBuilderName(), BuildMessage.Kind.ERROR, msg)); return ExitCode.ABORT; }
|
reportError
|
2,526 |
boolean (@NotNull CompileContext context, @NotNull String libraryName, @NotNull JpsMavenRepositoryLibraryDescriptor descriptor, @NotNull File artifact) { if (!artifact.exists()) return false; boolean zipCheckEnabled = SystemProperties.getBooleanProperty(RESOLUTION_RETRY_DOWNLOAD_CORRUPTED_ZIP_PROPERTY, false) || SystemProperties.getBooleanProperty(RESOLUTION_RETRY_DOWNLOAD_CORRUPTED_ZIP_LEGACY_PROPERTY, false); if (zipCheckEnabled && (artifact.getName().endsWith(".jar") || artifact.getName().endsWith(".zip"))) { long entriesCount = -1; try (ZipFile zip = new ZipFile(artifact)) { entriesCount = zip.size(); } catch (IOException ignored) { } if (entriesCount <= 0) { try { Path compiledRootPath = artifact.toPath(); reportCorruptedArtifactZip(context, libraryName, descriptor, compiledRootPath); context.processMessage( new ProgressMessage(JpsBuildBundle.message("progress.message.removing.invalid.artifact", libraryName, artifact)) ); Files.deleteIfExists(compiledRootPath); return false; } catch (IOException e) { throw new RuntimeException("Failed to delete invalid zip: " + artifact, e); } } } return true; }
|
verifyLibraryArtifact
|
2,527 |
boolean (@NotNull JpsMavenRepositoryLibraryDescriptor descriptor) { return !"LATEST".equals(descriptor.getVersion()) && !"RELEASE".equals(descriptor.getVersion()) && !descriptor.getVersion().endsWith("-SNAPSHOT"); }
|
isLibraryVersionFixed
|
2,528 |
boolean (@NotNull JpsMavenRepositoryLibraryDescriptor descriptor, @NotNull List<File> compiledRootsFiles) { if (compiledRootsFiles.size() != descriptor.getArtifactsVerification().size()) { return false; } Set<String> compiledRootsPaths = compiledRootsFiles.stream().map(File::getAbsolutePath).collect(Collectors.toSet()); Set<String> verifiableArtifactsPaths = descriptor.getArtifactsVerification().stream() .map(ArtifactVerification::getUrl) .map(it -> JpsPathUtil.urlToFile(it).getAbsolutePath()) .collect(Collectors.toSet()); return compiledRootsPaths.equals(verifiableArtifactsPaths); }
|
isAllCompiledRootsVerificationPresent
|
2,529 |
void (@NotNull CompileContext context, @NotNull String libraryName, @NotNull JpsMavenRepositoryLibraryDescriptor descriptor, @NotNull Path artifactFile) { if (SystemProperties.getBooleanProperty(RESOLUTION_REPORT_CORRUPTED_ZIP_PROPERTY, false)) { String sha256; try { // compute checksum to ensure the artifact is copied without errors sha256 = JpsChecksumUtil.getSha256Checksum(artifactFile); } catch (IOException e) { LOG.error("Failed to compute checksum for corrupted zip: " + artifactFile, e); sha256 = "failed_to_compute"; } reportBadArtifact(context, libraryName, descriptor, artifactFile, sha256, "corrupted_zip"); } }
|
reportCorruptedArtifactZip
|
2,530 |
void (@NotNull CompileContext context, @NotNull String libraryName, @NotNull JpsMavenRepositoryLibraryDescriptor descriptor, @NotNull Path artifactFile, @NotNull String sha256sum) { if (SystemProperties.getBooleanProperty(RESOLUTION_REPORT_INVALID_SHA256_CHECKSUM_PROPERTY, false)) { reportBadArtifact(context, libraryName, descriptor, artifactFile, sha256sum, "invalid_checksum"); } }
|
reportInvalidArtifactChecksum
|
2,531 |
void (@NotNull CompileContext context, @NotNull String libraryName, @NotNull JpsMavenRepositoryLibraryDescriptor descriptor, @NotNull Path artifactFile, @NotNull String sha256sum, @NotNull String problemKind) { Path reportsDir = createVerificationProblemReport(context, libraryName, descriptor, problemKind, metadata -> { metadata.setProperty("sha256", sha256sum); metadata.setProperty("filename", artifactFile.getFileName().toString()); }); if (reportsDir == null) { return; } // Dump all artifacts in artifact's parent directory try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(artifactFile.getParent())) { for (Path sourcePath : directoryStream) { if (!Files.isRegularFile(sourcePath)) continue; Path targetPath = reportsDir.resolve(sourcePath.getFileName()); try { Files.copy(sourcePath, targetPath, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES); } catch (IOException e) { LOG.error("Unable to copy bad artifact " + sourcePath, e); } } } catch (IOException e) { LOG.error("Failed to open directory stream for " + artifactFile.getParent(), e); } }
|
reportBadArtifact
|
2,532 |
void (@NotNull CompileContext context, @NotNull String libraryName, @NotNull JpsMavenRepositoryLibraryDescriptor descriptor, @NotNull List<Path> allRoots, @NotNull List<Path> missingRoots) { if (missingRoots.isEmpty() || !SystemProperties.getBooleanProperty(RESOLUTION_REPORT_INVALID_SHA256_CHECKSUM_PROPERTY, false)) { return; } Path reportsDir = createVerificationProblemReport(context, libraryName, descriptor, "missing_artifact", reportMetadata -> { reportMetadata.setProperty("all_roots_list", allRoots.toString()); reportMetadata.setProperty("missing_roots_list", missingRoots.toString()); }); if (reportsDir == null) { return; } // publish .pom files to investigate why some files are not downloaded for (Path artifact : allRoots) { String possiblePomFileName = FileUtilRt.getNameWithoutExtension(artifact.getFileName().toString()) + ".pom"; Path pomFile = artifact.getParent().resolve(possiblePomFileName); if (Files.exists(pomFile)) { try { Path pomFileCopy = reportsDir.resolve(pomFile.getFileName()); Files.copy(pomFile, pomFileCopy, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES); } catch (IOException e) { LOG.error("Unable to copy pom file " + pomFile, e); } } } }
|
reportMissingCompiledRootArtifacts
|
2,533 |
void (CompileContext context) { context.putUserData(CONTEXT_KEY, new ConcurrentHashMap<>()); }
|
init
|
2,534 |
Guard (@NotNull CompileContext context, @NotNull JpsMavenRepositoryLibraryDescriptor descriptor) { Map<Object, Guard> map = context.getUserData(CONTEXT_KEY); assert map != null; return map.computeIfAbsent(descriptor, (ignored) -> new Guard(true) // descriptor must not be processed more than once ); }
|
getDescriptorGuard
|
2,535 |
Guard (@NotNull CompileContext context, @NotNull Path rootPath) { Map<Object, Guard> map = context.getUserData(CONTEXT_KEY); assert map != null; return map.computeIfAbsent(rootPath, (ignored) -> new Guard(false) // root can be processed more than once (similar dependency root can be used in multiple libraries) ); }
|
getRootGuard
|
2,536 |
Collection<JpsTypedLibrary<JpsSimpleElement<JpsMavenRepositoryLibraryDescriptor>>> (Collection<? extends JpsModule> modules) { final Collection<JpsTypedLibrary<JpsSimpleElement<JpsMavenRepositoryLibraryDescriptor>>> result = new SmartHashSet<>(); for (JpsModule module : modules) { for (JpsDependencyElement dep : module.getDependenciesList().getDependencies()) { if (dep instanceof JpsLibraryDependency) { final JpsLibrary _lib = ((JpsLibraryDependency)dep).getLibrary(); final JpsTypedLibrary<JpsSimpleElement<JpsMavenRepositoryLibraryDescriptor>> lib = _lib != null ? _lib.asTyped(JpsRepositoryLibraryType.INSTANCE) : null; if (lib != null) { result.add(lib); } } } } return result; }
|
getRepositoryLibraries
|
2,537 |
void (@NlsSafe String message) { context.processMessage(new ProgressMessage(message)); }
|
consume
|
2,538 |
boolean () { return context.getCancelStatus().isCanceled(); }
|
isCanceled
|
2,539 |
File (@NotNull JpsGlobal global) { final JpsPathVariablesConfiguration pvConfig = JpsModelSerializationDataService.getPathVariablesConfiguration(global); final String localRepoPath = pvConfig != null ? pvConfig.getUserVariableValue(MAVEN_REPOSITORY_PATH_VAR) : null; if (localRepoPath != null) { return new File(localRepoPath); } final String root = System.getProperty("user.home", null); return root != null ? new File(root, DEFAULT_MAVEN_REPOSITORY_PATH) : new File(DEFAULT_MAVEN_REPOSITORY_PATH); }
|
getLocalArtifactRepositoryRoot
|
2,540 |
void (@NotNull ProjectDependenciesResolvingTarget target, @NotNull DirtyFilesHolder<BuildRootDescriptor, ProjectDependenciesResolvingTarget> holder, @NotNull BuildOutputConsumer outputConsumer, @NotNull CompileContext context) { context.processMessage(new ProgressMessage(JpsBuildBundle.message("progress.message.resolving.repository.libraries.in.the.project"))); try { DependencyResolvingBuilder.resolveMissingDependencies(context, context.getProjectDescriptor().getProject().getModules(), BuildTargetChunk.forSingleTarget(target)); } catch (Exception e) { DependencyResolvingBuilder.reportError(context, "project", e); } }
|
build
|
2,541 |
String () { return JpsBuildBundle.message("builder.name.project.dependencies.resolver"); }
|
getPresentableName
|
2,542 |
String () { return "project"; }
|
getId
|
2,543 |
List<BuildRootDescriptor> (@NotNull JpsModel model, @NotNull ModuleExcludeIndex index, @NotNull IgnoredFileIndex ignoredFileIndex, @NotNull BuildDataPaths dataPaths) { return Collections.emptyList(); }
|
computeRootDescriptors
|
2,544 |
String () { return "Project Dependencies Resolving"; }
|
getPresentableName
|
2,545 |
Collection<File> (@NotNull CompileContext context) { return Collections.emptyList(); }
|
getOutputRoots
|
2,546 |
List<ProjectDependenciesResolvingTarget> (@NotNull JpsModel model) { return Collections.singletonList(new ProjectDependenciesResolvingTarget()); }
|
computeAllTargets
|
2,547 |
BuildTargetLoader<ProjectDependenciesResolvingTarget> (@NotNull JpsModel model) { return new BuildTargetLoader<ProjectDependenciesResolvingTarget>() { @Override public ProjectDependenciesResolvingTarget createTarget(@NotNull String targetId) { return new ProjectDependenciesResolvingTarget(); } }; }
|
createLoader
|
2,548 |
ProjectDependenciesResolvingTarget (@NotNull String targetId) { return new ProjectDependenciesResolvingTarget(); }
|
createTarget
|
2,549 |
String () { return myCompilerName; }
|
getCompilerName
|
2,550 |
long () { return myLine; }
|
getLine
|
2,551 |
long () { return myColumn; }
|
getColumn
|
2,552 |
long () { return myProblemBeginOffset; }
|
getProblemBeginOffset
|
2,553 |
long () { return myProblemEndOffset; }
|
getProblemEndOffset
|
2,554 |
long () { return myProblemLocationOffset; }
|
getProblemLocationOffset
|
2,555 |
void (String moduleName) { myModuleNames.add(moduleName); }
|
addModuleName
|
2,556 |
Collection<String> () { return Collections.unmodifiableCollection(myModuleNames); }
|
getModuleNames
|
2,557 |
String () { final StringBuilder builder = new StringBuilder(); builder.append(getCompilerName()).append(":").append(getKind().name()).append(":").append(super.toString()); final String path = getSourcePath(); if (path != null) { builder.append("; file: ").append(path); final long line = getLine(); final long column = getColumn(); if (line >= 0 && column >= 0) { builder.append(" at (").append(line).append(":").append(column).append(")"); } } return builder.toString(); }
|
toString
|
2,558 |
void (String root, String relativePath) { if (root != null && relativePath != null) { myPaths.add(Pair.create(FileUtil.toSystemIndependentName(root), FileUtil.toSystemIndependentName(relativePath))); } else { LOG.info("Invalid file generation event: root=" + root + "; relativePath=" + relativePath); } }
|
add
|
2,559 |
long (BuildTargetType<?> type, Set<? extends BuildTargetType<?>> allTypes, Object2LongMap<BuildTargetType<?>> expectedBuildTimeForTarget) { BuilderRegistry registry = BuilderRegistry.getInstance(); int baseTargetsCount = 0; long expectedTimeSum = 0; for (BuildTargetType<?> anotherType : allTypes) { long realExpectedTime = expectedBuildTimeForTarget.getLong(anotherType); long defaultExpectedTime = registry.getExpectedBuildTimeForTarget(anotherType); if (realExpectedTime != -1 && defaultExpectedTime > 0) { baseTargetsCount++; expectedTimeSum += realExpectedTime * registry.getExpectedBuildTimeForTarget(type) / defaultExpectedTime; } } return baseTargetsCount != 0 ? expectedTimeSum/baseTargetsCount : registry.getExpectedBuildTimeForTarget(type); }
|
computeExpectedTimeBasedOnOtherTargets
|
2,560 |
void () { myFreezeDetector.stop(); if (LOG.isDebugEnabled()) { LOG.debug("update expected build time for " + myTotalBuildTimeForFullyRebuiltTargets.size() + " target types"); } myTotalBuildTimeForFullyRebuiltTargets.object2LongEntrySet().fastForEach(entry -> { BuildTargetType<?> type = entry.getKey(); long totalTime = entry.getLongValue(); BuildTargetsState targetsState = myDataManager.getTargetsState(); long oldAverageTime = targetsState.getAverageBuildTime(type); long newAverageTime; if (oldAverageTime == -1) { newAverageTime = totalTime / myNumberOfFullyRebuiltTargets.getInt(type); } else { //if not all targets of this type were fully rebuilt, we assume that old average value is still actual for them; this way we won't get incorrect value if only one small target was fully rebuilt newAverageTime = (totalTime + (myTotalTargets.getInt(type) - myNumberOfFullyRebuiltTargets.getInt(type)) * oldAverageTime) / myTotalTargets.getInt(type); } if (LOG.isDebugEnabled()) { LOG.debug(" " + type.getTypeId() + ": old=" + oldAverageTime + ", new=" + newAverageTime + " (based on " + myNumberOfFullyRebuiltTargets.getInt(type) + " of " + myTotalTargets.getInt(type) + " targets)"); } targetsState.setAverageBuildTime(type, newAverageTime); }); }
|
updateExpectedAverageTime
|
2,561 |
String () { return myBuilderId; }
|
getBuilderId
|
2,562 |
String () { return myMessageType; }
|
getMessageType
|
2,563 |
String () { return myMessageText; }
|
getMessageText
|
2,564 |
String (Collection<? extends BuildTarget<?>> targets, Event event) { String targetsString = StringUtil.join(targets, dom -> dom.getPresentableName(), ", "); return (event == Event.STARTED ? "Started" : "Finished") + " building " + targetsString; }
|
composeMessageText
|
2,565 |
Event () { return myEventType; }
|
getEventType
|
2,566 |
Collection<String> () { return myFilePaths; }
|
getFilePaths
|
2,567 |
Kind () { return myKind; }
|
getKind
|
2,568 |
String () { return myMessageText; }
|
getMessageText
|
2,569 |
String () { return getMessageText(); }
|
toString
|
2,570 |
float () { return myDone; }
|
getDone
|
2,571 |
void (float done) { myDone = done; }
|
setDone
|
2,572 |
String (String builderName, int srcCount, long time) { return "Build duration: Builder '" + StringUtil.capitalize(builderName) + "' took " + Utils.formatDuration(time) + "; " + srcCount + " sources processed" + (srcCount == 0 ? "" : " (" + time / srcCount + " ms per file)"); }
|
createText
|
2,573 |
String () { return myBuilderName; }
|
getBuilderName
|
2,574 |
int () { return myNumberOfProcessedSources; }
|
getNumberOfProcessedSources
|
2,575 |
long () { return myElapsedTimeMs; }
|
getElapsedTimeMs
|
2,576 |
void (final @NotNull OutputFileObject fileObject) { final BinaryContent content = fileObject.getContent(); boolean isTemp = false; final JavaFileObject.Kind outKind = fileObject.getKind(); final Collection<File> sourceFiles = ContainerUtil.collect(fileObject.getSourceFiles().iterator()); if (!sourceFiles.isEmpty() && content != null) { final List<String> sourcePaths = ContainerUtil.map(sourceFiles, f -> FileUtil.toSystemIndependentName(f.getPath())); JavaSourceRootDescriptor rootDescriptor = null; for (File srcFile : sourceFiles) { rootDescriptor = myContext.getProjectDescriptor().getBuildRootIndex().findJavaRootDescriptor(myContext, srcFile); if (rootDescriptor != null) { break; } } try { if (rootDescriptor != null) { isTemp = rootDescriptor.isTemp; if (!isTemp) { // first, handle [src->output] mapping and register paths for files_generated event if (outKind == JavaFileObject.Kind.CLASS) { myOutputConsumer.registerCompiledClass(rootDescriptor.target, new CompiledClass(fileObject.getFile(), sourceFiles, fileObject.getClassName(), content)); // todo: avoid array copying? } else { myOutputConsumer.registerOutputFile(rootDescriptor.target, fileObject.getFile(), sourcePaths); } } } else { // was not able to determine the source root descriptor or the source root is excluded from compilation (e.g. for annotation processors) if (outKind == JavaFileObject.Kind.CLASS) { myOutputConsumer.registerCompiledClass(null, new CompiledClass(fileObject.getFile(), sourceFiles, fileObject.getClassName(), content)); } } } catch (IOException e) { myContext.processMessage(new CompilerMessage(JavaBuilder.getBuilderName(), e)); } if (!isTemp && outKind == JavaFileObject.Kind.CLASS) { // register in mappings any non-temp class file try { final ClassReader reader = new FailSafeClassReader(content.getBuffer(), content.getOffset(), content.getLength()); myMappingsCallback.associate(FileUtil.toSystemIndependentName(fileObject.getFile().getPath()), sourcePaths, reader, fileObject.isGenerated()); } catch (Throwable e) { // need this to make sure that unexpected errors in, for example, ASM will not ruin the compilation final String message = JpsBuildBundle.message( "build.message.class.dependency.information.may.be.incomplete", fileObject.getFile().getPath() ); LOG.info(message, e); for (String sourcePath : sourcePaths) { myContext.processMessage(new CompilerMessage( JavaBuilder.getBuilderName(), BuildMessage.Kind.WARNING, message + "\n" + CompilerMessage.getTextFromThrowable(e), sourcePath )); } } } } if (outKind == JavaFileObject.Kind.CLASS) { myContext.processMessage(new ProgressMessage(JpsBuildBundle.message("progress.message.writing.classes.0", myChunkName))); if (!isTemp && !sourceFiles.isEmpty()) { mySuccessfullyCompiled.addAll(sourceFiles); } } }
|
save
|
2,577 |
Set<File> () { return Collections.unmodifiableSet(mySuccessfullyCompiled); }
|
getSuccessfullyCompiled
|
2,578 |
void (final @NotNull File sourceFile) { mySuccessfullyCompiled.remove(sourceFile); }
|
markError
|
2,579 |
void (final @NotNull Set<File> problematic) { mySuccessfullyCompiled.removeAll(problematic); }
|
markError
|
2,580 |
boolean (@NotNull JpsModule module, @NotNull JpsModuleSourceRoot root) { final JpsJavaCompilerConfiguration compilerConfig = JpsJavaExtensionService.getInstance().getCompilerConfiguration(module.getProject()); final ProcessorConfigProfile profile = compilerConfig.getAnnotationProcessingProfile(module); if (!profile.isEnabled()) { return false; } final File outputDir = ProjectPaths.getAnnotationProcessorGeneratedSourcesOutputDir(module, JavaSourceRootType.TEST_SOURCE == root.getRootType(), profile); return outputDir != null && FileUtil.filesEqual(outputDir, root.getFile()); }
|
isExcludedFromCompilation
|
2,581 |
void () { }
|
initialize
|
2,582 |
boolean () { return true; }
|
isEnabled
|
2,583 |
void (CompileContext context, String filePath, Iterable<Map.Entry<? extends JavacRef, Integer>> refs, Collection<? extends JavacDef> defs, Collection<? extends JavacTypeCast> casts, Collection<? extends JavacRef> implicitToString) { final Set<String> definedClasses = new HashSet<>(); for (JavacDef def : defs) { if (def instanceof JavacDef.JavacClassDef) { final JavacRef element = def.getDefinedElement(); if (element instanceof JavacRef.JavacClass) { definedClasses.add(element.getName()); } } } if (definedClasses.isEmpty()) { return; } Iterator<Map.Entry<? extends JavacRef, Integer>> iterator = refs.iterator(); if (iterator.hasNext()) { final Set<String> classImports = new HashSet<>(); final Set<String> staticImports = new HashSet<>(); final Map<String, List<Callbacks.ConstantRef>> cRefs = new HashMap<>(); while (iterator.hasNext()) { JavacRef ref = iterator.next().getKey(); final JavacRef.ImportProperties importProps = ref.getImportProperties(); if (importProps != null) { // the reference comes from import list if (ref instanceof JavacRef.JavacClass) { classImports.add(ref.getName()); if (importProps.isStatic() && importProps.isOnDemand()) { staticImports.add(ref.getName() + ".*"); } } else { if (ref instanceof JavacRef.JavacField || ref instanceof JavacRef.JavacMethod) { staticImports.add(ref.getOwnerName() + "." + ref.getName()); } } } else if (ref instanceof JavacRef.JavacField && ref.getModifiers().contains(Modifier.FINAL)) { final JavacRef.JavacField fieldRef = (JavacRef.JavacField)ref; final String descriptor = fieldRef.getDescriptor(); if (descriptor != null && definedClasses.contains(fieldRef.getContainingClass()) && !definedClasses.contains(fieldRef.getOwnerName())) { List<Callbacks.ConstantRef> refsList = cRefs.get(fieldRef.getContainingClass()); if (refsList == null) { refsList = new ArrayList<>(); cRefs.put(fieldRef.getContainingClass(), refsList); } refsList.add(Callbacks.createConstantReference(fieldRef.getOwnerName(), fieldRef.getName(), descriptor)); } } } if (!classImports.isEmpty() || !staticImports.isEmpty()) { final Callbacks.Backend reg = JavaBuilderUtil.getDependenciesRegistrar(context); for (String aClass : definedClasses) { reg.registerImports(aClass, classImports, staticImports); } } if (!cRefs.isEmpty()) { final Callbacks.Backend reg = JavaBuilderUtil.getDependenciesRegistrar(context); for (String aClass : definedClasses) { final List<Callbacks.ConstantRef> classCRefs = cRefs.get(aClass); reg.registerConstantReferences(aClass, classCRefs != null? classCRefs : Collections.emptyList()); } } } }
|
registerFile
|
2,584 |
void (final String elemName, final String nsPrefix, final String nsURI, final String systemID, final int lineNr) { if (!FORM_TAG.equalsIgnoreCase(elemName)) { stop(); } boolean alien = !Utils.FORM_NAMESPACE.equalsIgnoreCase(nsURI); if (alien) { isAlien.set(Boolean.TRUE); stop(); } }
|
startElement
|
2,585 |
void (final String key, final String nsPrefix, final String nsURI, final String value, final String type) { if (UIFormXmlConstants.ATTRIBUTE_BIND_TO_CLASS.equals(key)) { result.set(value); stop(); } }
|
addAttribute
|
2,586 |
void (final String name, final String nsPrefix, final String nsURI) { stop(); }
|
elementAttributesProcessed
|
2,587 |
void (final InputStream is, final IXMLBuilder builder) { try (is) { parse(new MyXMLReader(is), builder); } catch (IOException e) { LOG.error(e); } }
|
parse
|
2,588 |
void (final StdXMLReader r, final IXMLBuilder builder) { StdXMLParser parser = new StdXMLParser(); parser.setReader(r); parser.setBuilder(builder); parser.setValidator(new EmptyValidator()); parser.setResolver(new EmptyEntityResolver()); try { parser.parse(); } catch (XMLException e) { if (e.getException() instanceof ParserStoppedException) { return; } LOG.debug(e); } }
|
parse
|
2,589 |
void (String name, String systemId, int lineNr) { }
|
elementStarted
|
2,590 |
void (String key, String value, String systemId, int lineNr) { }
|
attributeAdded
|
2,591 |
void (String name, Properties extraAttributes, String systemId, int lineNr) { }
|
elementAttributesProcessed
|
2,592 |
void (String name, String value) { }
|
addInternalEntity
|
2,593 |
void (String name, String publicID, String systemID) { }
|
addExternalEntity
|
2,594 |
Reader (StdXMLReader xmlReader, String name) { return new StringReader(""); }
|
getEntity
|
2,595 |
boolean (String name) { return false; }
|
isExternalEntity
|
2,596 |
Reader (String publicId, String systemId) { return new StringReader(" "); }
|
openStream
|
2,597 |
void (final String systemID, final int lineNr) { }
|
startBuilding
|
2,598 |
void (final String target, final Reader reader) { }
|
newProcessingInstruction
|
2,599 |
void (final String name, final String nsPrefix, final String nsURI, final String systemID, final int lineNr) { }
|
startElement
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.