/hg/icedtea6: 4 new changesets

mjw at icedtea.classpath.org mjw at icedtea.classpath.org
Mon Mar 26 14:45:56 PDT 2012


changeset 55b21736fe19 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=55b21736fe19
author: Jon VanAlten <jon.vanalten at redhat.com>
date: Fri Mar 23 14:11:00 2012 +0100

	Add tapset tests.

	        * Makefile.am:
	        Add target to run tapset tests.
	        * tapset/hotspot_jni.stp.in:
	        Add notes regarding required JVM option to Get<PrimitiveType>Field
	        family of probe aliases.
	        * test/tapset/ClassUnloadedProbeTester.java:
	        Part of test coverage for hotspot.stp and hotspot_jni.stp tapsets.
	        * test/tapset/JNIStapTest.c:
	        Likewise.
	        * test/tapset/JNITestClass.c:
	        Likewise.
	        * test/tapset/JNITestClass.h:
	        Likewise.
	        * test/tapset/JNITestClass.java:
	        Likewise.
	        * test/tapset/RunWrapper.java:
	        Likewise.
	        * test/tapset/StapJNIClassLoader.java:
	        Likewise.
	        * test/tapset/StapURLClassLoader.java:
	        Likewise.
	        * test/tapset/SystemtapTester.java:
	        Likewise.
	        * test/tapset/TestingRunner.java:
	        Likewise.
	        * test/tapset/jstaptest.pl:
	        Wrapper script, compiles and runs tests for tapsets.


changeset 393ad37b0c83 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=393ad37b0c83
author: Mark Wielaard <mark at klomp.org>
date: Fri Mar 23 22:39:35 2012 +0100

	Add jstack tests to test/tapset/jstaptest.pl.


changeset 5491f5a5175a in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=5491f5a5175a
author: Mark Wielaard <mark at klomp.org>
date: Mon Mar 26 22:07:22 2012 +0200

	jstaptest.pl: thread_start and stop thread id can be any positive number.

	tid was hard coded as being '8', but newer hotspot might start more
	than 7 background threads before the first user thread is started.
	So allow tid to be any positive number.


changeset e5b8981cf2ab in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=e5b8981cf2ab
author: Mark Wielaard <mark at klomp.org>
date: Mon Mar 26 23:45:05 2012 +0200

	Merge


diffstat:

 ChangeLog                                       |    70 +
 Makefile.am                                     |    33 +-
 NEWS                                            |     1 +
 acinclude.m4                                    |   149 +-
 configure.ac                                    |     2 +-
 patches/apache-xml-internal-fix-bug-38655.patch |    10 +
 patches/idresolver_fix.patch                    |   193 ++
 tapset/hotspot_jni.stp.in                       |    20 +-
 test/tapset/ClassUnloadedProbeTester.java       |    38 +
 test/tapset/JNIStapTest.c                       |  2107 +++++++++++++++++++++++
 test/tapset/JNITestClass.c                      |     7 +
 test/tapset/JNITestClass.h                      |    21 +
 test/tapset/JNITestClass.java                   |   121 +
 test/tapset/RunWrapper.java                     |    21 +
 test/tapset/StapJNIClassLoader.java             |    64 +
 test/tapset/StapURLClassLoader.java             |    24 +
 test/tapset/SystemtapTester.java                |   202 ++
 test/tapset/TestingRunner.java                  |    82 +
 test/tapset/jstaptest.pl                        |  1009 +++++++++++
 19 files changed, 4110 insertions(+), 64 deletions(-)

diffs (truncated from 4514 to 500 lines):

diff -r 2ec767396557 -r e5b8981cf2ab ChangeLog
--- a/ChangeLog	Tue Mar 20 13:48:29 2012 +0100
+++ b/ChangeLog	Mon Mar 26 23:45:05 2012 +0200
@@ -1,7 +1,77 @@
+2012-03-21  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* patches/apache-xml-internal-fix-bug-38655.patch:
+	Added patch which fixes the Apache XML security bug #38655
+	* Makefile.am: Updated
+
+2012-03-21  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	PR881: Sign tests (wsse.policy.basic) failures with OpenJDK6
+	* Makefile.am: Updated
+	* patches/idresolver_fix.patch: added patch for a class
+	IdResolver.
+
+2012-03-26  Mark Wielaard  <mjw at redhat.com>
+
+	* test/tapset/jstaptest.pl: thread_start and thread_stop thread id
+	can be any positive number.
+
+2012-03-23  Mark Wielaard  <mjw at redhat.com>
+
+	* test/tapset/jstaptest.pl: Add jstack tests.
+
+2012-03-23  Jon VanAlten  <jon.vanalten at redhat.com>
+
+	* Makefile.am:
+	Add target to run tapset tests.
+	* tapset/hotspot_jni.stp.in:
+	Add notes regarding required JVM option to Get<PrimitiveType>Field
+	family of probe aliases.
+	* test/tapset/ClassUnloadedProbeTester.java:
+	Part of test coverage for hotspot.stp and hotspot_jni.stp tapsets.
+	* test/tapset/JNIStapTest.c:
+	Likewise.
+	* test/tapset/JNITestClass.c:
+	Likewise.
+	* test/tapset/JNITestClass.h:
+	Likewise.
+	* test/tapset/JNITestClass.java:
+	Likewise.
+	* test/tapset/RunWrapper.java:
+	Likewise.
+	* test/tapset/StapJNIClassLoader.java:
+	Likewise.
+	* test/tapset/StapURLClassLoader.java:
+	Likewise.
+	* test/tapset/SystemtapTester.java:
+	Likewise.
+	* test/tapset/TestingRunner.java:
+	Likewise.
+	* test/tapset/jstaptest.pl:
+	Wrapper script, compiles and runs tests for tapsets.
+
 2012-03-20  Mark Wielaard  <mjw at redhat.com>
 
 	* Makefile.am (clean-jtreg): Depend on clean-jtreg-reports.
 
+2012-03-20  Andrew John Hughes  <ahughes at redhat.com>
+
+	* acinclude.m4:
+	(IT_FIND_COMPILER): Define only once and
+	rename from IT_FIND_JAVAC.
+	(IT_FIND_ECJ): Use same form as detection
+	for java, javah, jar and rmic.
+	(IT_FIND_JAVAC): Likewise.
+	(IT_CHECK_JAVA_AND_JAVAC_WORK): New macro to check
+	java and javac actually work together to compile code
+	before running other tests such as the dtdtype one.
+	(IT_CHECK_FOR_CLASS): Depend on java/javac working.
+	(IT_CHECK_IF_INSTANTIABLE): Likewise.
+	(IT_GETDTDTYPE_CHECK): Likewise.  Add -target 5.
+	(IT_JAVAH): Depend on java/javac working.
+	* configure.ac: Invoke IT_FIND_COMPILER rather than
+	IT_FIND_JAVAC.
+
 2012-03-19  Andrew John Hughes  <ahughes at redhat.com>
 
 	* acinclude.m4:
diff -r 2ec767396557 -r e5b8981cf2ab Makefile.am
--- a/Makefile.am	Tue Mar 20 13:48:29 2012 +0100
+++ b/Makefile.am	Mon Mar 26 23:45:05 2012 +0200
@@ -422,7 +422,9 @@
 	patches/openjdk/remove-mimpure-option-to-gcc.patch \
 	patches/ScriptEngineManager-doc.patch \
 	patches/openjdk/6883983-JarVerifier_removed_dependency_sun_security_pkcs.patch \
-	patches/openjdk/4465490-Suspicious_double-check_locking_idiom.patch
+	patches/openjdk/4465490-Suspicious_double-check_locking_idiom.patch \
+	patches/idresolver_fix.patch \
+	patches/apache-xml-internal-fix-bug-38655.patch
 
 if WITH_RHINO
 ICEDTEA_PATCHES += \
@@ -654,9 +656,16 @@
 
 all-local: icedtea-against-icedtea
 
-check-local: jtregcheck
+check-local: jtregcheck check-tapset
 
-clean-local: clean-jtreg clean-jtreg-reports $(PULSE_JAVA_CLEAN_TARGET) \
+clean-tests: clean-jtreg clean-tapset-report
+	if [ $(abs_top_srcdir) != $(abs_top_builddir) ] ; then \
+	  if [ -e test ] ; then \
+	    rmdir test ; \
+	  fi \
+	fi
+
+clean-local: clean-tests $(PULSE_JAVA_CLEAN_TARGET) \
  clean-icedtea clean-icedtea-debug clean-icedtea-ecj clean-extract clean-ports \
  clean-overlay clean-native-ecj clean-icedtea-against-icedtea clean-icedtea-debug-against-icedtea \
  clean-icedtea-against-ecj clean-extract-ecj clean-generated clean-replace-hotspot \
@@ -700,7 +709,7 @@
 	clean-add-pulseaudio clean-add-pulseaudio-debug clean-add-nss clean-add-nss-debug \
 	clean-add-tzdata-support clean-add-tzdata-support-debug clean-add-systemtap-ecj \
 	clean-add-pulseaudio-ecj clean-add-nss-ecj clean-add-tzdata-support-ecj clean-fonts \
-	clean-download-hotspot jtregcheck
+	clean-download-hotspot clean-tests clean-tapset-report jtregcheck
 
 env:
 	@echo 'unset JAVA_HOME'
@@ -2163,9 +2172,6 @@
 	  rmdir test/jtreg ; \
 	fi
 	rm -f test/jtreg.jar
-	if [ -e test ] ; then \
-	  rmdir test ; \
-	fi
 	rm -f stamps/jtreg.stamp
 
 check-hotspot: stamps/jtreg.stamp
@@ -2246,6 +2252,19 @@
 	  $(jtreg_processes); \
 	fi
 
+check-tapset: 
+if ENABLE_SYSTEMTAP
+	$(abs_top_srcdir)/test/tapset/jstaptest.pl \
+	  -B $(BUILD_OUTPUT_DIR) -A $(BUILD_ARCH_DIR) \
+	  -S $(abs_top_srcdir)/test/tapset \
+	  -o test/check-stap.log
+endif
+
+clean-tapset-report:
+if ENABLE_SYSTEMTAP
+	rm -f test/check-stap.log
+endif
+
 # Support classes for non-OpenJDK bootstraps
 
 # rt.jar additional class files.
diff -r 2ec767396557 -r e5b8981cf2ab NEWS
--- a/NEWS	Tue Mar 20 13:48:29 2012 +0100
+++ b/NEWS	Mon Mar 26 23:45:05 2012 +0200
@@ -15,6 +15,7 @@
 * Bug fixes
   - PR865: Patching fails with patches/ecj/jaxws-getdtdtype.patch
   - PR886: 6-1.11.1 fails to build CACAO on ppc
+  - PR881: Sign tests (wsse.policy.basic) failures with OpenJDK6
 * Backports
   - S6706974: Add krb5 test infrastructure
   - S6764553: com.sun.org.apache.xml.internal.security.utils.IdResolver is not thread safe
diff -r 2ec767396557 -r e5b8981cf2ab acinclude.m4
--- a/acinclude.m4	Tue Mar 20 13:48:29 2012 +0100
+++ b/acinclude.m4	Mon Mar 26 23:45:05 2012 +0200
@@ -129,49 +129,46 @@
   AC_SUBST(OS_PATH)
 ])
 
-AC_DEFUN([IT_FIND_JAVAC],
+AC_DEFUN_ONCE([IT_FIND_COMPILER],
 [
-  JAVAC=${SYSTEM_JDK_DIR}/bin/javac
   IT_FIND_JAVAC
   IT_FIND_ECJ
 
-  AC_SUBST(JAVAC)
-])
-
-AC_DEFUN([IT_FIND_ECJ],
-[
-  AC_ARG_WITH([ecj],
-	      [AS_HELP_STRING(--with-ecj,bytecode compilation with ecj)],
-  [
-    if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
-      IT_CHECK_ECJ(${withval})
-    else
-      if test "x${withval}" != xno; then
-        IT_CHECK_ECJ
-      fi
-    fi
-  ],
-  [ 
-    IT_CHECK_ECJ
-  ])
   if test "x${JAVAC}" = "x"; then
     if test "x{ECJ}" != "x"; then
       JAVAC="${ECJ} -nowarn"
     fi
   fi
+  AC_SUBST(ECJ)
+  AC_SUBST(JAVAC)
 ])
 
-AC_DEFUN([IT_CHECK_ECJ],
+AC_DEFUN_ONCE([IT_FIND_ECJ],
 [
-  if test "x$1" != x; then
-    if test -f "$1"; then
-      AC_MSG_CHECKING(for ecj)
-      ECJ="$1"
-      AC_MSG_RESULT(${ECJ})
+  ECJ_DEFAULT=/usr/bin/ecj
+  AC_MSG_CHECKING([if an ecj binary was specified])
+  AC_ARG_WITH([ecj],
+	      [AS_HELP_STRING(--with-ecj,bytecode compilation with ecj)],
+  [
+    if test "x${withval}" = "xyes"; then
+      ECJ=no
     else
-      AC_PATH_PROG(ECJ, "$1")
+      ECJ="${withval}"
     fi
+  ],
+  [ 
+    ECJ=no
+  ])
+  AC_MSG_RESULT(${ECJ})
+  if test "x${ECJ}" = "xno"; then
+    ECJ=${ECJ_DEFAULT}
+  fi
+  AC_MSG_CHECKING([if $ECJ is a valid executable file])
+  if test -x "${ECJ}" && test -f "${ECJ}"; then
+    AC_MSG_RESULT([yes])
   else
+    AC_MSG_RESULT([no])
+    ECJ=""
     AC_PATH_PROG(ECJ, "ecj")
     if test -z "${ECJ}"; then
       AC_PATH_PROG(ECJ, "ecj-3.1")
@@ -182,43 +179,45 @@
     if test -z "${ECJ}"; then
       AC_PATH_PROG(ECJ, "ecj-3.3")
     fi
+    if test -z "${ECJ}"; then
+      AC_PATH_PROG(ECJ, "ecj-3.4")
+    fi
   fi
 ])
 
-AC_DEFUN([IT_FIND_JAVAC],
+AC_DEFUN_ONCE([IT_FIND_JAVAC],
 [
+  JAVAC_DEFAULT=${SYSTEM_JDK_DIR}/bin/javac
+  AC_MSG_CHECKING([if a javac binary was specified])
   AC_ARG_WITH([javac],
 	      [AS_HELP_STRING(--with-javac,bytecode compilation with javac)],
   [
-    if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
-      IT_CHECK_JAVAC(${withval})
+    if test "x${withval}" = "xyes"; then
+      JAVAC=no
     else
-      if test "x${withval}" != xno; then
-        IT_CHECK_JAVAC
-      fi
+      JAVAC="${withval}"
     fi
   ],
-  [ 
-    IT_CHECK_JAVAC
+  [
+    JAVAC=no
+  ])
+  AC_MSG_RESULT(${JAVAC})
+  if test "x${JAVAC}" = "xno"; then
+    JAVAC=${JAVAC_DEFAULT}
+  fi
+  AC_MSG_CHECKING([if $JAVAC is a valid executable file])
+  if test -x "${JAVAC}" && test -f "${JAVAC}"; then
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_RESULT([no])
+    JAVAC=""
+    AC_PATH_PROG(JAVAC, "javac")
+  fi
+  AC_SUBST(JAVAC)
   ])
 ])
 
-AC_DEFUN([IT_CHECK_JAVAC],
-[
-  if test "x$1" != x; then
-    if test -f "$1"; then
-      AC_MSG_CHECKING(for javac)
-      JAVAC="$1"
-      AC_MSG_RESULT(${JAVAC})
-    else
-      AC_PATH_PROG(JAVAC, "$1")
-    fi
-  else
-    AC_PATH_PROG(JAVAC, "javac")
-  fi
-])
-
-AC_DEFUN([IT_FIND_JAVA],
+AC_DEFUN_ONCE([IT_FIND_JAVA],
 [
   JAVA_DEFAULT=${SYSTEM_JDK_DIR}/bin/java
   AC_MSG_CHECKING([if a java binary was specified])
@@ -1241,6 +1240,44 @@
 fi
 ])
 
+dnl check that javac and java work
+AC_DEFUN_ONCE([IT_CHECK_JAVA_AND_JAVAC_WORK],[
+  AC_REQUIRE([IT_FIND_JAVA])
+  AC_REQUIRE([IT_FIND_COMPILER])
+  AC_CACHE_CHECK([if the VM and compiler work together], it_cv_jdk_works, [
+  CLASS=Test.java
+  BYTECODE=$(echo $CLASS|sed 's#\.java##')
+  mkdir tmp.$$
+  cd tmp.$$
+  cat << \EOF > $CLASS
+[/* [#]line __oline__ "configure" */
+
+public class Test
+{
+    public static void main(String[] args)
+    {
+      System.out.println("Hello World!");
+    }
+}]
+EOF
+  if $JAVAC -cp . $JAVACFLAGS -source 5 -target 5 $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then
+    if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then
+      it_cv_jdk_works=yes;
+    else
+      it_cv_jdk_works=no;
+      AC_MSG_ERROR([VM failed to run compiled class.])
+    fi
+  else
+    it_cv_jdk_works=no;
+    AC_MSG_ERROR([Compiler failed to compile Java code.])
+  fi
+  rm -f $CLASS *.class
+  cd ..
+  rmdir tmp.$$
+  ])
+AC_PROVIDE([$0])dnl
+])
+
 dnl Generic macro to check for a Java class
 dnl Takes two arguments: the name of the macro
 dnl and the name of the class.  The macro name
@@ -1248,6 +1285,7 @@
 dnl replaced by '_' and all letters capitalised.
 dnl e.g. IT_CHECK_FOR_CLASS([JAVA_UTIL_SCANNER],[java.util.Scanner])
 AC_DEFUN([IT_CHECK_FOR_CLASS],[
+AC_REQUIRE([IT_CHECK_JAVA_AND_JAVAC_WORK])
 AC_CACHE_CHECK([if $2 is missing], it_cv_$1, [
 CLASS=Test.java
 BYTECODE=$(echo $CLASS|sed 's#\.java##')
@@ -1291,6 +1329,7 @@
 dnl e.g. IT_CHECK_FOR_INSTANTIABLE_CLASS([JAVA_LANG_INTEGER],
 dnl        [java.lang.Integer],[0],[./bin])
 AC_DEFUN([IT_CHECK_IF_INSTANTIABLE],[
+AC_REQUIRE([IT_CHECK_JAVA_AND_JAVAC_WORK])
 AC_CACHE_CHECK([if $2 is instantiable], it_cv_$1, [
 CLASS=Test.java
 BYTECODE=$(echo $CLASS|sed 's#\.java##')
@@ -1350,7 +1389,8 @@
   AC_PROVIDE([$0])dnl
 ])
 
-AC_DEFUN([IT_GETDTDTYPE_CHECK],[
+AC_DEFUN_ONCE([IT_GETDTDTYPE_CHECK],[
+  AC_REQUIRE([IT_CHECK_JAVA_AND_JAVAC_WORK])
   AC_CACHE_CHECK([if javax.xml.stream.events.Attribute.getDTDType() wrongly returns a QName], it_cv_dtdtype, [
   CLASS=Test.java
   BYTECODE=$(echo $CLASS|sed 's#\.java##')
@@ -1407,7 +1447,7 @@
     }
 }]
 EOF
-  if $JAVAC -cp . $JAVACFLAGS -source 5 $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then
+  if $JAVAC -cp . $JAVACFLAGS -source 5 -target 5 $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then
     if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then
       it_cv_dtdtype=no;
     else
@@ -1672,6 +1712,7 @@
 ])
 
 AC_DEFUN([IT_JAVAH],[
+AC_REQUIRE([IT_CHECK_JAVA_AND_JAVAC_WORK])
 AC_CACHE_CHECK([if $JAVAH exhibits Classpath bug 39408], it_cv_cp39408_javah, [
 SUPERCLASS=Test.java
 SUBCLASS=TestImpl.java
diff -r 2ec767396557 -r e5b8981cf2ab configure.ac
--- a/configure.ac	Tue Mar 20 13:48:29 2012 +0100
+++ b/configure.ac	Mon Mar 26 23:45:05 2012 +0200
@@ -144,7 +144,7 @@
 IT_CHECK_IF_BOOTSTRAPPING
 IT_CHECK_FOR_JDK
 IT_FIND_JAVA
-IT_FIND_JAVAC
+IT_FIND_COMPILER
 IT_FIND_JAVAH
 IT_FIND_JAR
 IT_FIND_RMIC
diff -r 2ec767396557 -r e5b8981cf2ab patches/apache-xml-internal-fix-bug-38655.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/apache-xml-internal-fix-bug-38655.patch	Mon Mar 26 23:45:05 2012 +0200
@@ -0,0 +1,11 @@
+diff -u -r /jck/apache-xml/icedtea6/openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java security/c14n/implementations/NameSpaceSymbTable.java
+--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java	2011-11-14 23:11:46.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java	2012-03-16 17:52:37.000000000 +0100
+@@ -370,6 +370,7 @@
+         if (cur == null || (cur.equals( obj))) {
+                         return index;
+         }
++        length=length-1;
+         do {
+                         index=index==length? 0:++index;
+                         cur = set[index];
diff -r 2ec767396557 -r e5b8981cf2ab patches/idresolver_fix.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/idresolver_fix.patch	Mon Mar 26 23:45:05 2012 +0200
@@ -0,0 +1,194 @@
+--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/IdResolver.java	2012-03-20 20:29:30.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/IdResolver.java	2012-03-20 22:18:41.094309861 +0100
+@@ -26,6 +26,7 @@
+ import org.w3c.dom.Attr;
+ import org.w3c.dom.Document;
+ import org.w3c.dom.Element;
++import org.w3c.dom.NamedNodeMap;
+ import org.w3c.dom.Node;
+ 
+ import java.util.Arrays;
+@@ -175,69 +176,124 @@
+        return null;
+    }
+ 
++    private static java.util.List names;
++    private static int namesLength;
++    static {
++        String namespaces[]={
++            Constants.SignatureSpecNS,
++            EncryptionConstants.EncryptionSpecNS,
++            "http://schemas.xmlsoap.org/soap/security/2000-12",
++            "http://www.w3.org/2002/03/xkms#",
++            "urn:oasis:names:tc:SAML:1.0:assertion",
++            "urn:oasis:names:tc:SAML:1.0:protocol"
++        };
++        names = Arrays.asList(namespaces);
++        namesLength = names.size();
++    }
+ 
+-   static java.util.List names;
+-   static {
+-           String namespaces[]={ Constants.SignatureSpecNS,
+-                           EncryptionConstants.EncryptionSpecNS,
+-                           "http://schemas.xmlsoap.org/soap/security/2000-12",
+-                           "http://www.w3.org/2002/03/xkms#"
+-                   };
+-           names=Arrays.asList(namespaces);
+-   }
+ 
++    private static Element getElementBySearching(Node root,String id) {
++            Element []els=new Element[namesLength + 1];
++            getEl(root,id,els);
++            for (int i=0;i<els.length;i++) {
++                    if (els[i]!=null) {
++                            return els[i];
++                    }
++            }
++            return null;
++    }
+ 
+-   private static Element getElementBySearching(Node root,String id) {
+-           Element []els=new Element[5];
+-           getElementBySearching(root,id,els);
+-           for (int i=0;i<els.length;i++) {
+-                   if (els[i]!=null) {
+-                           return els[i];
+-                   }
+-           }
+-           return null;
++    private static int getEl(Node currentNode,String id,Element []els) {
++        Node sibling=null;
++        Node parentNode=null;
++        do {
++                switch (currentNode.getNodeType()) {
++                case Node.DOCUMENT_FRAGMENT_NODE :
++                case Node.DOCUMENT_NODE :
++                        sibling= currentNode.getFirstChild();
++                        break;
++



More information about the distro-pkg-dev mailing list