Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Checked assignments anyone?

Owen_Feb 6 2021 — edited Feb 6 2021

Hello.
For a while now I have been disliking the way I have to declare a variable outside a try block whenever I assign to the given variable anything returned from a method that throws an exception I may want to handle from the code in which the assignment is made.
There isn't much facility to provide code here, so I'll just give the example of what I'd like to do as a one-liner:
Type variable=try receiver.method();
The catch block would be provided as usual. Indeed, one could assign more than one variable before coding a catch block, and this would help keep code concise. Additionally, when using the var keyword, one wouldn't have to quote types that were long or had extensive parameter lists.
Who likes this idea? Who doesn't? Why wouldn't you?

Comments

Arnoschots-Oracle Apr 22 2020 — edited on Apr 22 2020

Hi,

The "sudo al-config -s" doesn't work on my Autonomous Linux instance.

Command output:

[opc@opsserver ~]$ sudo al-config -s

/sbin/al-config: illegal option -- s

Configure OCI notification service topic OCID:

  Usage:

    al-config -T [topic OCID]

  Options:

    -T [topic OCID] OCI notification service topic OCID

Configure OCI CLI profile:

  Usage:

    al-config -u [user OCID] -t [tenancy OCID] -k [key file]

  Options:

    -u [user OCID] OCI User OCID

    -t [tenancy OCID] OCI Tenancy OCID

    -k [key file] from which we obtaion the API private key

    -p [key passphrase file] from which we obtain API key passphrase. Provide

       this if API private key is encrypted. If not provided, user will be

       prompted to enter passphrase.

1 - 1

Post Details

Added on Feb 6 2021
0 comments
183 views