Skip to content

Exclude substituted class from build time initialization #2935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ziyilin
Copy link
Collaborator

@ziyilin ziyilin commented Oct 21, 2020

The class substituted with @Substitute or @Delete annotation should not be initialized at build time because it will not appear at run time. It makes no sense to put it in the native heap but causing initialization errors.

This patch fixes the issue #2936

@@ -216,7 +221,18 @@ private boolean isInvokeUnsafeIterative(InvokeTypeFlow i) {
}

private void addInitializer(AnalysisType t) {
types.put(t, initialTypeInitializerSafety(t));
ResolvedJavaType rt = t.getWrappedWithoutResolve();
Copy link
Member

Choose a reason for hiding this comment

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

I would put this whole block in initialTypeInitializerSafety.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@vjovanov
Copy link
Member

Otherwise, LGTM.

@ziyilin
Copy link
Collaborator Author

ziyilin commented Oct 23, 2020

Otherwise, LGTM.

What is LGTM short for?

The class substituted with @substitute or @delete annotation should not be initialized at build time
because it will not appear in the run time. It makes no sense to put it
in the native heap but causing initialization errors.
@ziyilin ziyilin force-pushed the noSubstitutionClinit branch from 47ad520 to 30bb408 Compare October 23, 2020 03:25
@zakkak
Copy link
Collaborator

zakkak commented Oct 23, 2020

What is LGTM short for?

LGTM = Looks Good To Me

@vjovanov
Copy link
Member

vjovanov commented Aug 19, 2022

This fix has been integrated.

@vjovanov vjovanov closed this Aug 19, 2022
@ziyilin ziyilin deleted the noSubstitutionClinit branch October 12, 2023 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants