Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
---|---|---|
2,100 |
boolean (DifferentiateContext context, Difference.Change<JvmClass, JvmClass.Diff> classChange, Utils future, Utils present) { JvmClass changedClass = classChange.getPast(); Difference.Specifier<JvmField, JvmField.Diff> fieldsDiff = classChange.getDiff().fields(); if (!processAddedFields(context, changedClass, fieldsDiff.added(), future, present)) { return false; } if (!processRemovedFields(context, changedClass, fieldsDiff.removed(), future, present)) { return false; } if (!processChangedFields(context, changedClass, fieldsDiff.changed(), future, present)) { return false; } return true; }
|
processFieldChanges
|
2,101 |
boolean (DifferentiateContext context, JvmClass changedClass, Iterable<JvmField> added, Utils future, Utils present) { if (Iterators.isEmpty(added)) { return true; } debug("Processing added fields"); if (changedClass.getFlags().isEnum()) { debug("Constants added to enum, affecting class usages " + changedClass.getName()); // only mark synthetic classes used to implement switch statements: this will limit the number of recompiled classes to those where switch statements on changed enum are used context.affectUsage(new ClassUsage(changedClass.getReferenceID()), n -> n instanceof JVMClassNode<?, ?> && ((JVMClassNode<?, ?>)n).isSynthetic()); } for (JvmField addedField : added) { debug("Field: " + addedField.getName()); Set<JvmNodeReferenceID> changedClassWithSubclasses = future.collectSubclassesWithoutField(changedClass.getReferenceID(), addedField.getName()); changedClassWithSubclasses.add(changedClass.getReferenceID()); for (JvmNodeReferenceID subClass : changedClassWithSubclasses) { String affectReason = null; if (!addedField.isPrivate()) { for (JvmClass cl : future.getNodes(subClass, JvmClass.class)) { if (cl.isLocal()) { affectReason = "Affecting local subclass (introduced field can potentially hide surrounding method parameters/local variables): "; break; } else { String outerClassName = cl.getOuterFqName(); if (!outerClassName.isEmpty()) { Iterable<JvmClass> outerClasses = Iterators.collect(future.getClassesByName(outerClassName), new SmartList<>()); if (Iterators.isEmpty(outerClasses) || !Iterators.isEmpty(Iterators.filter(outerClasses, ocl -> future.isFieldVisible(ocl, addedField)))) { affectReason = "Affecting inner subclass (introduced field can potentially hide surrounding class fields): "; break; } } } } } if (affectReason != null) { affectNodeSources(context, subClass, affectReason); } if (!addedField.isPrivate() && addedField.isStatic()) { affectStaticMemberOnDemandUsages(context, subClass, Collections.emptyList()); } else { // ensure analysis scope includes classes that depend on the subclass context.affectUsage(new AffectionScopeMetaUsage(subClass)); } } context.affectUsage((n, u) -> { // affect all clients that access fields with the same name via subclasses, // if the added field is not visible to the client if (!(u instanceof FieldUsage) || !(n instanceof JvmClass)) { return false; } FieldUsage fieldUsage = (FieldUsage)u; return Objects.equals(fieldUsage.getName(), addedField.getName()) && changedClassWithSubclasses.contains(fieldUsage.getElementOwner()); }); } debug("End of added fields processing"); return true; }
|
processAddedFields
|
2,102 |
boolean (DifferentiateContext context, JvmClass changedClass, Iterable<JvmField> removed, Utils future, Utils present) { if (Iterators.isEmpty(removed)) { return true; } debug("Processing removed fields:"); for (JvmField removedField : removed) { debug("Field: ", removedField.getName()); if (!context.getParams().isProcessConstantsIncrementally() && !removedField.isPrivate() && removedField.isInlinable() && removedField.getValue() != null) { debug("Field had value and was (non-private) final => a switch to non-incremental mode requested"); if (!affectOnNonIncrementalChange(context, changedClass.getReferenceID(), removedField, present)) { debug("End of Differentiate, returning false"); return false; } } Set<JvmNodeReferenceID> propagated = present.collectSubclassesWithoutField(changedClass.getReferenceID(), removedField.getName()); affectMemberUsages(context, changedClass.getReferenceID(), removedField, propagated); if (!removedField.isPrivate() && removedField.isStatic()) { debug("The field was static --- affecting static field import usages"); affectStaticMemberImportUsages(context, changedClass.getReferenceID(), removedField.getName(), propagated); } } debug("End of removed fields processing"); return true; }
|
processRemovedFields
|
2,103 |
boolean (DifferentiateContext context, JvmClass changedClass, Iterable<Difference.Change<JvmField, JvmField.Diff>> changed, Utils future, Utils present) { if (Iterators.isEmpty(changed)) { return true; } debug("Processing changed fields:"); for (Difference.Change<JvmField, JvmField.Diff> change : changed) { JvmField changedField = change.getPast(); JvmField.Diff diff = change.getDiff(); if (diff.unchanged()) { continue; } debug("Field: ", changedField.getName()); Iterable<JvmNodeReferenceID> propagated = Iterators.lazy(() -> future.collectSubclassesWithoutField(changedClass.getReferenceID(), changedField.getName())); JVMFlags addedFlags = diff.getAddedFlags(); JVMFlags removedFlags = diff.getRemovedFlags(); if (!changedField.isPrivate() && changedField.isInlinable() && changedField.getValue() != null) { // if the field was a compile-time constant boolean harmful = !Iterators.isEmpty(Iterators.filter(List.of(addedFlags, removedFlags), f -> f.isStatic() || f.isFinal())); if (harmful || diff.valueChanged() || diff.accessRestricted()) { if (context.getParams().isProcessConstantsIncrementally()) { debug("Potentially inlined field changed its access or value => affecting field usages and static member import usages"); affectMemberUsages(context, changedClass.getReferenceID(), changedField, propagated); affectStaticMemberImportUsages(context, changedClass.getReferenceID(), changedField.getName(), propagated); } else { debug("Potentially inlined field changed its access or value => a switch to non-incremental mode requested"); if (!affectOnNonIncrementalChange(context, changedClass.getReferenceID(), changedField, present)) { debug("End of Differentiate, returning false"); return false; } } } } if (diff.typeChanged() || diff.signatureChanged()) { debug("Type or signature changed --- affecting field usages"); affectMemberUsages(context, changedClass.getReferenceID(), changedField, propagated); } else if (diff.flagsChanged()) { if (addedFlags.isStatic() || removedFlags.isStatic() || addedFlags.isPrivate() || addedFlags.isVolatile()) { debug("Added/removed static modifier or added private/volatile modifier --- affecting field usages"); affectMemberUsages(context, changedClass.getReferenceID(), changedField, propagated); if (!changedField.isPrivate()) { if (addedFlags.isStatic()) { debug("Added static modifier --- affecting static member on-demand import usages"); affectStaticMemberOnDemandUsages(context, changedClass.getReferenceID(), propagated); } else if (removedFlags.isStatic()) { debug("Removed static modifier --- affecting static field import usages"); affectStaticMemberImportUsages(context, changedClass.getReferenceID(), changedField.getName(), propagated); } } } else { Predicate<Node<?, ?>> constraint = null; if (removedFlags.isPublic()) { debug("Removed public modifier, affecting field usages with appropriate constraint"); constraint = addedFlags.isProtected()? new InheritanceConstraint(future, changedClass) : new PackageConstraint(changedClass.getPackageName()); affectMemberUsages(context, changedClass.getReferenceID(), changedField, propagated, constraint); } else if (removedFlags.isProtected() && diff.accessRestricted()){ debug("Removed protected modifier and the field became less accessible, affecting field usages with package constraint"); constraint = new PackageConstraint(changedClass.getPackageName()); affectMemberUsages(context, changedClass.getReferenceID(), changedField, propagated, constraint); } if (addedFlags.isFinal()) { debug("Added final modifier --- affecting field assign usages"); affectUsages(context, "field assign", Iterators.flat(Iterators.asIterable(changedClass.getReferenceID()), propagated), id -> changedField.createAssignUsage(id.getNodeName()), constraint); } } } if (!diff.annotations().unchanged()) { // todo: AnnotationsTracker handling } } debug("End of changed fields processing"); return true; }
|
processChangedFields
|
2,104 |
boolean (DifferentiateContext context, Difference.Specifier<JvmModule, JvmModule.Diff> modulesDiff, Utils future, Utils present) { if (modulesDiff.unchanged()) { return true; } for (JvmModule addedModule : modulesDiff.added()) { // after module has been added, the whole target should be rebuilt // because necessary 'require' directives may be missing from the newly added module-info file affectModule(context, future, addedModule); } for (JvmModule removedModule : modulesDiff.removed()) { affectDependentModules(context, present, removedModule, true, null); } for (Difference.Change<JvmModule, JvmModule.Diff> change : modulesDiff.changed()) { JvmModule changedModule = change.getPast(); JvmModule.Diff diff = change.getDiff(); boolean affectSelf = false; boolean affectDeps = false; Set<String> constraintPackageNames = new SmartHashSet<>(); if (diff.versionChanged()) { String version = changedModule.getVersion(); String moduleName = changedModule.getName(); affectDependentModules( context, present, changedModule, false, mod -> mod instanceof JvmModule && !Iterators.isEmpty(Iterators.filter(((JvmModule)mod).getRequires(), req -> Objects.equals(moduleName, req.getName()) && Objects.equals(version, req.getVersion()))) ); } Difference.Specifier<ModuleRequires, ModuleRequires.Diff> requiresDiff = diff.requires(); for (ModuleRequires removedRequires : requiresDiff.removed()) { affectSelf = true; if (removedRequires.isTransitive()) { affectDeps = true; break; } } for (Difference.Change<ModuleRequires, ModuleRequires.Diff> rChange : requiresDiff.changed()) { affectSelf |= rChange.getDiff().versionChanged(); if (rChange.getDiff().becameNonTransitive()) { affectDeps = true; // we could have created more precise constraint here: analyze if required module (recursively) // has only qualified exports that include given module's name. But this seems to be excessive since // in most cases module's exports are unqualified, so that any other module can access the exported API. } } Difference.Specifier<ModulePackage, ModulePackage.Diff> exportsDiff = diff.exports(); if (!affectDeps) { if (!Iterators.isEmpty(exportsDiff.removed())) { affectDeps = true; if (Iterators.isEmpty(Iterators.filter(exportsDiff.removed(), modPackage -> !modPackage.isQualified()))) { // all removed exports are qualified Iterators.collect(Iterators.flat(Iterators.map(exportsDiff.removed(), modPackage -> modPackage.getModules())), constraintPackageNames); } } } if (!affectDeps || !constraintPackageNames.isEmpty()) { for (Difference.Change<ModulePackage, ModulePackage.Diff> exportChange : exportsDiff.changed()) { Iterable<String> removedModuleNames = exportChange.getDiff().targetModules().removed(); affectDeps |= !Iterators.isEmpty(removedModuleNames); if (affectDeps) { Iterators.collect(removedModuleNames, constraintPackageNames); } } } if (affectSelf) { affectModule(context, present, changedModule); } if (affectDeps) { affectDependentModules( context, present, changedModule, true, constraintPackageNames.isEmpty()? null : node -> node instanceof JvmModule && constraintPackageNames.contains(((JvmModule)node).getName()) ); } } return true; }
|
processModules
|
2,105 |
void (DifferentiateContext context, JvmNodeReferenceID clsId, ProtoMember member, Iterable<JvmNodeReferenceID> propagated) { affectMemberUsages(context, clsId, member, propagated, null); }
|
affectMemberUsages
|
2,106 |
void (DifferentiateContext context, JvmNodeReferenceID clsId, ProtoMember member, Iterable<JvmNodeReferenceID> propagated, @Nullable Predicate<Node<?, ?>> constraint) { affectUsages( context, member instanceof JvmMethod? "method" : member instanceof JvmField? "field" : "member", Iterators.flat(Iterators.asIterable(clsId), propagated), id -> member.createUsage(id), constraint ); }
|
affectMemberUsages
|
2,107 |
void (DifferentiateContext context, JvmNodeReferenceID clsId, Iterable<JvmNodeReferenceID> propagated) { affectUsages( context, "static member on-demand import usage", Iterators.flat(Iterators.asIterable(clsId), propagated), id -> new ImportStaticOnDemandUsage(id), null ); }
|
affectStaticMemberOnDemandUsages
|
2,108 |
void (DifferentiateContext context, JvmNodeReferenceID clsId, String memberName, Iterable<JvmNodeReferenceID> propagated) { affectUsages( context, "static member import", Iterators.flat(Iterators.asIterable(clsId), propagated), id -> new ImportStaticMemberUsage(id.getNodeName(), memberName), null ); }
|
affectStaticMemberImportUsages
|
2,109 |
void (DifferentiateContext context, String usageKind, Iterable<JvmNodeReferenceID> usageOwners, Function<? super JvmNodeReferenceID, ? extends Usage> usageFactory, @Nullable Predicate<Node<?, ?>> constraint) { for (JvmNodeReferenceID id : usageOwners) { if (constraint != null) { context.affectUsage(usageFactory.apply(id), constraint); } else { context.affectUsage(usageFactory.apply(id)); } debug("Affect ", usageKind, " usage referenced of class ", id.getNodeName()); } }
|
affectUsages
|
2,110 |
void (DifferentiateContext context, Utils utils, ReferenceID fromClass, boolean affectUsages) { debug("Affecting subclasses of class: ", fromClass, "; with usages affection: ", affectUsages); for (ReferenceID cl : utils.withAllSubclasses(fromClass)) { affectNodeSources(context, cl, "Affecting source file: "); if (affectUsages) { String nodeName = utils.getNodeName(cl); if (nodeName != null) { context.affectUsage(new ClassUsage(nodeName)); debug("Affect usage of class ", nodeName); } } } }
|
affectSubclasses
|
2,111 |
void (DifferentiateContext context, Utils utils, ReferenceID fromClass) { for (ReferenceID id : utils.withAllSubclasses(fromClass)) { if (utils.isLambdaTarget(id)) { String clsName = utils.getNodeName(id); if (clsName != null) { debug("The interface could be not a SAM interface anymore or lambda target method name has changed => affecting lambda instantiations for ", clsName); context.affectUsage(new ClassNewUsage(clsName)); } } } }
|
affectLambdaInstantiations
|
2,112 |
boolean (DifferentiateContext context, JvmNodeReferenceID owner, Proto proto, Utils utils) { if (proto.isPublic()) { debug("Public access, switching to a non-incremental mode"); return false; } if (proto.isProtected()) { debug("Protected access, softening non-incremental decision: adding all relevant subclasses for a recompilation"); debug("Root class: ", owner); for (ReferenceID id : proto instanceof JvmField? utils.collectSubclassesWithoutField(owner, proto.getName()) : utils.allSubclasses(owner)) { affectNodeSources(context, id, "Adding "); } } String packageName = JvmClass.getPackageName(owner.getNodeName()); debug("Softening non-incremental decision: adding all package classes for a recompilation"); debug("Package name: ", packageName); for (ReferenceID nodeWithinPackage : Iterators.filter(context.getGraph().getRegisteredNodes(), id -> id instanceof JvmNodeReferenceID && packageName.equals(JvmClass.getPackageName(((JvmNodeReferenceID)id).getNodeName())))) { affectNodeSources(context, nodeWithinPackage, "Adding "); } return true; }
|
affectOnNonIncrementalChange
|
2,113 |
void (DifferentiateContext context, ReferenceID clsId, String affectReason) { affectNodeSources(context, clsId, affectReason, false); }
|
affectNodeSources
|
2,114 |
void (DifferentiateContext context, ReferenceID clsId, String affectReason, boolean forceAffect) { Set<NodeSource> deletedSources = context.getDelta().getDeletedSources(); Predicate<? super NodeSource> affectionFilter = context.getParams().affectionFilter(); for (NodeSource source : Iterators.filter(context.getGraph().getSources(clsId), affectionFilter::test)) { if (forceAffect || !context.isCompiled(source) && !deletedSources.contains(source)) { context.affectNodeSource(source); debug(affectReason, source.getPath()); } } }
|
affectNodeSources
|
2,115 |
void (DifferentiateContext context, Utils utils, JvmModule mod) { debug("Affecting module ", mod.getName()); for (NodeSource source : Iterators.filter(utils.getNodeSources(mod.getReferenceID()), context.getParams().affectionFilter()::test)) { context.affectNodeSource(source); debug("Affected source ", source.getPath()); } }
|
affectModule
|
2,116 |
void (DifferentiateContext context, Utils utils, JvmModule fromModule, boolean checkTransitive, @Nullable Predicate<Node<?, ?>> constraint) { Iterable<JvmModule> dependent = !checkTransitive? Collections.emptyList() : Iterators.recurseDepth( fromModule, mod -> Iterators.filter(Iterators.flat(Iterators.map(context.getGraph().getDependingNodes(mod.getReferenceID()), id -> utils.getNodes(id, JvmModule.class))), m -> m.requiresTransitively(mod.getName())), false ); for (JvmModule mod : Iterators.flat(Iterators.asIterable(fromModule), dependent)) { debug("Affecting modules depending on module ", mod.getName()); ModuleUsage usage = new ModuleUsage(mod.getReferenceID()); if (constraint != null) { context.affectUsage(usage, constraint); } else { context.affectUsage(usage); } } }
|
affectDependentModules
|
2,117 |
void (String message, Object... details) { if (LOG.isDebugEnabled()) { StringBuilder msg = new StringBuilder(message); for (Object detail : details) { msg.append(detail); } debug(msg.toString()); } }
|
debug
|
2,118 |
void (String message) { LOG.debug(message); }
|
debug
|
2,119 |
String () { return getElementOwner().getNodeName(); }
|
getModuleName
|
2,120 |
boolean () { return "<init>".equals(getName()); }
|
isConstructor
|
2,121 |
MethodUsage (JvmNodeReferenceID owner) { return new MethodUsage(owner, getName(), getDescriptor()); }
|
createUsage
|
2,122 |
Iterable<ParamAnnotation> () { return myParamAnnotations; }
|
getParamAnnotations
|
2,123 |
Iterable<TypeRepr> () { return myArgTypes; }
|
getArgTypes
|
2,124 |
boolean (JvmMethod other) { return getName().equals(other.getName()) && Iterators.equals(myArgTypes, other.myArgTypes); }
|
isSameByJavaRules
|
2,125 |
boolean (DiffCapable<?, ?> other) { if (!(other instanceof JvmMethod)) { return false; } JvmMethod that = (JvmMethod)other; return Objects.equals(getType(), that.getType()) && isSameByJavaRules(that); }
|
isSame
|
2,126 |
int () { return 31 * (31 * Iterators.hashCode(myArgTypes) + getType().hashCode()) + getName().hashCode(); }
|
diffHashCode
|
2,127 |
boolean (Object obj) { return obj instanceof JvmMethod && isSame((JvmMethod)obj); }
|
equals
|
2,128 |
int () { return diffHashCode(); }
|
hashCode
|
2,129 |
boolean () { return super.unchanged() && paramAnnotations().unchanged() && exceptions().unchanged(); }
|
unchanged
|
2,130 |
String () { final StringBuilder buf = new StringBuilder(); buf.append("("); for (TypeRepr t : myArgTypes) { buf.append(t.getDescriptor()); } buf.append(")"); buf.append(getType().getDescriptor()); return buf.toString(); }
|
getDescriptor
|
2,131 |
Iterable<String> () { return myUsedArgNames; }
|
getUsedArgNames
|
2,132 |
Iterable<ElemType> () { return myTargets; }
|
getTargets
|
2,133 |
boolean (Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final AnnotationUsage that = (AnnotationUsage)o; if (!myClassType.equals(that.myClassType)) { return false; } if (!myUsedArgNames.equals(that.myUsedArgNames)) { return false; } if (!myTargets.equals(that.myTargets)) { return false; } return true; }
|
equals
|
2,134 |
int () { int result = myClassType.hashCode(); result = 31 * result + myUsedArgNames.hashCode(); result = 31 * result + myTargets.hashCode(); return result; }
|
hashCode
|
2,135 |
boolean (Node<?, ?> node) { return !(node instanceof JvmClass) || !myPackageName.equals(((JvmClass)node).getPackageName()); }
|
test
|
2,136 |
boolean (JvmField other) { return isStatic() == other.isStatic() && isSynthetic() == other.isSynthetic() && isFinal() == other.isFinal() && Objects.equals(getType(), other.getType()); }
|
isSameKind
|
2,137 |
boolean () { return getFlags().isAllSet(INLINABLE_FIELD_FLAGS); }
|
isInlinable
|
2,138 |
FieldUsage (JvmNodeReferenceID owner) { return new FieldUsage(owner, getName(), getType().getDescriptor()); }
|
createUsage
|
2,139 |
FieldAssignUsage (String owner) { return new FieldAssignUsage(owner, getName(), getType().getDescriptor()); }
|
createAssignUsage
|
2,140 |
boolean (DiffCapable<?, ?> other) { return other instanceof JvmField && getName().equals(((JvmField)other).getName()); }
|
isSame
|
2,141 |
int () { return getName().hashCode(); }
|
diffHashCode
|
2,142 |
int () { return 31 * diffHashCode() + getType().hashCode(); }
|
hashCode
|
2,143 |
boolean (Object obj) { if (!(obj instanceof JvmField)) { return false; } JvmField other = (JvmField)obj; return isSame(other) && Objects.equals(getType(), other.getType()); }
|
equals
|
2,144 |
void (DataOutput out, Object v) { }
|
save
|
2,145 |
Object (DataInput in) { return null; }
|
load
|
2,146 |
JvmProtoMemberValueExternalizer (@Nullable Class<?> dataType) { if (dataType != null) { if (dataType.isArray()) { return ARRAY; } for (JvmProtoMemberValueExternalizer ext : values()) { if (ext.dataType != null && ext.dataType.isAssignableFrom(dataType)) { return ext; } } } return NONE; }
|
find
|
2,147 |
T () { return past; }
|
getPast
|
2,148 |
T () { return now; }
|
getNow
|
2,149 |
D () { return diff; }
|
getDiff
|
2,150 |
Iterable<V> () { return Iterators.map(diff.added(), adapter -> adapter.getValue()); }
|
added
|
2,151 |
Iterable<V> () { return Iterators.map(diff.removed(), adapter -> adapter.getValue()); }
|
removed
|
2,152 |
boolean () { return true; }
|
unchanged
|
2,153 |
Iterable<T> () { return now; }
|
added
|
2,154 |
boolean () { return false; }
|
unchanged
|
2,155 |
Iterable<T> () { return past; }
|
removed
|
2,156 |
boolean () { return false; }
|
unchanged
|
2,157 |
Iterable<T> () { return added; }
|
added
|
2,158 |
Iterable<T> () { return removed; }
|
removed
|
2,159 |
T () { return value; }
|
getValue
|
2,160 |
boolean (DiffCapable<?, ?> other) { return other instanceof Adapter && value.equals(((Adapter<?>)other).getValue()); }
|
isSame
|
2,161 |
int () { return value.hashCode(); }
|
diffHashCode
|
2,162 |
Difference (Adapter past) { return () -> value.equals(past.getValue()); }
|
difference
|
2,163 |
boolean () { return calculateAffected; }
|
isCalculateAffected
|
2,164 |
boolean () { return processConstantsIncrementally; }
|
isProcessConstantsIncrementally
|
2,165 |
DifferentiateParameters () { return this; }
|
get
|
2,166 |
DifferentiateParametersBuilder () { return new DifferentiateParametersBuilder(); }
|
create
|
2,167 |
DifferentiateParameters () { return create().get(); }
|
withDefaultSettings
|
2,168 |
DifferentiateParametersBuilder (boolean value) { calculateAffected = value; return this; }
|
calculateAffected
|
2,169 |
DifferentiateParametersBuilder (boolean value) { processConstantsIncrementally = value; return this; }
|
processConstantsIncrementally
|
2,170 |
DifferentiateParametersBuilder (Predicate<? super NodeSource> filter) { myAffectionFilter = filter; return this; }
|
withAffectionFilter
|
2,171 |
DifferentiateParametersBuilder (Predicate<? super NodeSource> filter) { myCurrentChunkFilter = filter; return this; }
|
withChunkStructureFilter
|
2,172 |
boolean (K key) { return myDelegate.containsKey(key); }
|
containsKey
|
2,173 |
void (K key, @NotNull V value) { myCache.invalidate(key); myDelegate.put(key, value); }
|
put
|
2,174 |
void (K key) { myCache.invalidate(key); myDelegate.remove(key); }
|
remove
|
2,175 |
Iterable<K> () { return myDelegate.getKeys(); }
|
getKeys
|
2,176 |
String () { return myName; }
|
getName
|
2,177 |
Iterable<ReferenceID> () { return myMap.getKeys(); }
|
getKeys
|
2,178 |
Iterable<ReferenceID> (@NotNull ReferenceID id) { return myMap.get(id); }
|
getDependencies
|
2,179 |
void (@NotNull Node<?, ?> node) { ReferenceID nodeID = node.getReferenceID(); for (ReferenceID referentId : getIndexedDependencies(node)) { myMap.appendValue(referentId, nodeID); } }
|
indexNode
|
2,180 |
void (Iterable<Node<?, ?>> deletedNodes, Iterable<Node<?, ?>> updatedNodes, BackDependencyIndex deltaIndex) { Map<ReferenceID, Set<ReferenceID>> depsToRemove = new HashMap<>(); for (var node : deletedNodes) { cleanupDependencies(node, depsToRemove); // corner case, relevant to situations when keys in this index are actually real node IDs // if a node gets deleted, corresponding index key gets deleted to: this allows to ensure there is no outdated information in the index // If later a new node with the same ID is added, the previous index data for this ID will not interfere with the new state. myMap.remove(node.getReferenceID()); } for (var node : updatedNodes) { cleanupDependencies(node, depsToRemove); } for (ReferenceID id : Iterators.unique(Iterators.flat(deltaIndex.getKeys(), depsToRemove.keySet()))) { Set<ReferenceID> toRemove = depsToRemove.get(id); if (!Iterators.isEmpty(toRemove)) { Set<ReferenceID> deps = Iterators.collect(getDependencies(id), new HashSet<>()); deps.removeAll(toRemove); myMap.put(id, Iterators.collect(deltaIndex.getDependencies(id), deps)); } else { Iterable<ReferenceID> toAdd = deltaIndex.getDependencies(id); if (!Iterators.isEmpty(toAdd)) { myMap.appendValues(id, toAdd); } } } }
|
integrate
|
2,181 |
void (Node<?, ?> node, Map<ReferenceID, Set<ReferenceID>> depsToRemove) { ReferenceID nodeID = node.getReferenceID(); for (ReferenceID referentId : getIndexedDependencies(node)) { Set<ReferenceID> deps = depsToRemove.get(referentId); if (deps == null) { depsToRemove.put(referentId, deps = new HashSet<>()); } deps.add(nodeID); } }
|
cleanupDependencies
|
2,182 |
DataOutput (DataOutput out) { return new GraphDataOutput(out); }
|
wrap
|
2,183 |
DataOutput (DataOutput out, StringEnumerator enumerator) { return new GraphDataOutput(out) { @Override public void writeUTF(@NotNull String s) throws IOException { writeInt(enumerator.toNumber(s)); } }; }
|
wrap
|
2,184 |
MapletFactory (String rootDirPath) { return new PersistentMapletFactory(rootDirPath); }
|
createPersistentContainerFactory
|
2,185 |
int (@Nullable T o) { return hashCodeImpl.apply(o); }
|
hashCode
|
2,186 |
boolean (@Nullable T a, @Nullable T b) { return equalsImpl.apply(a, b); }
|
equals
|
2,187 |
void () { Throwable ex = null; for (Closeable container : Iterators.flat(myMultiMaplets, myMaplets)) { try { container.close(); } catch (Throwable e) { if (ex == null) { ex = e; } } } myMultiMaplets.clear(); myMaplets.clear(); if (ex instanceof IOException) { throw new BuildDataCorruptedException((IOException)ex); } else if (ex != null) { throw new RuntimeException(ex); } }
|
close
|
2,188 |
Path (final String name) { final File file = new File(myRootDirPath, name); FileUtil.createIfDoesntExist(file); return file.toPath(); }
|
getMapFile
|
2,189 |
boolean (T val1, T val2) { return val1.equals(val2); }
|
isEqual
|
2,190 |
int (T value) { return value.hashCode(); }
|
getHashCode
|
2,191 |
boolean (K key) { return myMap.containsKey(key); }
|
containsKey
|
2,192 |
Iterable<V> (K key) { C col = myMap.get(key); return col != null? col : Collections.emptySet(); }
|
get
|
2,193 |
void (K key, @NotNull Iterable<? extends V> values) { //noinspection unchecked myMap.put(key, ensureCollection(values)); }
|
put
|
2,194 |
C (Iterable<? extends V> seq) { if (myEmptyCollection instanceof Set && seq instanceof Set) { return (C)seq; } if (myEmptyCollection instanceof List && seq instanceof List) { return (C)seq; } return Iterators.collect(seq, myCollectionFactory.get()); }
|
ensureCollection
|
2,195 |
void (K key) { myMap.remove(key); }
|
remove
|
2,196 |
void (K key, V value) { C values = myMap.get(key); if (values == null) { myMap.put(key, values = myCollectionFactory.get()); } values.add(value); }
|
appendValue
|
2,197 |
void (K key, V value) { C values = myMap.get(key); if (values != null) { values.remove(value); } }
|
removeValue
|
2,198 |
Iterable<K> () { return myMap.keySet(); }
|
getKeys
|
2,199 |
void () { myMap.clear(); }
|
close
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.