incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r828668 - in /incubator/kato/branches/experimental/thirdview/org.apache.kato: kato.api/src/main/java/javax/tools/diagnostics/image/ kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ kato.hprof.api/src/main/java/org/apache/kato/hprof/...
Date Thu, 22 Oct 2009 12:17:52 GMT
Author: spoole
Date: Thu Oct 22 12:17:52 2009
New Revision: 828668

URL: http://svn.apache.org/viewvc?rev=828668&view=rev
Log:
implemented removing lists from remaining image classes  and replaced with queryresults

Modified:
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageModule.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageProcess.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageThread.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/main/java/org/apache/kato/hprof/image/ImageProcessImpl.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/test/java/test/apache/kato/hprof/image/TestImageProcess.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AbstractDTFJTestcase.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageModuleTest.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tools.katoview/src/main/java/org/apache/kato/katoview/commands/helpers/KatoSearch.java

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageModule.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageModule.java?rev=828668&r1=828667&r2=828668&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageModule.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageModule.java
Thu Oct 22 12:17:52 2009
@@ -13,9 +13,10 @@
  ******************************************************************************/
 package javax.tools.diagnostics.image;
 
-import java.util.List;
 import java.util.Properties;
 
+import javax.tools.diagnostics.QueryResult;
+
 /**
  * Represents a shared library loaded into the image, or the executable module itself
  * 
@@ -37,7 +38,7 @@
      * 
      * @see ImageSection
      */
-    List<ImageSection> getSections();
+    QueryResult<ImageSection> getSections();
     
     /**
      * Provides a collection of symbols defined by the library. This
@@ -49,7 +50,7 @@
      * 
      * @see ImageSymbol
      */
-    List<ImageSymbol> getSymbols();
+    QueryResult<ImageSymbol> getSymbols();
     
     /**
      * Get the table of properties associated with this module.

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageProcess.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageProcess.java?rev=828668&r1=828667&r2=828668&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageProcess.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageProcess.java
Thu Oct 22 12:17:52 2009
@@ -13,9 +13,9 @@
  ******************************************************************************/
 package javax.tools.diagnostics.image;
 
-import java.util.List;
 import java.util.Properties;
 
+import javax.tools.diagnostics.QueryResult;
 import javax.tools.diagnostics.runtime.ManagedRuntime;
 
 /**
@@ -65,7 +65,7 @@
      * 
      * @see ImageModule
      */
-    List<ImageModule> getLibraries() throws DataUnavailable, CorruptDataException;
+    QueryResult<ImageModule> getLibraries() throws DataUnavailable, CorruptDataException;
     
     /**
      * Get the module representing the executable within the image.
@@ -90,7 +90,7 @@
      * @see ImageThread 
      * @see CorruptData
      */
-    List<ImageThread> getThreads();
+    QueryResult<ImageThread> getThreads();
 
     /**
      * Find the thread which triggered the creation of the image
@@ -116,7 +116,7 @@
      * @see javax.tools.diagnostics.runtime.ManagedRuntime 
      * @see javax.tools.diagnostics.runtime.java.JVMRuntime
      */
-    List<ManagedRuntime> getRuntimes();
+    QueryResult<ManagedRuntime> getRuntimes();
     
     /**
      * Get the OS signal number in this process which triggered the creation 

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageThread.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageThread.java?rev=828668&r1=828667&r2=828668&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageThread.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageThread.java
Thu Oct 22 12:17:52 2009
@@ -13,7 +13,6 @@
  ******************************************************************************/
 package javax.tools.diagnostics.image;
 
-import java.util.List;
 import java.util.Properties;
 
 import javax.tools.diagnostics.QueryResult;
@@ -58,7 +57,7 @@
      * @see ImageSection
      * @see CorruptData
      */
-    List<ImageSection> getStackSections();
+    QueryResult<ImageSection> getStackSections();
     
     /**
      * Get the register contents.
@@ -72,7 +71,7 @@
      * 
      * @see ImageRegister
      */
-    List<ImageRegister> getRegisters();
+    QueryResult<ImageRegister> getRegisters();
     
     /**
      * Get the OS-specific properties for this thread.

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java?rev=828668&r1=828667&r2=828668&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
Thu Oct 22 12:17:52 2009
@@ -33,6 +33,7 @@
 import javax.tools.diagnostics.image.ImageThread;
 import javax.tools.diagnostics.runtime.ManagedRuntime;
 
+import org.apache.kato.common.EmptyQueryResult;
 import org.apache.kato.common.ListBackedQueryResult;
 import org.apache.kato.jvmti.javaruntime.JavaRuntimeImpl;
 import org.apache.kato.jvmti.javaruntime.model.EmptyList;
@@ -92,7 +93,7 @@
 	}
 
 	@Override
-	public List<ImageModule> getLibraries() throws DataUnavailable,
+	public QueryResult<ImageModule> getLibraries() throws DataUnavailable,
 	CorruptDataException {
 		throw new DataUnavailable("no env");
 	}
@@ -109,8 +110,8 @@
 	}
 
 	@Override
-	public List<ManagedRuntime> getRuntimes() {
-		return runtimes;
+	public QueryResult<ManagedRuntime> getRuntimes() {
+		return new ListBackedQueryResult<ManagedRuntime>(runtimes);
 	}
 
 	/* Image methods */
@@ -129,8 +130,8 @@
 	}
 
 	@Override
-	public List<ImageThread> getThreads() {
-		return new EmptyList<ImageThread>();
+	public QueryResult<ImageThread> getThreads() {
+		return new EmptyQueryResult<ImageThread>();
 	}
 
 	@Override

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/main/java/org/apache/kato/hprof/image/ImageProcessImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/main/java/org/apache/kato/hprof/image/ImageProcessImpl.java?rev=828668&r1=828667&r2=828668&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/main/java/org/apache/kato/hprof/image/ImageProcessImpl.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/main/java/org/apache/kato/hprof/image/ImageProcessImpl.java
Thu Oct 22 12:17:52 2009
@@ -18,14 +18,18 @@
 import java.util.List;
 import java.util.Properties;
 
+import javax.tools.diagnostics.QueryResult;
 import javax.tools.diagnostics.image.CorruptDataException;
 import javax.tools.diagnostics.image.DataUnavailable;
 import javax.tools.diagnostics.image.ImageAddressSpace;
 import javax.tools.diagnostics.image.ImageModule;
 import javax.tools.diagnostics.image.ImageProcess;
 import javax.tools.diagnostics.image.ImageThread;
+import javax.tools.diagnostics.runtime.ManagedRuntime;
 
+import org.apache.kato.common.EmptyQueryResult;
 import org.apache.kato.common.IViewMonitor;
+import org.apache.kato.common.ListBackedQueryResult;
 import org.apache.kato.hprof.HProfView;
 import org.apache.kato.hprof.java.JavaRuntimeImpl;
 
@@ -86,7 +90,7 @@
 	}
 
 	@Override
-	public List getLibraries() throws DataUnavailable,
+	public QueryResult<ImageModule> getLibraries() throws DataUnavailable,
 			CorruptDataException {
 		throw new DataUnavailable();
 	}
@@ -97,15 +101,15 @@
 	}
 
 	@Override
-	public List getRuntimes() {
+	public QueryResult<ManagedRuntime> getRuntimes() {
 		
 		if(javaRuntime==null) {
 			
 			javaRuntime=new JavaRuntimeImpl(this.view, imageImpl.getDefaultAddressSpace());
 		}
-		List list=new LinkedList();
+		List<ManagedRuntime> list=new LinkedList<ManagedRuntime>();
 		list.add(javaRuntime);
-		return list;
+		return new ListBackedQueryResult<ManagedRuntime>(list);
 	}
 
 	@Override
@@ -121,8 +125,8 @@
 	}
 
 	@Override
-	public List getThreads() {
+	public QueryResult<ImageThread> getThreads() {
 		// There will never be any native threads.
-		return new LinkedList();
+		return new EmptyQueryResult<ImageThread>();
 	}
 }
\ No newline at end of file

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/test/java/test/apache/kato/hprof/image/TestImageProcess.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/test/java/test/apache/kato/hprof/image/TestImageProcess.java?rev=828668&r1=828667&r2=828668&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/test/java/test/apache/kato/hprof/image/TestImageProcess.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/test/java/test/apache/kato/hprof/image/TestImageProcess.java
Thu Oct 22 12:17:52 2009
@@ -17,6 +17,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import javax.tools.diagnostics.QueryResult;
 import javax.tools.diagnostics.image.CorruptDataException;
 import javax.tools.diagnostics.image.DataUnavailable;
 import javax.tools.diagnostics.image.ImageAddressSpace;
@@ -127,9 +128,11 @@
 	public void testGetThreadsNotNull() throws Exception {
 		ImageProcess process = getCurrentProcess();
 		
-		List threads = process.getThreads();
+		QueryResult threads = process.getThreads();
 		
 		assertNotNull(threads);
+		threads.dispose();
+		
 	}
 	
 	public void testGetThreadsEmpty() throws Exception {

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java?rev=828668&r1=828667&r2=828668&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
Thu Oct 22 12:17:52 2009
@@ -82,7 +82,7 @@
 			}
 
 			@Override
-			public List getLibraries()
+			public QueryResult<ImageModule> getLibraries()
 					throws DataUnavailable,
 					CorruptDataException {
 				throw new DataUnavailable("no env");
@@ -95,7 +95,7 @@
 			}
 
 			@Override
-			public List getRuntimes() {
+			public QueryResult<ManagedRuntime> getRuntimes() {
 				if(runtimes==null) {
 					runtimes=new LinkedList<ManagedRuntime>();
 					try {
@@ -116,7 +116,7 @@
 						
 					}
 				}
-				return runtimes;
+				return new ListBackedQueryResult<ManagedRuntime>(runtimes);
 			}
 
 			@Override
@@ -134,7 +134,7 @@
 			}
 
 			@Override
-			public List getThreads() {
+			public QueryResult<ImageThread> getThreads() {
 				// TODO Auto-generated method stub
 				return null;
 			}

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AbstractDTFJTestcase.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AbstractDTFJTestcase.java?rev=828668&r1=828667&r2=828668&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AbstractDTFJTestcase.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AbstractDTFJTestcase.java
Thu Oct 22 12:17:52 2009
@@ -98,7 +98,7 @@
 		if(_module!=null)  return _module;
 		
 		ImageProcess proc = defaultImageProcess();
-		List it = null;
+		QueryResult<ImageModule> it = null;
 		
 		try {
 			it = proc.getLibraries();
@@ -111,8 +111,14 @@
 			//we have nothing to test so throw unimplemented so we know it isn't a real bug
 			throw new TestNotImplementedException();
 		}
+		try {
 		_module=(ImageModule) it.get(0);
+		it.dispose();
 		return _module;
+		} catch(IOException e) {
+			e.printStackTrace();
+		}
+		return null;
 	}
 
 	public ImageFactory getFactory() {

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageModuleTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageModuleTest.java?rev=828668&r1=828667&r2=828668&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageModuleTest.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageModuleTest.java
Thu Oct 22 12:17:52 2009
@@ -14,11 +14,15 @@
 package org.apache.kato.tests.junit;
 
 
+import java.io.IOException;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
 
+import javax.tools.diagnostics.QueryResult;
 import javax.tools.diagnostics.image.CorruptDataException;
+import javax.tools.diagnostics.image.ImageSection;
+import javax.tools.diagnostics.image.ImageSymbol;
 
 
 public class ImageModuleTest extends AbstractDTFJTestcase {
@@ -41,25 +45,30 @@
 	 * Test method for 'javax.tools.diagnostics.image.ImageModule.getSections()'
 	 * 
 	 * Ensures that the sections iterator is non-null and non-empty
+	 * @throws IOException 
 	 */
-	public void testGetSections() {
-		List it = defaultImageModule().getSections();
+	public void testGetSections() throws IOException {
+		QueryResult<ImageSection> it = defaultImageModule().getSections();
 		
 		assertNotNull(it);
 		assertFalse(it.isEmpty());
+		it.dispose();
 	}
 
 	/**
 	 * Test method for 'javax.tools.diagnostics.image.ImageModule.getSymbols()'
 	 * 
 	 * Ensures that symbols exist in the module
+	 * @throws IOException 
 	 * 
 	 */
-	public void testGetSymbols() {
-		List it = defaultImageModule().getSymbols();
+	public void testGetSymbols() throws IOException {
+		QueryResult<ImageSymbol> it = defaultImageModule().getSymbols();
 		
 		assertNotNull(it);
 		assertFalse(it.isEmpty());
+		
+		it.dispose();
 	}
 
 	/**

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tools.katoview/src/main/java/org/apache/kato/katoview/commands/helpers/KatoSearch.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tools.katoview/src/main/java/org/apache/kato/katoview/commands/helpers/KatoSearch.java?rev=828668&r1=828667&r2=828668&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tools.katoview/src/main/java/org/apache/kato/katoview/commands/helpers/KatoSearch.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tools.katoview/src/main/java/org/apache/kato/katoview/commands/helpers/KatoSearch.java
Thu Oct 22 12:17:52 2009
@@ -26,6 +26,7 @@
 import javax.tools.diagnostics.image.ImageAddressSpace;
 import javax.tools.diagnostics.image.ImageProcess;
 import javax.tools.diagnostics.image.DiagnosticException;
+import javax.tools.diagnostics.runtime.ManagedRuntime;
 import javax.tools.diagnostics.runtime.java.JVMClass;
 import javax.tools.diagnostics.runtime.java.JVMClassLoader;
 import javax.tools.diagnostics.runtime.java.JVMField;
@@ -67,7 +68,7 @@
 				
 				ImageProcess process = (ImageProcess) nextProcess;
 				
-				List runtimes = process.getRuntimes();
+				QueryResult<ManagedRuntime> runtimes = process.getRuntimes();
 				
 				for (Object nextRuntime : runtimes) {
 					
@@ -81,6 +82,12 @@
 						visitor.visit(runtime);
 					}
 				}
+				try {
+					runtimes.dispose();
+				} catch (IOException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
 			}
 			try {
 				processes.dispose();



Mime
View raw message