Kaydet (Commit) 43cc8ad3 authored tarafından Noel Grandin's avatar Noel Grandin

java: remove dead code

found by UCDetector

Change-Id: I6b0f49529379072da566e927b86815f173e7a90b
üst cfcbe2e4
......@@ -61,10 +61,6 @@ class ScreenComparer
m_imgDiff = null;
}
public Rectangle getLocation()
{
return m_rect;
}
public void grabOne() throws Exception
{
grabOne(m_rect);
......
......@@ -41,7 +41,6 @@ $(eval $(call gb_JunitTest_add_sourcefiles,connectivity_complex,\
connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions \
connectivity/qa/complex/connectivity/dbase/DBaseSqlTests \
connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions \
connectivity/qa/complex/connectivity/hsqldb/DatabaseMetaData \
connectivity/qa/complex/connectivity/hsqldb/TestCacheSize \
connectivity/qa/connectivity/tools/AbstractDatabase \
connectivity/qa/connectivity/tools/CRMDatabase \
......
......@@ -18,6 +18,7 @@
package com.sun.star.sdbcx.comp.hsqldb;
@SuppressWarnings("ucd")
public class StorageAccess implements org.hsqldb.lib.Storage {
String key;
String name;
......
......@@ -20,6 +20,7 @@ package com.sun.star.sdbcx.comp.hsqldb;
import org.hsqldb.lib.FileAccess;
import org.hsqldb.lib.FileSystemRuntimeException;
@SuppressWarnings("ucd")
public class StorageFileAccess implements org.hsqldb.lib.FileAccess{
static { NativeLibraries.load(); }
......
......@@ -34,29 +34,8 @@ public class FileSystemRuntimeException extends java.lang.RuntimeException {
public static final int fileAccessRemoveElementFailed = 1;
public static final int fileAccessRenameElementFailed = 2;
private final int errorCode;
public FileSystemRuntimeException(int _errorCode) {
super();
errorCode = _errorCode;
}
public FileSystemRuntimeException(String _message, int _errorCode) {
super(_message);
errorCode = _errorCode;
}
public FileSystemRuntimeException(String _message, java.lang.Throwable _cause, int _errorCode) {
super(_message, _cause);
errorCode = _errorCode;
}
public FileSystemRuntimeException(java.lang.Throwable _cause, int _errorCode) {
super(_cause);
errorCode = _errorCode;
}
public final int getErrorCode() {
return errorCode;
}
}
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package complex.connectivity.hsqldb;
import complex.connectivity.HsqlDriverTest;
import java.sql.*;
import java.lang.reflect.Method;
public class DatabaseMetaData {
private final java.sql.DatabaseMetaData m_xMD;
private final HsqlDriverTest m_TestCase;
/** Creates a new instance of DatabaseMetaData */
public DatabaseMetaData(HsqlDriverTest _testCase,java.sql.DatabaseMetaData _xmd) {
m_TestCase = _testCase;
m_xMD = _xmd;
}
protected void assure(String _sText,boolean btest){
m_TestCase.assurePublic(_sText,btest);
}
protected void testMethod(String sName,Class<?>[] params,Object[] objParams,int nCount){
try {
System.out.println("test method " + sName);
Method aGet = ((Object)m_xMD).getClass().getDeclaredMethod(sName, params);
if ( aGet != null ){
ResultSet rs = (ResultSet)aGet.invoke(m_xMD, objParams);
ResultSetMetaData rsMD = rs.getMetaData();
assure( sName + " returns wrong column count" , rsMD.getColumnCount() == nCount);
rs.close();
}
else
assure( sName + " returns wrong column count" , false);
} catch( java.lang.NoSuchMethodException ex ) {
assure("Method " + sName + " could not be found!",false);
} catch( java.lang.IllegalAccessException ex ) {
assure("IllegalAccessException!",false);
} catch( SQLException ex ) {
assure("SQLException occurred: " + ex.getMessage() ,false);
} catch( java.lang.reflect.InvocationTargetException ex ) {
assure("IllegalAccessException!",false);
}
}
public void test() {
try {
ResultSet rs = m_xMD.getTables(null, null, "TESTCASE", null);
while (rs.next()) {
String catalog = rs.getString(1);
if (rs.wasNull())
catalog = null;
String schema = rs.getString(2);
if (rs.wasNull())
schema = null;
String table = rs.getString(3);
String type = rs.getString(4);
System.out.println("Catalog: " + catalog + " Schema: " + schema
+ " Table: " + table + " Type: " + type);
System.out
.println("------------------ Columns ------------------");
ResultSet rsColumns = m_xMD.getColumns(catalog, schema, table,
"%");
while (rsColumns.next()) {
System.out.println("Column: " + rsColumns.getString(4)
+ " Type: " + rsColumns.getInt(5) + " TypeName: "
+ rsColumns.getString(6));
}
}
rs.close();
} catch (Exception e) {
}
}
}
......@@ -82,7 +82,6 @@ public class TestCacheSize {
// type of the big table {MEMORY | CACHED | TEXT}
private String tableType = "CACHED";
private int cacheScale = 17;
int cacheSizeScale = 8;
// script format {TEXT, BINARY, COMPRESSED}
private String logType = "TEXT";
......@@ -109,7 +108,6 @@ public class TestCacheSize {
private XStatement sStatement;
private XConnection cConnection;
XDataSource ds;
private XDriver drv;
private com.sun.star.beans.PropertyValue[] info;
......
......@@ -28,9 +28,4 @@ public class CsvDatabase extends FlatFileDatabase
super( i_orb, "flat" );
}
protected CsvDatabase( final XMultiServiceFactory i_orb, final String i_existingDocumentURL ) throws Exception
{
super( i_orb, i_existingDocumentURL, "flat" );
}
}
......@@ -29,8 +29,4 @@ public class DbaseDatabase extends FlatFileDatabase
}
protected DbaseDatabase( final XMultiServiceFactory i_orb, final String i_existingDocumentURL ) throws Exception
{
super( i_orb, i_existingDocumentURL, "dbase" );
}
}
......@@ -18,11 +18,9 @@
package connectivity.tools;
import com.sun.star.beans.PropertyVetoException;
import com.sun.star.beans.UnknownPropertyException;
import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lang.IllegalArgumentException;
public class QueryDefinition
{
......@@ -48,18 +46,4 @@ public class QueryDefinition
return command;
}
/** retrieves the command underlying the query definition
*
* This method is a mere wrapped around the <code>getPropertyValue( "Command" )</code> call
*/
public void setCommand( String _command ) throws WrappedTargetException
{
try
{
m_queryDef.setPropertyValue( "Command", _command );
}
catch (UnknownPropertyException e) { }
catch (PropertyVetoException e) { }
catch (IllegalArgumentException e) { }
}
}
......@@ -22,7 +22,6 @@ import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.sdb.XSingleSelectQueryComposer;
import com.sun.star.sdbc.SQLException;
import com.sun.star.sdbc.XConnection;
import com.sun.star.sdbc.XDatabaseMetaData;
import com.sun.star.sdbc.XPreparedStatement;
import com.sun.star.sdbc.XStatement;
import com.sun.star.sdbcx.XTablesSupplier;
......@@ -73,12 +72,6 @@ public class Connection
return m_connection.prepareStatement( _sql );
}
public
XDatabaseMetaData getMetaData() throws SQLException
{
return m_connection.getMetaData();
}
public
void close() throws SQLException
{
......
......@@ -52,21 +52,11 @@ public class DatabaseApplication
documentUI.connect();
}
public XOfficeDatabaseDocument getDatabaseDocument()
{
return databaseDocument;
}
public XDatabaseDocumentUI getDocumentUI()
{
return documentUI;
}
public DatabaseAccess getDb()
{
return db;
}
public void store()
{
// store the doc in a new location
......
......@@ -24,15 +24,12 @@ import com.sun.star.container.XIndexAccess;
import com.sun.star.container.XChild;
import com.sun.star.container.XNamed;
import com.sun.star.drawing.XDrawPage;
import com.sun.star.lang.XServiceInfo;
public class FormComponent
{
private final Object m_component;
private final XNameAccess m_nameAccess;
private final XIndexAccess m_indexAccess;
private final XChild m_child;
private final XNamed m_named;
/* ------------------------------------------------------------------ */
private FormComponent()
......@@ -40,8 +37,6 @@ public class FormComponent
m_component = null;
m_nameAccess = null;
m_indexAccess = null;
m_child = null;
m_named = null;
}
/* ------------------------------------------------------------------ */
......@@ -54,9 +49,9 @@ public class FormComponent
m_nameAccess = (XNameAccess)m_component;
m_indexAccess = UnoRuntime.queryInterface(
XIndexAccess.class, m_component );
m_child = UnoRuntime.queryInterface(
UnoRuntime.queryInterface(
XChild.class, m_component );
m_named = UnoRuntime.queryInterface(
UnoRuntime.queryInterface(
XNamed.class, m_component );
}
......@@ -68,9 +63,9 @@ public class FormComponent
XNameAccess.class, m_component );
m_indexAccess = UnoRuntime.queryInterface(
XIndexAccess.class, m_component );
m_child = UnoRuntime.queryInterface(
UnoRuntime.queryInterface(
XChild.class, m_component );
m_named = UnoRuntime.queryInterface(
UnoRuntime.queryInterface(
XNamed.class, m_component );
}
......@@ -100,20 +95,6 @@ public class FormComponent
return new FormComponent();
}
/* ------------------------------------------------------------------ */
public String[] getElementNames()
{
return ( m_nameAccess != null ) ? m_nameAccess.getElementNames() : new String[]{};
}
/* ------------------------------------------------------------------ */
public int getCount()
{
return ( m_indexAccess != null ) ? m_indexAccess.getCount() : 0;
}
/* ------------------------------------------------------------------ */
public FormComponent getByIndex( int index )
{
......@@ -130,35 +111,4 @@ public class FormComponent
return new FormComponent();
}
/* ------------------------------------------------------------------ */
public com.sun.star.uno.Type getElementType( )
{
if ( m_indexAccess != null )
return m_indexAccess.getElementType();
else if ( m_nameAccess != null )
return m_nameAccess.getElementType();
return new com.sun.star.uno.Type( String.class );
}
/* ------------------------------------------------------------------ */
public FormComponent getParent()
{
return ( m_child != null ) ? new FormComponent( m_child.getParent() ) : new FormComponent();
}
/* ------------------------------------------------------------------ */
public String getName()
{
return ( m_named != null ) ? m_named.getName() : "";
}
/* ------------------------------------------------------------------ */
public String getImplementationName()
{
XServiceInfo si = UnoRuntime.queryInterface(
XServiceInfo.class, m_component );
return ( si != null ) ? si.getImplementationName() : "";
}
}
......@@ -22,12 +22,9 @@ import com.sun.star.uno.*;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XComponent;
import com.sun.star.table.XCellRange;
import com.sun.star.table.CellAddress;
import com.sun.star.table.CellRangeAddress;
import com.sun.star.container.XIndexAccess;
import com.sun.star.sheet.XSpreadsheetDocument;
import com.sun.star.sheet.XSpreadsheets;
import com.sun.star.beans.NamedValue;
public class SpreadsheetDocument extends DocumentHelper
{
......@@ -68,71 +65,4 @@ public class SpreadsheetDocument extends DocumentHelper
);
}
/* ------------------------------------------------------------------ */
/** creates a value binding for a given cell
*/
public com.sun.star.form.binding.XValueBinding createCellBinding( short sheet, short column, short row )
{
return createCellBinding( sheet, column, row, false );
}
/* ------------------------------------------------------------------ */
/** creates a value binding which can be used to exchange a list box selection <em>index</em> with a cell
*/
public com.sun.star.form.binding.XValueBinding createListIndexBinding( short sheet, short column, short row )
{
return createCellBinding( sheet, column, row, true );
}
/* ------------------------------------------------------------------ */
/** creates a value binding for a given cell, with or without support for integer value exchange
*/
private com.sun.star.form.binding.XValueBinding createCellBinding( short sheet, short column, short row, boolean supportIntegerValues )
{
com.sun.star.form.binding.XValueBinding cellBinding = null;
try
{
CellAddress address = new CellAddress( sheet, column, row );
Object[] initParam = new Object[] { new NamedValue( "BoundCell", address ) };
cellBinding = UnoRuntime.queryInterface(
com.sun.star.form.binding.XValueBinding.class,
createInstanceWithArguments(
supportIntegerValues ? "com.sun.star.table.ListPositionCellBinding"
: "com.sun.star.table.CellValueBinding",
initParam
)
);
}
catch( com.sun.star.uno.Exception e )
{
System.err.println( e );
e.printStackTrace( System.err );
}
return cellBinding;
}
/* ------------------------------------------------------------------ */
/** creates a source of list entries associated with a (one-column) cell range
*/
public com.sun.star.form.binding.XListEntrySource createListEntrySource( short sheet, short column,
short topRow, short bottomRow )
{
com.sun.star.form.binding.XListEntrySource entrySource = null;
try
{
CellRangeAddress rangeAddress = new CellRangeAddress( sheet, column,
topRow, column, bottomRow );
Object[] initParam = new Object[] { new NamedValue( "CellRange", rangeAddress ) };
entrySource = UnoRuntime.queryInterface(
com.sun.star.form.binding.XListEntrySource.class,
createInstanceWithArguments(
"com.sun.star.table.CellRangeListSource", initParam ) );
}
catch( com.sun.star.uno.Exception e )
{
System.err.println( e );
e.printStackTrace( System.err );
}
return entrySource;
}
}
......@@ -41,13 +41,6 @@ public class XMLDocument extends integration.forms.DocumentHelper
impl_initialize( getDocument() );
}
/* ------------------------------------------------------------------ */
public XMLDocument( XMultiServiceFactory _orb, XComponent _document )
{
super( _orb, _document );
impl_initialize( _document );
}
/* ------------------------------------------------------------------ */
private void impl_initialize( XComponent _document )
{
......
......@@ -36,8 +36,6 @@ $(eval $(call gb_JunitTest_add_sourcefiles,framework_complex,\
framework/qa/complex/disposing/GetServiceWhileDisposingOffice \
framework/qa/complex/path_substitution/PathSubstitutionTest \
framework/qa/complex/loadAllDocuments/InteractionHandler \
framework/qa/complex/loadAllDocuments/StreamSimulator \
framework/qa/complex/loadAllDocuments/TestDocument \
framework/qa/complex/loadAllDocuments/CheckXComponentLoader \
framework/qa/complex/loadAllDocuments/StatusIndicator \
framework/qa/complex/broken_document/TestDocument \
......@@ -46,7 +44,6 @@ $(eval $(call gb_JunitTest_add_sourcefiles,framework_complex,\
framework/qa/complex/framework/autosave/AutoSave \
framework/qa/complex/framework/autosave/Protocol \
framework/qa/complex/framework/autosave/ConfigHelper \
framework/qa/complex/framework/recovery/TimeoutThread \
framework/qa/complex/framework/recovery/KlickButtonThread \
framework/qa/complex/framework/recovery/RecoveryTools \
framework/qa/complex/framework/recovery/RecoveryTest \
......
......@@ -240,18 +240,6 @@ public class Interceptor implements XDispatch,
}
/** set a new list of URL's, which should be used on registration time
(that's why it's necessary to call this impl-method before the interceptor
is used at the OOo API!) to optimize the interception chain.
*/
public synchronized void setURLs4InterceptionInfo(String[] lURLs)
{
m_lURLs4InterceptionInfo = lURLs;
}
/** set a new list of URL's, which should be blocked by this interceptor.
(that's why it's necessary to call this impl-method before the interceptor
is used at the OOo API!)
......
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package complex.framework.recovery;
public class TimeoutThread extends Thread{
public int timeOut = 0;
/** Creates a new instance of TimeoutThread */
public TimeoutThread(int timeOut) {
this.timeOut = timeOut;
}
@Override
public void run(){
util.utils.shortWait(timeOut);
}
}
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package complex.loadAllDocuments;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.ucb.XSimpleFileAccess;
import com.sun.star.lang.XMultiServiceFactory;
/**
* Simulates an input and output stream and
* implements the interfaces XInputStream, XOutputStream.
* So it can be used for testing loading/saving of documents
* using streams instead of URLs.
*/
public class StreamSimulator implements com.sun.star.io.XInputStream ,
com.sun.star.io.XOutputStream ,
com.sun.star.io.XSeekable
{
/**
* the internal input stream for reading
*/
private com.sun.star.io.XInputStream m_xInStream ;
/**
* the internal input stream for writing
*/
private com.sun.star.io.XOutputStream m_xOutStream ;
/**
* points at runtime to m_xInStream or m_xOutStream and make it seekable
*/
private com.sun.star.io.XSeekable m_xSeek ;
/**
* indicates, that the input stream interface was used
*/
public boolean m_bInWasUsed ;
/**
* indicates, that the output stream interface was used
*/
public boolean m_bOutWasUsed ;
/**
* construct a new instance of this class
* It set the name of the correspojnding file on disk, which
* should be source or target for the following operations on
* this object. And it regulate if it should function as
* input or output stream.
*
* @param sFileName
* name of the file on disk
* Will be used as source (if param bInput==true)
* or as target (if param bInput==false).
*
* @param bInput
* it specify, which interface should work at this object.
* <TRUE/> => we simulate an input stream
* <FALSE/> => we simulate an output stream
*
* @throw com.sun.star.io.NotConnectedException
* in case the internal streams to the file on disk couldn't
* be established.
* They are necessary. Otherwhise this simulator can't
* really work.
*/
public StreamSimulator(XMultiServiceFactory xMSF,
String sFileName, boolean bInput)
throws com.sun.star.io.NotConnectedException
{
m_bInWasUsed = false ;
m_bOutWasUsed = false ;