Nyeng Gyang wrote:this claim of mine is as follows: “It is a compile-time error to throw an exception of class E in a try block and place an exception of a subclass of class E in the corresponding catch block”).
Paul Clapham wrote:That rule appears to be supported by your examples. So far so good.
Paul Clapham wrote:The rule "If the try block can throw an exception of class E, then either the corresponding catch blocks must catch all exceptions which are instances of type E or the containing method must declare class E to be thrown" ...
Stephan van Hulst wrote:You have shown that you have no true wish in understanding the JLS, illustrated by your indifferent dismissal of a very simple language rule that tells you exactly why your code is wrong.
Stephan van Hulst wrote:According to you, not only are Campbell and I wrong, but the JLS itself is wrong, the very thing that defines the Java language.
Nyeng Gyang wrote:The only thing that I have said, which comes close to what you claim in the foregoing remark that you have furnished here, is that the JLS rule Campbell furnished needs the (albeit small, but important and non-trivial) correction that I have suggested.
Paul Clapham wrote:No, your rule only covers part of what the JLS covers.
Paul Clapham wrote:Recall that your rule doesn't cover the situation where there's no catch block.
Paul Clapham wrote:And if you're claiming that your rule is a correction to the rule in the JLS then you're wasting your time with that claim.
Paul Clapham wrote:You can post on as many forums as you like but everybody is going to write you off as a crank.
Nyeng Gyang wrote:(2) The correction I have suggested needs to be made to the JLS rule.
Paul Clapham wrote:Your rule is rather pointless, since it includes the assumption that the try statement is accompanied by exactly one catch statement.
Paul Clapham wrote:Remember that the "S" in "JLS" stands for "Specification". A specification defines how something (in this case the Java language) must work and therefore "correcting a specification" is a meaningless idea. If there are differences between what the JLS says and what your Java compiler does, then it's the compiler which is in error.
Nyeng Gyang wrote:this claim of mine is as follows: “It is a compile-time error to throw an exception of class E in a try block and place an exception of a subclass of class E in the corresponding catch block”).
Paul Clapham wrote:Notice the word "the" near the end of your claim. That means that your rule only considers cases where there's exactly one catch block. That's what "the" means. And so it should, because if there's more than one catch block attached to a try block then the rule isn't true. Or at least, a revised rule which referred to "one of the corresponding catch blocks" wouldn't be true.
Paul Clapham wrote:I suspect that overlooking this case may have contributed to your idea that the Java compiler isn't a faithful implementation of the JLS.
Paul Clapham wrote:You surely don't propose to modify the JLS by extra verbiage which only applies when a try block is followed by a single catch block?
Paul Clapham wrote:I mean, I've already asserted that's exactly what you propose ...
Nyeng Gyang wrote:I have thought of employing yet another approach to demonstrate that your take on my suggested correction is wrong. However, until I am able to confirm that this your misunderstanding of the suggested correction is due to genuine, sincere misunderstanding, rather than deliberate crafty obfuscation, I fear that I will only waste my time making any such attempt at supporting and clarifying my claim that you have decidedly gotten my suggested correction wrong.
Paul Clapham wrote:You surely don't propose to modify the JLS by extra verbiage which only applies when a try block is followed by a single catch block?
Paul Clapham wrote:This would be a welcome change. So far you have only been vigorously avoiding saying anything which would support your claim. Instead you have limited yourself to attacking people who would like to clarify it.
Paul Clapham wrote:And indeed it's likely that my take on your claim is wrong. That's why I have repeatedly asked you to clarify. I have provided several examples; you have done nothing except to reply that your claim should be obvious.
Paul Clapham wrote:The examples were intended to explore the limits of your claim. In other words all of the examples I have provided, in your view, result in a compiler and your assertion is that the JLS says that is the correct behaviour. Your single example, however, is very similar to mine so it's your responsibility to explain what the differences are and how that's related to the JLS.
Paul Clapham wrote:The other thing to take into account is that if your goal is to demonstrate that the JLS is incomplete and needs repairing, then demonstrating that I'm wrong is not what you want to do. That means nothing. Your goal should be to demonstrate that you are right. So far I have seen nothing like that. So, I look forward to seeing your clarifications.
Those cherries would go best on cherry cheesecake. Don't put those cherries on this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
|