diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-13 10:08:31 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-13 10:24:10 +0200 |
commit | 34bcf9b498bccb5c924f4cec850ff15d88df6f07 (patch) | |
tree | 4d9604ec8c3b73639338ec45a0618b5daa5cf0ed /scripting | |
parent | 347926e8e57c1825261daa46c1886aa2ebf9571b (diff) |
java: remove dead methods
found by UCDetector
Change-Id: I219caa8e680dba5a395541a778df6144841c4dde
Diffstat (limited to 'scripting')
19 files changed, 24 insertions, 437 deletions
diff --git a/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java b/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java index 68cf617a5179..4b80e9a685f1 100644 --- a/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java +++ b/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java @@ -67,61 +67,7 @@ public class DialogFactory return factory; } - public boolean showConfirmDialog(String title, String prompt) - { - final XDialog xDialog; - try - { - xDialog = createConfirmDialog(title, prompt); - } - catch (com.sun.star.uno.Exception e) - { - return false; - } - - // add an action listener to the button controls - XControlContainer controls = UnoRuntime.queryInterface(XControlContainer.class, xDialog); - - XButton okButton = UnoRuntime.queryInterface( - XButton.class, controls.getControl("Ok")); - okButton.setActionCommand("Ok"); - - XButton cancelButton = UnoRuntime.queryInterface( - XButton.class, controls.getControl("Cancel")); - cancelButton.setActionCommand("Cancel"); - - final ResultHolder resultHolder = new ResultHolder(); - com.sun.star.awt.XActionListener listener = - new com.sun.star.awt.XActionListener() - { - public void actionPerformed(com.sun.star.awt.ActionEvent e) { - if (e.ActionCommand.equals("Cancel")) - { - resultHolder.setResult(Boolean.FALSE); - xDialog.endExecute(); - } - else - { - resultHolder.setResult(Boolean.TRUE); - xDialog.endExecute(); - } - } - - public void disposing(EventObject o) { - // does nothing - } - }; - - okButton.addActionListener(listener); - cancelButton.addActionListener(listener); - - xDialog.execute(); - - Boolean result = (Boolean)resultHolder.getResult(); - - return result == null ? false : result.booleanValue(); - } public String showInputDialog(String title, String prompt) { diff --git a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java index cf860de625b4..dc40198de3d7 100644 --- a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java +++ b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java @@ -61,20 +61,7 @@ public class ParcelContainer implements XNameAccess * @return <tt>true</tt> if has parent <tt>false</tt> otherwise */ public boolean isUnoPkg() { return isPkgContainer; } - /** - * Tests if this <tt>ParcelContainer</tt> has a parent - * a parent. - * - * @return <tt>true</tt> if has parent <tt>false</tt> otherwise - */ - public boolean hasParent() - { - if ( parent == null ) - { - return false; - } - return true; - } + /** * Returns this <tt>ParcelContainer</tt>'s parent diff --git a/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java b/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java index dd7017b32df1..4b8e751fac81 100644 --- a/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java +++ b/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java @@ -57,21 +57,9 @@ public class ParcelDescriptor { private String language = null; private Map<String,String> languagedepprops = new HashMap<String,String>(3); - public static synchronized void removeParcelDescriptor(File parent) { - File path = new File(parent, PARCEL_DESCRIPTOR_NAME); - PARCEL_DESCRIPTOR_MAP.remove(path); - } - public static synchronized void renameParcelDescriptor(File oldFile, File newFile) { - File oldPath = new File(oldFile, PARCEL_DESCRIPTOR_NAME); - ParcelDescriptor pd = PARCEL_DESCRIPTOR_MAP.get(oldPath); - if(pd != null) { - PARCEL_DESCRIPTOR_MAP.remove(oldPath); - File newPath = new File(newFile, PARCEL_DESCRIPTOR_NAME); - pd.file = newPath; - PARCEL_DESCRIPTOR_MAP.put(newPath, pd); - } - } + + // returns the ParcelDescriptor in the corresponding directory // returns null if no ParcelDescriptor is found in the directory @@ -93,24 +81,7 @@ public class ParcelDescriptor { return pd; } - // returns a ParcelDescriptor for the corresponding directory - // if no ParcelDescriptor exists, one is created - public static synchronized ParcelDescriptor - createParcelDescriptor(File parent) throws IOException { - - ParcelDescriptor pd = getParcelDescriptor(parent); - - if (pd == null) { - if (parent == null || !parent.exists() || !parent.isDirectory()) { - throw new IOException("Cannot create Parcel Descriptor"); - } - File path = new File(parent, PARCEL_DESCRIPTOR_NAME); - pd = new ParcelDescriptor(path); - PARCEL_DESCRIPTOR_MAP.put(path, pd); - } - return pd; - } public ParcelDescriptor() throws IOException { ByteArrayInputStream bis = null; @@ -172,12 +143,7 @@ public class ParcelDescriptor { fos.close(); } - public void write() throws IOException { - if (file == null) - throw new FileNotFoundException("No file specified"); - write(file); - } public void write(OutputStream out) throws IOException { XMLParserFactory.getParser().write(document, out); @@ -301,10 +267,7 @@ public class ParcelDescriptor { return languagedepprops.get(name); } - public void setLanguageProperty(String name, String value) { - languagedepprops.put(name, value); - setScriptEntries(getScriptEntries()); - } + private void initLanguageProperties() { NodeList nl = document.getElementsByTagName("languagedepprops"); diff --git a/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java b/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java index 69d94eb252c3..3a5989febcc3 100644 --- a/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java +++ b/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java @@ -46,9 +46,7 @@ public class XMLParserFactory { return parser; } - public static void setParser(XMLParser p) { - parser = p; - } + public static void setOfficeDTDURL(String url) { officedtdurl = url; diff --git a/scripting/java/com/sun/star/script/framework/provider/java/ScriptDescriptor.java b/scripting/java/com/sun/star/script/framework/provider/java/ScriptDescriptor.java index 98f29c08c2b7..c41b6058056a 100644 --- a/scripting/java/com/sun/star/script/framework/provider/java/ScriptDescriptor.java +++ b/scripting/java/com/sun/star/script/framework/provider/java/ScriptDescriptor.java @@ -135,19 +135,7 @@ public class ScriptDescriptor } - /** - * Adds the given array of <code>Class</code> to the list of argument types - * stored in this ScriptDescriptor - * - * @param classes The feature to be added to the ArgumentTypes attribute - */ - public synchronized void addArgumentTypes( Class<?>[] classes ) - { - for ( int i = 0; i < classes.length; i++ ) - { - addArgumentType( classes[ i ] ); - } - } + /** diff --git a/scripting/java/org/openoffice/idesupport/JavaFinder.java b/scripting/java/org/openoffice/idesupport/JavaFinder.java index 7ef66c62dc9e..1594b9fd37c5 100644 --- a/scripting/java/org/openoffice/idesupport/JavaFinder.java +++ b/scripting/java/org/openoffice/idesupport/JavaFinder.java @@ -49,15 +49,7 @@ public class JavaFinder implements MethodFinder { this.classpath = classpath; } - public static JavaFinder getInstance() { - if (finder == null) { - synchronized(JavaFinder.class) { - if (finder == null) - finder = new JavaFinder(); - } - } - return finder; - } + public static JavaFinder getInstance(List<String> classpath) { return new JavaFinder(classpath); diff --git a/scripting/java/org/openoffice/idesupport/LocalOffice.java b/scripting/java/org/openoffice/idesupport/LocalOffice.java index f28e36ad3c9e..07b502c546ab 100644 --- a/scripting/java/org/openoffice/idesupport/LocalOffice.java +++ b/scripting/java/org/openoffice/idesupport/LocalOffice.java @@ -32,41 +32,7 @@ import java.util.ArrayList; */ public class LocalOffice { - /** - * Creates an instance of the local office connection. - * - * @param parent is an application specific class loader. - * @param officePath is a platform specific path string - * to the office distribution. - * @param port is a communication port. - */ - public static final LocalOffice create( - ClassLoader parent, String officePath, int port) - { - ArrayList<String> path = new ArrayList<String>(); - path.add(officePath + "/program/classes/ridl.jar"); - path.add(officePath + "/program/classes/jurt.jar"); - path.add(officePath + "/program/classes/unoil.jar"); - path.add(officePath + "/program/classes/juh.jar"); - path.add(System.getProperties().getProperty("netbeans.home") + - File.separator + "modules" + - File.separator + "ext" + - File.separator + "localoffice.jar"); - // commented out so code will compile - // ClassLoader appcl = new DefaultScriptClassLoader(parent, path); - ClassLoader appcl = path.getClass().getClassLoader(); - Class clazz = null; - LocalOffice office = null; - try { - clazz = appcl.loadClass( - "org.openoffice.idesupport.localoffice.LocalOfficeImpl"); - office = (LocalOffice)clazz.newInstance(); - office.connect(officePath, port); - } catch (java.lang.Exception exp) { - office = null; - } - return office; - } + /** * Connects to the running office. diff --git a/scripting/java/org/openoffice/idesupport/OfficeInstallation.java b/scripting/java/org/openoffice/idesupport/OfficeInstallation.java index d8b337fb3ea1..586d3a2d47ef 100644 --- a/scripting/java/org/openoffice/idesupport/OfficeInstallation.java +++ b/scripting/java/org/openoffice/idesupport/OfficeInstallation.java @@ -65,30 +65,15 @@ public class OfficeInstallation implements java.io.Serializable { return path; } - public String getPath(String name) { - if (!name.startsWith(File.separator)) - name = File.separator + name; - return path + name; - } public String getURL() { return url; } - public String getURL(String name) { - if (System.getProperty("os.name").startsWith("Windows")) - name = name.replace(File.separatorChar, '/'); - if (!name.startsWith("/")) - name = "/" + name; - return url + name; - } - public boolean hasFramework() { - return hasFW; - } public boolean supportsFramework() { return true; diff --git a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java index bd5eb48c3f20..30cf598a706a 100644 --- a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java +++ b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java @@ -51,35 +51,11 @@ public class ParcelZipper return zipper; } - public String zipParcel(File basedir) throws IOException { - File targetfile, targetdir; - if (basedir.getName().equals(CONTENTS_DIRNAME)) - targetdir = basedir.getParentFile(); - else - targetdir = basedir; - targetfile = new File(targetdir, targetdir.getName() + "." + PARCEL_EXTENSION); - return zipParcel(basedir, targetfile, DEFAULT_FILTER); - } - public String zipParcel(File basedir, File targetfile) throws IOException { - return zipParcel(basedir, targetfile, DEFAULT_FILTER); - } - public String zipParcel(File basedir, FileFilter filter) throws IOException { - File targetfile, targetdir; - - if (basedir.getName().equals(CONTENTS_DIRNAME)) - targetdir = basedir.getParentFile(); - else - targetdir = basedir; - - targetfile = new File(targetdir, targetdir.getName() + "." + PARCEL_EXTENSION); - - return zipParcel(basedir, targetfile, filter); - } private String zipParcel(File basedir, File targetfile, FileFilter filter) throws IOException { @@ -155,18 +131,7 @@ public class ParcelZipper } } - public boolean isOverwriteNeeded(File parcel, File target) - throws IOException - { - boolean result; - - if (target.isDirectory()) - result = isDirectoryOverwriteNeeded(parcel, target); - else - result = isDocumentOverwriteNeeded(parcel, target); - return result; - } private boolean isDirectoryOverwriteNeeded(File parcel, File target) { String parcelDir = getParcelDirFromParcelZip(parcel.getName()); @@ -218,16 +183,7 @@ public class ParcelZipper return result; } - public String deployParcel(File parcel, File target) - throws IOException { - String output = null; - if (target.isDirectory()) - output = unzipToDirectory(parcel, target); - else - output = unzipToZip(parcel, target); - return output; - } private String getParcelDirFromParcelZip(String zipname) { String result = zipname.substring(0, zipname.lastIndexOf(".")); diff --git a/scripting/workben/ifc/scripting/ScriptingUtils.java b/scripting/workben/ifc/scripting/ScriptingUtils.java index 84cce3fc48c4..ce6071c78dd2 100644 --- a/scripting/workben/ifc/scripting/ScriptingUtils.java +++ b/scripting/workben/ifc/scripting/ScriptingUtils.java @@ -44,11 +44,9 @@ public class ScriptingUtils { return utils; } - public static void cleanUserDir() { - } - public static void cleanShareDir() { - } + + public Object getScriptStorage(XMultiServiceFactory xMSF, String location) { int id = getStorageId(xMSF, location); diff --git a/scripting/workben/ifc/scripting/SecurityDialogUtil.java b/scripting/workben/ifc/scripting/SecurityDialogUtil.java index 955e37b21036..fbcee55b5431 100644 --- a/scripting/workben/ifc/scripting/SecurityDialogUtil.java +++ b/scripting/workben/ifc/scripting/SecurityDialogUtil.java @@ -59,14 +59,7 @@ public String getErrorMessage() return errorMsg; } -/** - * Is there an error message available? - * @return true, if an error happened - */ -public boolean hasErrorMessage() -{ - return !errorMsg.equals(""); -} + /** * Press the named button in the currently visible dialog box. diff --git a/scripting/workben/installer/FileUpdater.java b/scripting/workben/installer/FileUpdater.java index 558c0c4c21d2..5c628dbd89c4 100644 --- a/scripting/workben/installer/FileUpdater.java +++ b/scripting/workben/installer/FileUpdater.java @@ -23,71 +23,7 @@ import javax.swing.JLabel; public class FileUpdater { - public static boolean updateProtocolHandler( String installPath, JLabel statusLabel ) { - File in_file = null; - File out_file = null; - FileWriter out = null; - int count = 0; - - try { - in_file = new File( installPath+File.separator+"share"+File.separator+"registry"+File.separator+"data"+File.separator+"org"+File.separator+"openoffice"+File.separator+"Office"+File.separator+"ProtocolHandler.xcu" ); - - String[] xmlArray = new String[50]; - try { - BufferedReader reader = new BufferedReader(new FileReader(in_file)); - count = -1; - for (String s = reader.readLine(); s != null; s = reader.readLine()) { //</oor:node> - count = count + 1; - xmlArray[count] = s; - } - reader.close(); - } - catch( IOException ioe ) { - String message = "\nError reading ProtocolHandler.xcu, please view SFrameworkInstall.log."; - System.out.println(message); - ioe.printStackTrace(); - statusLabel.setText(message); - return false; - } - - in_file.delete(); - - out_file = new File( installPath+File.separator+"share"+File.separator+"registry"+File.separator+"data"+File.separator+"org"+File.separator+"openoffice"+File.separator+"Office"+File.separator+"ProtocolHandler.xcu" ); - out_file.createNewFile(); - out = new FileWriter( out_file ); - - for(int i=0; i<count + 1; i++) { - out.write(xmlArray[i]+"\n"); - if( ( xmlArray[i].indexOf( "<node oor:name=\"HandlerSet\">" ) != -1 ) && ( xmlArray[i+1].indexOf( "ScriptProtocolHandler" ) == -1 ) ) { - out.write( " <node oor:name=\"com.sun.star.comp.ScriptProtocolHandler\" oor:op=\"replace\">\n" ); - out.write( " <prop oor:name=\"Protocols\">\n" ); - out.write( " <value>script:*</value>\n" ); - out.write( " </prop>\n" ); - out.write( " </node>\n" ); - } - } - } - catch( Exception e ) { - String message = "\nError updating ProtocolHandler.xcu, please view SFrameworkInstall.log."; - System.out.println(message); - e.printStackTrace(); - statusLabel.setText(message); - return false; - } - finally { - try { - out.close(); - System.out.println("File closed"); - } - catch(Exception e) { - System.out.println("Update ProtocolHandler Failed, please view SFrameworkInstall.log."); - System.err.println(e); - e.printStackTrace(); - } - } - return true; - }// updateProtocolHandler public static boolean updateScriptXLC( String installPath, JLabel statusLabel ) { diff --git a/scripting/workben/installer/IdeUpdater.java b/scripting/workben/installer/IdeUpdater.java index 3efe04e1f282..fe7b700d237d 100644 --- a/scripting/workben/installer/IdeUpdater.java +++ b/scripting/workben/installer/IdeUpdater.java @@ -64,52 +64,6 @@ public class IdeUpdater extends Thread { }// XmlUpdater - public boolean checkStop() - { - if (internalThread == Thread.currentThread()) - return false; - return true; - }// checkStop - - - public void checkSuspend() - { - if (threadSuspended) - { - synchronized(this) - { - while (threadSuspended) - { - try { - wait(); - } catch (InterruptedException eInt) { - - } - } - } - } - }// checkSuspend - - - public void setSuspend() - { - threadSuspended = true; - }// setSuspend - - - public void setResume() - { - threadSuspended = false; - notify(); - }// setResume - - - public void setStop() - { - internalThread = null; - }// setStop - - @Override public void run() { diff --git a/scripting/workben/installer/IdeVersion.java b/scripting/workben/installer/IdeVersion.java index 32e77552165e..6c1df1ce866c 100644 --- a/scripting/workben/installer/IdeVersion.java +++ b/scripting/workben/installer/IdeVersion.java @@ -316,9 +316,7 @@ class MyTableModelIDE extends AbstractTableModel { fireTableCellUpdated(row, col); } - String [] getSelected() { - return null; - } + public boolean isAnySelected() { Iterator iter = data.iterator(); diff --git a/scripting/workben/installer/InstUtil.java b/scripting/workben/installer/InstUtil.java index ed9fd928e17b..af29db64c3ce 100644 --- a/scripting/workben/installer/InstUtil.java +++ b/scripting/workben/installer/InstUtil.java @@ -91,15 +91,7 @@ public class InstUtil { } - public static boolean hasJeditInstallation() { - boolean result = false; - result = checkForSupportedVersion( getJeditLocation(), versions ); - if ( !result ) - { - System.out.println("No supported version for JEdit found."); - } - return result; - } + diff --git a/scripting/workben/installer/InstallWizard.java b/scripting/workben/installer/InstallWizard.java index c9d73ba7c126..26459d4664b7 100644 --- a/scripting/workben/installer/InstallWizard.java +++ b/scripting/workben/installer/InstallWizard.java @@ -290,25 +290,13 @@ public class InstallWizard extends javax.swing.JFrame implements ActionListener System.err.println("-bindings will only install the menu & key bindings in user/config/soffice.cfg."); } - public static synchronized boolean isPatchedTypes() - { - return bPatchedTypes; - } - public static synchronized boolean isPatchedJava() - { - return bPatchedJava; - } - public static synchronized boolean isPatchedRDB() - { - return bPatchedRDB; - } - public static synchronized boolean isInstallStarted() - { - return bInstallStarted; - } + + + + public static synchronized void setPatchedTypes(boolean value) { @@ -330,25 +318,13 @@ public class InstallWizard extends javax.swing.JFrame implements ActionListener bInstallStarted = value; } - public static synchronized void setTypesPath(String path) - { - typesPath = path; - } - public static synchronized void setJavaPath(String path) - { - javaPath = path; - } - public static synchronized String getTypesPath() - { - return typesPath; - } - public static synchronized String getJavaPath() - { - return javaPath; - } + + + + private javax.swing.JPanel navigation; private javax.swing.JButton navBack; diff --git a/scripting/workben/installer/NavPanel.java b/scripting/workben/installer/NavPanel.java index af2b21f45046..d8718e1257d1 100644 --- a/scripting/workben/installer/NavPanel.java +++ b/scripting/workben/installer/NavPanel.java @@ -103,15 +103,9 @@ public class NavPanel extends JPanel implements ActionListener { navCancel.addActionListener(listener); } - public void removeNextListener(ActionListener listener) - { - navNext.removeActionListener(listener); - } - public void removeBackListener(ActionListener listener) - { - navBack.removeActionListener(listener); - } + + public void removeCancelListener(ActionListener listener) { diff --git a/scripting/workben/installer/Version.java b/scripting/workben/installer/Version.java index 40ec3c8dbef1..38da3f21befb 100644 --- a/scripting/workben/installer/Version.java +++ b/scripting/workben/installer/Version.java @@ -328,9 +328,7 @@ class MyTableModel extends AbstractTableModel { fireTableCellUpdated(row, col); } - String [] getSelected() { - return null; - } + public boolean isAnySelected() { Iterator iter = data.iterator(); diff --git a/scripting/workben/installer/XmlUpdater.java b/scripting/workben/installer/XmlUpdater.java index 8c5763a3b05f..3424cd57d110 100644 --- a/scripting/workben/installer/XmlUpdater.java +++ b/scripting/workben/installer/XmlUpdater.java @@ -106,35 +106,8 @@ public class XmlUpdater extends Thread { }// XmlUpdater - public boolean checkStop() - { - if (internalThread == Thread.currentThread()) - return false; - return true; - }// checkStop - - - public void checkSuspend() - { - if (threadSuspended) { - synchronized(this) { - while (threadSuspended) { - try { - wait(); - } catch (InterruptedException eInt) { - - } - } - } - } - }// checkSuspend - public void setSuspend() - { - threadSuspended = true; - }// setSuspend - public void setResume() { @@ -143,12 +116,6 @@ public class XmlUpdater extends Thread { }// setResume - public void setStop() - { - internalThread = null; - }// setStop - - @Override public void run() { |