+
Skip to content

[Bug]: ClassCastException with JimpleAnalysisInputLocation in JavaView.getClasses #1370

@adjoint-modality

Description

@adjoint-modality

What happened?

Trying to invoke JavaView.getClasses with the view containing a JimpleAnalysisInputLocation causes a ClassCastException. getClasses unconditionally casts class sources to JavaSootClassSource, from which buildClassFrom expects to get a JavaSootClass. Apparently this is not always the case.

Version

Latest release (e.g. via Maven)

Relevant log output

java.lang.ClassCastException: class sootup.core.model.SootClass cannot be cast to class sootup.java.core.JavaSootClass (sootup.core.model.SootClass and sootup.java.core.JavaSootClass are in unnamed module of loader 'app')
	at sootup.java.core.views.JavaView.buildClassFrom(JavaView.java:170)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.accept(Unknown Source)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
	at re.pranta.Extractor.extractFacts(Extractor.java:414)
	at re.pranta.Extractor.extract(Extractor.java:338)
	at re.pranta.Extract.run(Main.java:121)
	at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
	at picocli.CommandLine.access$1500(CommandLine.java:148)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
	at picocli.CommandLine.execute(CommandLine.java:2170)
	at re.pranta.Main.main(Main.java:50)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载