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

False negatives in the presence of generics #264

Open
mkr-plse opened this issue Jun 29, 2020 · 1 comment
Open

False negatives in the presence of generics #264

mkr-plse opened this issue Jun 29, 2020 · 1 comment

Comments

@mkr-plse
Copy link

See convertValue method in jackson databind (2.11) and convertValue in jackson databind-2.9.6.

The signature changed to public <T> T convertValue(Object fromValue, TypeReference<T> toValueTypeRef) from public <T> T convertValue(Object fromValue, TypeReference<?> toValueTypeRef). This is not reflected in the xml output when the two jars are compared. The output of the comparison (filtered to these methods) is as follows:

 <method binaryCompatible="true" changeStatus="UNCHANGED" name="convertValue" newLineNumber="4143" oldLineNumber="3678" sourceCompatible="true">
    <annotations/>
     <attributes>
        <attribute changeStatus="UNCHANGED" newValue="NON_SYNTHETIC" oldValue="NON_SYNTHETIC"/>
     </attributes>
     <compatibilityChanges/>
     <exceptions>
         <exception changeStatus="UNCHANGED" name="java.lang.IllegalArgumentException"/>
      </exceptions>
      <modifiers>
          <modifier changeStatus="UNCHANGED" newValue="NON_FINAL" oldValue="NON_FINAL"/>
          <modifier changeStatus="UNCHANGED" newValue="NON_STATIC" oldValue="NON_STATIC"/>
          <modifier changeStatus="UNCHANGED" newValue="PUBLIC" oldValue="PUBLIC"/>
          <modifier changeStatus="UNCHANGED" newValue="NON_ABSTRACT" oldValue="NON_ABSTRACT"/>
          <modifier changeStatus="UNCHANGED" newValue="NON_BRIDGE" oldValue="NON_BRIDGE"/>
          <modifier changeStatus="UNCHANGED" newValue="NON_SYNTHETIC" oldValue="NON_SYNTHETIC"/>
       </modifiers>
       <parameters>
            <parameter type="java.lang.Object"/>
            <parameter type="com.fasterxml.jackson.core.type.TypeReference"/>
        </parameters>
        <returnType changeStatus="UNCHANGED" newValue="java.lang.Object" oldValue="java.lang.Object"/>
 </method>

Is there any option to extract these differences too?

@mkr-plse
Copy link
Author

mkr-plse commented Jul 1, 2020

javap -v ObjectMapper.class from the two versions mentioned above gives the following output for the convertValue method definitions:

public <T extends java.lang.Object> T convertValue(java.lang.Object, com.fasterxml.jackson.core.type.TypeReference<T>) throws java.lang.IllegalArgumentException;
vs
public <T extends java.lang.Object> T convertValue(java.lang.Object, com.fasterxml.jackson.core.type.TypeReference<?>) throws java.lang.IllegalArgumentException;

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

No branches or pull requests

1 participant