Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Autoboxing


Related Topics

In the News (Wed 9 Dec 09)

  
  Autoboxing Tips at Chaotic Java   (Site not responding. Last check: 2007-10-30)
Autoboxing, a feature which seems like it had squeezed into JSR 201, is a convenience feature which has its own bag of tricks.
The group designing the autoboxing feature had probably assumed (correctly) that once such transparency is achieved between the primitive and its wrapping class, it might be used more often and widely.
Autoboxing is no exception to the rule, and has some common mistakes associated with it.
javachaos.crazyredpanda.com /?p=138   (775 words)

  
 Introduction to Autoboxing and Introduction to Tables with JDesktop Network Components (JDNC) Tech Tips
Autoboxing is used in a number of places in the updated Autoboxing example.
In particular, testing for the equality of objects created by autoboxing is not the same as testing for the equality of objects that are not created by autoboxing.
Autoboxing is guaranteed to return the same object for integral values in the range [-128, 127], but an implementation may, at its discretion, cache values outside of that range.
java.sun.com /developer/JDCTechTips/2005/tt0405.html   (1701 words)

  
 Object type - Wikipedia, the free encyclopedia
Autoboxing is the term for treating a primitive type as an object type without any extra code.
This action is called autoboxing, because it is boxing that is done automatically and implicitly instead of requiring you to do it yourself.
Unboxing is the term for treating an object type as a primitive type without any extra code.
en.wikipedia.org /wiki/Autoboxing   (465 words)

  
 Java 5 - News on the Latest Release of Java
Autoboxing / unboxing is the automated 'under the covers' conversion between primitive types and their equivalent object types.
Autoboxing / unboxing does nothing to address the fundamental distinction between objects and primitives within the Java language.
As mentioned before, autoboxing and unboxing is just an 'under the covers' conversion between primitive types and their object equivalents.
www.clanproductions.com /java5.html   (1977 words)

  
 Java Fun and Games: Autoboxing Treats Primitives Like Objects   (Site not responding. Last check: 2007-10-30)
Autoboxing implicitly converts primitive type data to reference type data, via a new conversion known as the boxing conversion.
Autoboxing uses the complementary unboxing conversion to convert back from a wrapper type to the equivalent primitive type.
Autoboxing is best used with generics and the collections framework.
www.javaworld.com /weblogs/java101/archives/000171.html   (795 words)

  
 Autoboxing surprises from J2SE 5
The autoboxing creates an Integer object and the contract of Integer is that hashcode returns the intValue and equals ensures that the two Integer objects have the same intValue.
The problem with autoboxing in Java is that the variable i is both an object reference AND a primitive depending on the context.
Autoboxing is simply about automatically wrapping, or "boxing" your primitives with their corresponding object wrapper classes (int -> Integer).
www.theserverside.com /news/thread.tss?thread_id=27129   (4522 words)

  
 Java.net Weblogs: Defending Autoboxing (or Save Us From the Preprocessor)
I plan to use autoboxing in a project, so I'm responding to Erb Cooper's damning blog, "The Terror That Is Autoboxing." I haven't read the spec yet -- Only JCP members have had the chance.
Under the eye-catching headline, Erb's complaint is that autoboxing could create a lot of objects for no good reason, use a lot of memory, and create a lot of garbage.
I hope autoboxing will be a bit more sophisticated, and that developers will use the same care they show with Strings.
weblogs.java.net /lpt/wlg/451   (624 words)

  
 java.net: Boxing Conversion in J2SE 5.0
Here autoboxing plays a different role, choosing a most-specific method when more than one method is applicable for method invocation.
Autoboxing unclutters your code, but comes with important considerations in terms of performance and sometimes unexpected behavior.
Hopefully, autoboxing will reduce the more number of programming errors in the future by avoiding the conversions back and forth between primitives and objects.
today.java.net /pub/a/today/2005/03/24/autoboxing.html   (1413 words)

  
 [JavaSpecialists 090] - Autoboxing Yourself in JDK 1.5
If you are reading this, and have not subscribed, please do so now by sending an email to subscribe@javaspecialists.co.za.
(Autoboxing is the process of converting primitives to objects and vice-versa, automatically).
However, we have to be aware when we may be doing stupid things that could impact performance, such as autoboxing when we should not.
www.javaspecialists.co.za /archive/newsletter.do?issue=090&locale=pt_BR   (959 words)

  
 davidflanagan.com: Equality and Autoboxing
That is, it is no longer a compilation error to use the equality operators with a primitive on one side and a reference type on the other.
The equality operators already have a meaning when there are two operands of reference type, so we can't unbox both sides of the operator and compare their contents: we have to compare the object references.
The reason is that the autoboxing spec requires that small integers (-128 to 127) always box to the same wrapper object.
www.davidflanagan.com /blog/000022.html   (456 words)

  
 Java: Autoboxing   (Site not responding. Last check: 2007-10-30)
Autoboxing, introduced in Java 5, is the automatic conversion the Java compiler makes between the primitive (basic) types and their corresponding object wrapper classes (eg,
The underlying code that is generated is the same, but autoboxing provides a sugar coating that avoids the tedious and hard-to-read casting typically required by Java Collections, which can not be used with primitive types.
Autoboxing surprises from J2SE 5 (www.theserverside.com/news/thread.tss?thread_id=27129) shows some problem areas with autoboxing.
www.leepoint.net /notes-java/data/basic_types/autoboxing.html   (153 words)

  
 JSR 201: Public Review of Enumerations, Autoboxing, for loops
Draft specs for enumerations, autoboxing, enhanced for loop, static import are being made available concurrently with the release of this JSR.
Also, things like autoboxing, generics, for loops etc. should be well understood enough by now for someone (not some rookie of course) to just write the specification down and sign it off internal to Sun.
Add to this the fact that autoboxing was also the solution for creating generic containers of primitives and you can start to see where a problem may start to arise.
www.theserverside.com /discussions/thread.tss?thread_id=23517   (3861 words)

  
 Autoboxing
The autoboxing and unboxing feature automates the process, eliminating the pain and the clutter.
The following example illustrates autoboxing and unboxing, along with generics and the for-each loop.
It is not appropriate to use autoboxing and unboxing for scientific computing, or other performance-sensitive numerical code.
java.sun.com /j2se/1.5.0/docs/guide/language/autoboxing.html   (637 words)

  
 Autoboxing Tips ...
This means, that the primitive int-Array isn't autoboxed to an Integer[] but to an int[][]...
Before autoboxing this type of errors was not possible.
My opinion is that autoboxing is nice but you should be more vigilant than before.
www.javalobby.org /java/forums/t64731.html   (1166 words)

  
 [Isolate-interest] Isolate: Generics and autoboxing considered harmful
This is all very slick and cool, however, the J2ME CDC platforms, for which Isolate is otherwise a perfect fit, do not have generics or autoboxing.
It must be sufficient to unambiguously specify the signatures that would be present in a pre-autoboxing/generics environment, and readable by someone "skilled in the art" who isn't up on generics and autoboxing.
If one were to specify a stack with Isolate and PBP, for example, one would also have to specify the mapping of autoboxing and generics, which probably means pulling some bit of specification out of J2SE, which can lead to a whole big political mess that's potentially fatal, and totally avoidable and unnecessary.
www.cs.oswego.edu /pipermail/isolate-interest/2005-May/000241.html   (528 words)

  
 Jibble news archive
Sure, I could see the benefits of things like autoboxing, but having taught this stuff to university students for 3 years, I couldn't help but think of the problems it could cause.
Using autoboxing in this way is a poor practice, but I can imagine it being all too easy for student programmers to fall into this trap and end up getting really confused.
An Integer is not a substitute for an int; autoboxing and unboxing blur the distinction between primitive types and reference types, but they do not eliminate it.
www.jibble.org /news/?period=2005-12&id=1135198746   (630 words)

  
 Bug ID: 4993464 Autoboxing on 1.5b1 does not work with Arrays.asList
IE: It is possible to do it by hand by NOT using any new features of JDK 1.5, but looses the nice new code cleanliness that 1.5 introduces.
Autoboxing of entire arrays is not specified behavior, for good reason.
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License.
bugs.sun.com /bugdatabase/view_bug.do?bug_id=4993464   (249 words)

  
 Otaku, Cedric's weblog: JDK 5.0 in practice, part 2
I have stayed away from autoboxing so far, probably because I have a vague feeling of losing control of the performance of my code.
I don't think it is justified, though, so autoboxing can come in handy and make your code a little bit more readable.
I think I would encourage developers to flag their code when such autoboxing is happening, and I am pretty sure that IDE's will soon be able to do the same.
beust.com /weblog/archives/000185.html   (1233 words)

  
 Magic with Merlin: The generics prototype
Tiger) hasn't yet made its official debut, but you can take the early access release of the generics prototype download out for a spin now.
This next version of the standard edition is expected to have a number of significant changes.
Autoboxing is the automatic conversion from a primitive type to its
www.ibm.com /developerworks/library/j-mer12193.html?ca=dnt-51   (1604 words)

  
 evolutionNext WebLog - J2SE5.0 : Should I teach beginners about primitives anymore?   (Site not responding. Last check: 2007-10-30)
Since the topic of the article had been about autoboxing, I made the (incorrect) assumption that it was illustrating autoboxing.
Which, since before autoboxing was the only operator overloading example contained in the Java language, pretty much works on the same principle; you just can't directly call the method behind the '+' operator.
So, another approach to the problem of autoboxing potential confusion, an approach completely different from the one I was advocating in my previous comment, could be to use primitive types everywhere, and let autoboxing deal with code using collections:
www.evolutionnext.com /blog/2004/07/03/1088886468000.html   (2036 words)

  
 [Isolate-interest] Isolate: Generics and autoboxing considered harmful
Previous message: [Isolate-interest] Isolate: Generics and autoboxing considered harmful
Next message: [Isolate-interest] Isolate: Generics and autoboxing considered harmful
It must be sufficient to unambiguously specify the >> signatures that would be present in a pre-autoboxing/generics >> environment, and readable by someone "skilled in the art" who >> isn't up on generics and autoboxing.
www.cs.oswego.edu /pipermail/isolate-interest/2005-May/000243.html   (403 words)

  
 java.net: (Not So) Stupid Questions: (2) String Equality
But we have more of this possible confusion coming with autoboxing and autounboxing.
Seems autoboxing uses either equals to compare the boxed values (else there would be no sense in comparing - it would false by default) or it unboxes the object and uses == on the primitive type - result still the same.
I'm not familiar enough with autoboxing to know how this effects things, I hope some of this problem can be aleviated..
today.java.net /pub/a/today/2004/04/07/stringsSQ2.html   (2099 words)

  
 Autoboxing pitfalls ...   (Site not responding. Last check: 2007-10-30)
My fear is that with autoboxing, people will be willy-nilly using ints, longs, etc. as keys and values and what not without being aware of the cost of that autoboxing converting them into Objects and the inherently slower operations for hashCode and equals on those objects.
But the problem with autoboxing is that an Integer is not always an object.
I agree, some compiler directive to disable autoboxing would be a really good idea...
www.javalobby.org /java/forums/m91802803   (1810 words)

  
 [#IDEADEV-3919] Inaccurate "unnecessary autoboxing" warning - JetBrains JIRA
If you were logged in you would be able to see more operations.
When I do this, IntelliJ suggests that this is "Unnecessary autoboxing" (via a code inspection).
This, however, is necessary to make the code compile.
www.jetbrains.net /jira/browse/IDEADEV-3919   (114 words)

  
 SCJP 5 : Chapter 3. API Contents (Part-1) - Free Training
Develop code that uses the primitive wrapper classes (such as Boolean, Character, Double, Integer, etc.), and/or autoboxing and unboxing.
The autoboxing and auto-unboxing of Java primitives produces code that is more concise and easier to follow.
It is a static factory that takes an int array and returns a List of Integer backed by the array.
www.exforsys.com /content/view/1885/362   (1797 words)

  
 Java.net Weblogs: Autoboxing - imagining the spec
This time the topic is autoboxing and there's a twist - we only kind of know what we're talking about.
As David Walend writes in his entry Defending Autoboxing (or Save Us From the Preprocessor), "I haven't read the spec yet -- Only JCP members have had the chance.
Java.net member jimothy first addresses why autoboxing will probably not meet Walend's needs and then goes on to address Walend's comment that using autoboxing properly will require "that developers will use the same care they show with Strings".
weblogs.java.net /lpt/wlg/463   (653 words)

  
 Resources for Java server-side developers: Typesafe Enums, Autoboxing, ... (JSR 201) (ALL - Articles)
Resources for Java server-side developers: Typesafe Enums, Autoboxing,...
This JSR proposes four new Java programming language features: enumerations, autoboxing, enhanced for loops and static
After examining basic syntax, we'll cover diverse uses for variable arguments.
www.java201.com /resources/browse/174-all.html   (616 words)

  
 Autoboxing/Unboxing in J2SE 1.5
Thankfully, J2SE 1.5 comes with a feature called Autoboxing and Unboxing.
public void autoBoxing() { int a = 12; Integer b = a; int c = b; } // -------------------------
Remember: Boxing and unboxing too many values can make your garbage collector go mad.
www.devx.com /tips/Tip/21437   (190 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.