You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by mc...@apache.org on 2008/08/20 20:14:59 UTC
svn commit: r687404 - in /db/jdo/trunk/tck2/src: conf/jdo-2_2-signatures.txt
java/org/apache/jdo/tck/util/signature/SignatureVerifier.java
Author: mcaisse
Date: Wed Aug 20 11:14:58 2008
New Revision: 687404
URL: http://svn.apache.org/viewvc?rev=687404&view=rev
Log:
JDO-583 Add license header to jdo-2_2-signatures.txt, parse comments out in SignatureVerifier.java
Modified:
db/jdo/trunk/tck2/src/conf/jdo-2_2-signatures.txt
db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/util/signature/SignatureVerifier.java
Modified: db/jdo/trunk/tck2/src/conf/jdo-2_2-signatures.txt
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/jdo-2_2-signatures.txt?rev=687404&r1=687403&r2=687404&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/conf/jdo-2_2-signatures.txt (original)
+++ db/jdo/trunk/tck2/src/conf/jdo-2_2-signatures.txt Wed Aug 20 11:14:58 2008
@@ -1,3 +1,20 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
public interface javax.jdo.Constants {
static String SERVICE_LOOKUP_PMF_RESOURCE_NAME
= "META-INF/services/javax.jdo.PersistenceManagerFactory";
@@ -13,6 +30,7 @@
= "http://java.sun.com/xml/ns/jdo/jdoquery";
static String ELEMENT_PERSISTENCE_MANAGER_FACTORY
= "persistence-manager-factory";
+ //fooo3 fooo foo
static String PMF_ATTRIBUTE_CLASS
= "class";
static String PMF_ATTRIBUTE_NAME
Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/util/signature/SignatureVerifier.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/util/signature/SignatureVerifier.java?rev=687404&r1=687403&r2=687404&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/util/signature/SignatureVerifier.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/util/signature/SignatureVerifier.java Wed Aug 20 11:14:58 2008
@@ -830,24 +830,73 @@
}
/**
- * Skips any "white space" and returns whether there are more
+ * Skips any "white space" and /* style comments
+ * and returns whether there are more
* characters to be parsed.
*/
protected boolean skip() throws IOException {
- char c;
- do {
- ir.mark(1);
- int i;
- if ((i = ir.read()) < 0) {
+ Character c;
+ Character cnext;
+ // Permitted states are white, commentSlashStar, commentSlashSlash
+ String state = "white";
+ final Character SLASH = '/';
+ final Character STAR = '*';
+ while (true) {
+ c = peek();
+ if (c == null)
return false;
- }
- c = (char)i;
- } while (Character.isWhitespace(c));
+ if (state.equals("commentSlashStar") && STAR.equals(c)) {
+ cnext = peek();
+ if (cnext == null)
+ return false;
+ if (SLASH.equals(cnext)) {
+ state = "white";
+ }
+ continue;
+ }
+ if (state.equals("white")) {
+ if (SLASH.equals(c)) {
+ cnext = peek();
+ if (cnext == null)
+ return false;
+ if (STAR.equals(cnext)) {
+ state = "commentSlashStar";
+ continue;
+ }
+ if (SLASH.equals(cnext)) {
+ state = "commentSlashSlash";
+ continue;
+ }
+ }
+ if (!Character.isWhitespace(c)) {
+ break;
+ }
+ }
+ if (state.equals("commentSlashSlash")
+ && (c == Character.LINE_SEPARATOR
+ || c == '\n'
+ || c == '\r')) {
+ state = "white";
+ continue;
+ }
+ }
ir.reset();
return true;
}
/**
+ * Returns next char, or null if there is none
+ */
+ protected Character peek() throws IOException {
+ ir.mark(1);
+ int i;
+ if ((i = ir.read()) < 0) {
+ return null;
+ }
+ return Character.valueOf((char)i);
+ }
+
+ /**
* Scans for an (unqualified) identifier.
* @return <code>null</code> if the next token is not an identifier
*/