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

java: remove commented out code

Change-Id: I05c907a38b562231e968c17f14e09ef80e0a6ed1
üst 89c0a2b2
......@@ -205,7 +205,6 @@ public class LocalOfficeWindow
if ( isShowing() )
{
// create direct parent relationship
//setVisible( true );
parentPeer = new JavaWindowPeerFake( getNativeWindow(), type);
bPeer = true;
}
......
......@@ -186,7 +186,6 @@ public class LocalOfficeWindow
if ( isShowing() )
{
// create direct parent relationship
//setVisible( true );
parentPeer = new JavaWindowPeerFake(getWrappedWindowHandle(), type);
bPeer = true;
}
......
......@@ -543,7 +543,6 @@ public class OOoBeanTest
}
else
{
// Thread.sleep(2000);
}
} finally {
......
......@@ -137,7 +137,6 @@ final class CustomURLClassLoader extends URLClassLoader {
// this.findClass, after this.loadClass has already called
// super.findClass, so no need to call super.findClass again:
throw new ClassNotFoundException( name );
// return super.findClass(name);
}
......
......@@ -37,7 +37,6 @@ import java.io.PrintStream;
public final class TestBed {
public boolean execute(XInstanceProvider provider, boolean waitForServer,
Class client, long wait) throws Exception {
// assert client.isAssignableFrom(client) && wait >= 0;
synchronized (lock) {
server = new Server(provider);
server.start();
......@@ -45,10 +44,6 @@ public final class TestBed {
}
Process p = Runtime.getRuntime().exec(new String[] {
"java", "-classpath", System.getProperty("java.class.path"),
/*
"-Xdebug",
"-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n",
*/
client.getName() });
pipe(p.getInputStream(), System.out, "CO> ");
pipe(p.getErrorStream(), System.err, "CE> ");
......
......@@ -347,7 +347,6 @@ public class TestCaseOldAPI extends ComplexTestCase {
fMax1 = AnyConverter.toDouble( oMax );
log.println( "Maximum retrieved: " + fMax1 );
//todo: the view has to be built before there is an explicit value
// assure( "Max is 0.0", fMax1 > 0.0 );
xProp.setPropertyValue( "AutoMax", new Boolean( false ));
oMax = xProp.getPropertyValue( "Max" );
assure( "No Maximum set", AnyConverter.isDouble( oMax ));
......@@ -546,13 +545,6 @@ public class TestCaseOldAPI extends ComplexTestCase {
xDiaProp.getPropertyValue( "Vertical" )));
}
// reset to bar-chart
// aMyServiceName = new String( "com.sun.star.chart.BarDiagram" );
// XDiagram xDia = (XDiagram) UnoRuntime.queryInterface(
// XDiagram.class, xFact.createInstance( aMyServiceName ));
// assure( aMyServiceName + " could not be created", xDia != null );
// mxOldDoc.setDiagram( xDia );
}
catch( Exception ex )
{
......
......@@ -55,9 +55,6 @@ public class DBaseSqlTests extends SubTestCase
execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 0 < 1");
execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 2 > 1");
execute(xRowRes,"1,1+1,'a' + 'b' FROM \"biblio\" \"biblio\" where 2 > 1");
// execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where (0 = 0) is true");
// execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not (0 = 0) is not true");
// execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 1 between 0 and 2");
execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not \"Identifier\" is NULL");
execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where \"Identifier\" is not NULL");
execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where \"Identifier\" = \"Identifier\"");
......
......@@ -71,8 +71,6 @@ public class DatabaseMetaData {
public void test(){
// try {
try{
ResultSet rs = m_xMD.getTables(null,null,"TESTCASE",null);
while ( rs.next() )
......@@ -99,66 +97,5 @@ public class DatabaseMetaData {
} catch(Exception e){
}
//testMethod("getTypeInfo", zclass,empty,17);
/*
Class[] zclass = new Class[]{};
Object[] empty = new Object[]{};
testMethod("getCatalogs", zclass,empty,1);
testMethod("getSchemas", zclass,empty,2);
testMethod("getTableTypes", zclass,empty,1);
Class[] a4 = new Class[4];
Object[] o4 = new Object[4];
a4[0] = Class.forName("java.lang.Object");
a4[1] = Class.forName("java.lang.String");
a4[2] = Class.forName("java.lang.String");
a4[3] = Class.forName("java.lang.String");
o4[0] = null;
o4[1] = null;
o4[2] = null;
o4[3] = "%";
testMethod("getColumnPrivileges", a4,o4,7);
testMethod("getColumns", a4,o4,18);
testMethod("getProcedureColumns", a4,o4,13);
testMethod("getColumns", a4,o4,18);
Class[] a3 = new Class[3];
Object[] o3 = new Object[3];
a3[0] = Class.forName("java.lang.Object");
a3[1] = Class.forName("java.lang.String");
a3[2] = Class.forName("java.lang.String");
o3[0] = null;
o3[1] = null;
o3[2] = "%";
testMethod("getExportedKeys", a3,o3,14);
testMethod("getImportedKeys", a3,o3,14);
testMethod("getPrimaryKeys", a3,o3,14);
testMethod("getProcedures", a3,o3,5);
testMethod("getTablePrivileges", a3,o3,6);
testMethod("getVersionColumns", a3,o3,7);
// testMethod("getCrossReference", a3,o3,14);
} catch( java.lang.ClassNotFoundException ex) {
assure("ClassNotFoundException: " + ex.getMessage() ,false);
}
*/
}
/*
public com.sun.star.sdbc.XResultSet getCrossReference(Object obj, String str, String str2, Object obj3, String str4, String str5) {
}
public com.sun.star.sdbc.XResultSet getIndexInfo(Object obj, String str, String str2, boolean param, boolean param4) {
}
public com.sun.star.sdbc.XResultSet getTables(Object obj, String str, String str2, String[] str3) {
}
public com.sun.star.sdbc.XResultSet getUDTs(Object obj, String str, String str2, int[] values) {
}
public com.sun.star.sdbc.XResultSet getBestRowIdentifier(Object obj, String str, String str2, int param, boolean param4) throws com.sun.star.sdbc.SQLException {
}
*/
}
......@@ -136,8 +136,6 @@ public class TestCacheSize {
sStatement = null;
cConnection = null;
//Class.forName("org.hsqldb.jdbcDriver");
if (filedb) {
cConnection = drv.connect(url,info);
......@@ -147,9 +145,6 @@ public class TestCacheSize {
sStatement.execute("SET LOGSIZE " + 0);
sStatement.execute("SHUTDOWN");
cConnection.close();
// props.setProperty("hsqldb.cache_scale", "" + cacheScale);
// props.setProperty("hsqldb.cache_size_scale",
//"" + cacheSizeScale);
}
} catch (Exception e) {
e.printStackTrace();
......@@ -255,7 +250,6 @@ public class TestCacheSize {
System.out.println("multi key table");
}
// sStatement.execute("CREATE INDEX idx3 ON tempTEST (zip);");
System.out.println("Setup time: " + sw.elapsedTime());
fillUpBigTable(filler, randomgen);
......@@ -339,9 +333,6 @@ public class TestCacheSize {
}
}
// sStatement.execute("INSERT INTO test SELECT * FROM temptest;");
// sStatement.execute("DROP TABLE temptest;");
// sStatement.execute(ddl7);
System.out.println("Total insert: " + i);
System.out.println("Insert time: " + sw.elapsedTime() + " rps: "
+ (i * 1000 / (sw.elapsedTime() + 1)));
......
......@@ -73,7 +73,6 @@ class FlatFileDatabase extends AbstractDatabase
documentFile.delete();
m_tableFileLocation = new File(documentFile.getParent() + File.separator + documentFile.getName().replace(".odb", "") + File.separator );
m_tableFileLocation.mkdir();
//subPath.deleteOnExit();
m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath(documentFile);
final String path = URLHelper.getFileURLFromSystemPath( m_tableFileLocation.getPath() );
......
......@@ -81,7 +81,6 @@ public class DataSource extends TestCase
}
catch (Exception ex)
{
// Logger.getLogger(DataSource.class.getName()).log(Level.SEVERE, null, ex);
fail();
}
}
......
......@@ -260,9 +260,6 @@ public class EmbedContApp extends Applet
m_aNativeView.resize( 800, 600 );
this.add( m_aNativeView );
// Handle mouse clicks in our window.
// addMouseListener( this );
}
public void actionPerformed( ActionEvent evt )
{
......@@ -845,8 +842,6 @@ public class EmbedContApp extends Applet
{
super.paint( g );
// m_aNativeView.paint( g );
createVclWindow();
}
......
......@@ -290,7 +290,6 @@ public class CellBinding extends complexlib.ComplexTestCase
setCellText( sourceCol, (short)( row + 0 ), "Oranges" );
setCellText( sourceCol, (short)( row + 1 ), "Peaches" );
//setListSource( listBox, sourceCol, row, (short)( row + 2 ) );
// TODO: this is currently prone to deadlocks
......@@ -332,7 +331,6 @@ public class CellBinding extends complexlib.ComplexTestCase
setCellText( sourceCol, (short)( row + 0 ), "Bananas" );
setCellText( sourceCol, (short)( row + 1 ), "Strawberries" );
//setListSource( listBox, sourceCol, row, (short)( row + 2 ) );
// TODO: this is currently prone to deadlocks
......
......@@ -923,7 +923,6 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE
{
xProducer.addConsumer( compareImages );
xProducer.startProduction();
// wait();
}
xProducer.removeConsumer( compareImages );
......
......@@ -165,28 +165,6 @@ public class EventTest {
closeDoc(xDoc);
}
/**
* creates a chart document and check the <CODE>XMouseClickHandler</CODE> and
* <CODE>XKeyHandler</CODE>
* @see com.sun.star.awt.XKeyHandler
* @see com.sun.star.awt.XMouseClickHandler
*/
// TODO!
// @Test public void checkChartDocument(){
//
// XChartDocument xDoc = null;
//
// try{
// xDoc = m_SOF.createChartDoc("ChartTest");
// } catch (com.sun.star.uno.Exception e){
// fail("Could not create a chart document: " +e.toString());
// }
//
// checkListener(xDoc);
//
// closeDoc(xDoc);
// }
/**
* creates a math document and check the <CODE>XMouseClickHandler</CODE> and
* <CODE>XKeyHandler</CODE>
......
......@@ -67,7 +67,6 @@ public class CheckAPI {
@Test public void checkAPI() {
System.out.println("Start with test");
// if test is idle for 5 minutes, assume that it hangs and kill it.
// param.put("TimeOut", new Integer("300000"));
XMultiServiceFactory xMSF = getMSF();
Object oObj = null;
try {
......
......@@ -199,12 +199,10 @@ public class CheckContextMenuInterceptor
}
catch (com.sun.star.uno.RuntimeException ex)
{
// ex.printStackTrace();
fail("Runtime exception caught!" + ex.getMessage());
}
catch (java.lang.Exception ex)
{
// ex.printStackTrace();
fail("Java lang exception caught!" + ex.getMessage());
}
}
......
......@@ -150,7 +150,6 @@ public class DesktopTerminate
{
System.out.println("tearDownConnection()");
// don't do a tearDown here, desktop is already terminated.
// connection.tearDown();
}
private static final OfficeConnection connection = new OfficeConnection();
......
......@@ -398,7 +398,6 @@ public class checkdispatchapi
catch (java.lang.Throwable ex)
{
fail("Exception caught during using XDispatchInformationProvider.");
// ex.printStackTrace();
}
}
......
......@@ -90,7 +90,6 @@ public class GetServiceWhileDisposingOffice
{
System.out.println("tearDownConnection()");
// Office is already terminated.
// connection.tearDown();
}
private static final OfficeConnection connection = new OfficeConnection();
......
......@@ -241,22 +241,16 @@ public class CheckXComponentLoader
File aSysFile = new File(m_sTestDocPath, aSnapshot.next());
String sURL = URLHelper.getFileURLFromSystemPath(aSysFile);
if (/*! (sURL.endsWith(".jpg") ||
sURL.endsWith(".gif"))*/
true
)
loadURL(m_xLoader, RESULT_VALID_DOC, sURL, "_blank", 0, lProps);
// Its not needed to reset this using states!
// Its done internally ...
if (!xIndicator.wasUsed())
{
loadURL(m_xLoader, RESULT_VALID_DOC, sURL, "_blank", 0, lProps);
// Its not needed to reset this using states!
// Its done internally ...
if (!xIndicator.wasUsed())
{
System.out.println("External progress was not used for loading.");
}
if (xHandler.wasUsed())
{
System.out.println("External interaction handler was not used for loading.");
}
System.out.println("External progress was not used for loading.");
}
if (xHandler.wasUsed())
{
System.out.println("External interaction handler was not used for loading.");
}
}
}
......
......@@ -126,7 +126,6 @@ public class PathSettingsTest
{
System.out.println(e.getClass().getName());
System.out.println("Message: " + e.getMessage());
// fail("Could not create an instance of the test object.");
}
catch (Exception e)
{
......
......@@ -119,8 +119,6 @@ public final class PropertySetMixin {
XComponentContext context, XInterface object, Type type,
String[] absentOptional)
{
// assert context != null && object != null && type != null
// && type.getTypeClass() == TypeClass.INTERFACE;
this.context = context;
this.object = object;
this.type = type;
......@@ -881,8 +879,6 @@ public final class PropertySetMixin {
boolean isAmbiguous, boolean wrapDefaulted, boolean isDefaulted,
boolean wrapOptional)
{
// assert (wrapAmbiguous || !isAmbiguous)
// && (wrapDefaulted || !isDefaulted);
if (wrapAmbiguous
&& type.getName().startsWith("com.sun.star.beans.Ambiguous<"))
{
......
......@@ -156,7 +156,6 @@ public class SharedLibraryLoader_Test {
passed = test_instantiateSharedLibraryLoader() && passed;
passed = test_loadNativeServiceManager() && passed;
passed = test_loadNativeSimpleRegistry() && passed;
//passed = test_registerSharedLibraryLoader() && passed;
System.err.println("SharedLibraryLoader test passed? " + passed);
......
......@@ -109,9 +109,6 @@ public final class pipeAcceptor implements XAcceptor {
com.sun.star.lang.IllegalArgumentException
{
throw new java.lang.NoSuchMethodError( "pipeAcceptor not fully implemented yet" );
//try { return new PipeConnection( connectionDescription ); }
//catch ( java.io.IOException e ) { return null; }
}
/**
......
......@@ -118,13 +118,6 @@ public final class java_environment implements IEnvironment {
*/
public void list() {
// TODO???
// synchronized (proxies) {
// System.err.println("##### " + getClass().getName() + ".list: "
// + getName() + ", " + getContext());
// for (Iterator it = proxies.values().iterator(); it.hasNext();) {
// System.err.println("#### entry: " + it.next());
// }
// }
}
/**
......
......@@ -67,7 +67,7 @@ public final class Marshaling_Test {
new Any(new Type(Integer.class), new Integer(10)), // Any as Any
null,
new TestPrimitiveStruct(),
x, //new TestPrimitiveSeqStruct(),
x,
new byte[]{1,2,3,4,5,6,7}, // primitive sequence
new int[]{7,6,5,4,3,2,1}, // primitive sequence
new Object[]{new Integer(123), new String("hallo")}, // any sequence
......
......@@ -116,7 +116,6 @@ public class GlobalFile {
public static ArrayList<ArrayList<Double>> getCurveDataFromFile(String fileName) {
File file = new File(fileName);
if(!file.exists()){
//showMessage();
return null;
}
//open data file
......@@ -126,7 +125,6 @@ public class GlobalFile {
inStream = new FileInputStream(file);
inReader = new BufferedReader(new InputStreamReader(inStream));
}catch(Exception e){
//showMessage();
return null;//Data file open error.
}
ArrayList<Double> xaxes = new ArrayList<Double>(1);
......@@ -158,7 +156,6 @@ public class GlobalFile {
xaxis = Double.valueOf(s);
xaxes.add(xaxis);
}catch(NumberFormatException e){
//showMessage();
inReader.close();
inStream.close();
return null;//Data file data format error.
......@@ -168,7 +165,6 @@ public class GlobalFile {
yaxis = Double.valueOf(s);
yaxes.add(yaxis);
}catch(NumberFormatException e){
//showMessage();
inReader.close();
inStream.close();
return null;//Data file data format error.
......@@ -177,7 +173,6 @@ public class GlobalFile {
}
inReader.close();
}catch(Exception e){
//showMessage();
return null;//Uncertain data file error.
}
ArrayList<ArrayList<Double>> curveData = new ArrayList<ArrayList<Double>>(2);
......
......@@ -68,7 +68,6 @@ public static double doubleRangeRandom(double lowLimit,double upLimit){
if(times<=0) return new int[0];
int realTimes = Math.min(maxNum, times);
boolean[] flags = new boolean[maxNum];
// Arrays.fill(flags, false);
boolean isBelowHalf = times<maxNum*0.5;
int virtualTimes = realTimes;
if(!isBelowHalf) {
......
......@@ -169,7 +169,6 @@ public class DialogComponent {
//XServiceInfo
public String getImplementationName() {
// return DialogComponent.class.getName();
return _DialogComponent.class.getName();
}
......
......@@ -102,7 +102,6 @@ public class CodeSamples
}
displayTableStructure( con );
}
// printDataSources();
}
catch(Exception e)
{
......
......@@ -113,10 +113,6 @@ public class Sales
{
// example for a programmatic way to do updates.
XStatement stmt = con.createStatement();
// stmt.executeUpdate("INSERT INTO SALES " +
// "VALUES (4, 102, 5, 'FTOP Darjeeling tea', '2002-01-02',150)");
//
// stmt = con.createStatement();
XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,stmt);
xProp.setPropertyValue("ResultSetType", new java.lang.Integer(ResultSetType.SCROLL_INSENSITIVE));
xProp.setPropertyValue("ResultSetConcurrency", new java.lang.Integer(ResultSetConcurrency.UPDATABLE));
......
......@@ -710,9 +710,6 @@ public class SpreadsheetSample extends SpreadsheetDocHelper
aAutoFormatObj = xAutoFormatsNA.getByName( aAutoFormatName );
else
{
// create a new auto format (with document service manager!)
// xDocServiceManager = (com.sun.star.lang.XMultiServiceFactory)
// UnoRuntime.queryInterface( com.sun.star.lang.XMultiServiceFactory.class, getDocument() );
aAutoFormatObj = xDocServiceManager.createInstance(
"com.sun.star.sheet.TableAutoFormat" );
xAutoFormatsNA.insertByName( aAutoFormatName, aAutoFormatObj );
......
......@@ -312,12 +312,6 @@ public class ConverterServlet extends HttpServlet {
xComponent.dispose();
}
// }
// catch( Exception exception ) {
// exception.printStackTrace();
// return( "" );
// }
if ( stringConvertedFile.startsWith( "file:///" ) ) {
// Truncating the beginning of the file name
stringConvertedFile = stringConvertedFile.substring( 8 );
......
......@@ -124,7 +124,6 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
m_aObjectMenu.add( aItem );
// Handle mouse clicks in our window.
// addMouseListener( new MouseWatcher() );
addMouseListener( this );
}
......
......@@ -316,10 +316,8 @@ public class UnoNode{
private static Type sequenceComponentType(Type sequenceType) {
// assert sequenceType.getTypeClass() == TypeClass.SEQUENCE;
String n = sequenceType.getTypeName();
final String PREFIX = "[]";
// assert n.startsWith(PREFIX);
return new Type(n.substring(PREFIX.length()));
}
......
......@@ -315,7 +315,6 @@ public class SCalc {
XPropertySet oTPS = UnoRuntime.queryInterface(
XPropertySet.class, xChart.getTitle() );
oTPS.setPropertyValue("String","The new title");
//oDiag.Dim3D();
} catch (Exception e){
System.err.println("Changin Properties failed "+e);
e.printStackTrace(System.err);
......
......@@ -581,7 +581,6 @@ public class ToDo {
private String getStringFromGregorianCalendar( GregorianCalendar gregCal ) {
String sDate = ( gregCal.get( Calendar.MONTH ) + 1 )
+ STRING_SEPARATOR + gregCal.get( Calendar.DATE )
// + STRING_SEPARATOR + ( gregCal.get( Calendar.MONTH ) + 1 )
+ STRING_SEPARATOR + gregCal.get( Calendar.YEAR );
return sDate;
......
......@@ -234,11 +234,6 @@ public class TestHelper {
public boolean checkRelations( StringPair[][] aStorRels, StringPair[][] aTestRels )
{
// Message( "StorageRels:" );
// PrintRelations( aStorRels );
// Message( "TestRels:" );
// PrintRelations( aTestRels );
if ( aStorRels.length != aTestRels.length )
{
Error( "The provided relations sequence has different size than the storage's one!" );
......
......@@ -89,8 +89,6 @@ public class java_complex implements TestBase
// and the office was killed.
// In complex tests just use "ThreadTimeOut" as timout.
// param.put("TimeOut", new Integer(0));
for (int i = 0; i < entries.length; i++)
{
......
......@@ -301,7 +301,6 @@ public class ConvWatchStarter extends EnhancedComplexTestCase
GlobalLogWriter.get().println("Set office watcher");
OfficeWatcher aWatcher = (OfficeWatcher)param.get("Watcher");
GlobalLogWriter.get().setWatcher(aWatcher);
// initializeWatcher(param);
String sStatusRunThrough = "";
String sStatusMessage = "";
......
......@@ -263,7 +263,6 @@ public class DB extends DBHelper
{