Bogus NullPointerExceptions

T

Twisted

Tom said:
Don't be condescending. You have a bad design and you insist on fixing
it by adding more complexity, synchronisation.

Don't be insulting. There is nothing wrong with my design. I'd like to
see you try to suggest a better way to:
* Delete a file in a particular subtree and then
* If the directory it's in is now empty, delete that, and if that
leaves its parent directory entry, delete that too, and so forth, while
remaining confined to that subtree (whose root, even if it becomes
empty, isn't deleted).
That's why its not over, you may ignore any further comments if you
wish, but you should not tell others what to do with the thread in a
public forum.

You seem to misunderstand. Everything has already been said, and now
you are just going around in circles (and forcing me to do so as well,
to rebut insulting BS like what you just posted) saying the same things
repeatedly. You are awfully free with criticism, but seem to lack any
constructive suggestions -- or if not, you're keeping them to yourself.
I suggest you reverse that pattern -- keep your criticisms to yourself
and make any constructive suggestions you may have public. (Yes, that
does mean that in the event you have no constructive suggestions you
should simply shut up.)

But I suspect both of us have better things to do than to continue this
pointless debate. Obviously you disagree with me; equally obviously
neither of us is likely to change the other's mind. Slinging insults
around won't do anything but waste your time slinging them and mine
cleaning up after you. So let's both just go home.
 
S

sgoo

Concurrency may be the problem. Suppose your code runs in thread A, but
another thread B is doing some evil things:

Thread A: check dir.equals(baseDir), false
Thread A: checking dir.list() != null, true, go on

Suddenly --
Thread B: remove dir

Thread A: dir.list().length == 0, NullPointerException! because
dir.list()!=null is no longer true.
 
F

foobarbazqux

Twisted said:
You seem to misunderstand. Everything has already been said, and now
you are just going around in circles (and forcing me to do so as well,

"forcing"? You poor little weak helpless thing! I feel so sorry for
you, being forced against your will to make newsgroup postings by the
nasty big Java programmers.

....

Your design is obviously unmaintainable and inefficient, why can you
not see this?
 
A

Andrew Thompson

Twisted said:
[snip] Your design is [snip]

If you are going to criticize, make it constructive. Suggest how you
would do it instead.

The 'earth is round' answer has already been provided
by Patricia, Tom, Fred & nalhawash with refinements
offered by Andreas, Daniel, Chris and Ingo.

How many times do you need to hear it, before it
does not bear repeating? (Note that most of the
rest of the people here, would be grateful to
foobarbaz for sparing us the bandwidth..)
... Otherwise, shut up.

As an aside. You are an *excellent* troll -
my score for your recent efforts, is '9.4'.

Andrew T.
 
T

Twisted

Andrew said:
How many times do you need to hear it, before it
does not bear repeating? (Note that most of the
rest of the people here, would be grateful to
foobarbaz for sparing us the bandwidth..)

Which is what, add an extra test for null every iteration of a loop
that in the current setting can never test true? (Now that access is
synchronized. It hasn't cropped up in days now.)
 
F

foobarbazqux

Twisted said:
[snip] Your design is [snip]

If you are going to criticize,

What do you mean "if". I am definitely criticizing your approach to the
problem. Couldn't you tell?
make it constructive.

You're deluded if you think you have any authority in this newsgroup. I
spurn your directive! You've had a surfeit of constructive help.
Suggest how you would do it instead.

Another order, your delusion deepens. You've had plenty of sensible
suggestions which you chose to ignore or dismiss offhand.
Otherwise, shut up.

You thrice compound your error. Your debating skills might suffice for
5 year olds in the schoolyard but I think you'll need to apply more
adult reasoning in this newsgroup if you wish to persuade anyone.

Why don't you use the Observer Pattern?
 
F

foobarbazqux

Andrew said:
Twisted said:
[snip] Your design is [snip]

If ...
(Note that most of the
rest of the people here, would be grateful to
foobarbaz for sparing us the bandwidth..)

Andrew, please use your killfile. I'm just applying reductio ad
absurdam to Twisted's assertion that he is FORCED to respond to every
posting. Everyone but he must by now be aware that it is only Twisted's
own ego that forces him to carry on like this. I doubt he is capable of
getting it under control.

If Twisted doesn't understand why synchronisation reduced the frequency
of occurrence of the NPE then he is just postponing the date when he'll
have to get to grips with his bugs.

I wonder if Twisted has considered upgrading his JRE to 1.6 and
retesting without synchronisation?
 
T

Tom Forsmo

Pay attention and read the entire message before you start steaming,
there is more than just vivid rudeness in this reply. There is also an
actual attempt at providing some help. Only Allah knows why... (LOL).
But that all depends on whether you want some help or are just out to
assert yourself.
Don't be insulting. There is nothing wrong with my design.

What insult did I commit? Is it that asked you not to be
condescending? Oh no! some little person asking you to behave like a
grown up, such insolence! ... Ahh, now I get it. Its because I said your
design was bad, now that's a real insult. You should bang my head against
the wall until it pops. Or better yet, you should just raise your voice
so everybody can hear the mighty Twisted speak.

You need to deflate quite a bit. This is a public forum, where the aim
is to try to provide help, You have already shown us, the last couple of
weeks, that you are not quite the genius you envision yourself to be.
There are messages scattered around from the last couple of weeks, where
you seem to have some problem with your program and the fault is
definitely not yours, it has to be java, it has to be...
This leads me and others to notice that maybe you should be looking at
the code you write.
I'd like to
see you try to suggest a better way to:

Because there can only be one solution for this task? what arrogance!
* Delete a file in a particular subtree and then
* If the directory it's in is now empty, delete that, and if that
leaves its parent directory entry, delete that too, and so forth, while
remaining confined to that subtree (whose root, even if it becomes
empty, isn't deleted).

Did you ever read ESRs "How to ask questions the right way" (I'll leave
it to you to find it on the net). You should have noticed that, in at
least one of the replies to your post, it was suggested that you should
try to look for the real problem, instead of creating a quick fix. That
should suggest to you that 1) maybe the problem lies deeper than what it
seems initially 2) maybe your design is not the best way to solve this
particular problem 3) to solve this problem you should look at it in a
larger perspective or from a different angle. 4) Maybe if you explain
more than just a little bit of the problem you can get some real answers.
You seem to misunderstand. Everything has already been said, and now
you are just going around in circles

No, I have not misunderstood anything, I have read all the posts and I
know what the posters say. But you do not have time to listen, as you
throw out insults instead on focusing on what the posters are trying to
say to you.
(and forcing me to do so as well,
to rebut insulting BS like what you just posted) saying the same things
repeatedly.

some more hot air...
You are awfully free with criticism, but seem to lack any
constructive suggestions -- or if not, you're keeping them to yourself.
I suggest you reverse that pattern -- keep your criticisms to yourself
and make any constructive suggestions you may have public. (Yes, that
does mean that in the event you have no constructive suggestions you
should simply shut up.)

Fortunately you do not have the possibility to control what I say, when
I say it and where I say it.

You don't seem to have noticed that people here have actually tried to
help you, but you have been so busy cutting them of with rude remarks
and self assertions that they simply cant be bothered to help you any more.
But I suspect both of us have better things to do than to continue this
pointless debate. Obviously you disagree with me; equally obviously
neither of us is likely to change the other's mind. Slinging insults
around won't do anything but waste your time slinging them and mine
cleaning up after you. So let's both just go home.

You might have been out flying high, but I have been home all the time
with my feet planted firmly on the ground.


Now, if you are ready to listen, I will give you the suggestions you
think I am unable to provide.

But first, there are some things you need to answer to get proper help,
because as several people have already stated your design has a bad
smell and should probably be redesigned.

- what is the purpose of what you are trying to do?
- why do you need a deep directory structure with files scattered in it?
- why do you need support for multi threaded file operations within the
same directory structure?
- can other solutions help you better?
-

the main criticisms are:

- the design and implementation you have chosen is not very maintainable
- the code its more complicated than it needs to be
- i.e. there are too many difficult to control side effects in the
code.

which both can lead to more headache in the future.

here are some suggestions:

1- don't use multi threading
- but that only solves your immediate problem, so you could almost
just continue to use multi threading.
2- add some proper file error handling code, to allow you to recover
from file errors, as the file system is not very transaction based.
3- not use deep directory structure but some other method instead, such
as dotted hierarchical file names in one directory.
4- design the directory operations in a singleton object in its own
thread, with a message queue to send commands through.
- at least now we are getting closer to some good design for reuse
and maintainability.
5- a recursive clean up method instead of the iterative version you
have chosen.
6- extend 4 with a separate TimerTask thread run every x seconds.
So the only thing you main thread, or x number of threads,
does, is to delete a single file. The clean up thread will take care
of the rest for you. This single file would then only be named in one
thread so there will be no problems. And the operation that creates a
file in the directory structure must also be able to create any
missing directories, so it should be able to handle disappearing
directories
7- or even better, combine 4,5 and 6 into one solution, where the
TimerTask is to add a message in the message queue signalling clean-up.


tom
 
T

Twisted

You're deluded if you think you have any authority in this newsgroup.

So are you. Yet you persist in telling me what to do. Why?
Another order, your delusion deepens. You've had plenty of sensible
suggestions which you chose to ignore or dismiss offhand.

I determined that the problem was a concurrency one and fixed it. End
of story -- or should have been, anyway. Why do you keep posting to
this thread?
...if you wish to persuade anyone.

I don't wish to persuade anyone of anything, except that they should
leave me alone when they are not responding helpfully to something I
wrote. Right now there are several people doing neither (here and in
another thread). They stand to gain nothing, yet they continue, and in
doing so they continue to aggravate me.
 
T

Twisted

(e-mail address removed) wrote:
[Snip some nonsensical ranting about my ego]

You seem to be obsessed with other peoples' egos. Perhaps this is the
wrong newsgroup though.
If Twisted doesn't understand why synchronisation reduced the frequency
of occurrence of the NPE then he is just postponing the date when he'll
have to get to grips with his bugs.

Like I've said a thousand times before, it didn't "reduce" anything; it
stopped the NPEs, because concurrency flubs were the *sole* cause. The
only way it could happen any more would be if a user elects to put a
symlink into the directory tree it created, which isn't intended for
user modification anyway.
I wonder if Twisted has considered upgrading his JRE to 1.6 and
retesting without synchronisation?

I *am* using 1.6, but I don't see any point in doing anything without
synchronization that clearly requires it for threadsafety!
 
T

Twisted

(e-mail address removed) wrote:
[Snip some nonsensical ranting about my ego]

You seem to be obsessed with other peoples' egos. Perhaps this is the
wrong newsgroup though.
If Twisted doesn't understand why synchronisation reduced the frequency
of occurrence of the NPE then he is just postponing the date when he'll
have to get to grips with his bugs.

Like I've said a thousand times before, it didn't "reduce" anything; it
stopped the NPEs, because concurrency flubs were the *sole* cause. The
only way it could happen any more would be if a user elects to put a
symlink into the directory tree it created, which isn't intended for
user modification anyway.
I wonder if Twisted has considered upgrading his JRE to 1.6 and
retesting without synchronisation?

I *am* using 1.6, but I don't see any point in doing anything without
synchronization that clearly requires it for threadsafety!
 
T

Twisted

Tom said:
Pay attention and read the entire message before you start steaming

If you don't want me to start steaming, then be more diplomatic in your
posts. Accusing me of gross incompetence will merely put me on the
defensive and make me entrench myself. Then nothing else you say will
make me budge.

The reason for this is simple. If we are collaborating on finding a
solution to a problem, then great! I'll consider any suggestion you
have.

If on the other hand you are bullying me and making sullying statements
about me (or implying them), then you are my adversary rather than
partner, and you've created a situation with winners and losers.
Obviously, if I do or say anything that amounts to acceptance of your
judgment of me, then I lose, so I can't do that, and that means I have
to argue against whatever you're saying. I certainly cannot start
believing it, since it would mean starting to believe whatever
insulting thing was implied along with it. The reason for that is
itself simple: any other policy on my part would open the door to
letting any Tom, Dick, or Asshole on usenet convince me of whatever
negative claims about me they wished. I'd be letting anyone manipulate
me into all kinds of nihilistic, futility-implying beliefs, which would
probably end with suicide. The third option appears to be to disbelieve
the insult but not publicly oppose it, which will still leave whatever
audience there is with the unopposed impression that the insulting
claim might be true. That's not a much better outcome, since having
everyone in the world believe something bad and untrue about me (even
while I don't) would probably interfere severely in being able to
continue anything resembling a life worth living. Anti-me propaganda
must be met with an equal and opposite force rather than allowed to be
disseminated unopposed. Since I don't believe in censorship, forcibly
shutting up my attackers is out of the question too. Clearly,
therefore, the policy I adopt, which is to fight back with
counterarguments when anyone publicly claims something hostile to me,
is the only viable option.
there is more than just vivid rudeness in this reply. There is also an
actual attempt at providing some help.

Help? Unfortunately, attaching some "help" as a rider to a steaming
pile just ensures that it goes into the compost heap along with all of
the accompanying reeking shit.

As a rule, gifts wrapped in fancy paper are accepted far more
frequently than gifts left in someone's toilet bowl, and there's a
reason for this.
Only Allah knows why... (LOL).

This could explain a great deal...
But that all depends on whether you want some help or are just out to
assert yourself.

Well, first of all, the original problem raised in this thread has long
since been solved to my satisfaction, so actually, I don't. As for
"asserting myself", in response to a serious insult leveled at me in a
public forum, you're damned straight.
What insult did I commit? Is it that asked you not to be
condescending?

Hypocrisy is almost as bad. But the insult was the accusation of
incompetence.

In any event, your advice is suspect, since you suggested that
synchronizing access to a shared object in a concurrent application was
"unnecessary complexity". I disagree, especially given that it not
being synchronized was in fact causing difficulties before.

[Further insults]
You need to deflate quite a bit. This is a public forum, where the aim
is to try to provide help.

Unfortunately, some of you have forgotten that, unless you honestly
believe that the best way to help *anyone* is by insulting them.

[Insults my intelligence]
There are messages scattered around from the last couple of weeks, where
you seem to have some problem with your program and the fault is
definitely not yours, it has to be java, it has to be...

Well, let's see. The priority queue NPE is now part of the Java bug
database as an apparent regression in 1.6 vs. 1.5. That looks to be a
genuine library bug. This NPE proved to be a concurrency problem and
has long since been solved.
Because there can only be one solution for this task? what arrogance!

That's odd. In another thread here, people are blasting me for
considering that there may be more than one solution to a task. Now
here, with zero evidence, you accuse *me* of claiming there is only one
solution.
Did you ever read ESRs "How to ask questions the right way" (I'll leave
it to you to find it on the net).

I fail to see the relevance. You appear to be recommending some kind of
non-Java resource. It sounds like it might be a self-help book or
something similar, though, which implies an insult. In fact, the phrase
you've quoted itself implies an insult, namely that I'm doing something
the *wrong* way. (And now who is saying there is a right way and a
wrong way and arrogantly assuming the only correct way is their way?)

[Snip a whole lot of rubbish]

I stated some simple requirements, and you've failed to provide even a
sketch of your idea of a preferred implementation. Sorry, you scored 0
points in this round.

What you did instead, mysteriously, was ask a whole bunch of questions
seemingly with the intent of making me redesign the thing. If I did
that, I'd end up with the same code I have now, for obvious reasons.
Unless you suggest something else that obviously doesn't occur to me
otherwise. And you seem to be refusing to do so!
Maybe if you explain more than just a little bit of the problem you can get
some real answers!

Sorry, no can do. I will not divulge more than the minimum required,
and I did that in the post you are replying to in a part of it that you
completely ignored.
No, I have not misunderstood anything, I have read all the posts and I
know what the posters say. But you do not have time to listen, as you
throw out insults instead on focusing on what the posters are trying to
say to you.

Excuse me? *I* throw out insults? What is this, some kind of
transference, or whatever the psychobabble of the month for this
particular pathology is?

It is *you* who has persisted in throwing out insults.
Fortunately you do not have the possibility to control what I say, when
I say it and where I say it.

You misspelled "unfortunately".
You don't seem to have noticed that people here have actually tried to
help you

Really? Maybe early in the thread when I actually still needed it. I
haven't seen anything recently that looked like any kind of "help",
other than people trying to "help" me believe nasty and awful
accusations, start feeling bad about myself, and maybe go kill myself
or whatever it is that they seem to want.
but you have been so busy cutting them of with rude remarks
and self assertions that they simply cant be bothered to help you any more.

Really. I'm the one making "rude remarks" in your twisted perceptions?
Actually all I've done is refute some insulting, malicious remarks
people have made *about* me.
Now, if you are ready to listen, I will give you the suggestions you
think I am unable to provide.

Really? (And I never thought you were unable to give suggestions; just
unwilling, or at least unwilling to do so in a civil manner.)

[Insulting suggestion of malodor deleted]

That one doesn't need a detailed rebuttal. It's clearly ludicrous,
given the nature of the medium. :)
- what is the purpose of what you are trying to do?

Outside the scope of this discussion, and proprietary. Sorry.
- why do you need a deep directory structure with files scattered in it?

It is a cache implementation. Beyond that, you don't Need To Know(tm).
- why do you need support for multi threaded file operations within the
same directory structure?

That's irrelevant. It only matter *that* I do.
- can other solutions help you better?

Since it's multithreaded, I don't see any superior method to using the
"synchronized" keyword; sorry.
- the design and implementation you have chosen is not very maintainable

I disagree.
- the code its more complicated than it needs to be
- i.e. there are too many difficult to control side effects in the
code.

If this is true, it's also unavoidable.
1- don't use multi threading
- but that only solves your immediate problem, so you could almost
just continue to use multi threading.

This is silly. For one thing, the nature of the larger application
requires multithreading. For another, all of the file operations in the
directories in question are now in critical sections synchronized on a
single common Java object, and so in effect it already *is*
single-threaded for that purpose.
2- add some proper file error handling code, to allow you to recover
from file errors, as the file system is not very transaction based.

It has the potential to throw IOException; where file manipulation is
done there are catches and finallys to deal with these here and there
(e.g. to close streams). I'm fairly sure all the needed error handling
is already in place.
3- not use deep directory structure but some other method instead, such
as dotted hierarchical file names in one directory.

This has issues of its own and was ruled out a long time ago. Why isn't
your concern.
4- design the directory operations in a singleton object in its own
thread, with a message queue to send commands through.

This occurred to me as well, but it means adding a new class and other
complexities that just don't seem necessary given that the same effect
is achieved simply by synchronizing.
5- a recursive clean up method instead of the iterative version you
have chosen.

The directory construction uses "mkdirs" so there's no recursive
user-code to unroll along. Besides, construction and destruction may be
widely-separated events.
6- extend 4 with a separate TimerTask thread run every x seconds.

Complexity abounds. And you suggested that *my* method was too complex
for just adding a few "synchronized (foo) {" and "}" pairs here and
there!
And the operation that creates a
file in the directory structure must also be able to create any
missing directories, so it should be able to handle disappearing
directories

It already does, with mkdirs.
7- or even better, combine 4,5 and 6 into one solution, where the
TimerTask is to add a message in the message queue signalling clean-up.

Now the project we're currently discussing would have more classes for
doing just this cleanup than it does for doing the whole rest of what
it does. :p
 
J

Joe Attardi

Hahaha, wow. Twisted sure likes trolling on this newsgroup!

Tom said:
Pay attention and read the entire message before you start steamingIf you don't want me to start steaming, then be more diplomatic in your
posts. Accusing me of gross incompetence will merely put me on the
defensive and make me entrench myself. Then nothing else you say will
make me budge.

The reason for this is simple. If we are collaborating on finding a
solution to a problem, then great! I'll consider any suggestion you
have.

If on the other hand you are bullying me and making sullying statements
about me (or implying them), then you are my adversary rather than
partner, and you've created a situation with winners and losers.
Obviously, if I do or say anything that amounts to acceptance of your
judgment of me, then I lose, so I can't do that, and that means I have
to argue against whatever you're saying. I certainly cannot start
believing it, since it would mean starting to believe whatever
insulting thing was implied along with it. The reason for that is
itself simple: any other policy on my part would open the door to
letting any Tom, Dick, or Asshole on usenet convince me of whatever
negative claims about me they wished. I'd be letting anyone manipulate
me into all kinds of nihilistic, futility-implying beliefs, which would
probably end with suicide. The third option appears to be to disbelieve
the insult but not publicly oppose it, which will still leave whatever
audience there is with the unopposed impression that the insulting
claim might be true. That's not a much better outcome, since having
everyone in the world believe something bad and untrue about me (even
while I don't) would probably interfere severely in being able to
continue anything resembling a life worth living. Anti-me propaganda
must be met with an equal and opposite force rather than allowed to be
disseminated unopposed. Since I don't believe in censorship, forcibly
shutting up my attackers is out of the question too. Clearly,
therefore, the policy I adopt, which is to fight back with
counterarguments when anyone publicly claims something hostile to me,
is the only viable option.
there is more than just vivid rudeness in this reply. There is also an
actual attempt at providing some help.Help? Unfortunately, attaching some "help" as a rider to a steaming
pile just ensures that it goes into the compost heap along with all of
the accompanying reeking shit.

As a rule, gifts wrapped in fancy paper are accepted far more
frequently than gifts left in someone's toilet bowl, and there's a
reason for this.
Only Allah knows why... (LOL).This could explain a great deal...
But that all depends on whether you want some help or are just out to
assert yourself.Well, first of all, the original problem raised in this thread has long
since been solved to my satisfaction, so actually, I don't. As for
"asserting myself", in response to a serious insult leveled at me in a
public forum, you're damned straight.
What insult did I commit? Is it that asked you not to be
condescending?Hypocrisy is almost as bad. But the insult was the accusation of
incompetence.

In any event, your advice is suspect, since you suggested that
synchronizing access to a shared object in a concurrent application was
"unnecessary complexity". I disagree, especially given that it not
being synchronized was in fact causing difficulties before.

[Further insults]
You need to deflate quite a bit. This is a public forum, where the aim
is to try to provide help.Unfortunately, some of you have forgotten that, unless you honestly
believe that the best way to help *anyone* is by insulting them.

[Insults my intelligence]
There are messages scattered around from the last couple of weeks, where
you seem to have some problem with your program and the fault is
definitely not yours, it has to be java, it has to be...Well, let's see.. The priority queue NPE is now part of the Java bug
database as an apparent regression in 1.6 vs. 1.5. That looks to be a
genuine library bug. This NPE proved to be a concurrency problem and
has long since been solved.
Because there can only be one solution for this task? what arrogance!That's odd. In another thread here, people are blasting me for
considering that there may be more than one solution to a task. Now
here, with zero evidence, you accuse *me* of claiming there is only one
solution.
Did you ever read ESRs "How to ask questions the right way" (I'll leave
it to you to find it on the net).I fail to see the relevance. You appear to be recommending some kind of
non-Java resource. It sounds like it might be a self-help book or
something similar, though, which implies an insult. In fact, the phrase
you've quoted itself implies an insult, namely that I'm doing something
the *wrong* way. (And now who is saying there is a right way and a
wrong way and arrogantly assuming the only correct way is their way?)

[Snip a whole lot of rubbish]

I stated some simple requirements, and you've failed to provide even a
sketch of your idea of a preferred implementation. Sorry, you scored 0
points in this round.

What you did instead, mysteriously, was ask a whole bunch of questions
seemingly with the intent of making me redesign the thing. If I did
that, I'd end up with the same code I have now, for obvious reasons.
Unless you suggest something else that obviously doesn't occur to me
otherwise. And you seem to be refusing to do so!
Maybe if you explain more than just a little bit of the problem you can get
some real answers!Sorry, no can do. I will not divulge more than the minimum required,
and I did that in the post you are replying to in a part of it that you
completely ignored.
No, I have not misunderstood anything, I have read all the posts and I
know what the posters say. But you do not have time to listen, as you
throw out insults instead on focusing on what the posters are trying to
say to you.Excuse me? *I* throw out insults? What is this, some kind of
transference, or whatever the psychobabble of the month for this
particular pathology is?

It is *you* who has persisted in throwing out insults.
Fortunately you do not have the possibility to control what I say, when
I say it and where I say it.You misspelled "unfortunately".
You don't seem to have noticed that people here have actually tried to
help youReally? Maybe early in the thread when I actually still needed it. I
haven't seen anything recently that looked like any kind of "help",
other than people trying to "help" me believe nasty and awful
accusations, start feeling bad about myself, and maybe go kill myself
or whatever it is that they seem to want.
but you have been so busy cutting them of with rude remarks
and self assertions that they simply cant be bothered to help you any more.Really. I'm the one making "rude remarks" in your twisted perceptions?
Actually all I've done is refute some insulting, malicious remarks
people have made *about* me.
Now, if you are ready to listen, I will give you the suggestions you
think I am unable to provide.Really? (And I never thought you were unable to give suggestions; just
unwilling, or at least unwilling to do so in a civil manner.)

[Insulting suggestion of malodor deleted]

That one doesn't need a detailed rebuttal. It's clearly ludicrous,
given the nature of the medium. :)
- what is the purpose of what you are trying to do?Outside the scope of this discussion, and proprietary. Sorry.
- why do you need a deep directory structure with files scattered in it?It is a cache implementation. Beyond that, you don't Need To Know(tm).
- why do you need support for multi threaded file operations within the
same directory structure?That's irrelevant. It only matter *that* I do.
- can other solutions help you better?Since it's multithreaded, I don't see any superior method to using the
"synchronized" keyword; sorry.
- the design and implementation you have chosen is not very maintainableI disagree.
- the code its more complicated than it needs to be
- i.e. there are too many difficult to control side effects in the
code.If this is true, it's also unavoidable.
1- don't use multi threading
- but that only solves your immediate problem, so you could almost
just continue to use multi threading.This is silly. For one thing, the nature of the larger application
requires multithreading. For another, all of the file operations in the
directories in question are now in critical sections synchronized on a
single common Java object, and so in effect it already *is*
single-threaded for that purpose.
2- add some proper file error handling code, to allow you to recover
from file errors, as the file system is not very transaction based.It has the potential to throw IOException; where file manipulation is
done there are catches and finallys to deal with these here and there
(e.g. to close streams). I'm fairly sure all the needed error handling
is already in place.
3- not use deep directory structure but some other method instead, such
as dotted hierarchical file names in one directory.This has issues of its own and was ruled out a long time ago. Why isn't
your concern.
4- design the directory operations in a singleton object in its own
thread, with a message queue to send commands through.This occurred to me as well, but it means adding a new class and other
complexities that just don't seem necessary given that the same effect
is achieved simply by synchronizing.
5- a recursive clean up method instead of the iterative...

read more »
 
A

Andreas Leitgeb

Twisted said:
If on the other hand you are bullying me and making sullying statements
about me (or implying them), then you are my adversary rather than
partner, and you've created a situation with winners and losers.
Obviously, if I do or say anything that amounts to acceptance of your
judgment of me, then I lose,

You're forgetting one important detail in your argumentation:
*You* are the one seeking help for *your* problem.

I can't say for the others, but my motivation to help is,
that someones problems look like puzzles to me. Your
problems even had quite an interesting touch. Your
NullPointerException was my Sudoku-alike :)
Unfortunately, solving your problems is no longer fun.
And this is not for the nature of the problems.
 
T

Twisted

Joe said:
Hahaha, wow. [snip more at roughly the same level of articulateness]

[snip way, way too damn much quoted material]

If you don't have anything constructive to say, FOR CHRIST'S SAKE AT
LEAST DON'T TOP-POST! :p
 
T

Twisted

Andreas said:
You're forgetting one important detail in your argumentation:
*You* are the one seeking help for *your* problem.

Actually, it is you who are forgetting something, and that is your
English language lessons, particularly vis-a-vis verb tenses. *I* am
the one that *was* seeking help ... and eventually solved the problem,
largely on my own. As an unfortunate side effect of having posted here
before coming up with said solution, though, I now find myself wading
through piles of tripe every time I check news!

Perhaps you can help me with that, though -- by letting this stupid
thread die, now that it's emphatically served its original purpose and
is equally emphatically no longer serving *any* constructive purpose.
 
F

foobarbazqux

Twisted said:
So are you.

More pantomime debate. If I did I would be, but I didn't.

Yet you persist in telling me what to do.

You said "If you are going to criticize,make it constructive."

I said "I think you'll need to apply more adult reasoning in this
newsgroup if you wish to persuade anyone."

See the difference? Prefixing with "I think" makes mine more of an
observation than your directive".


I'll take that as rhetorical.

I determined that the problem was a concurrency one and fixed it.

No you didn't, you found that adding concurrency diminished the
frequency of occurrence. The cause is as much a mystery to you today as
it was when you first posted on this subject.

End of story -- or should have been, anyway. Why do you keep posting to
this thread?

You enjoy it really.

I don't wish to persuade anyone of anything, except that they should
leave me alone when they are not responding helpfully to something I
wrote. Right now there are several people doing neither (here and in
another thread). They stand to gain nothing,

You've missed something there.

yet they continue, and in doing so they continue to aggravate me.

As ye sow, so shall ye reap.
 
T

Twisted

No you didn't, you found that adding concurrency diminished the
frequency of occurrence.

To zero. Which is the same thing, moron.
You've missed something there.

Oh? Such as? Tell me what you gain by posting drivel like the reeking
turd I'm replying to?
Or hacking GG to make my replying spam random extra newsgroups and put
me over Google's dumbass limit, for that matter? (Which activity you
seem to have stopped, once I caught on to it and it thereby became
futile.)
As ye sow, so shall ye reap.

Are you claiming that I attacked you before you ever attacked me? If
so, it's a damn lie...
 

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,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top