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

replace deprecated Constructor based initialization of primitive type… #488

Merged

Conversation

eklaDFF
Copy link

@eklaDFF eklaDFF commented Aug 1, 2024

…'s Wrapper Class with WrapperClass.valueOf(value)

// Verify.setLocalAttribute("v", 4200);
//
// // explicit
// Integer o = Integer.valueOf(v);
Copy link
Member

Choose a reason for hiding this comment

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

I thought that the first half of the test still works? If we can keep the part with the explicit cast, that would be preferable.

Copy link
Author

Choose a reason for hiding this comment

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

Explicit means Integer in = new Integer () ?

// int attr = Verify.getLocalAttribute("j");
// assert attr == 4200;
//
// // semi autoboxed
Copy link
Member

Choose a reason for hiding this comment

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

If the part above works, we can start comment out this part.
I think it is nicer to use /* here, akin to the commented-out part below. Definitely not // in addition to /*.
With /*.../*, we clearly mark two blocks of code as being parts of the test that do not (or do no longer) work. With //, we lose that information.

Copy link
Author

Choose a reason for hiding this comment

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

Actually, none of the Assertion works.

Pavel taught me that Local Variable and Local Attribute are different entities in JPF.
Constructor type initialisation passes the value of Local Variables to Local Attributes but in case of new method it doesn't.

@eklaDFF
Copy link
Author

eklaDFF commented Aug 2, 2024 via email

@cyrille-artho
Copy link
Member

I see. In this case, please modify this PR to first retain the problematic test as is (with no code changes, keeping the code that produces compiler warnings).
I think it might be better to suppress the remaining compiler warnings in that problematic test in a second PR, to avoid commenting out or removing a lot of code.

…'s Wrapper Class with WrapperClass.valueOf(value)
@eklaDFF eklaDFF force-pushed the CompWarnWrapperClassPrBranch branch from f6dc122 to a64a935 Compare August 3, 2024 08:37
@eklaDFF
Copy link
Author

eklaDFF commented Aug 3, 2024

Made those changes, please review

@cyrille-artho
Copy link
Member

Great, thanks!

@cyrille-artho cyrille-artho merged commit 8b0618d into javapathfinder:java-17 Aug 3, 2024
2 checks passed
@eklaDFF eklaDFF deleted the CompWarnWrapperClassPrBranch branch September 4, 2024 02:26
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