Skip to content

[JEP 411] Deprecate DoInsideDoPrivileged (DP_DO_INSIDE_DO_PRIVILEGED + DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED) #1515

@jglick

Description

@jglick

Assuming JEP 411 is accepted, DoInsideDoPrivileged will be issuing recommendations to insert API calls which are slated to be officially deprecated and either deleted or made no-ops. Suggest this detector be removed, or disabled by default.

<BugPattern type="DP_DO_INSIDE_DO_PRIVILEGED">
<ShortDescription>Method invoked that should be only be invoked inside a doPrivileged block</ShortDescription>
<LongDescription>Invocation of {2}, which should be invoked from within a doPrivileged block, in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code invokes a method that requires a security permission check.
If this code will be granted security permissions, but might be invoked by code that does not
have security permissions, then the invocation needs to occur inside a doPrivileged block.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DP_DO_INSIDE_DO_PRIVILEDGED"> <!-- misspelled for backward compatibility -->
<ShortDescription>Method invoked that should be only be invoked inside a doPrivileged block</ShortDescription>
<LongDescription>Invocation of {2}, which should be invoked from within a doPrivileged block, in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code invokes a method that requires a security permission check.
If this code will be granted security permissions, but might be invoked by code that does not
have security permissions, then the invocation needs to occur inside a doPrivileged block.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED">
<ShortDescription>Classloaders should only be created inside doPrivileged block</ShortDescription>
<LongDescription>{1} creates a {2} classloader, which should be performed within a doPrivileged block</LongDescription>
<Details>
<![CDATA[
<p> This code creates a classloader, which needs permission if a security manage is installed.
If this code might be invoked by code that does not
have security permissions, then the classloader creation needs to occur inside a doPrivileged block.</p>
]]>
</Details>
</BugPattern>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions