Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 259547 Details for
Bug 487153
[compiler] Miscompilation when passing byte[] from generic return to varargs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Test case
Test.java (text/x-java), 648 bytes, created by
Martin Partel
on 2016-02-03 12:17:55 EST
(
hide
)
Description:
Test case
Filename:
MIME Type:
Creator:
Martin Partel
Created:
2016-02-03 12:17:55 EST
Size:
648 bytes
patch
obsolete
> >import java.util.ArrayList; >import java.util.Arrays; > >public class Test { > public static void main(String[] args) { > byte[] bytes = {1, 2, 3, 4}; > f(bytes); // Works fine > > System.out.println("------------"); > > ArrayList<byte[]> arrays = new ArrayList<>(); > arrays.add(bytes); > // The following line fails with: "java.lang.ClassCastException: [B cannot be cast to > // [Ljava.lang.Object;" > // Eclipse Java Compiler adds an incorrect checkcast to Object[] after the get(0), but javac > // does not. > f(arrays.get(0)); > } > > public static void f(Object... args) { > System.out.println(Arrays.toString(args)); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 487153
: 259547