|
17 | 17 | import soot.jimple.infoflow.results.ResultSinkInfo; |
18 | 18 | import soot.jimple.infoflow.results.ResultSourceInfo; |
19 | 19 | import soot.jimple.infoflow.solver.cfg.IInfoflowCFG; |
| 20 | +import soot.jimple.infoflow.sourcesSinks.definitions.ISourceSinkCategory; |
20 | 21 | import soot.jimple.infoflow.sourcesSinks.definitions.ISourceSinkDefinition; |
21 | 22 | import soot.jimple.infoflow.sourcesSinks.definitions.MethodSourceSinkDefinition; |
22 | 23 |
|
@@ -201,12 +202,17 @@ private void writeSourceInfo(ResultSourceInfo source, XMLStreamWriter writer) th |
201 | 202 | if (config.getEnableLineNumbers()) |
202 | 203 | writer.writeAttribute(XmlConstants.Attributes.linenumber, |
203 | 204 | String.valueOf(source.getStmt().getJavaSourceStartLineNumber())); |
204 | | - if (source.getDefinition().getCategory() != null) |
205 | | - writer.writeAttribute(XmlConstants.Attributes.category, |
206 | | - source.getDefinition().getCategory().getHumanReadableDescription()); |
| 205 | + |
| 206 | + ISourceSinkDefinition def = source.getDefinition(); |
| 207 | + ISourceSinkCategory category = def.getCategory(); |
| 208 | + if (category != null) { |
| 209 | + String desc = category.getHumanReadableDescription(); |
| 210 | + if (desc != null && !desc.isBlank()) |
| 211 | + writer.writeAttribute(XmlConstants.Attributes.category, desc); |
| 212 | + } |
| 213 | + |
207 | 214 | if (icfg != null) |
208 | 215 | writer.writeAttribute(XmlConstants.Attributes.method, icfg.getMethodOf(source.getStmt()).getSignature()); |
209 | | - ISourceSinkDefinition def = source.getDefinition(); |
210 | 216 | if (def instanceof MethodSourceSinkDefinition) { |
211 | 217 | MethodSourceSinkDefinition ms = (MethodSourceSinkDefinition) def; |
212 | 218 | if (ms.getMethod() != null) |
|
0 commit comments