Re: Bug parade

Discussion in 'Java' started by Eric Sosman, May 25, 2009.

  1. Eric Sosman

    Eric Sosman Guest

    Christian wrote:
    > Hello Group,
    >
    > I just recently stumbled over a problem with my Mac jvm (actual 1.5 jvm
    > that comes with Mac as default).
    >
    > String.format() did not accept a %C in the format string and threw up
    > a RuntimeException.


    What was the argument the "%C" was trying to convert?
    According to the Javadoc, "%C" works with char, Character,
    byte, Byte, short, Short, and with some (not all) values of
    int and Integer.

    It would also be helpful to know exactly which exception
    was thrown, and what message it carried ...

    > Now I would like to ask if you know of some alike open
    > bugs/problems/differences in common Java/jvm implementations that would
    > be just good to know and may be you want to share with everyone.


    You could start with <http://bugs.sun.com/bugdatabase/>.

    --
    Eric Sosman
    lid
    Eric Sosman, May 25, 2009
    #1
    1. Advertising

  2. Eric Sosman wrote:
    > Christian wrote:
    >> Hello Group,
    >>
    >> I just recently stumbled over a problem with my Mac jvm (actual 1.5
    >> jvm that comes with Mac as default).
    >>
    >> String.format() did not accept a %C in the format string and threw
    >> up a RuntimeException.

    >
    > What was the argument the "%C" was trying to convert?
    > According to the Javadoc, "%C" works with char, Character,
    > byte, Byte, short, Short, and with some (not all) values of
    > int and Integer.
    >
    > It would also be helpful to know exactly which exception
    > was thrown, and what message it carried ...

    [ SNIP ]

    java.util.UnknownFormatConversionException: Conversion = 'C'

    I tested this with character literals, e.g. 'a' or '\u0061' (same
    thing), Character, and ints, e.g. 97. Incidentally "%c" works just fine
    on all of these...it's only "%C" that's causing the exception.

    AHS
    Arved Sandstrom, May 25, 2009
    #2
    1. Advertising

  3. On May 27, 12:31 am, Christian <> wrote:
    > Eric Sosman wrote:
    > >     You could start with <http://bugs.sun.com/bugdatabase/>.

    >
    > I think we all know the bugdatabase...


    You'd be surprised.

    > And we know its really large...I wouldn't expect anyone ro read it
    > through and know every bug in it..


    That is why it provides a search engine, which I
    believe (even from glancing at the URL string) is
    where Eric linked to.

    OTOH, I do not get good results from Sun's own
    search engine (mainly in the time it takes to get
    a response forced down the twisted copper wire
    joining America to Australia, so instead often
    use (the evil) Google - either international or
    local variant.

    You might try using it something like this..
    <http://www.google.com/search?q=runtimeexception "String.format
    %22+site%3Abugs.sun.com>

    > And because it is that way there might be some favorite ..


    Favorite? My 'favorite' bugs are the ones I have
    been involved with, or raised, or were based on my
    code samples. Usually they were involved with
    applets, rich clients, and webstart.

    >..bugs that you
    > know off/that you stumbled over that might be of interest for others...


    Surely that depends on the 'interests' of 'others'.
    And heck, they can do their own Googling.

    But ultimately, if you could not be bothered
    searching for it, why should *we?*

    --
    Andrew T.
    Andrew Thompson, May 26, 2009
    #3
  4. On May 27, 12:53 am, Eric Sosman <> wrote:
    >      I can't imagine how you'd filter "favorites" from the rest
    > in a way that would be useful.  


    I think that 'votes' goes at least a small part of
    the way to indicating those bugs that the *developers*
    consider the most important. At least it is ostensibly
    open and simple.

    (My own favorite bugs - usually in obscure corners of
    the J2SE, rarely got more than a couple of votes.)

    --
    Andrew T.
    Andrew Thompson, May 26, 2009
    #4
  5. Eric Sosman

    Lew Guest

    Christian wrote:
    > (I am also often wondering that no Compile-time error is thrown if a
    > class implementing Serializable does not have a noargs constructor)
    >


    There is no relationship between implementation of an interface and
    what constructors a class has. Interfaces cannot specify
    constructors, therefore there is no interface-based restriction on
    what constructors an implementing class may have.

    There is also no operational requirement for a Serializable class to
    have a no-arg constructor, thus it would not only be unnecessary but
    harmful for lack of such to cause a compiler error.

    --
    Lew
    Lew, May 29, 2009
    #5
  6. Eric Sosman

    Eric Sosman Guest

    Christian wrote:
    > Lew schrieb:
    >> Christian wrote:
    >>> (I am also often wondering that no Compile-time error is thrown if a
    >>> class implementing Serializable does not have a noargs constructor)
    >>>

    >>
    >> There is no relationship between implementation of an interface and
    >> what constructors a class has. Interfaces cannot specify
    >> constructors, therefore there is no interface-based restriction on
    >> what constructors an implementing class may have.
    >>
    >> There is also no operational requirement for a Serializable class to
    >> have a no-arg constructor, thus it would not only be unnecessary but
    >> harmful for lack of such to cause a compiler error.
    >>
    >> --
    >> Lew

    >
    > Serialization is though a special interface... Its not there for
    > specifying functional behaviour but behaviour that the class can be
    > serialized so it would be good if this were checked ...
    >
    > If you never used it, it would be nice to get a compiletime
    > error/warning if you defined a class that can not be deserialized as its
    > definately sth the compiler can know.
    >
    >
    > And till now Deserialization of classes that directly extend Object and
    > do not have a noargs constructor allways failed for me.


    According to the Javadoc, the Serializable class itself
    does not need a no-args constructor. Deserialization does
    not use any of that class' constructors at all, so the lack
    of a no-args constructor or an array-of-int constructor or
    any other constructor is no hindrance.

    However, every Serializable class eventually descends
    from a non-Serializable class -- from Object, if nothing
    else. And it is *that* class whose no-args constructor is
    used during deserialization. Object has such a constructor,
    so a Serializable direct subclass of Object should present
    no difficulties. I suspect you may have misremembered the
    details of the trouble you ran into.

    As to whether the compiler could/should complain if your
    Serializable class extends a non-Serializable that lacks a
    no-args constructor -- Well, I guess it would be helpful. The
    situation would have to be special-cased by the compiler, since
    an interface definition can't specify constructors. But the
    compiler has special cases for lots of other things already
    (toString(), autoboxing, Iterable, ...), so it might not be an
    enormous burden to add this one. You might want to submit an
    RFE for it (or add your vote to an existing RFE if there's
    already one in the database).

    --
    Eric Sosman
    lid
    Eric Sosman, May 30, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John

    Re: BUG? OR NOT A BUG?

    John, Sep 20, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    545
  2. RedEye
    Replies:
    2
    Views:
    578
    Jason Kester
    Dec 13, 2005
  3. Michel Joly de Lotbiniere

    Bug Parade Bug 4953793

    Michel Joly de Lotbiniere, Nov 30, 2003, in forum: Java
    Replies:
    4
    Views:
    638
    Michel
    Dec 2, 2003
  4. DarkSpy
    Replies:
    4
    Views:
    881
    tom_usenet
    Jun 27, 2003
  5. Steve Holden
    Replies:
    1
    Views:
    392
    Behrang Dadsetan
    Jul 2, 2003
Loading...

Share This Page