mbien commented on code in PR #7333:
URL: https://github.com/apache/netbeans/pull/7333#discussion_r1581556019
##########
java/java.hints.declarative/src/org/netbeans/modules/java/hints/declarative/DeclarativeHintRegistry.java:
##########
@@ -229,8 +229,12 @@ private static Collection<? extends FileObject>
findFilesRecursive(FileObject fo
public static Map<HintMetadata, Collection<? extends HintDescription>>
parseHintFile(@NonNull FileObject file) {
String spec = Utilities.readFile(file);
-
- return spec != null ? parseHints(file, spec) : Collections.emptyMap();
+ try {
+ return spec != null ? parseHints(file, spec) :
Collections.emptyMap();
+ } catch (Exception ex) {
+ LOG.log(Level.WARNING, "Can not parse hint file:
"+file.toURL()+"\n"+spec, ex);
+ return Collections.emptyMap();
+ }
Review Comment:
also worth mentioning that the hint file itself would usually display parser
errors, however the parser doesn't like non trivial hint files and it is
typically full with error badges (and parsing exceptions). I tried to find ways
some time ago to disable semantic editor features for hint files but gave up at
some point.
--
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