Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
40,900
Statement () { throw new RuntimeException("not implemented"); }
getSimpleCopy
40,901
void () { if (!stats.isEmpty()) { first = stats.get(0); } }
initSimpleCopy
40,902
void (Statement oldstat, Statement newstat) { cancellationManager.checkCanceled(); for (StatEdge edge : oldstat.getAllPredecessorEdges()) { oldstat.removePredecessor(edge); edge.getSource().changeEdgeNode(EdgeDirection.FORWARD, edge, newstat); newstat.addPredecessor(edge); } for (StatEdge edge : oldstat.getAllSuccessor...
replaceStatement
40,903
void (Statement root, List<? super Statement> lst) { LinkedList<Statement> stackNode = new LinkedList<>(); LinkedList<Integer> stackIndex = new LinkedList<>(); HashSet<Statement> setVisited = new HashSet<>(); stackNode.add(root); stackIndex.add(0); while (!stackNode.isEmpty()) { Statement node = stackNode.getLast(); in...
addToReversePostOrderListIterative
40,904
void (Statement stat, List<? super Statement> lst, HashSet<? super Statement> setVisited) { if (setVisited.contains(stat)) { // because of not considered exception edges, s. isExitComponent. Should be rewritten, if possible. return; } setVisited.add(stat); for (StatEdge prededge : stat.getEdges(EdgeType.REGULAR.unite(E...
addToPostReversePostOrderList
40,905
void (EdgeDirection direction, StatEdge edge, Statement value) { cancellationManager.checkCanceled(); Map<EdgeType, List<StatEdge>> mapEdges = direction == EdgeDirection.BACKWARD ? mapPredEdges : mapSuccEdges; Map<EdgeType, List<Statement>> mapStates = direction == EdgeDirection.BACKWARD ? mapPredStates : mapSuccStates...
changeEdgeNode
40,906
void (EdgeDirection direction, StatEdge edge, EdgeType newtype) { cancellationManager.checkCanceled(); EdgeType oldtype = edge.getType(); if (oldtype == newtype) { return; } if (oldtype == EdgeType.EXCEPTION || newtype == EdgeType.EXCEPTION) { throw new RuntimeException("Invalid edge type!"); } removeEdgeDirectInternal...
changeEdgeType
40,907
List<StatEdge> (EdgeType type, @NotNull EdgeDirection direction) { cancellationManager.checkCanceled(); Map<EdgeType, List<StatEdge>> map = direction == EdgeDirection.BACKWARD ? mapPredEdges : mapSuccEdges; List<StatEdge> res; if ((type.mask() & (type.mask() - 1)) == 0) { res = map.get(type); res = res == null ? new Ar...
getEdges
40,908
List<Statement> (EdgeType type, EdgeDirection direction) { cancellationManager.checkCanceled(); Map<EdgeType, List<Statement>> map = direction == EdgeDirection.BACKWARD ? mapPredStates : mapSuccStates; List<Statement> res; if ((type.mask() & (type.mask() - 1)) == 0) { res = map.get(type); res = res == null ? new ArrayL...
getNeighbours
40,909
Set<Statement> (EdgeType type, EdgeDirection direction) { return new HashSet<>(getNeighbours(type, direction)); }
getNeighboursSet
40,910
List<StatEdge> (EdgeType type) { return getEdges(type, EdgeDirection.FORWARD); }
getSuccessorEdges
40,911
List<StatEdge> (EdgeType type) { return getEdges(type, EdgeDirection.BACKWARD); }
getPredecessorEdges
40,912
List<StatEdge> () { return getEdges(EdgeType.ALL, EdgeDirection.FORWARD); }
getAllSuccessorEdges
40,913
List<StatEdge> () { return getEdges(EdgeType.ALL, EdgeDirection.BACKWARD); }
getAllPredecessorEdges
40,914
Statement () { cancellationManager.checkCanceled(); return first; }
getFirst
40,915
void (Statement first) { this.first = first; }
setFirst
40,916
Statement () { return post; }
getPost
40,917
StatementType () { return lastBasicType; }
getLastBasicType
40,918
HashSet<Statement> () { return continueSet; }
getContinueSet
40,919
boolean () { return containsMonitorExit; }
isContainsMonitorExit
40,920
boolean () { return isMonitorEnter; }
isMonitorEnter
40,921
BasicBlockStatement () { if (type == StatementType.BASIC_BLOCK) { return (BasicBlockStatement)this; } else { return first.getBasichead(); } }
getBasichead
40,922
boolean () { for (StatEdge edge : labelEdges) { if (edge.labeled && edge.explicit) { // FIXME: consistent setting return true; } } return false; }
isLabeled
40,923
boolean () { // FIXME: default switch return type == StatementType.BASIC_BLOCK || (type == StatementType.IF && ((IfStatement)this).iftype == IfStatement.IFTYPE_IF) || (type == StatementType.DO && ((DoStatement)this).getLoopType() != LoopType.DO); }
hasBasicSuccEdge
40,924
Statement () { cancellationManager.checkCanceled(); return parent; }
getParent
40,925
void (Statement parent) { this.parent = parent; }
setParent
40,926
HashSet<StatEdge> () { // FIXME: why HashSet? return labelEdges; }
getLabelEdges
40,927
List<Exprent> () { cancellationManager.checkCanceled(); return varDefinitions; }
getVarDefinitions
40,928
List<Exprent> () { cancellationManager.checkCanceled(); return exprents; }
getExprents
40,929
void (List<Exprent> exprents) { this.exprents = exprents; }
setExprents
40,930
boolean () { return copied; }
isCopied
40,931
void (boolean copied) { this.copied = copied; }
setCopied
40,932
String () { return Integer.toString(id); }
toString
40,933
IMatchable (MatchNode matchNode, int index) { int node_type = matchNode.getType(); if (node_type == MatchNode.MATCHNODE_STATEMENT && !this.stats.isEmpty()) { String position = (String)matchNode.getRuleValue(MatchProperties.STATEMENT_POSITION); if (position != null) { if (position.matches("-?\\d+")) { return this.stats....
findObject
40,934
boolean (MatchNode matchNode, MatchEngine engine) { if (matchNode.getType() != MatchNode.MATCHNODE_STATEMENT) { return false; } for (Entry<MatchProperties, RuleValue> rule : matchNode.getRules().entrySet()) { switch (rule.getKey()) { case STATEMENT_TYPE -> { if (this.type != rule.getValue().value) { return false; } } c...
match
40,935
TextBuffer (int indent, BytecodeMappingTracer tracer) { return ExprProcessor.listToJava(varDefinitions, indent, tracer).append(first.toJava(indent, tracer)); }
toJava
40,936
DummyExitStatement () { return dummyExit; }
getDummyExit
40,937
Statement (Statement head) { if (head.type == StatementType.BASIC_BLOCK && head.getLastBasicType() == StatementType.IF) { int regsize = head.getSuccessorEdges(EdgeType.REGULAR).size(); Statement p = null; boolean ok = (regsize < 2); if (!ok) { List<Statement> lst = new ArrayList<>(); if (DecHelper.isChoiceStatement(hea...
isHead
40,938
TextBuffer (int indent, BytecodeMappingTracer tracer) { TextBuffer buf = new TextBuffer(); buf.append(ExprProcessor.listToJava(varDefinitions, indent, tracer)); buf.append(first.toJava(indent, tracer)); if (isLabeled()) { buf.appendIndent(indent).append("label").append(Integer.toString(id)).append(":").appendLineSepara...
toJava
40,939
void () { IfExprent ifexpr = (IfExprent)first.getExprents().remove(first.getExprents().size() - 1); if (negated) { ifexpr = (IfExprent)ifexpr.copy(); ifexpr.negateIf(); } headexprent.set(0, ifexpr); }
initExprents
40,940
List<Object> () { List<Object> lst = new ArrayList<>(stats); lst.add(1, headexprent.get(0)); return lst; }
getSequentialObjects
40,941
void (Exprent oldexpr, Exprent newexpr) { if (headexprent.get(0) == oldexpr) { headexprent.set(0, newexpr); } }
replaceExprent
40,942
void (Statement oldstat, Statement newstat) { super.replaceStatement(oldstat, newstat); if (ifstat == oldstat) { ifstat = newstat; } if (elsestat == oldstat) { elsestat = newstat; } List<StatEdge> lstSuccs = first.getSuccessorEdges(EdgeType.DIRECT_ALL); if (iftype == IFTYPE_IF) { ifedge = lstSuccs.get(0); elseedge = nu...
replaceStatement
40,943
Statement () { IfStatement is = new IfStatement(); is.iftype = this.iftype; is.negated = this.negated; return is; }
getSimpleCopy
40,944
void () { first = stats.get(0); List<StatEdge> lstSuccs = first.getSuccessorEdges(EdgeType.DIRECT_ALL); ifedge = lstSuccs.get((iftype == IFTYPE_IF || negated) ? 0 : 1); if (stats.size() > 1) { ifstat = stats.get(1); } if (iftype == IFTYPE_IFELSE) { elseedge = lstSuccs.get(negated ? 1 : 0); elsestat = stats.get(2); } }
initSimpleCopy
40,945
Statement () { return elsestat; }
getElsestat
40,946
void (Statement elsestat) { this.elsestat = elsestat; }
setElsestat
40,947
Statement () { return ifstat; }
getIfstat
40,948
void (Statement ifstat) { this.ifstat = ifstat; }
setIfstat
40,949
boolean () { return negated; }
isNegated
40,950
void (boolean negated) { this.negated = negated; }
setNegated
40,951
List<Exprent> () { return headexprent; }
getHeadexprentList
40,952
IfExprent () { return (IfExprent)headexprent.get(0); }
getHeadexprent
40,953
void (StatEdge elseedge) { this.elseedge = elseedge; }
setElseEdge
40,954
void (StatEdge ifedge) { this.ifedge = ifedge; }
setIfEdge
40,955
StatEdge () { return ifedge; }
getIfEdge
40,956
StatEdge () { return elseedge; }
getElseEdge
40,957
IMatchable (MatchNode matchNode, int index) { IMatchable object = super.findObject(matchNode, index); if (object != null) { return object; } if (matchNode.getType() == MatchNode.MATCHNODE_EXPRENT) { String position = (String)matchNode.getRuleValue(MatchProperties.EXPRENT_POSITION); if ("head".equals(position)) { return...
findObject
40,958
boolean (MatchNode matchNode, MatchEngine engine) { if (!super.match(matchNode, engine)) { return false; } Integer type = (Integer)matchNode.getRuleValue(MatchProperties.STATEMENT_IFTYPE); return type == null || this.iftype == type; }
match
40,959
void (Collection<Integer> bytecodeOffsets) { if (bytecodeOffsets != null && !bytecodeOffsets.isEmpty()) { if (bytecode == null) { bytecode = new HashSet<>(bytecodeOffsets); } else { bytecode.addAll(bytecodeOffsets); } } }
addBytecodeOffsets
40,960
void (boolean canBeRule) { this.canBeRule = canBeRule; }
setCanBeRule
40,961
void (@NotNull Statement statement, @NotNull Exprent guard) { guards.put(statement, guard); }
addGuard
40,962
void (@NotNull Statement statement) { stats.removeWithKey(statement.id); int caseIndex = caseStatements.indexOf(statement); if (caseIndex < 0) { return; } caseStatements.remove(caseIndex); caseEdges.remove(caseIndex); caseValues.remove(caseIndex); for (StatEdge edge : statement.getAllSuccessorEdges()) { edge.getDestina...
removeCaseStatement
40,963
int (@NotNull Statement currentStatement) { Statement dummy = currentStatement.getSimpleCopy(); int statIndex = stats.indexOf(currentStatement); if (statIndex < 0) { return statIndex; } stats.addWithKeyAndIndex(statIndex + 1, dummy, dummy.id); int caseIndex = caseStatements.indexOf(currentStatement); caseStatements.add...
duplicateCaseStatement
40,964
Statement (@NotNull Statement head) { if (head.type == StatementType.BASIC_BLOCK && head.getLastBasicType() == StatementType.SWITCH) { List<Statement> statements = new ArrayList<>(); if (DecHelper.isChoiceStatement(head, statements)) { Statement post = statements.remove(0); for (Statement statement : statements) { if (...
isHead
40,965
TextBuffer (int indent, @NotNull BytecodeMappingTracer tracer) { SwitchHelper.simplifySwitchOnEnum(this); TextBuffer buf = new TextBuffer(); buf.append(ExprProcessor.listToJava(varDefinitions, indent, tracer)); buf.append(first.toJava(indent, tracer)); if (isLabeled()) { buf.appendIndent(indent).append("label").append(...
toJava
40,966
void () { SwitchExprent exprent = (SwitchExprent)first.getExprents().remove(first.getExprents().size() - 1); exprent.setCaseValues(caseValues); headExprent = exprent; }
initExprents
40,967
List<Object> () { List<Object> result = new ArrayList<>(stats); result.add(1, headExprent); return result; }
getSequentialObjects
40,968
void (Exprent oldExprent, Exprent newExprent) { if (headExprent == oldExprent) { headExprent = newExprent; } }
replaceExprent
40,969
void (Statement oldStatement, Statement newStatement) { for (int i = 0; i < caseStatements.size(); i++) { if (caseStatements.get(i) == oldStatement) { caseStatements.set(i, newStatement); } } super.replaceStatement(oldStatement, newStatement); }
replaceStatement
40,970
Statement () { return new SwitchStatement(); }
getSimpleCopy
40,971
void () { first = stats.get(0); defaultEdge = first.getSuccessorEdges(EdgeType.DIRECT_ALL).get(0); sortEdgesAndNodes(); }
initSimpleCopy
40,972
void () { Map<StatEdge, Integer> edgeIndicesMapping = new HashMap<>(); List<StatEdge> firstSuccessors = first.getSuccessorEdges(EdgeType.DIRECT_ALL); for (int i = 0; i < firstSuccessors.size(); i++) { edgeIndicesMapping.put(firstSuccessors.get(i), i == 0 ? firstSuccessors.size() : i); } BasicBlockStatement firstBlock =...
sortEdgesAndNodes
40,973
void (int[] values, @NotNull List<List<Integer>> edgeIndices, @NotNull List<List<StatEdge>> caseEdges, @NotNull List<List<@Nullable Exprent>> caseValues) { for (List<Integer> indices : edgeIndices) { List<StatEdge> edges = new ArrayList<>(indices.size()); List<Exprent> valueExprents = new ArrayList<>(indices.size()); L...
mapEdgeIndicesToEdges
40,974
void (@NotNull Map<StatEdge, Integer> edgeIndicesMapping, @NotNull List<@Nullable Statement> nodes, @NotNull List<List<Integer>> edgeIndices) { for (int i = 1; i < stats.size(); i++) { Statement statement = stats.get(i); List<Integer> regularEdgeIndices = new ArrayList<>(); for (StatEdge regularEdge : statement.getPred...
collectRegularEdgesIndices
40,975
void (@NotNull Map<StatEdge, Integer> edgeIndicesMapping, @NotNull List<@Nullable Statement> nodes, @NotNull List<List<Integer>> edgeIndices) { List<StatEdge> firstExitEdges = first.getSuccessorEdges(EdgeType.BREAK.unite(EdgeType.CONTINUE)); while (!firstExitEdges.isEmpty()) { StatEdge exitEdge = firstExitEdges.get(0);...
collectExitEdgesIndices
40,976
void (List<@Nullable Statement> nodes, @NotNull List<List<Integer>> edgeIndices) { for (int i = 0; i < edgeIndices.size() - 1; i++) { for (int j = edgeIndices.size() - 1; j > i; j--) { if (edgeIndices.get(j - 1).get(0) > edgeIndices.get(j).get(0)) { edgeIndices.set(j, edgeIndices.set(j - 1, edgeIndices.get(j))); nodes....
sortEdges
40,977
void (List<@Nullable Statement> statements, @NotNull List<List<StatEdge>> edges) { for (int i = 0; i < statements.size(); i++) { if (statements.get(i) == null) { BasicBlockStatement basicBlock = new BasicBlockStatement(new BasicBlock( DecompilerContext.getCounterContainer().getCounterAndIncrement(CounterContainer.STATE...
replaceNullStatementsWithBasicBlocks
40,978
List<Exprent> () { return Collections.singletonList(headExprent); }
getHeadExprentList
40,979
Exprent () { return headExprent; }
getHeadExprent
40,980
List<List<StatEdge>> () { return caseEdges; }
getCaseEdges
40,981
List<Statement> () { return caseStatements; }
getCaseStatements
40,982
StatEdge () { return defaultEdge; }
getDefaultEdge
40,983
TextBuffer (int indent, BytecodeMappingTracer tracer) { TextBuffer tb = ExprProcessor.listToJava(varDefinitions, indent, tracer); tb.append(ExprProcessor.listToJava(exprents, indent, tracer)); return tb; }
toJava
40,984
Statement () { int id = DecompilerContext.getCounterContainer().getCounterAndIncrement(CounterContainer.STATEMENT_COUNTER); SimpleInstructionSequence seq = new SimpleInstructionSequence(); for (int i = 0; i < block.getSeq().length(); i++) { seq.addInstruction(block.getSeq().getInstr(i).clone(), -1); } return new BasicB...
getSimpleCopy
40,985
BasicBlock () { return block; }
getBlock
40,986
void () { try { buildInheritanceTree(); renameAllClasses(); renameInterfaces(); renameClasses(); context.reloadContext(); } catch (IOException ex) { throw new RuntimeException("Renaming failed!"); } }
rename
40,987
void () { List<ClassWrapperNode> lstClasses = getReversePostOrderListIterative(rootClasses); Map<String, Map<String, String>> classNameMaps = new HashMap<>(); for (ClassWrapperNode node : lstClasses) { StructClass cl = node.getClassStruct(); Map<String, String> names = new HashMap<>(); // merge information on super cla...
renameClasses
40,988
void () { List<ClassWrapperNode> lstInterfaces = getReversePostOrderListIterative(rootInterfaces); Map<String, Map<String, String>> interfaceNameMaps = new HashMap<>(); // rename methods and fields for (ClassWrapperNode node : lstInterfaces) { StructClass cl = node.getClassStruct(); Map<String, String> names = new Hash...
renameInterfaces
40,989
void () { // order not important List<ClassWrapperNode> lstAllClasses = new ArrayList<>(getReversePostOrderListIterative(rootInterfaces)); lstAllClasses.addAll(getReversePostOrderListIterative(rootClasses)); // rename all interfaces and classes for (ClassWrapperNode node : lstAllClasses) { renameClass(node.getClassStru...
renameAllClasses
40,990
void (StructClass cl) { if (!cl.isOwn()) { return; } String classOldFullName = cl.qualifiedName; // TODO: rename packages String clSimpleName = ConverterHelper.getSimpleClassName(classOldFullName); if (helper.toBeRenamed(IIdentifierRenamer.Type.ELEMENT_CLASS, clSimpleName, null, null)) { String classNewFullName; do { S...
renameClass
40,991
void (StructClass cl, Map<String, String> names) { // all classes are already renamed String classOldFullName = cl.qualifiedName; String classNewFullName = interceptor.getName(classOldFullName); if (classNewFullName == null) { classNewFullName = classOldFullName; } // methods HashSet<String> setMethodNames = new HashSe...
renameClassIdentifiers
40,992
String (String className) { return interceptor.getName(className); }
buildNewClassname
40,993
String (boolean isField, String descriptor) { String newDescriptor; if (isField) { newDescriptor = FieldDescriptor.parseDescriptor(descriptor).buildNewDescriptor(this); } else { newDescriptor = MethodDescriptor.parseDescriptor(descriptor).buildNewDescriptor(this); } return newDescriptor != null ? newDescriptor : descri...
buildNewDescriptor
40,994
List<ClassWrapperNode> (List<ClassWrapperNode> roots) { List<ClassWrapperNode> res = new ArrayList<>(); LinkedList<ClassWrapperNode> stackNode = new LinkedList<>(); LinkedList<Integer> stackIndex = new LinkedList<>(); Set<ClassWrapperNode> setVisited = new HashSet<>(); for (ClassWrapperNode root : roots) { stackNode.ad...
getReversePostOrderListIterative
40,995
void () { Map<String, ClassWrapperNode> nodes = new HashMap<>(); Map<String, StructClass> classes = context.getClasses(); List<ClassWrapperNode> rootClasses = new ArrayList<>(); List<ClassWrapperNode> rootInterfaces = new ArrayList<>(); for (StructClass cl : classes.values()) { if (!cl.isOwn()) { continue; } LinkedList...
buildInheritanceTree
40,996
void (String oldName, String newName) { mapOldToNewNames.put(oldName, newName); mapNewToOldNames.put(newName, oldName); }
addName
40,997
String (String oldName) { return mapOldToNewNames.get(oldName); }
getName
40,998
String (String newName) { return mapNewToOldNames.get(newName); }
getOldName
40,999
void (ClassWrapperNode node) { subclasses.add(node); }
addSubclass