[Title] Code qualification
authorBon-Yong Lee <bonyong.lee@samsung.com>
Mon, 27 Aug 2012 08:11:57 +0000 (17:11 +0900)
committerBon-Yong Lee <bonyong.lee@samsung.com>
Mon, 27 Aug 2012 08:11:57 +0000 (17:11 +0900)
[Type]      Enhancement
[Module]    Sub
[Priority]  Minor
[CQ#]       // CQ Issue Number
[Redmine#]  // Redmine Isuue Number
[Problem]   // Problem Description
[Cause]     // Cause Description
[Solution]  // Solution Description
[TestCase]  // Executed the test-target (How to)

19 files changed:
org.tizen.common.connection/src/org/tizen/common/connection/ConnectionPlugin.java [changed mode: 0644->0755]
org.tizen.common.connection/src/org/tizen/common/connection/debugtools/ToolsInstall.java [changed mode: 0644->0755]
org.tizen.common.connection/src/org/tizen/common/connection/explorer/ConnectionExplorerPanel.java
org.tizen.common.connection/src/org/tizen/common/connection/explorer/Messages.java [changed mode: 0644->0755]
org.tizen.common.connection/src/org/tizen/common/connection/log/AddViewDialog.java [changed mode: 0644->0755]
org.tizen.common.connection/src/org/tizen/common/connection/log/LogPanel.java [changed mode: 0644->0755]
org.tizen.common.externals/src/org/mihalis/opal/imageSelector/ImageSelector.java [changed mode: 0644->0755]
org.tizen.common.externals/src/org/mihalis/opal/launcher/Launcher.java [changed mode: 0644->0755]
org.tizen.common.externals/src/org/mihalis/opal/multiChoice/MultiChoice.java
org.tizen.common.externals/src/org/mihalis/opal/rangeSlider/RangeSlider.java
org.tizen.common.externals/src/org/mihalis/opal/textAssist/TextAssist.java [changed mode: 0644->0755]
org.tizen.common.externals/src/org/mihalis/opal/transitionComposite/TransitionFactory.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/core/application/UpdateManager.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/util/Assert.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/util/EFSUtil.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/util/HostUtil.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/util/StreamGobbler.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/util/StringUtil.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/util/cache/FontCache.java [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 65d02c8..09d28fd
@@ -98,9 +98,13 @@ public class ConnectionPlugin extends AbstractUIPlugin {
         plugin = this;
 
         if (OSChecker.isWindows())
+        {
             this.os = WINDOWS;
+        }
         else
+        {
             this.os = LINUX;
+        }
 
     }
 
@@ -114,10 +118,14 @@ public class ConnectionPlugin extends AbstractUIPlugin {
                 if (ce.getName().equals("tools")) {
                     String packagename = ce.getAttribute("packagename");
                     if (packagename == null)
+                    {
                         continue;
+                    }
                     String sourcepath = ce.getAttribute("sourcepath");
                     if (sourcepath == null)
+                    {
                         continue;
+                    }
                     String description = ce.getAttribute("description");
                     Path sourcePath = new Path(InstallPathConfig.getPlatformVersionPath() + "/" + sourcepath);
                     File packageList = new File(sourcePath.toOSString());
@@ -204,10 +212,14 @@ public class ConnectionPlugin extends AbstractUIPlugin {
 
         if (device.isEmulator()) {
             if (!architecture.equals("i386"))
+            {
                 return null;
+            }
         } else {
             if (!architecture.equals("armel"))
+            {
                 return null;
+            }
         }
 
         DebugTool dt = new DebugTool(packagename, f.getName(), sourcepath, version, description, architecture, "tar");
old mode 100644 (file)
new mode 100755 (executable)
index 057b720..75f7af0
@@ -27,6 +27,9 @@
 
 package org.tizen.common.connection.debugtools;
 
+import static org.tizen.common.util.CollectionUtil.isEmpty;
+import static org.tizen.common.util.IOUtil.tryClose;
+
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -49,11 +52,7 @@ import org.tizen.common.util.IOUtil;
 import org.tizen.common.util.SdbCommandUtil;
 import org.tizen.common.util.log.Logger;
 import org.tizen.sdblib.IDevice;
-import org.tizen.sdblib.SdbCommandRejectedException;
 import org.tizen.sdblib.SdbShellProcess;
-import org.tizen.sdblib.SyncService;
-import org.tizen.sdblib.SyncService.SyncResult;
-import org.tizen.sdblib.TimeoutException;
 
 class PackageInstallMonitorDialog extends ProgressMonitorDialog {
     public PackageInstallMonitorDialog(Shell parent) {
@@ -90,7 +89,9 @@ class InstallProgress implements IRunnableWithProgress {
         String msg = ToolsInstallMessages.CANNOT_CREATE_DIRECTORY;
 
         if (checkExitCode(cmd, msg) == false)
+        {
             installCoreException(msg, null);
+        }
     }
 
     private boolean checkExitCode( String cmd, String msg ) throws CoreException
@@ -114,12 +115,7 @@ class InstallProgress implements IRunnableWithProgress {
             Logger.error(msg, e);
         }finally
         {
-            if( br != null )
-                try {
-                    br.close();
-                } catch (IOException e) {
-                    Logger.error("Error to close BufferedReader", e);
-                }
+            tryClose( br );
         }
         return result;
     }
@@ -153,18 +149,15 @@ class InstallProgress implements IRunnableWithProgress {
                     }
                     break;
                 } else
+                {
                     ret = false;
+                }
             }
         } catch (IOException e) {
             installCoreException(ToolsInstallMessages.CANNOT_CHECK_INSTALLED, e);
             Logger.error(ToolsInstallMessages.CANNOT_CHECK_INSTALLED, e);
         } finally {
-            if(br != null)
-                try {
-                    br.close();
-                } catch (IOException e) {
-                    Logger.error("Error to close BufferedReader", e);
-                }
+            tryClose( br );
         }
         return ret;
 
@@ -183,8 +176,10 @@ class InstallProgress implements IRunnableWithProgress {
         final List<DebugTool>  allDebugTools = ConnectionPlugin.getDebugTools(device);
         List<DebugTool> installDebugTools = new ArrayList<DebugTool>();
 
-        if (allDebugTools == null || allDebugTools.size() == 0)
+        if ( isEmpty( allDebugTools ) )
+        {
             return;
+        }
         boolean isInstalled = false;
         for ( DebugTool dt : allDebugTools ) {
             try {
index f5d9b46..2478c1d 100755 (executable)
@@ -455,7 +455,9 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
                 String name = getNameFromInputDialog("New File Resource", "New File Name: ", entry, "");
 
                 if (name == null)
+                {
                     return;
+                }
 
                 String fullPath = FilenameUtil.addDoubleQuote(entry.getFullEscapedPath() + "/" + name);
                 String command = String.format("touch %s; echo $?", fullPath);
@@ -498,7 +500,9 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
 
                 String name = getNameFromInputDialog("New Folder Resource", "New Folder Name: ", entry, "");
                 if (name == null)
+                {
                     return;
+                }
 
                 // create the mkdir command
                 String fullPath = FilenameUtil.addDoubleQuote(entry.getFullEscapedPath() + "/" + name);
@@ -542,12 +546,16 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
             inputDialog = new InputDialog(Display.getCurrent().getActiveShell(), title, message, initValue, new FileNameValidator());
 
             if (inputDialog.open() != Window.OK)
+            {
                 return null;
+            }
 
             String input = inputDialog.getValue();
             // same entry is already exist..
             if (findDuplicateFileEntry(input, entry))
+            {
                 again = true;
+            }
 
         } while (again);
 
@@ -567,7 +575,9 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
                 String name = getNameFromInputDialog("Rename Resource", "New name: ", entry.getParent(), entry.getName());
 
                 if (name == null)
+                {
                     return;
+                }
 
                 String fullPath = entry.getFullEscapedPath();
                 int lastIndex = fullPath.lastIndexOf(PATH_SEPARATOR);
@@ -755,7 +765,9 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
     public void refreshSelection()
     {
         if (treeViewer.getTree().getSelectionCount() == 0)
+        {
             return;
+        }
         refresh(getSingleFileEntry());
     }
 
@@ -951,7 +963,9 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
     public void deviceConnected(IDevice device)
     {
         if (device.isOffline())
+        {
             return;
+        }
         devicesList.add(device);
         ToolsInstall.installPackages(device);
         execRefresh();
@@ -1153,10 +1167,14 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
     {
 
         if (selectedEntry == null)
+        {
             return;
+        }
 
         if (!selectedEntry.isRoot())
+        {
             return;
+        }
 
         final Tree tree = treeViewer.getTree();
         exec(new Runnable()
old mode 100644 (file)
new mode 100755 (executable)
index 28a1661..f603e24
@@ -52,80 +52,4 @@ public class Messages {
                        return '!' + key + '!';\r
                }\r
        }\r
-       private static String messageBind(String message, Object[] args, String argZero, String argOne) {\r
-               int length = message.length();\r
-               //estimate correct size of string buffer to avoid growth\r
-               int bufLen = length + (args.length * 5);\r
-               if (argZero != null)\r
-                       bufLen += argZero.length() - 3;\r
-               if (argOne != null)\r
-                       bufLen += argOne.length() - 3;\r
-               StringBuffer buffer = new StringBuffer(bufLen < 0 ? 0 : bufLen);\r
-               for (int i = 0; i < length; i++) {\r
-                       char c = message.charAt(i);\r
-                       switch (c) {\r
-                               case '{' :\r
-                                       int index = message.indexOf('}', i);\r
-                                       // if we don't have a matching closing brace then...\r
-                                       if (index == -1) {\r
-                                               buffer.append(c);\r
-                                               break;\r
-                                       }\r
-                                       i++;\r
-                                       if (i >= length) {\r
-                                               buffer.append(c);\r
-                                               break;\r
-                                       }\r
-                                       // look for a substitution\r
-                                       int number = -1;\r
-                                       try {\r
-                                               number = Integer.parseInt(message.substring(i, index));\r
-                                       } catch (NumberFormatException e) {\r
-                                               throw (IllegalArgumentException) new IllegalArgumentException().initCause(e);\r
-                                       }\r
-                                       if (number == 0 && argZero != null)\r
-                                               buffer.append(argZero);\r
-                                       else if (number == 1 && argOne != null)\r
-                                               buffer.append(argOne);\r
-                                       else {\r
-                                               if (number >= args.length || number < 0) {\r
-                                                       buffer.append("<missing argument>"); //$NON-NLS-1$\r
-                                                       i = index;\r
-                                                       break;\r
-                                               }\r
-                                               buffer.append(args[number]);\r
-                                       }\r
-                                       i = index;\r
-                                       break;\r
-                               case '\'' :\r
-                                       // if a single quote is the last char on the line then skip it\r
-                                       int nextIndex = i + 1;\r
-                                       if (nextIndex >= length) {\r
-                                               buffer.append(c);\r
-                                               break;\r
-                                       }\r
-                                       char next = message.charAt(nextIndex);\r
-                                       // if the next char is another single quote then write out one\r
-                                       if (next == '\'') {\r
-                                               i++;\r
-                                               buffer.append(c);\r
-                                               break;\r
-                                       }\r
-                                       // otherwise we want to read until we get to the next single quote\r
-                                       index = message.indexOf('\'', nextIndex);\r
-                                       // if there are no more in the string, then skip it\r
-                                       if (index == -1) {\r
-                                               buffer.append(c);\r
-                                               break;\r
-                                       }\r
-                                       // otherwise write out the chars inside the quotes\r
-                                       buffer.append(message.substring(nextIndex, index));\r
-                                       i = index;\r
-                                       break;\r
-                               default :\r
-                                       buffer.append(c);\r
-                       }\r
-               }\r
-               return buffer.toString();\r
-       }\r
 }\r
old mode 100644 (file)
new mode 100755 (executable)
index 6e68172..13cb202
@@ -25,6 +25,8 @@
  */
 package org.tizen.common.connection.log;
 
+import static org.tizen.common.util.StringUtil.isEmpty;
+
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -101,7 +103,9 @@ public class AddViewDialog extends Dialog
             dialogName = "Edit LogTab";
             tabName = tab.getLogTabName();
             if (tab.getDeviceSerialNumber() == null)
+            {
                 return;
+            }
             device = tab.getDeviceSerialNumber();
 
             pidKeyword = tab.getPidFilter();
@@ -272,26 +276,42 @@ public class AddViewDialog extends Dialog
                 }
 
                 bOk = true;
-
-                if (tabNameText.getText().length() != 0)
-                    tabName = tabNameText.getText();
-                else
+                
+                if ( isEmpty( tabNameText.getText() ) )
+                {
                     tabName = TEMPNAME + cnt++;
-
-                if (tagText.getText().length() != 0)
-                    tagKeyword = tagText.getText();
+                }
                 else
-                    tagKeyword = null;
+                {
+                    tabName = tabNameText.getText();
+                }
 
-                if (pidText.getText().length() != 0)
-                    pidKeyword = pidText.getText();
+                if ( isEmpty( tagText.getText() ) )
+                {
+                    tagKeyword = null;
+                }
                 else
-                    pidKeyword = null;
+                {
+                    tagKeyword = tagText.getText();
+                }
 
-                if (msgText.getText().length() != 0)
-                    msgKeyword = msgText.getText();
+                if ( isEmpty( pidText.getText() ) )
+                {
+                    pidKeyword = null;
+                }
                 else
+                {
+                    pidKeyword = pidText.getText();
+                }
+
+                if ( isEmpty( msgText.getText() ) )
+                {
                     msgKeyword = null;
+                }
+                else
+                {
+                    msgKeyword = msgText.getText();
+                }
 
                 device = dCombo.getItem(dCombo.getSelectionIndex());
 
old mode 100644 (file)
new mode 100755 (executable)
index d8dafc0..2f9427d
@@ -206,11 +206,15 @@ public class LogPanel extends Panel implements IDeviceChangeListener
     {
         int index = tabFolder.getSelectionIndex();
         if(index == -1)
+        {
             return ;
+        }
         TabItem item = tabFolder.getItem(index);
         LogTab logTab = getSelectionLogTab();
         if(logTab == null)
+        {
             return ;
+        }
 
         setEnableAndCheckState(logTab);
         stackLayout.topControl = item.getControl();
@@ -255,9 +259,13 @@ public class LogPanel extends Panel implements IDeviceChangeListener
         level = (int) Math.pow(2, level);
 
         if (setCheck)
+        {
             levelMode |= level;
+        }
         else
+        {
             levelMode &= (~level);
+        }
 
         getSelectionLogTab().setLevelMode(levelMode);
         getSelectionLogTab().filterMessages();
old mode 100644 (file)
new mode 100755 (executable)
index 44410b8..2bab62d
@@ -364,6 +364,8 @@ public class ImageSelector extends Canvas {
                                case SWT.PAGE_DOWN:\r
                                        scrollBy(ImageSelector.this.pageIncrement);\r
                                        break;\r
+                default:\r
+                    break;\r
                                }\r
                        }\r
 \r
old mode 100644 (file)
new mode 100755 (executable)
index c0a0cb9..42bf7b1
@@ -226,6 +226,8 @@ public class Launcher extends Composite {
                        this.selection = this.items.size() - 1;\r
                        changeColor(this.selection, true);\r
                        break;\r
+               default:\r
+                        break;   \r
                }\r
 \r
        }\r
index 43271e5..3a5cb0e 100755 (executable)
@@ -1116,6 +1116,8 @@ public class MultiChoice<T> extends Composite {
                        }\r
                        this.checkboxes = null;\r
                        break;\r
+        default:\r
+            break;\r
                }\r
 \r
        }\r
index d6a451a..620042e 100755 (executable)
@@ -645,6 +645,8 @@ public class RangeSlider extends Canvas {
                        }\r
                        needRedraw = true;\r
                        break;\r
+        default:\r
+            break;\r
                }\r
 \r
                if (needRedraw) {\r
old mode 100644 (file)
new mode 100755 (executable)
index 64ce94f..08bcebc
@@ -160,6 +160,9 @@ public class TextAssist extends Composite {
                                case SWT.ESC:\r
                                        TextAssist.this.popup.setVisible(false);\r
                                        break;\r
+                                       \r
+                               default:\r
+                                   break;\r
                                }\r
                        }\r
                };\r
old mode 100644 (file)
new mode 100755 (executable)
index 8e909f4..ef73b8b
@@ -40,8 +40,9 @@ public class TransitionFactory {
                        return new UpDownTransition();\r
                case UP_TO_DOWN_AND_APPEAR:\r
                        return new UpDownAppearTransition();\r
+        default:\r
+            return null;\r
                }\r
-               return null;\r
        }\r
 \r
 }\r
old mode 100644 (file)
new mode 100755 (executable)
index 9baf0e6..0213b27
 */
 package org.tizen.common.core.application;
 
+import static org.tizen.common.util.SWTUtil.syncExec;
+
 import java.io.File;
 
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IStartup;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.PlatformUI;
@@ -70,15 +71,14 @@ public class UpdateManager implements IStartup {
                }
                
                executeInstallManger();
-               if (workbench != null) {
-                       final Display display = workbench.getDisplay();
-                       display.syncExec( new Runnable() {
-                               public void run() {
-                                       if (!display.isDisposed())
-                                               workbench.close();
-                               }
-                       });
-               }
+               syncExec( new Runnable() {
+                   public void run() {
+                       if (!workbench.getDisplay().isDisposed())
+                       {
+                           workbench.close();
+                       }
+                   }
+               });
        }
        
        private boolean isExistUpdatablePackage()
old mode 100644 (file)
new mode 100755 (executable)
index 20935ec..b9c4a0a
@@ -595,7 +595,10 @@ Assert
                
                for ( int i=0, n=ArrayUtil.size( array ) ; i<n ; ++i )
                {
-                       if ( null != array[i] ) continue;
+                       if ( null != array[i] )
+                       {
+                           continue;
+                       }
                        
                        fail( msg ); 
                }
old mode 100644 (file)
new mode 100755 (executable)
index ee3d8e0..47d33ea
@@ -283,6 +283,8 @@ public class EFSUtil {
         case NoToAll :
         case No :
             break;
+        default:
+            break;
         }
         monitor.worked(1);
         
old mode 100644 (file)
new mode 100755 (executable)
index 1cf2781..012a60c
@@ -30,11 +30,9 @@ import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.FileWriter;
-import java.io.IOException;
 import java.io.InputStreamReader;
 import java.nio.channels.FileChannel;
 
@@ -42,12 +40,9 @@ import org.tizen.common.ui.view.console.ConsoleManager;
 
 public abstract class HostUtil{
     
-//    public static final String USER = System.getenv("USER");
-//    public static final String USER_HOME = System.getenv("HOME");
     public static final String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
     public static final String FILE_SEPARATOR = System.getProperty("file.separator"); //$NON-NLS-1$
     
-//    private static final String PROC_PATH = "/proc"; //$NON-NLS-1$
     private static final String SHELL_COMMAND_LINUX= "/bin/sh"; //$NON-NLS-1$
     private static final String SHELL_COMMAND_WINDOW= "cmd"; //$NON-NLS-1$
     
@@ -78,10 +73,7 @@ public abstract class HostUtil{
 
         File file = new File( path );
 
-        if( file != null && file.exists() )
-            return true;
-        else
-            return false;
+        return file.exists();
     }
 
     public static boolean execute(String command){
@@ -131,7 +123,6 @@ public abstract class HostUtil{
           }catch(Exception e){
               e.printStackTrace();
               return false;
-          }finally{
           } 
         return i == 0;
     }
@@ -198,9 +189,11 @@ public abstract class HostUtil{
             e.printStackTrace();
             return null;
         } finally{
+            tryClose( input );
             if(proc!=null)    
+            {
                 proc.destroy();
-            tryClose( input );
+            }
         }
         
         return contents.toString().trim();
@@ -238,9 +231,11 @@ public abstract class HostUtil{
             if (proc.exitValue() != 0)
                 throw new Exception("Failed to execute command: " + command);
         } finally {
+            tryClose( input );
             if(proc!=null)
+            {
                 proc.destroy();
-            tryClose( input );
+            }
         }
     }
     
@@ -327,12 +322,6 @@ public abstract class HostUtil{
             long size= fcin.size();
             fcin.transferTo(0, size, fcout);
             desFile.setExecutable(canExecute);
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-            throw e;
-        } catch (IOException e) {
-            e.printStackTrace();
-            throw e;
         }finally{
             tryClose( fcout, fcin, fos, fis );
         }
old mode 100644 (file)
new mode 100755 (executable)
index dd4ea17..da25324
@@ -62,7 +62,9 @@ public class StreamGobbler extends Thread
                                        buffer.append("\n");
                                        
                                        if ( os != null )
+                                       {
                                                os.write( (line + "\n").getBytes());
+                                       }
                                }
                        }
                } catch (IOException ioe) {
old mode 100644 (file)
new mode 100755 (executable)
index 6c7ef6d..8b97822
@@ -740,7 +740,10 @@ public class StringUtil
             final int ST_ESCAPE = 1;
             int status = ST_NORMAL;
             int index = 0;
-            if ( 0 == targetIndex ) writer = new StringWriter();
+            if ( 0 == targetIndex )
+            {
+                writer = new StringWriter();
+            }
             while ( 0 <= ( ch = reader.read() ) ) {
                 if ( ST_ESCAPE == status ) {
                     status = ST_NORMAL;
@@ -749,15 +752,27 @@ public class StringUtil
                         status = ST_ESCAPE;
                         continue;
                     } else if ( delimeter == ch ) {
-                        if ( index == targetIndex ) return writer.toString();
+                        if ( index == targetIndex )
+                        {
+                            return writer.toString();
+                        }
                         ++index;
-                        if ( index == targetIndex ) writer = new StringWriter();
+                        if ( index == targetIndex )
+                        {
+                            writer = new StringWriter();
+                        }
                         continue;
                     }
                 }
-                if ( null != writer ) writer.write( (int) ch );
+                if ( null != writer )
+                {
+                    writer.write( (int) ch );
+                }
+            }
+            if ( index == targetIndex )
+            {
+                return writer.toString();
             }
-            if ( index == targetIndex ) return writer.toString();
             return null;
         }
         catch ( final IOException e )
old mode 100644 (file)
new mode 100755 (executable)
index 34e6a78..5a83a77
@@ -25,6 +25,8 @@
 */\r
 package org.tizen.common.util.cache;\r
 \r
+import static org.tizen.common.util.SWTUtil.tryDispose;\r
+\r
 import java.util.ArrayList;\r
 import java.util.List;\r
 \r
@@ -101,7 +103,10 @@ public class FontCache {
      */\r
     public static Font getFont(Font font) {\r
         try {\r
-            if (font == null || font.isDisposed()) return null;\r
+            if (font == null || font.isDisposed())\r
+            {\r
+                return null;\r
+            }\r
 \r
             FontData fd = font.getFontData()[0];\r
             return getFont(fd);\r