diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-27 09:59:49 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-29 22:02:58 +0200 |
commit | b728bb537fb21c2bc890d4c5c90bd14cb35805e2 (patch) | |
tree | a2143d9e8e08cde8b35529f57f4b2f437fb77fdd /dbaccess | |
parent | f4cca7347f56663f42c8a8fdf3bca654727fc060 (diff) |
Convert code to Java5 generics in dbaccess module
Some of the code need the warnings suppressed - unavoidable when
dealing with the reflection interface.
Change-Id: I2016c3f904bcebc4e34556eb5d231fc25761a9ce
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/qa/complex/dbaccess/DatabaseDocument.java | 19 | ||||
-rw-r--r-- | dbaccess/qa/complex/dbaccess/RowSet.java | 1 | ||||
-rw-r--r-- | dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java | 1 | ||||
-rw-r--r-- | dbaccess/qa/complex/dbaccess/TestCase.java | 2 |
4 files changed, 14 insertions, 9 deletions
diff --git a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java index 0608530ce386..eaf107d81307 100644 --- a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java +++ b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java @@ -88,8 +88,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. private static final String _BLANK = "_blank"; private XComponent m_callbackFactory = null; - private final ArrayList m_documentEvents = new ArrayList(); - private final ArrayList m_globalEvents = new ArrayList(); + private final ArrayList<String> m_documentEvents = new ArrayList<String>(); + private final ArrayList<String> m_globalEvents = new ArrayList<String>(); // for those states, see testDocumentEvents private static short STATE_NOT_STARTED = 0; private static short STATE_LOADING_DOC = 1; @@ -143,7 +143,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. private class CallbackComponentFactory implements XSingleComponentFactory, XServiceInfo, XComponent { - private final ArrayList m_eventListeners = new ArrayList(); + private final ArrayList<XEventListener> m_eventListeners = new ArrayList<XEventListener>(); public Object createInstanceWithContext(XComponentContext _context) throws com.sun.star.uno.Exception { @@ -173,15 +173,16 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. }; } + @SuppressWarnings("unchecked") public void dispose() { final EventObject event = new EventObject(this); - final ArrayList eventListenersCopy = (ArrayList) m_eventListeners.clone(); - final Iterator iter = eventListenersCopy.iterator(); + final ArrayList<XEventListener> eventListenersCopy = (ArrayList<XEventListener>)m_eventListeners.clone(); + final Iterator<XEventListener> iter = eventListenersCopy.iterator(); while (iter.hasNext()) { - ((XEventListener) iter.next()).disposing(event); + iter.next().disposing(event); } } @@ -850,7 +851,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. } // -------------------------------------------------------------------------------------------------------- - private void impl_stopObservingEvents(ArrayList _actualEvents, String[] _expectedEvents, String _context) + private void impl_stopObservingEvents(ArrayList<String> _actualEvents, String[] _expectedEvents, String _context) { try { @@ -896,13 +897,13 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. } // -------------------------------------------------------------------------------------------------------- - int impl_waitForEvent(ArrayList _eventQueue, String _expectedEvent, int _maxMilliseconds) + int impl_waitForEvent(ArrayList<String> _eventQueue, String _expectedEvent, int _maxMilliseconds) { return impl_waitForEvent(_eventQueue, _expectedEvent, _maxMilliseconds, 0); } // -------------------------------------------------------------------------------------------------------- - int impl_waitForEvent(ArrayList _eventQueue, String _expectedEvent, int _maxMilliseconds, int _firstQueueElementToCheck) + int impl_waitForEvent(ArrayList<String> _eventQueue, String _expectedEvent, int _maxMilliseconds, int _firstQueueElementToCheck) { synchronized (_eventQueue) { diff --git a/dbaccess/qa/complex/dbaccess/RowSet.java b/dbaccess/qa/complex/dbaccess/RowSet.java index e7f195ab9a55..b5ecad9237ee 100644 --- a/dbaccess/qa/complex/dbaccess/RowSet.java +++ b/dbaccess/qa/complex/dbaccess/RowSet.java @@ -370,6 +370,7 @@ public class RowSet extends TestCase // -------------------------------------------------------------------------------------------------------- @Test + @SuppressWarnings("unchecked") public void testRowSetEvents() throws java.lang.Exception { System.out.println("testing RowSet Events"); diff --git a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java index 4b762d814e73..b95144ae4a6a 100644 --- a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java +++ b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java @@ -80,6 +80,7 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase } // -------------------------------------------------------------------------------------------------------- + @SuppressWarnings("unchecked") private void checkAttributeAccess(String _attributeName, String _attributeValue) { System.out.println("setting " + _attributeName + " to " + _attributeValue); diff --git a/dbaccess/qa/complex/dbaccess/TestCase.java b/dbaccess/qa/complex/dbaccess/TestCase.java index 43e15f319ef7..738f39d2a937 100644 --- a/dbaccess/qa/complex/dbaccess/TestCase.java +++ b/dbaccess/qa/complex/dbaccess/TestCase.java @@ -117,6 +117,7 @@ public abstract class TestCase * is the class of the exception to be caught. If this is null, * it means that <em>no</em> exception must be throw by invoking the method. */ + @SuppressWarnings("unchecked") protected void assureException( final String _message, final Object _object, final String _methodName, final Class[] _argClasses, final Object[] _methodArgs, final Class _expectedExceptionClass ) { @@ -199,6 +200,7 @@ public abstract class TestCase } // -------------------------------------------------------------------------------------------------------- + @SuppressWarnings("unchecked") protected void assureException( Object _object, Class _unoInterfaceClass, String _methodName, Object[] _methodArgs, Class _expectedExceptionClass ) { |