History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-17837
Type: Bug Bug
Status: Open Open
Assignee: Bas Leijdekkers
Reporter: andrew belom
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

'unnecessary boxing' - sometimes boxing is compulsory

Created: 21 Apr 08 15:28   Updated: 22 Apr 08 01:40
Component/s: Code Analysis. Inspection

Build: 7,757
Severity: Medium


 Description  « Hide
static class test {
public static void main(String[] args) { add(1l, new Long(2l)); }

public static void add(long k, Long v) {
}
public static void add(Long k, Long v) {
}
}

applying the inspection-offered action on this class makes it invalid



 All   Comments   Work Log   Change History      Sort Order:
andrew belom - 21 Apr 08 15:28
I've also created http://www.jetbrains.net/jira/browse/IDEA-17836 - i am not sure if you need both issues or not

Bas Leijdekkers - 21 Apr 08 17:57
Sorry, on my machine the "Unnecessary boxing" inspection does not trigger on that code. Perhaps you could provide another example?

andrew belom - 21 Apr 08 18:36
and this?

import java.util.AbstractMap;

/**

  • @author Andrey Belomutskiy
    */

class test {
static abstract class AAbstractLongMap extends AbstractMap<Long, Long> {
public Long put(long key, Long value) { return null; }
}
static AAbstractLongMap new_times;
public static void main(String[] args) { new_times.put(1l, new Long(2l)); }
}

[do you have 1.5 language level?]


Bas Leijdekkers - 21 Apr 08 18:41
Thank you, I can reproduce with that example.

Eugene Vigdorchik - 21 Apr 08 22:07
This will probably be fixed with http://www.jetbrains.net/jira/browse/IDEA-17836: resolve target should really be ambiguous in this case.

Bas Leijdekkers - 22 Apr 08 01:40
Ok, I think I will wait for the fix for IDEA-17836 and see if that fixes this issue too.