Skip to content

Commit 5c293e1

Browse files
committed
update
1 parent ce249fe commit 5c293e1

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

src/main/java/tabby/algo/NewPathFinding.java renamed to src/main/java/tabby/algo/beta/PathFinding.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tabby.algo;
1+
package tabby.algo.beta;
22

33
import org.neo4j.graphalgo.BasicEvaluationContext;
44
import org.neo4j.graphalgo.impl.path.TraversalPathFinder;
@@ -20,7 +20,7 @@
2020
* @author wh1t3p1g
2121
* @since 2022/1/6
2222
*/
23-
public class NewPathFinding {
23+
public class PathFinding {
2424

2525
@Context
2626
public GraphDatabaseService db;
@@ -62,7 +62,7 @@ public Stream<PathResult> findPathWithState(@Name("source") Node sourceNode,
6262
}
6363

6464
@Procedure("tabby.beta.findPathWithAuth")
65-
@Description("tabby.beta.findPath(source, sink, maxNodeLength, isDepthFirst) YIELD path, weight" +
65+
@Description("tabby.beta.findPathWithAuth(source, sink, maxNodeLength, isDepthFirst) YIELD path, weight" +
6666
" - using findPath to get source-sink path with maxNodeLength")
6767
public Stream<PathResult> findPathWithAuth(@Name("source") Node sourceNode,
6868
@Name("sink") Node sinkNode,

src/main/java/tabby/algo/JavaGadgetPathFinding.java renamed to src/main/java/tabby/algo/release/JavaGadgetPathFinding.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tabby.algo;
1+
package tabby.algo.release;
22

33
import org.neo4j.graphalgo.BasicEvaluationContext;
44
import org.neo4j.graphdb.*;

src/main/java/tabby/algo/PathFinding.java renamed to src/main/java/tabby/algo/release/PathFinding.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tabby.algo;
1+
package tabby.algo.release;
22

33
import org.neo4j.graphalgo.BasicEvaluationContext;
44
import org.neo4j.graphalgo.impl.path.TraversalPathFinder;

src/main/java/tabby/data/Pollution.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Set<Integer> getFlatPolluted(){
5252
}
5353

5454
public Set<String> getTypes(int index){
55-
if(types.size() < index) return new HashSet<>();
55+
if(types.size() <= index) return new HashSet<>();
5656
return types.get(index);
5757
}
5858

@@ -99,8 +99,11 @@ public static Pollution getNextPollution(Pollution pre, Pollution cur){
9999
next.add(Set.of(index-1));
100100
flag = false;
101101
}
102-
int pos = p+1;
103-
if(pos < pre.getTypes().size() && pos >= 0 && !cur.isCallerInstanceObj()){
102+
}
103+
104+
int pos = p+1;
105+
if(pos < pre.getTypes().size() && pos >= 0){
106+
if(index != 0 || !cur.isCallerInstanceObj()){
104107
newTypes.addAll(pre.getTypes(pos));
105108
}
106109
}
@@ -224,7 +227,7 @@ public static Pollution pure(Node start, Node end, Pollution cur){
224227

225228
if(!types.isEmpty()){
226229
Set<String> baseObjTypes = types.get(0);
227-
if(baseObjTypes.size() > 0){
230+
if(baseObjTypes.size() > 0 && !baseObjTypes.contains("java.lang.Object")){
228231
try{
229232
String startNodeClazz = (String) start.getProperty("CLASSNAME");
230233
if(startNodeClazz != null && !startNodeClazz.isBlank()){

0 commit comments

Comments
 (0)