mbien opened a new pull request, #8962:
URL: https://github.com/apache/netbeans/pull/8962

   Don't dump the serialized form on `DataObjectNotFoundException` when a 
`TopComponent` can't be deserialized. This is often harmless and happens for 
example when an opened project moved while NB was closed. A single warning line 
should be sufficient.
   
   Full exception is logged with `FINE` level.
   
   example log line:
   ```
   WARNING [org.netbeans.core.windows.persistence]: 
[PersistenceManager.getTopComponentForID] Problem when deserializing 
TopComponent for tcID:'MultiView-java#002Eso2D0988CFtext#002Ehistory#007C'. 
Reason: 
/tmp/mavenproject1/src/main/java/com/mycompany/mavenproject1/Mavenproject1.java@6051f4cb:671b4d0d[invalid]
   ```
   open project -> close NB -> remove project -> start NB
   
   
   as sidenote:
   the original stack dump had several lines which just said "msg". Those were 
ResourceBundle keys which weren't substituted with the actual message. But 
substituting it might cause more harm than good (given the key name). I haven't 
seen this anywhere else so far. My guess is that the mechanism isn't used very 
often. In any case the hotfix would look like:
   
   <details>
   
   ```diff
   diff --git a/platform/openide.util/src/org/openide/util/Exceptions.java 
b/platform/openide.util/src/org/openide/util/Exceptions.java
   index 65bdd7c..de07b22 100644
   --- a/platform/openide.util/src/org/openide/util/Exceptions.java
   +++ b/platform/openide.util/src/org/openide/util/Exceptions.java
   @@ -304,10 +304,17 @@
                    return;
                }
                try {
   -
                    for (LogRecord log : r) {
   -                    if (log.getMessage() != null) {
   -                        a.append(log.getMessage()).append("\n");
   +                    String msg = log.getMessage();
   +                    if (msg != null) {
   +                        ResourceBundle rb = log.getResourceBundle();
   +                        if (rb != null) {
   +                            String localized = rb.getString(msg);
   +                            if (localized != null) {
   +                                msg = localized;
   +                            }
   +                        }
   +                        a.append(msg).append("\n");
                        }
                        if (log.getThrown() != null) {
                            StringWriter w = new StringWriter();
   ```
   
   </details>


-- 
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