OT perhaps (better directed to Oracle?): Suggestions for improving checked exceptions in Java.

2021-10-28 Thread Owen Thomas
G'day.

Upon seeing some recent emails from this group expressing a somewhat
philosophical tone about how the evolving landscape of paradigms in
software development may be putting a strain on Java, I just wish to put
some comments that others might find interesting down about how a specific
Java feature, namely checked exceptions, can be improved so that again,
Java perhaps can show how to do something well enough that other languages
might try and copy it.

I say the following. Have an abstract checked exception class in the Java
SE API. Call it, say, CheckedException. Descendents of this class behave
like any other checked exception, with perhaps a few caveats explained in
this email.

The build script of a deployable artifact (an application or library, but
in this case, probably a library explains the situation more clearly)
somehow indicates that this deployable artifact (hereon referred to as a
library) can declare that descendents of CheckedExceptions (never the
CheckedException class itself) are:

   1. thrown: A more specific descendent of a checked exception under this
   clause occurs in the throws clause of a method that is exposed to libraries
   that are dependent on this one.

   2. caught: A more specific descendent of a checked exception under this
   clause occurs in the catch block of a method that calls a method from a
   library on which this one depends.

   3. ignored: Neither of the above scenarios occurs. *However, methods in
   this library that call methods that throw a descendent of a checked
   exception under this clause do not themselves explicitly declare that they
   throw or catch and deal with the given checked exception*.

If a library declares that it throws or ignores a descendent of a
CheckedException, in its build script or other deployment descriptor, then
any dependent library must either declare that that CheckedException is
thrown, caught, or ignored.

The emphasis above is used to underscore the utility that my suggestion is
trying to convey. I think that with perhaps a few tweaks, this is a
flexible suggestion. Although I do not (not yet perhaps... I just need a
compelling reason to) know much about Java modules, this system of
selectively dealing with checked exceptions appears as a very good
candidate for expression there.

These are just suggestions and I put them out there because someone with
some clout in shaping the future of the Java SE API might think these
suggestions are worth considering further. Happy to share and perhaps to
talk about it here if others share a similar interest.

Have a great day. :)

  Owen.


Re: 12.6-rc1: Can't set breakpoints in Groovy until a Java file is displayed

2021-10-28 Thread Geertjan Wielenga
Sounds about right. When you think you want Groovy, you need to be reminded
that what you actually need in the background is Java. NetBeans — your
helpful reminder of what’s what.

Gj

On Thu, 28 Oct 2021 at 23:53, Blake McBride  wrote:

> If I bring up NetBeans 12.6-rc1 on a project with Java & Groovy source
> files and go to a Groovy source file, the system will not allow me to set a
> breakpoint.  However, if I display a Java file and then go back to the
> Groovy file, I can then set a breakpoint in the Groovy file.
>
> It appears like displaying a Java file is activating something needed by
> the Groovy file.  Once it is activated all works well until I exit NetBeans
> and go back in.
>
> Thanks.
>
> Blake McBride
>
>
>


12.6-rc1: Can't set breakpoints in Groovy until a Java file is displayed

2021-10-28 Thread Blake McBride
If I bring up NetBeans 12.6-rc1 on a project with Java & Groovy source
files and go to a Groovy source file, the system will not allow me to set a
breakpoint.  However, if I display a Java file and then go back to the
Groovy file, I can then set a breakpoint in the Groovy file.

It appears like displaying a Java file is activating something needed by
the Groovy file.  Once it is activated all works well until I exit NetBeans
and go back in.

Thanks.

Blake McBride