Skip to content
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

[master] ClassWeaver refresh #2049

Merged
merged 4 commits into from
Jan 30, 2024
Merged

Conversation

rfelcman
Copy link
Contributor

Contains following main changes:

  • Replacement of deprecated e.g. new Integer(...) by Integer.valueOf(...)
  • Generated _persistence_shallow_clone content is wrapped by try/catch
  • Remove dependency to JPA module (org.eclipse.persistence.internal.jpa.EntityManagerImpl class) in generated _persistence_checkFetched and _persistence_checkFetchedForSet

There are some extensions in weaving test to more deeply check methods/logic generated by ClassWeaver.
To verify generated code I'd like recommend in extension to decompiler to use some plugin which can display decompiled bytecode as ASMified code. E.g. ASM Bytecode Viewer in InteliJ. Reason is that Integer.valueOf(...) is not displayed in decompiled bytecode.

Contains following main changes:
- Replacement of deprecated e.g. new Integer(...) by Integer.valueOf(...)
- Generated _persistence_shallow_clone content is wrapped by try/catch
- Remove dependency to JPA module (org.eclipse.persistence.internal.jpa.EntityManagerImpl class) in generated _persistence_checkFetched and _persistence_checkFetchedForSet

There are some extensions in weaving test to more deeply check methods/logic generated by ClassWeaver.

Signed-off-by: Radek Felcman <[email protected]>
cv_checkFetched.visitJumpInsn(Opcodes.valueInt("IFNE"), l1);
// String errorMsg = _persistence_getFetchGroup().
cv_checkFetched.visitVarInsn(Opcodes.valueInt("ALOAD"), 0);
cv_checkFetched.visitMethodInsn(Opcodes.valueInt("INVOKEVIRTUAL"), classDetails.getClassName(), "_persistence_getFetchGroup", "()Lorg/eclipse/persistence/queries/FetchGroup;", false);
Copy link
Member

Choose a reason for hiding this comment

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

reuse existing constants defined within this class, such as FETCHGROUP_SHORT_SIGNATURE in this case

@rfelcman rfelcman merged commit 7dd60fd into eclipse-ee4j:master Jan 30, 2024
6 checks passed
@rfelcman rfelcman deleted the weaving_refresh branch January 30, 2024 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants