Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6606476

Uncatchable exception printed to console for certain clipboard contents

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • P3
    • Resolution: Unresolved
    • 6
    • None
    • client-libs
    • Cause Known
    • x86
    • windows_xp

    Description

      FULL PRODUCT VERSION :
      java version "1.6.0_01"
      Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
      Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      For certain types of clipboard contents (Java objects not on the classpath, for instance), an uncatchable exception is printed to the console when those contents are pasted into another Java application. For example, if you run the IntelliJ IDE and copy text onto the clipboard from within it, then startup another Java application outside of IntelliJ and press Ctrl-V to paste, you'll get:

      Exception "java.lang.ClassNotFoundException: com.intellij.codeInsight.editorActi
      ons.TextBlockTransferable$FoldingData"while constructing DataFlavor for: applica
      tion/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.Te
      xtBlockTransferable$FoldingData

      This exception printout is coming from SystemDataFlavor.java, line 508:

                      System.err.println("Exception \"" + e.getClass().getName() +
                                         ": " + e.getMessage() +
                                         "\"while constructing DataFlavor for: " +
                                         decoded);

      The problem is that there is no way to catch this exception or suppress the printing of it, and this looks bad for the application.

      It would seem that all of the System.err.printlns in SystemFlavorMap should be changed to some other form of error handling (or hidden behind a flag) so that they don't appear while running an innocent Java app.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      (1) Startup IntelliJ and copy some Java text (or otherwise, place a Java object on the clipboard by other means).
      (2) From a DOS console, start the SwingSet2 application.
      (3) Paste (Ctrl-V) into the Frame title text field.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected no exceptions to be printed to console.
      ACTUAL -
      Exceptions are printed to console:

      Exception "java.lang.ClassNotFoundException: com.intellij.codeInsight.editorActi
      ons.TextBlockTransferable$ReferenceData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.
      TextBlockTransferable$ReferenceData
      Exception "java.lang.ClassNotFoundException: com.intellij.codeInsight.editorActions.TextBlockTransferable$ReferenceData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.
      TextBlockTransferable$ReferenceData
      Exception "java.lang.ClassNotFoundException: com.intellij.codeInsight.editorActions.TextBlockTransferable$FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.Te
      xtBlockTransferable$FoldingData
      Exception "java.lang.ClassNotFoundException: com.intellij.codeInsight.editorActions.TextBlockTransferable$FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.Te
      xtBlockTransferable$FoldingData

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      See Actual Result.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      n/a. Can be reproduced with SwingSet2 demo and another application (e.g., IntelliJ) that places a Java object on the clipboard.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None that I've discovered.

      Attachments

        Issue Links

          Activity

            People

              denis Denis Fokin (Inactive)
              igor Igor Nekrestyanov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Imported:
                Indexed: