How can i automatically find all unhandled exceptions in my java code?

I

Ingo R. Homann

Hi,

Eric said:

The problem is that you do not get uncaught RuntimeExceptions as Stefan
more or less mentioned. So, IMHO the correct answer would be:

"Read the error messages from javac and catch RuntimeExceptions in your
main-method."

Ciao,
Ingo
 
I

Ingo R. Homann

Hi,
He meant that you should see the X-Readme header. Do a search for
‘email headers’.

OMG (=Oh my god)!

What kind of nerd humor is it to express onself intentionally baffling
and not even respond in an understandable way if the OP exlicitely asks
for it? (IMHO it is the same kind of behaviour that we nerds make fun of
if e.g. a manager or salesman does so).

To upsa:
Eric meant: "Read the error messages from javac."
Stefan meant: "But wouldn't this apply only to the checked exceptions,
not to runtime exceptions."

Ciao,
Ingo
 
A

Alex Hunsley

Ingo said:
Hi,


OMG (=Oh my god)!

What kind of nerd humor is it to express onself intentionally baffling
and not even respond in an understandable way if the OP exlicitely asks
for it? (IMHO it is the same kind of behaviour that we nerds make fun of
if e.g. a manager or salesman does so).

They are chastising/needling the OP in a round-about way for not putting
the question where it is most important to have it: the message body.
 
I

Ingo R. Homann

Hi,

Alex said:
They are chastising/needling the OP in a round-about way for not putting
the question where it is most important to have it: the message body.

I think the question (short and exact) is put perfectly where it should
be - in the subject. Of course, one could argue about if it would be a
good idea to copy&paste to the body. (Although I do not think that it is
worth arguing about that.)

Having said this: If they have the oppinion that the OP should put the
question in the message body, they should say that - especially when he
asks for explaining what they meant. I don't think that the OP can read
their minds. He will only think "What ... nerds!"

Ciao,
Ingo
 
A

Alex Hunsley

Ingo said:
Hi,



I think the question (short and exact) is put perfectly where it should
be - in the subject.

It's just netiquette, I believe, that you should always have a
containing actual content rather than an empty one or one that says "see
subject".
Of course, one could argue about if it would be a
good idea to copy&paste to the body. (Although I do not think that it is
worth arguing about that.)

A succinct and direct question is good as a subject line. Personally I
think it should be pasted as the body too, even if it is only the same
content as the subject line.
Having said this: If they have the oppinion that the OP should put the
question in the message body, they should say that - especially when he
asks for explaining what they meant. I don't think that the OP can read
their minds. He will only think "What ... nerds!"

It would be more helpful to have done that, yes.
 
L

Lew

Alex said:
It would be more helpful to have done that, yes.

But far less clever.

And needling does not violate netiquette.

And when the OP rises to the level where they appreciate the needling, then
they will have transformed more than if they were given the easy way.

-- Lew
 
O

Oliver Wong

Stefan Ram said:
See »X-Readme« header.

(I wonder if this reply post will replicate your X-Readme header or not --
I suspect not)

Right, as Stefan says, Eric's solution of reading the javac error
messages would only apply to checked exceptions. To handled unchecked
exceptions, you might be able to do a bit of static analysis on the source
code, but I suspect that in general the problem is insoluble. For example,
what if you write a ClassLoader which generates random (but legal)
bytecode? It may generate code which throws a runtime exception without
declaring so in the method header, and you'd have a tough time "finding"
this unhandled exception (how would you define "find" in this case?) via
static analysis.

- Oliver
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top