bugKawa - Bugs: bug #39947, Bad resolution of...

 
 

bug #39947: Bad resolution of java.util.HashSet.addAll()

Submitted by:  None
Submitted on:  Wed 04 Sep 2013 10:21:42 PM UTC  
 
Category: Type declaration and inferenceSeverity: 3 - Normal
Item Group: Bad diagnosticStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 08 Sep 2013 05:55:11 AM UTC, comment #1:

There are actually 3 methods - which a newer version of Kawa shows:
/home/bothner/Kawa/work1/testsuite/sva39947.scm:2:3: warning - more than one definitely applicable method `addAll' in java.util.HashSet
candidate: boolean java.util.AbstractCollection.addAll(java.util.Collection)
candidate: boolean java.util.Collection.addAll(java.util.Collection)
candidate: boolean java.util.Set.addAll(java.util.Collection)

The Java Languages Specification v 3 section 15.12.2.5 "Choosing the Most Specific Method" has special rules (near the end) for disambiguating this situation, when all except possibly one of the methods are abstract. I implemented (an approximation) of these rules. I checked that in, along with the test-case, which now works. Thanks!

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Wed 04 Sep 2013 10:21:42 PM UTC, original submission:

This warning is not correct; there's only one definition of HashSet.addAll(), and that is the one defined in AbstractCollection.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 08 Sep 2013 05:55:11 AM UTCbothnerStatusNone=>Fixed
      Assigned toNone=>bothner
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1