Possible bug in Calendar

L

Lew

Arne said:
No. That about "core business-logic classes" is just something you
brought into the discussion late.

And BTW it is not even correct. Some types of business logic requires
Calendar knowledge.

Case in point: I'm on the programming staff of a multi-million-dollar Java EE
project involving electronic documents (XML, among other things) sent to a
central location from all over the world. java.util.Calendar is essential to
that project to coordinate the various time zones involved, including business
rules as to due dates, intervals between document submissions and the like.

Calendar is most assuredly a core business-logic class for that project.

Early in the project some less-experienced programmers attempted to express
these types of business rules without using Calendar. That code has caused
all kinds of difficulty in production. I've been rewriting some of that logic
using Calendar, and this has demonstrably simplified the task of getting it right.
 
L

Lew

Arne said:
English is not my native language, but even me knows that
"mention that an awful lot of them do" does not qualify as
"mention any".


Well - you just agreed with me (see above).

It is not a rule that no-argument getInstance() return a singleton. It is not
valid that because many such methods return a singleton that all such must do
so. That's like saying that because some cars are built to move at 200 miles
per hour that all cars must do so, or that because some cars are built to run
on batteries that all must do so, or that because some people have blond hair,
all must do so. This is a well-recognized logical fallacy, the notion that
because things sometimes happen a certain way they must always do so.

In the particular case of the Java API and getInstance(), Arne has already
proven that "Harold" is wrong:
I just grepped the Java API docs. There are nine no-arg getInstance
methods. Of those zero are singletons.

That is statistical evidence, and conclusive.

If the gods of Java don't follow the rule, and in their writing (as cited
upthread) allow for APIs not to follow any such rule, then we mere mortals
must not impute such a superstition.
 
R

reckoning54

[snip]

NO. DO NOT POST WHILE I AM STILL CATCHING UP. WAIT 24 HOURS FIRST.
[snip]

NO FEEDBACK LOOPS!
Was it not you who said: "I don't take orders from you?"

Turnabout is fair play, arsehole.
So if you won't take orders from us, why should Mr. Enderin take orders
from you?

It's called "giving him a taste of his own medicine".
 
R

reckoning54

[snip]

NO. DO NOT POST WHILE I AM STILL CATCHING UP. WAIT 24 HOURS FIRST.
Joshua Cranmer wrote:
[snip]

NO FEEDBACK LOOPS!
Thanks to Joshua for showing me this. [implied insult deleted]

No. None of the nasty things that you have said or implied about me
are at all true.

Turnabout is fair play.

It's called "giving him a taste of his own medicine".
Especially when [insult deleted]

None of the nasty things that you have said or implied about me are at
all true.
is so rude to Lars, calling him names and such.

Turnabout is fair play.

I put up with constant abuse and namecalling from Lars for *years*
before deciding to treat him like the piece of gutter trash he
apparently is.

*Years*.

I have the patience of a saint.

Don't you dare sit in judgment of me, not until you've walked a mile
(and at least two years) in my shoes.
 
R

reckoning54

[snip]

NO. DO NOT POST WHILE I AM STILL CATCHING UP. WAIT 24 HOURS FIRST.
[snip]

NO FEEDBACK LOOPS!
NO! DO NOT POST WHILE I AM STILL CATCHING UP. WAIT 24 HOURS FIRST.

[implied insult deleted]

None of the nasty things that you have said or implied about me are at
all true.
 
R

reckoning54

[snip]

NO. DO NOT POST WHILE I AM STILL CATCHING UP. WAIT 24 HOURS FIRST.
[snip]

NO FEEDBACK LOOPS!
[implied insult deleted]

None of the nasty things that you have said or implied about me are at
all true.
 
J

Joshua Cranmer

NO FEEDBACK LOOPS!

Without feedback loops--negative feedback loops, in fact--you'd die.
Your body has several negative feedback loops intended to prevent
escalation of certain disorders.

So why are feedback loops so bad?

"Science. It works, bitches."
 
H

Harold Yarmouth

Arne Vajhøj misquoted me:
Harold Yarmouth did not write:

Yes usually mean agree.

But, as I said in the previous post (and you dishonestly trimmed out and
otherwise ignored!), that is a complete misquotation of what I wrote.

This is what was actually originally written:

As you can CLEARLY see, I was agreeing that you had forgotten to check
your confrontational attitude at the door, not agreeing with any of your
vicious and uncalled-for personal attacks.

Now stop the dishonest quoting and other extremely childish tricks and
start discussing Java, or else go away. Your behavior is completely
inappropriate for this forum, not to mention totally uncalled-for, and
it will not be tolerated.
You forget something. People laugh at you - they are not afraid of you.

No, Arne, people laugh at *you*. They laugh at your combination of
thuggish attitude, poor grammar, childish dishonest cheap tricks to try
to "win" an argument, and complete inability to back up your blustery
words with any credible threat of real force.

It's like being hissed and growled at by a tiny little kitten, one that
frequently tries to hide to pounce at your leg when you walk by, only
its tail is sticking out into plain view. Everybody sees through its
pathetic attempts at deception and sneakiness, and nobody perceives a
real threat, no matter how furiously hissy it gets.

And it can't communicate in clear, understandable English like an adult
human being.

The same is true of you being nasty online, where you have no ability to
project force, your attempts at dishonesty are easily repudiated by a
quick Google Groups search, and you apparently can't make even a fairly
short post without at least three typos that make you look like you're
barely out of the single-digit grades in school. "Yes usually mean
agree" is one step up from "I can has cheezburger?" and two hundred
steps down from the its/it's mistakes that, as near as I can tell, even
the average Ph.D. doesn't seem to be able to avoid.

You are laughable, Arne.

I should probably stop wasting my time replying to your crap, but it's
amusing seeing you flail about in your ignorance and blind anger, and it
also causes you to further destroy your own credibility by posting
nonsense like you just did, thereby neutralizing what little threat you
pose here, that of possibly convincing other people to believe your crap.

Nobody will, now, when they see the cheap tricks you tried to use to
make it look like I was agreeing with you when I wasn't. That kind of
transparent desperation ploy is the last refuge of a stupid and angry
man that realizes he's about to lose the argument. (One that's obviously
nowhere near smart enough to realize that he already HAD lost the argument.)
Obviously not. I was just noting a fact.

But it is not a fact. You seem to think you can control others' opinions
of me, but you can't. You can maybe control others' opinions of *you*.
So far, you're doing a bang-up job, between your poor communication
skills and transparently dishonest tactics. Perhaps you should quit
while ... well, normally I'd say "quit while you're ahead", but you're
not ahead, you're way way behind. But you should still quit; like the
gambler that's lost his car, you shouldn't keep going until you lose
your house, and then your shirt. Not when you're clearly outclassed* and
Lady Luck clearly is not on your side.

* You, of course, would be outclassed by a ten year old with no
debate-team training or anything, and by any smarter-enough-than-average
five year old.
Well - please sue. I guess it would be possible to find around
5000 witnesses from here that can testify that your ability to
read documentation and understanding of OOP are exceptional low.

No, the only things they'll testify are "exceptional low" are
a) your honesty,
b) your intelligence (did you REALLY think nobody would see
through your creative quoting tricks?), and
c) your English reading comprehension and writing grade level

(Really I should stop and "pick on someone my own size". This is like
being in a fistfight with a grade school bully. Except that the grade
school bully was dumb enough to walk up to and punch *me*, so I wasn't
picking on anyone -- he was and he bit off more than he could chew!)
Nonsense. If you had, then this thread would not have existed.

Yet I did, and this thread nonetheless exists.

Clearly, you have made a mistake in your logic somewhere.

See if you can figure out, on your own, where the mistake is.

Hint: If the conclusion is false, either the premise is false or the
conclusion does not follow from the premise. Figure out first which of
these (if not both) is the case, and then continue from there.

Yes, I do.
Your idea of having Calendar implement Gregorian calendar
and have other calendars overwrite methods

My idea was of having Calendar implement a basic Date factory
functionality and have non-standard calendars provide Date- or Calendar-
wrapping and translation functionality, actually. Though given what I
now know regarding your apparent grade-level, I shouldn't expect you to
be able to comprehend any of that.

In other words, Date, Calendar (or maybe another name would be better),
and LocalizedCalendar (or maybe just Calendar, if the date-factory got a
different name), analogously to the existing pattern of String,
StringBuilder, and Collator, MessageBundle, and the other peripheral
classes for localized String handling.
Not true.

Well, now you've descended to calling me a liar and otherwise being at
the lowly "did too! did not!" level of argumentation.

There's really no point in my continuing this. It's like participating
in a gunfight with an unarmed opponent. It's not really fair to Arne if
I continue.

But then again, he was the one who started the fight ...
Obviously not.

Obviously yes.
What Date builder ?

As explained to you many times then Calendar is not a Date builder.

I don't need anything explained to me. I know Calendar has other
functions. The problem is that it IS also the Date builder -- as
evidenced by the Date constructors that produce specific dates and times
being deprecated with a note in the docs to use Calendar instead.

Calendar's split responsibilities are the cause of many if not all of
its woes. The date-building functionality and the localization
functionality belong in separate places, and even at separate layers.
Surprisingly calendar functionality belongs in the calendar classes.

Then it is date-builder functionality that does not.

It is probably best to use the name Calendar for the
localization/translation classes. But then the mutable-Date class used
to just construct a Date from a given bunch of integers should be broken
out as a separate class and named, oh, say, DateBuilder, and those Date
javadocs I mentioned updated to point people to DateBuilder.
 
H

Harold Yarmouth

Arne said:
Lars said:
Harold Yarmouth wrote:
[some refined variant of Twisted's usual rants]

Each posting from "Harold Yarmouth" makes me more confident that
"Harold" is the same person who uses/has used the aliases Twisted,
Scuzzbuster, Twerpinator, zerg, etc.

That seems to be the logical conclusion.

That's two wrong conclusions you've reached lately. As I said the
previous time, this means that either a premise was wrong or the
conclusion did not actually follow from the premises.

I will give you an additional hint: in both of your recent errors, the
same cause occurred. In other words, either a premise was faulty in both
cases or the conclusion did not logically follow from the premise in
both cases.

I leave it as a challenge to you to figure out which, to then figure out
what your error actually was in each case, and to then learn from those
two errors.
 
H

Harold Yarmouth

Arne said:
The Calendar has very well-defined functionality in having all the
calendar specific manipulations of Date.

The problem is that it ALSO has very well-defined functionality for
building fresh Dates from components. It's as if they'd jam-packed all
of the functionality of both StringBuilder and Collator, or
StringBuilder and MessageBundle, into a single class. It would have been
a horrid mess -- as the Calendar class actually proved to be, as has
been noted by "Lew", Mark, Roedy, and one or two other people here as
well. In fact you are about the only person here that's still arguing
the increasingly-untenable position that "Calendar is perfect as it is
and anyone suggesting otherwise is an idiot".
You will never become a programmer

This is ridiculous. I already AM a programmer, and I probably was a
programmer when you were still in diapers. (Particularly if you ARE
still in diapers.)

I have written, over the course of my career so far, in the neighborhood
of 10,000,000 lines of code. Some individual programs or systems have
over 10,000 lines of code of mine in them (or did at one point; parts
may of course have been rewritten or modified since). I've everything
from video game code to web browser and web spider code and code for
business apps under my belt. Applets, database front-ends for specific
report generation, game graphics engines (circa 1980 mind you), game
logic and AI (more recently), network tools (very recently), and more,
much of it in Java. You probably personally have, use at work, or
otherwise have contact with code that I wrote, without even knowing it
since most software does not have a movie-style list of credits on it
and though the newer games do the ones I worked on never made it to the
big-time.

You, on the other hand, have a level of proficiency with language and
communications that implies a grade level in the mid-to-upper single
digits, and the attitude of a schoolyard bully, which gives me the
strong suspicion that your greatest contribution to computer programming
thus far has probably been to write 10. PRINT "HELLO WORLD" 20. GOTO 10
and somehow thereby manage to crash the school's computer, earning an F
in sixth-grade computer class. (Assuming they still teach BASIC or Logo
programming at your school, that is, and not just pointing and clicking
and other user-oriented stuff. Sadly, I think most schools don't expose
everyone to simple programming at a young age anymore.)
But it was.

No, it was not.

You're in no fit state to judge, seeing as a) you have not seen it and
b) you wouldn't know good code if you got to see an example of some in
your fifth-grade computer class tomorrow morning.
You did not read the docs

I did read the docs.
your code did not work

My code is working fine, after I dealt with the serious oddity of Dates
generated identically not comparing .equals(). An oddity that could
easily catch anybody by surprise when they first had occasion to work
with Dates much in Java, and that stems from what pretty much everyone
but you has agreed is a design flaw in Date/Calendar.
 
H

Harold Yarmouth

Arne said:
Again you completely missed the point.

No, I have not. You have.
You should read the docs outside of your IDE.

So sez you. But you do not decide such things.

Even if that were true, it does not make the fact that the IDE shows me
the documentation for the method whose invocation I'm writing a mistake
that I made. If the IDE's behavior is a mistake, it is a mistake made by
someone who worked as a developer on that IDE. And since I have not ever
been a developer of that IDE, that person cannot be me.
And I can really not see any point in contacting NetBeans
team and ask them to get a guy named Paul to fire his web
browser and read the Java docs.

Neither can I. What does some guy named Paul have to do with any of
this, anyway? I don't see the relevance. You seem to have pulled that
hypothetical example of a possible future course of action for you
completely out of a hat.

I suppose it's some sort of surrealism or absurdism or something,
perhaps an attempt at humor. "Attempt" being the operative word here.

Oh, ok, I confess I cracked a smile at the image of some guy telling
Internet Explorer "you're fired!" and launching the Opera installer he'd
just used it to download. Or maybe something more elaborate? With
apologies to Swiffer:

*guy behind desk in office, facing a chair whose back is to the camera
and whose back conceals anyone who might be in it; desk has a computer
monitor on it*

"You're slow, you're bloated, you often fall asleep on the job, and you
keep letting in the wrong people. I can't have you working the desk here
anymore. I'm going to have to let you go."

*clickety-click*

*reverse angle shows IE icon being dropped on Recycle Bin icon on
computer screen on desk, and no fat donut-eating rent-a-cop, or anyone
else, sitting in the facing chair in the office*
 
H

Harold Yarmouth

Arne said:
But the Java API is *the* example of how SUN think Java should be used.

It is *the* example of how Sun themselves use Java. It is *an* example
of *one way* Sun think Java should be used.

Actually, I'm not even sure about the latter. A lot of Sun's own code
violates a lot of best practises. Consider this gem from the Javadoc for
javax.swing.JComboBox:


actionPerformed

public void actionPerformed(ActionEvent e)

This method is public as an implementation side effect. do not call
or override.

Specified by:
actionPerformed in interface ActionListener


Sun evidently has far more trouble with the concept of encapsulation (or
perhaps that of private inner classes) than anyone you should be
recommending I emulate. :)

There is a lot of code out there that is much, much better than some of
Sun's code.
 
H

Harold Yarmouth

Arne said:
Believe it or not but the IT world has not standardized on English
for business apps.

I never said that it did. I said that it's a language most businessmen
in the world that deal at the multinational level know and frequently
use. International commerce also tends to use the Gregorian Calendar
(and various time zones) almost exclusively.
It is a very common requirements to support French, German, Spanish
and worse the East Asian languages.

That is not relevant. It is not a very common requirement to support
non-Gregorian calendars, except for software with an ethnically-narrow
target market (and usually esoteric purposes). I don't see non-Gregorian
calendars being used in business applications like payroll processing
and the like, except for custom software for a business in a non-Western
country.

Okay. Argument over, then.
That is what Date does. This is not what Calendar does.

Not quite. If that were the case, Date would have non-deprecated
constructors to "just get me a date from these integers", or a
DateBuilder class analogous to StringBuilder in its role, or both. I see
neither.

"Just get me a date from these integers" is a basic function that should
exist, should assume a Gregorian calendar, and should have two versions,
one that takes a Locale and uses its time zone and one that uses the
time zone for the current default locale.

That function should be available from an
otherwise-nonlocalization-specific class, as StringBuilder's
functionality can be found outside of MessageBundle and Collator.

Since that apparently excludes Calendar, it seems it belongs in Date
itself or in a class that's different from either, yet I don't find it
there.
I think you should read it.

I already HAVE read it. Didn't I imply as much above?
They want to change a lot of things. But none of them are related
to your misunderstandings

That is because I HAVE NO MISUNDERSTANDINGS.

Please stop gratuitously and publicly insulting me. It has become
abundantly clear that you are the one with *ahem* "problems" here. I
should think that you would not wish to call too much attention to those
problems.
And they indeed want to support other calendars than Gregorian.

In peripheral classes that can be avoided when you just want to do
something simple.

They believe much more strongly in the KISS principle than you
apparently do. (Or rather, to be more specific, the "keep the core
simple, stupid" principle.)
Which of course is completely irrelevant.

No. YOU are completely irrelevant.

You clearly have nothing to say that's really about Java. Everything you
write is really not about Java at all, but rather it's about me. And I
am not within this newsgroup's topic bounds, so discussing me here is
off-charter. Please stop.
The fact that Calendar's are not used in DAL or database does not change
the fact that Calendars are used in business apps.

In the outer layers with the other I18N/L10N stuff. And, unfortunately,
deeper inside when what they really need is a DateBuilder, but only
because of the Date/Calendar system's flaws and Calendar's schizophrenic
nature.
 
H

Harold Yarmouth

Arne said:
It is relevant

It is irrelevant. This is an English-language newsgroup. Latin is
off-topic here.

And so are your insults, which I took the liberty of trimming as such.
Your opinions of me have nothing to do with Java programming and
therefore DO NOT BELONG IN THIS NEWSGROUP.

Got it?
 
H

Harold Yarmouth

John said:
Oh for God's sake! Am I the only person here who actually got a passing
grade in high-school English?

Most high school curricula do not cover Latin, least of all in an
English course. I am surprised to hear that apparently a high school
exists that does so, rather than placing it where it obviously belongs,
either in its own class or in History And Geography.

(Fixed up attributions. Somehow my words were being attributed to Joshua
Cranmer instead of to me.)
 
H

Harold Yarmouth

Lars said:
I use Thunderbird, like you do.

I don't see how that is relevant to the language of some remote Web
page. Even were Thunderbird to have some miraculous natural-language
translation power, Thunderbird does not display Web pages for me. Opera
does.
even if you were not educated enough

I grow tired of this insulting, snobbish, and superior attitude.

There is ABSOLUTELY NOTHING WRONG with not having an education IN LATIN.
NOBODY much has an education in Latin anymore. There are respected
Ph.D.s that know less Latin than I do. In fact, beyond knowing specific
Latin-derived terminology for some scientific field or similarly,
knowledge of Latin is almost useless. Nowadays, knowing the language
itself, and not just a vocabulary laced with borrowings into English
from Latin, is basically only important if you're a historian with an
interest in Europe in Roman times.
background material is symptomatic and strengthens my conviction that
you are indeed Twisted.

I am not. All the conviction in the world on your part won't make any
difference to that, either.
Latin for, in the work cited.

How fascinating. However, your assumption that everyone should know this
little bit of the Latin language is still clearly incorrect.
I think Lew did not use it correctly

If so, then it is even more unreasonable for you to berate me for not
knowing exactly what the hell he meant by it!
Your response to Lew's message was uncalled for

My response to Lew's message was perfectly appropriate when someone had
just blathered a bunch of insults and off-topic silliness, accusing me
of not paying attention, and then ended with "when the gods speak,
mortals should listen".

Since then, Lew has more explicitly compared himself to a god at least
twice.
and just showed your ignorance and unwillingness to learn.

If not knowing much Latin qualifies me for the label "ignorant" then
fine, I'm ignorant. So sue me.

If not being interested in learning Latin qualifies me for the label
"unwilling to learn", then fine, I'm unwilling to learn -- or at least,
unwilling to learn random and mostly-useless-or-obsolete things that are
difficult to learn* on the say-so of some random asshole on the Internet
that threatens to flame me (oooh, I'm scared!) if I don't do as he says.

*Languages, in general, being difficult for adults to learn, and Latin
reputed to be particularly so, though not as bad as the so-called tone
languages from the far east.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,353
Latest member
RogerDoger

Latest Threads

Top