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

Bug when using OO out of a map #40

Open
winterstein opened this issue Aug 28, 2016 · 1 comment
Open

Bug when using OO out of a map #40

winterstein opened this issue Aug 28, 2016 · 1 comment

Comments

@winterstein
Copy link

Thank you for making this brilliant plugin.

I've noticed a bug. Try the following code -- it claims to compile, but breaks class loading at runtime. This is using Java 7 on Ubuntu Linux.

Map<String, BigInteger> map = new HashMap<>();
map.put("a",BigInteger.valueOf(2));
BigInteger a2 = map["a"] * map["a"];

Note that if you add casts, e.g. BigInteger a2 = ((BigInteger)map["a"]) * ((BigInteger)map["a"]); it works fine.

@aroelke
Copy link

aroelke commented Sep 14, 2016

I get a similar problem when I have a Map<?, Integer>:

Map<String, Integer> map = new HashMap<String, Integer>();
map.put("str", 4);
if (map["str"] < 1) System.out.println(map["str"]);

This outputs "4" when it shouldn't, unless I cast map["str"] in the if expression to Integer or int explicitly. In other projects I get an "inconsistent stack map frames" error.

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

2 participants