sdedic commented on code in PR #7250:
URL: https://github.com/apache/netbeans/pull/7250#discussion_r1559813702


##########
ide/libs.graalsdk/src/org/netbeans/libs/graalsdk/impl/GraalEnginesProvider.java:
##########
@@ -60,7 +61,9 @@ public List<ScriptEngineFactory> 
factories(ScriptEngineManager m) {
             if (disable == null) {
                 enumerateLanguages(arr, m == null ? null : m.getBindings());
             }
-        } catch (IllegalStateException | LinkageError err) {
+        } catch (IllegalStateException | LinkageError | 
ServiceConfigurationError err) {
+            // See NETBEANS #7245: First-time initialization with broken 
implementation may produce ServiceConfigurationError, As this
+            // happens in class-initializer, subsequent attempts will throw 
LinkageErrors.

Review Comment:
   > the exception code path will only be hit once.
   
   That's not true IMHO; `ServerConfigError` will be fired just once, but 
`LinkageError` would be fired for every `Scripting.newBuilder().build()` call 
without the guard - this provider is bound to fail all the time after 
`ServerConfigurationError` condition (and most possibly after a LinkageError 
originating elsewhere as well). At least if I interpret/debugged the code 
correctly.
   
   The question is still whether it is desirable to have an exception logged 
for each `Scripting.newBuilder().build()` or not.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to