Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,12 @@ trait ConfigurationEntryPointsFinder extends EntryPointFinder {
declaringClass: String,
name: String,
descriptor: Option[String]
) derives ConfigReader
)

// Implement ConfigReader manually to avoid issue with scala-reflect: https://github.com/opalj/JCG/issues/17
implicit private val entryPointContainerReader: ConfigReader[EntryPointContainer] =
ConfigReader.forProduct3("declaring-class", "name", "descriptor")(EntryPointContainer.apply)
.orElse(ConfigReader.forProduct3("declaringClass", "name", "descriptor")(EntryPointContainer.apply))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this? There should only be one way to write the keys that is valid now.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • reference.conf uses "declaring-class":

    {declaring-class = "java/lang/System", name = "initializeSystemClass", descriptor = "()V"},
    {declaring-class = "java/lang/Thread", name = "<init>", descriptor = "(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;)V"},
    {declaring-class = "java/lang/Thread", name = "<init>", descriptor = "(Ljava/lang/ThreadGroup;Ljava/lang/String;)V"},
    {declaring-class = "java/lang/ThreadGroup", name = "<init>", descriptor = "()V"},
    {declaring-class = "java/lang/Thread", name = "exit", descriptor = "()V"},
    {declaring-class = "java/lang/ThreadGroup", name = "uncaughtException", descriptor = "(Ljava/lang/Thread;Ljava/lang/Throwable;)V"},
    {declaring-class = "java/lang/ref/Reference$ReferenceHandler", name = "run", descriptor = "()V"},
    {declaring-class = "java/lang/ClassLoader", name = " <init>", descriptor = "()V"},
    {declaring-class = "java/lang/ClassLoader", name = "loadClassInternal", descriptor = "(Ljava/lang/String;)Ljava/lang/Class;"},
    {declaring-class = "java/lang/ClassLoader", name = "checkPackageAccess", descriptor = "(Ljava/lang/Class;Ljava/security/ProtectionDomain;)V"},
    {declaring-class = "java/lang/ClassLoader", name = "addClass", descriptor = "(Ljava/lang/Class;)V"},
    {declaring-class = "java/lang/ClassLoader", name = "findNative", descriptor = "(Ljava/lang/ClassLoader;Ljava/lang/String;)J"},
    {declaring-class = "java/security/PrivilegedActionException", name = "<init>", descriptor = "(Ljava/lang/Exception;)V"},
    {declaring-class = "java/lang/System", name = "initPhase1", descriptor = "()V"},
    {declaring-class = "java/lang/System", name = "initPhase2", descriptor = "(ZZ)I"}
    {declaring-class = "java/lang/System", name = "initPhase3", descriptor = "()V"}

  • org.opalj.br.analyses.cg.InitialEntryPointsKey.entryPoints uses "declaringClass": https://github.com/opalj/JCG/blob/master/jcg_opal_testadapter/src/main/scala/OpalJCGAdatper.scala#L82-L83

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latter is because JCG has not been updated to recent Scala-3 based OPAL which, due to changes in the config library, had to change to "declaring-class". I.e., I think JCG has to be changed here instead of supporting different keys in OPAL.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation uses "declaringClass" too:

* {{{
* org.opalj.br.analyses.cg {
* InitialEntryPointKey {
* analysis = "org.opalj.br.analyses.cg.ConfigurationEntryPointsFinder"
* entryPoints = [
* {declaringClass = "java/util/List+", name = "add"},
* {declaringClass = "java/util/List", name = "remove", descriptor = "(I)Z"}
* ]
* }
* }
* }}}

Probably should be updated as well.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. Want to do that in this PR?

}

/**
Expand Down
Loading