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

Resolves #359: XML Property Updates Report #804

Conversation

jarmoniuk
Copy link
Contributor

XML version of the Property Updates Report

@slawekjaranowski please review

@jarmoniuk jarmoniuk force-pushed the issue-359-xml-property-updates-report branch from 01aa121 to 74a84ac Compare October 29, 2022 19:41
@jarmoniuk jarmoniuk marked this pull request as draft October 29, 2022 20:51
@jarmoniuk
Copy link
Contributor Author

jarmoniuk commented Oct 30, 2022

Failing with JVM 8 during compilation because of incompatible types:

java.util.Map cannot be assigned to a java.util.Map argument.

Strange. I've reproduced it with coretto-1.8

    org/codehaus/mojo/versions/xml/PropertyUpdatesXmlReportRenderer.createPropertyInfo(Ljava/util/Map;)Ljava/util/List; @12: invokedynamic
  Reason:
    Type 'java/util/Map' (current frame, stack[1]) is not assignable to 'org/codehaus/mojo/versions/xml/PropertyUpdatesXmlReportRenderer'
  Current Frame:
    bci: @12
    flags: { }
    locals: { 'java/util/Map' }
    stack: { 'java/util/stream/Stream', 'java/util/Map' }
  Bytecode:
    0x0000000: 2ab9 0016 0100 b900 1701 002a ba00 1800
    0x0000010: 00b9 0019 0200 b800 1ab9 001b 0200 c000
    0x0000020: 1cb0                                  

The error is gone if I make the method non-static.

Looks like a javac bug.

As I suspected the error has something to do with the inferred type of the List built with Collections.toList() so, not the reported Map incompatibility, but another one (because it's not PropertyAssociation, but its child type), I changed the way how the object is constructed and it worked fine; it also worked fine if I used

() -> new ArrayList<PropertyAssociation>() with the collect method. However, that the problem was gone when I changed the method to non-static suggests a compiler bug.

Anyway, the thing is resolved now -- I made the assigned list return a list of the actual PropertyAssociation. However, this fix has nothing to do with the reported java.util.Map incompatibitilty.

@jarmoniuk jarmoniuk force-pushed the issue-359-xml-property-updates-report branch 3 times, most recently from 7b35cb5 to e39a53b Compare October 30, 2022 06:45
@jarmoniuk jarmoniuk marked this pull request as ready for review October 30, 2022 07:12
@jarmoniuk jarmoniuk force-pushed the issue-359-xml-property-updates-report branch from e39a53b to eeee16f Compare October 30, 2022 07:32
@sultan
Copy link
Contributor

sultan commented Oct 30, 2022

i also had class cast ex, during report rendering, between classes like Map.Node and Map.TreeNode. i'll open an issue if i can reproduce

@jarmoniuk jarmoniuk force-pushed the issue-359-xml-property-updates-report branch 3 times, most recently from 2c5126e to 5d81035 Compare November 3, 2022 06:35
@slawekjaranowski slawekjaranowski linked an issue Nov 3, 2022 that may be closed by this pull request
@jarmoniuk jarmoniuk force-pushed the issue-359-xml-property-updates-report branch from 5d81035 to ba6b576 Compare November 3, 2022 17:04
@slawekjaranowski slawekjaranowski added this to the 2.14.0 milestone Nov 4, 2022
@slawekjaranowski slawekjaranowski merged commit e07ec68 into mojohaus:master Nov 4, 2022
@jarmoniuk jarmoniuk deleted the issue-359-xml-property-updates-report branch November 5, 2022 05:03
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.

XML format for property updates report
3 participants