pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1861394 - /pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/ui/LogDialog.java
Date Sat, 15 Jun 2019 14:19:23 GMT
Author: tilman
Date: Sat Jun 15 14:19:23 2019
New Revision: 1861394

URL: http://svn.apache.org/viewvc?rev=1861394&view=rev
Log:
PDFBOX-4071: SonarQube fix

Modified:
    pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/ui/LogDialog.java

Modified: pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/ui/LogDialog.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/ui/LogDialog.java?rev=1861394&r1=1861393&r2=1861394&view=diff
==============================================================================
--- pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/ui/LogDialog.java
(original)
+++ pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/ui/LogDialog.java
Sat Jun 15 14:19:23 2019
@@ -16,6 +16,7 @@
 package org.apache.pdfbox.debugger.ui;
 
 import java.awt.Color;
+import java.awt.Container;
 import java.awt.Frame;
 import java.io.PrintWriter;
 import java.io.StringWriter;
@@ -38,17 +39,6 @@ import javax.swing.text.StyledDocument;
 public class LogDialog extends JDialog
 {
     private static LogDialog instance;
-    
-    public static void init(Frame owner, JLabel logLabel)
-    {
-        instance = new LogDialog(owner, logLabel);
-    }
-
-    public static LogDialog instance()
-    {
-        return instance;
-    }
-
     private final JLabel logLabel;
     private final JTextPane textPane;
     private final JScrollPane scrollPane;
@@ -57,7 +47,7 @@ public class LogDialog extends JDialog
     private int warnCount = 0;
     private int otherCount = 0;
     private int exceptionCount = 0;
-    
+
     private LogDialog(Frame owner, JLabel logLabel)
     {
         super(owner);
@@ -69,7 +59,17 @@ public class LogDialog extends JDialog
         
         this.pack();
     }
-    
+
+    public static void init(Frame owner, JLabel logLabel)
+    {
+        instance = new LogDialog(owner, logLabel);
+    }
+
+    public static LogDialog instance()
+    {
+        return instance;
+    }
+
     public void log(String name, String level, Object o, Throwable throwable)
     {
         StyledDocument doc = textPane.getStyledDocument();
@@ -200,4 +200,18 @@ public class LogDialog extends JDialog
         textPane.setText("");
         logLabel.setText("");
     }
+
+    // these two just to avoid the "overridable method call in constructor" warning
+
+    @Override
+    public final Container getContentPane()
+    {
+        return super.getContentPane();
+    }
+
+    @Override
+    public final void pack()
+    {
+        super.pack();
+    }
 }



Mime
View raw message