From b5456a342e65f05c8ee950f8095f82785076952e Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 6 Sep 2024 15:57:44 +0200 Subject: [PATCH] Java: Update model generator expected test output. --- java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java | 2 +- .../dataflow/p/PrivateFlowViaPublicInterface.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java index 498c631f3d0d6..3e83c7150c1ea 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/Pojo.java @@ -170,7 +170,7 @@ public String getValue() { } // summary=p;Pojo;false;makeInnerPojo;(String);;Argument[0];ReturnValue;taint;df-generated - // MISSING CONTENT BASED SUMMARY. + // contentbased-summary=p;Pojo;false;makeInnerPojo;(String);;Argument[0];ReturnValue.SyntheticField[p.Pojo$InnerPojo.value];value;df-generated public InnerPojo makeInnerPojo(String value) { return new InnerPojo(value); } diff --git a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java index b60f9c9ef97dd..8b9397fdb3ca6 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java +++ b/java/ql/test/utils/modelgenerator/dataflow/p/PrivateFlowViaPublicInterface.java @@ -29,8 +29,9 @@ public PrivateImplWithSink(File file) { } // summary=p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];ReturnValue;taint;df-generated - // No content based summary as the summary for openStream can't be lifted as it pertains to a - // field. + // This summary shouldn't be created because the method is private. + // This is most likely because the lifting logic hasn't been properly adapted. + // SPURIOUS-contentbased-summary=p;PrivateFlowViaPublicInterface$PrivateImplWithSink;false;openStream;();;Argument[this].SyntheticField[p.PrivateFlowViaPublicInterface$PrivateImplWithSink.file];ReturnValue;taint;df-generated @Override public OutputStream openStream() throws IOException { return new FileOutputStream(file); @@ -53,7 +54,7 @@ public OutputStream openStreamNone() throws IOException { } // summary=p;PrivateFlowViaPublicInterface;true;createAnSPI;(File);;Argument[0];ReturnValue;taint;df-generated - // MISSING content based summary. + // contentbased-summary=p;PrivateFlowViaPublicInterface;true;createAnSPI;(File);;Argument[0];ReturnValue.SyntheticField[p.PrivateFlowViaPublicInterface$PrivateImplWithSink.file];value;df-generated public static SPI createAnSPI(File file) { return new PrivateImplWithSink(file); }