From kato-commits-return-694-apmail-incubator-kato-commits-archive=incubator.apache.org@incubator.apache.org Thu Oct 22 11:20:05 2009 Return-Path: Delivered-To: apmail-incubator-kato-commits-archive@minotaur.apache.org Received: (qmail 70423 invoked from network); 22 Oct 2009 11:20:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Oct 2009 11:20:05 -0000 Received: (qmail 87920 invoked by uid 500); 22 Oct 2009 11:20:05 -0000 Delivered-To: apmail-incubator-kato-commits-archive@incubator.apache.org Received: (qmail 87905 invoked by uid 500); 22 Oct 2009 11:20:05 -0000 Mailing-List: contact kato-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: kato-dev@incubator.apache.org Delivered-To: mailing list kato-commits@incubator.apache.org Received: (qmail 87890 invoked by uid 99); 22 Oct 2009 11:20:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2009 11:20:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2009 11:20:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 05A4323888CE; Thu, 22 Oct 2009 11:19:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r828657 - in /incubator/kato/branches/experimental/thirdview/org.apache.kato: kato.api/src/main/java/javax/tools/diagnostics/image/ kato.common/src/main/java/org/apache/kato/common/ kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ Date: Thu, 22 Oct 2009 11:19:40 -0000 To: kato-commits@incubator.apache.org From: spoole@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091022111941.05A4323888CE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: spoole Date: Thu Oct 22 11:19:40 2009 New Revision: 828657 URL: http://svn.apache.org/viewvc?rev=828657&view=rev Log: Updated ImageThread to deal with list to query conversion Added: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/EmptyQueryResult.java Modified: 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.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageStackFrameTest.java 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=828657&r1=828656&r2=828657&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 11:19:40 2009 @@ -16,6 +16,8 @@ import java.util.List; import java.util.Properties; +import javax.tools.diagnostics.QueryResult; + /** * A low-level thread instance */ @@ -44,7 +46,7 @@ * @see ImageStackFrame * */ - List getStackFrames() throws DataUnavailable; + QueryResult getStackFrames() throws DataUnavailable; /** * Get the set of image sections which make up the stack. Added: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/EmptyQueryResult.java URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/EmptyQueryResult.java?rev=828657&view=auto ============================================================================== --- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/EmptyQueryResult.java (added) +++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/EmptyQueryResult.java Thu Oct 22 11:19:40 2009 @@ -0,0 +1,90 @@ +/******************************************************************************* + * Licensed 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +package org.apache.kato.common; + +import java.io.IOException; +import java.util.Iterator; + +import javax.tools.diagnostics.QueryResult; + +/** + * + */ +public class EmptyQueryResult implements QueryResult { + + /* (non-Javadoc) + * @see javax.tools.diagnostics.QueryResult#dispose() + */ + @Override + public void dispose() throws IOException { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see javax.tools.diagnostics.QueryResult#get(long) + */ + @Override + public T get(long element) throws IOException, IndexOutOfBoundsException { + + throw new IndexOutOfBoundsException("element "+element+ " is out of bounds. result is empty"); + } + + /* (non-Javadoc) + * @see javax.tools.diagnostics.QueryResult#isEmpty() + */ + @Override + public boolean isEmpty() { + + return true; + } + + /* (non-Javadoc) + * @see javax.tools.diagnostics.QueryResult#size() + */ + @Override + public long size() throws IOException { + + return 0; + } + + /* (non-Javadoc) + * @see java.lang.Iterable#iterator() + */ + @Override + public Iterator iterator() { + + return new Iterator() { + + @Override + public boolean hasNext() { + + return false; + } + + @Override + public T next() { + + return null; + } + + @Override + public void remove() { + + + }}; + } + +} Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageStackFrameTest.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/ImageStackFrameTest.java?rev=828657&r1=828656&r2=828657&view=diff ============================================================================== --- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageStackFrameTest.java (original) +++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageStackFrameTest.java Thu Oct 22 11:19:40 2009 @@ -13,8 +13,10 @@ ******************************************************************************/ package org.apache.kato.tests.junit; +import java.io.IOException; import java.util.Iterator; +import javax.tools.diagnostics.QueryResult; import javax.tools.diagnostics.image.CorruptDataException; import javax.tools.diagnostics.image.DataUnavailable; import javax.tools.diagnostics.image.ImagePointer; @@ -37,10 +39,16 @@ ImageThread thread = (ImageThread) it.next(); try { if (thread.getStackFrames().isEmpty()==false) { - return (ImageStackFrame) thread.getStackFrames().get(0); + QueryResult frames=thread.getStackFrames(); + ImageStackFrame first=frames.get(0); + frames.dispose(); + return first; } } catch (DataUnavailable e1) { // Ignore + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } } // although this is accepted by the spec, it has no real meaning for the test so just choose to be unimplemented