From martinrb at google.com Mon Sep 1 01:24:16 2008 From: martinrb at google.com (Martin Buchholz) Date: Mon, 1 Sep 2008 01:24:16 -0700 Subject: [patch] Support New NIO in IcedTea In-Reply-To: <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> References: <20080831004043.GA19370@bamboo.destinee.acro.gen.nz> <1220193693.3524.24.camel@hermans.wildebeest.org> <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> Message-ID: <1ccfd1c10809010124s6694bfa5t379d1dfe9998b3ec@mail.gmail.com> On Sun, Aug 31, 2008 at 23:49, C. K. Jester-Young wrote: > (This process is a notorious PITA; I've had to write a fakeuname.so > to ``convince'' the build tools that I'm building on a 32-bit machine, > because some of the scripts don't respect the --build option that I > sent to configure.) Do you know about the linux32(1) command? Martin From mjw at icedtea.classpath.org Mon Sep 1 02:17:36 2008 From: mjw at icedtea.classpath.org (mjw at icedtea.classpath.org) Date: Mon, 01 Sep 2008 09:17:36 +0000 Subject: changeset in /hg/icedtea: Add autogen.sh file from icedtea6. Message-ID: changeset a33a69c34a6a in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=a33a69c34a6a description: Add autogen.sh file from icedtea6. diffstat: 2 files changed, 130 insertions(+) ChangeLog | 4 + autogen.sh | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diffs (141 lines): diff -r 0c5720b9671b -r a33a69c34a6a ChangeLog --- a/ChangeLog Sun Aug 31 20:57:09 2008 +0100 +++ b/ChangeLog Mon Sep 01 09:17:29 2008 +0000 @@ -1,3 +1,7 @@ 2008-08-31 Andrew John Hughes + + * autogen.sh: New file from icedtea6. + 2008-08-31 Andrew John Hughes * Makefile.am: diff -r 0c5720b9671b -r a33a69c34a6a autogen.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autogen.sh Mon Sep 01 09:17:29 2008 +0000 @@ -0,0 +1,126 @@ +#!/bin/sh + +# Test for autoconf commands. + +# Test for autoconf. + +HAVE_AUTOCONF=false + +for AUTOCONF in autoconf autoconf259; do + if ${AUTOCONF} --version > /dev/null 2>&1; then + AUTOCONF_VERSION=`${AUTOCONF} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` +# echo ${AUTOCONF_VERSION} + case ${AUTOCONF_VERSION} in + 2.59* | 2.6[0-9]* ) + HAVE_AUTOCONF=true + break; + ;; + esac + fi +done + +# Test for autoheader. + +HAVE_AUTOHEADER=false + +for AUTOHEADER in autoheader autoheader259; do + if ${AUTOHEADER} --version > /dev/null 2>&1; then + AUTOHEADER_VERSION=`${AUTOHEADER} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` +# echo ${AUTOHEADER_VERSION} + case ${AUTOHEADER_VERSION} in + 2.59* | 2.6[0-9]* ) + HAVE_AUTOHEADER=true + break; + ;; + esac + fi +done + +# Test for autoreconf. + +HAVE_AUTORECONF=false + +for AUTORECONF in autoreconf; do + if ${AUTORECONF} --version > /dev/null 2>&1; then + AUTORECONF_VERSION=`${AUTORECONF} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` +# echo ${AUTORECONF_VERSION} + case ${AUTORECONF_VERSION} in + 2.59* | 2.6[0-9]* ) + HAVE_AUTORECONF=true + break; + ;; + esac + fi +done + +if test ${HAVE_AUTOCONF} = false; then + echo "No proper autoconf was found." + echo "You must have autoconf 2.59 or later installed." + exit 1 +fi + +if test ${HAVE_AUTOHEADER} = false; then + echo "No proper autoheader was found." + echo "You must have autoconf 2.59 or later installed." + exit 1 +fi + +if test ${HAVE_AUTORECONF} = false; then + echo "No proper autoreconf was found." + echo "You must have autoconf 2.59 or later installed." + exit 1 +fi + + +# Test for automake commands. + +# Test for aclocal. + +HAVE_ACLOCAL=false + +for ACLOCAL in aclocal aclocal-1.10; do + if ${ACLOCAL} --version > /dev/null 2>&1; then + ACLOCAL_VERSION=`${ACLOCAL} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` +# echo ${ACLOCAL_VERSION} + case ${ACLOCAL_VERSION} in + 1.1[0-9]* ) + HAVE_ACLOCAL=true + break; + ;; + esac + fi +done + +# Test for automake. + +HAVE_AUTOMAKE=false + +for AUTOMAKE in automake automake-1.10; do + if ${AUTOMAKE} --version > /dev/null 2>&1; then + AUTOMAKE_VERSION=`${AUTOMAKE} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` +# echo ${AUTOMAKE_VERSION} + case ${AUTOMAKE_VERSION} in + 1.1[0-9]* ) + HAVE_AUTOMAKE=true + break; + ;; + esac + fi +done + +if test ${HAVE_ACLOCAL} = false; then + echo "No proper aclocal was found." + echo "You must have automake 1.10 or later installed." + exit 1 +fi + +if test ${HAVE_AUTOMAKE} = false; then + echo "No proper automake was found." + echo "You must have automake 1.10 or later installed." + exit 1 +fi + + +export ACLOCAL AUTOCONF AUTOHEADER AUTOMAKE + +${AUTORECONF} --force --install From mark at klomp.org Mon Sep 1 02:45:40 2008 From: mark at klomp.org (Mark Wielaard) Date: Mon, 01 Sep 2008 11:45:40 +0200 Subject: commit messages (Was: Support BSD and Caciocavallo) In-Reply-To: <17c6771e0808311301x7c7281a5od6ae9a8cbc35084a@mail.gmail.com> References: <17c6771e0808291839y2a26b031pd4cb226c8facb51c@mail.gmail.com> <1220193060.3524.12.camel@hermans.wildebeest.org> <17c6771e0808311301x7c7281a5od6ae9a8cbc35084a@mail.gmail.com> Message-ID: <1220262340.3762.3.camel@hermans.wildebeest.org> On Sun, 2008-08-31 at 21:01 +0100, Andrew John Hughes wrote: > On 31/08/2008, Mark Wielaard wrote: > > You managed to push this without generating a commit message. I cannot > > figure out why that is. Do you have any idea how you got this commit in > > "under the hgext.notify radar"? > Something is broken: > > remote: added 1 changesets with 2 changes to 2 files > remote: error: incoming.notify hook raised an exception: cannot > concatenate 'str' and 'NoneType' objects > > But at least it means merges are quiet ;) Yeah... But this is slightly worrying. I can replicate it when pushing remotely, but only with the icedtea6 repo, not with for example the testrepo (when enabling mail notifications on that one). And when pushing locally I don't get any errors which makes debugging this issue somewhat difficult. The only hint from a quick search was not having diffstat installed (server has hg 0.9.3 installed). But that isn't it because diffstat is, and always was, installed. hmmm, Mark From cky944 at gmail.com Mon Sep 1 05:00:21 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Tue, 2 Sep 2008 00:00:21 +1200 Subject: [patch] Support New NIO in IcedTea In-Reply-To: <1ccfd1c10809010124s6694bfa5t379d1dfe9998b3ec@mail.gmail.com> References: <20080831004043.GA19370@bamboo.destinee.acro.gen.nz> <1220193693.3524.24.camel@hermans.wildebeest.org> <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> <1ccfd1c10809010124s6694bfa5t379d1dfe9998b3ec@mail.gmail.com> Message-ID: <20080901120021.GD19370@bamboo.destinee.acro.gen.nz> On Mon, Sep 01, 2008 at 01:24:16AM -0700, Martin Buchholz wrote: > Do you know about the linux32(1) command? Nope; thanks for that! It's nice to know a non-sucky way to fake a different system type, using ``personalities'' rather than overriding uname. The upside is that this approach works for statically-linked programs too. :-) Thanks again, ---Chris K. From gnu_andrew at member.fsf.org Mon Sep 1 07:11:28 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 1 Sep 2008 15:11:28 +0100 Subject: Support BSD and Caciocavallo In-Reply-To: <20080901055058.GB19370@bamboo.destinee.acro.gen.nz> References: <17c6771e0808291839y2a26b031pd4cb226c8facb51c@mail.gmail.com> <1220193060.3524.12.camel@hermans.wildebeest.org> <17c6771e0808311301x7c7281a5od6ae9a8cbc35084a@mail.gmail.com> <20080901055058.GB19370@bamboo.destinee.acro.gen.nz> Message-ID: <17c6771e0809010711g64eb9384u89548ad220a8f643@mail.gmail.com> On 01/09/2008, C. K. Jester-Young wrote: > Hi Andrew, > > > On Sun, Aug 31, 2008 at 09:01:56PM +0100, Andrew John Hughes wrote: > > 2008-08-31 Andrew John Hughes > > > > * Makefile.am: > > Make enabling hg-only projects sufficient for > > downloading from hg. > > > > This does mean I had to separate out the hg forest check so it wasn't > > duplicated. > > > I like the idea of the fix, though I think the way it's implemented > doesn't do what's intended, and is additionally a maintenance hassle > whenever new Mercurial repositories are added. > > Looking at the forest test, it only applies if !OPENJDK_SRC_DIR_FOUND > && !USE_ALT_OPENJDK_SRC_ZIP && USE_HG && USE_CLOSURES && USE_CVMI && > USE_CACIOCAVALLO && USE_BSD. In other words, this test will never be > invoked. > > I propose an alternative patch, that simply turns --enable-hg on if > --with-project != jdk7. The main caveat is now that the --with-project > stuff must appear before the --enable-hg. But other than that, I think > that this is more robust and easier to maintain, and I hope it works > for you too. :-) > > Many thanks, > ---Chris K. > > This does simplify it quite a bit. Applying with the following addition from myself: 2008-09-01 Andrew John Hughes * Makefile.am: Simply hgforest rule and add corresponding clean rule. 2008-09-01 C. K. Jester-Young * acinclude.m4: Enable hg by default unless building jdk7. * configure.ac: Do project check before hg check. -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: implicit_enable_hg.diff Url: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080901/3f0da90e/implicit_enable_hg.diff From gnu_andrew at member.fsf.org Mon Sep 1 07:24:08 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 1 Sep 2008 15:24:08 +0100 Subject: IcedTea6 merged to IcedTea Message-ID: <17c6771e0809010724h212a1c50u206e48f8aded26f7@mail.gmail.com> ChangeLog is as follows: 2008-08-31 Andrew John Hughes Merge from IcedTea6. * config.guess, * config.sub, * install-sh, * patches/icedtea-arm-uname.patch: Removed. * .hgignore, * ChangeLog, * HACKING, * IcedTeaPlugin.cc, * Makefile.am, * README, * acinclude.m4: Merged. * autogen.sh: Added. * configure.ac: Merged. * generated/sun/misc/Version.java, * generated/sun/tools/jconsole/Version.java: Merged and updated for 1.7. * jconsole.desktop, * patches/icedtea-alpha-fixes.patch, * patches/icedtea-alt-jar.patch: Merged. * patches/icedtea-arch.patch: Merged and recreated against jdk7. * patches/icedtea-cacao.patch, * patches/icedtea-clean-crypto.patch, * patches/icedtea-enum-bug-181.patch, * patches/icedtea-hotspot-6b11-7b24.patch: Merged. * patches/icedtea-hotspot-citypeflow.patch: Merged and regenerated against jdk7. * patches/icedtea-hotspot-gcc-pr36917.patch: Merged. * patches/icedtea-hotspot-params-cast-size_t.patch: Merged and regenerated against jdk7. * patches/icedtea-hotspot-use-idx_t.patch, * patches/icedtea-jdk-use-ssize_t.patch, * patches/icedtea-liveconnect.patch, * patches/icedtea-shark.patch, * patches/icedtea-signed-types-hot6.patch: Merged. * patches/icedtea-signed-types.patch: Merged and applied to standard build for JDK7 HotSpot. * patches/icedtea-text-relocations.patch: Merged and regenerated against jdk7. * patches/icedtea-uname.patch: Merged. * patches/icedtea-zero-build.patch: Merged and regenerated against jdk7. * patches/icedtea-zero.patch, * policytool.desktop, * ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp, * ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp, * ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp, * ports/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp, * ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp, * ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp, * ports/hotspot/src/cpu/zero/vm/entry_zero.hpp, * ports/hotspot/src/cpu/zero/vm/frame_zero.cpp, * ports/hotspot/src/cpu/zero/vm/frame_zero.hpp, * ports/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp, * ports/hotspot/src/cpu/zero/vm/interpreter_zero.cpp, * ports/hotspot/src/cpu/zero/vm/interpreter_zero.hpp, * ports/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp, * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp, * ports/hotspot/src/cpu/zero/vm/stack_zero.hpp, * ports/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp, * ports/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp, * ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp, * ports/hotspot/src/share/vm/includeDB_shark, * ports/hotspot/src/share/vm/shark/llvmHeaders.hpp, * ports/hotspot/src/share/vm/shark/sharkBlock.cpp, * ports/hotspot/src/share/vm/shark/sharkBlock.hpp, * ports/hotspot/src/share/vm/shark/sharkBuilder.cpp, * ports/hotspot/src/share/vm/shark/sharkBuilder.hpp, * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp, * ports/hotspot/src/share/vm/shark/sharkCompiler.hpp, * ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp, * ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp, * ports/hotspot/src/share/vm/shark/sharkEntry.cpp, * ports/hotspot/src/share/vm/shark/sharkEntry.hpp, * ports/hotspot/src/share/vm/shark/sharkFunction.cpp, * ports/hotspot/src/share/vm/shark/sharkFunction.hpp, * ports/hotspot/src/share/vm/shark/sharkMonitor.cpp, * ports/hotspot/src/share/vm/shark/sharkMonitor.hpp, * ports/hotspot/src/share/vm/shark/sharkRuntime.cpp, * ports/hotspot/src/share/vm/shark/sharkRuntime.hpp, * ports/hotspot/src/share/vm/shark/sharkState.cpp, * ports/hotspot/src/share/vm/shark/sharkState.hpp, * ports/hotspot/src/share/vm/shark/sharkType.cpp, * ports/hotspot/src/share/vm/shark/sharkType.hpp, * ports/hotspot/src/share/vm/shark/sharkValue.hpp, * ports/hotspot/src/share/vm/shark/shark_globals.hpp: Merged. The patch is 464k bzipped so I'm not posting that, but you're welcome to a copy if you want one. hg diff would be much quicker though ;) -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From gnu_andrew at member.fsf.org Mon Sep 1 10:16:43 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 1 Sep 2008 18:16:43 +0100 Subject: [patch] Support New NIO in IcedTea In-Reply-To: <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> References: <20080831004043.GA19370@bamboo.destinee.acro.gen.nz> <1220193693.3524.24.camel@hermans.wildebeest.org> <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> Message-ID: <17c6771e0809011016y7755358dm5bd9cd7b6eb412ea@mail.gmail.com> On 01/09/2008, C. K. Jester-Young wrote: > Hi Mark, > > > On Sun, Aug 31, 2008 at 04:41:33PM +0200, Mark Wielaard wrote: > > Nice idea. I wasn't aware that NIO2 was progressing already. I now see > > that my ignorance was partly because it seems this work is done in the > > nio/nio forest instead of in the jdk7/nio2 forest. Do you know how they > > relate? > > > Looking at the jdk7/nio2, the last push was in February. The current > nio2 stuff seemed to have been established in April (see, e.g., [1]), > by different parties. But I'm not involved in NIO2 currently, let alone > back then, so I can't really say anything. > > [1] http://mail.openjdk.java.net/pipermail/nio-dev/2008-April/000001.html > > > > Also, how do you keep track of which commits are really nio2 related and > > which ones are the commits that just sync with the master jdk7 repo? It > > would be nice to have an easy way to see just those changes/commits made > > for the new nio support. > > > Yes, I'm much wondering about the same question myself. One of my > aspirations is to have an IcedTea build that incorporates multiple > projects simultaneously (NIO2, MLVM/Da Vinci Machine, and BGGA Closures > are three of the ones I have an interest in), and being able to work > with _just_ the diffs would be nice. > > On that note, the MLVM project works as a set of patches against the > mainline jdk7 code (although I have had some success applying it > against the NIO2 code too). It uses the Mercurial mq extension for > doing all the patching, and patches can be marked as being for specific > releases of jdk7, for example. > > > > Do you need any special tag to get that tag? While building with your > > patch applied and doing just: > > autoreconf --force --install \ > > && ./configure --enable-hg --with-project=nio2 \ > > && make > > > The tip revision is, at the time of writing, at -b94. I successfully > built with the supplied patches on Ubuntu 8.04, on amd64. Just to test > portability, I'm now building within a 32-bit chroot, just to see if > it works correctly there too. > > (This process is a notorious PITA; I've had to write a fakeuname.so > to ``convince'' the build tools that I'm building on a 32-bit machine, > because some of the scripts don't respect the --build option that I > sent to configure.) > > Here are the configure arguments I used: > > ./configure --with-openjdk --with-openjdk-home=/usr/lib/jvm/java-6-openjdk \ > > --enable-hg --with-project=nio2 > > > In other words, I'm building with OpenJDK 6 as supplied with Ubuntu. > (With the icedtea-implicit-enable-hg.diff I recently sent, that makes > the --enable-hg option redundant. My patch is, by the way, designed to > be applied to IcedTea revision 1158.) > > I noticed from your build output that you're also using 1.6 javac for > bootstrapping; is that a Sun build, or from IcedTea? Should it make > a difference? > It's not javac, it's ecj. > > > I got: > > /home/mark/src/icedtea/bootstrap/jdk1.6.0/bin/javac -g \ > > -d lib/hotspot-tools \ > > -source 1.5 \ > > -sourcepath \ > > 'hotspot-tools:openjdk/jdk/src/share/classes:openjdk/jdk/src/solaris/classes:openjdk/langtools/src/share/classes:openjdk/jaxp/src/share/classes:openjdk/corba/src/share/classes:openjdk/jaxws/src/share/classes:/home/mark/src/icedtea/generated:/home/mark/src/icedtea/rt' \ > > -bootclasspath '' @hotspot-tools-source-files.txt ; \ > > fi > > incorrect classpath: hotspot-tools/com/sun/codemodel/internal/ClassType.java > > > This is very odd. The first line in hotspot-tools-source-files.txt is > indeed hotspot-tools/com/sun/codemodel/internal/ClassType.java, which > means that whatever make system you have is not passing the '' argument > before it. Either that, or the javac you have is disregarding it. > Could be the opening " after bootclasspath without a closing one. > > > 1. ERROR in /home/mark/src/icedtea/openjdk/jdk/src/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java (at line 144) > > public void disableInterruptor(AbstractInterruptibleChannel ch) { > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > The method disableInterruptor(AbstractInterruptibleChannel) of type new JavaNioChannelsSpiAccess(){} must override a superclass method > > > This is to do with your javac too. Some compilers support the @Override > annonation being applied to interface methods, it seems, whereas other > ones don't. I haven't quite figured out which ones do/don't allow it. > Only very recent versions of ecj do, not those shipped with distros at present. > I remember seeing some IcedTea patches whose sole purpose is to remove > @Override annotations that would choke some compilers. However, since I > don't have such a compiler, working out which @Override annotation to > remove would be difficult task, since I presume the best way to find > them is by trial and error. :-) > Yes, patches/icedtea-override.patch. Which compiler are you using with IcedTea? The default build should use ecj unless you are building with an existing IcedTea tree (--with-icedtea). > > > Did I get the wrong nio tree, or did I apply the patch wrongly? > > > No, and no, it seems. :-) > > > > There are no real legal requirements except for making sure every > > contribution is free software. But it is encouraged to push anything > > upstream into openjdk of course to keep divergence as low as possible. > > > Cool, thanks for the clarification! > > > > Thanks for working on this, nio2 is very exciting. > > > No worries, and yes, I'm totally keen to get this working on IcedTea! > > Many thanks, > ---Chris K. > Thanks, -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From bugzilla-daemon at icedtea.classpath.org Mon Sep 1 14:20:31 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 01 Sep 2008 21:20:31 +0000 Subject: [Bug 188] New: Yahoo pool not working (probably not any game at all) Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=188 Summary: Yahoo pool not working (probably not any game at all) Product: IcedTea Version: unspecified Platform: PC URL: http://games.yahoo.com/games/login2?page=pl&ss=1 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: ihernandez at kiusys.com You go to yahoo pool, a heavy java application, and with a yahoo account (you can get one free) you enter the game. Then instead of the app that it's shown with the sun java, it says that you need java. I can try running firefox from console and capturing messages if needed. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Mon Sep 1 17:07:05 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 02 Sep 2008 00:07:05 +0000 Subject: [Bug 189] New: NullPointerException due to confused OBJECT/EMBED/APPLET attributes and PARAMs Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=189 Summary: NullPointerException due to confused OBJECT/EMBED/APPLET attributes and PARAMs Product: IcedTea Version: unspecified Platform: All URL: https://bugs.launchpad.net/ubuntu/+bug/199732 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: java at tjworld.net This is an upstream report based on Ubuntu Bug LP #199732 https://bugs.launchpad.net/ubuntu/+bug/199732 == Overview == Loading some Java applets via Firefox and the plugin with openjdk-6 results in: Exception in thread "main" java.lang.NullPointerException at sun.applet.PluginMain.start(PluginMain.java:211) at sun.applet.PluginMain.main(PluginMain.java:73) See, for example: http://www.jeacle.ie/mortgage/ca/ http://wypte.acislive.com/pda/pda_maps.asp?SysId=30 I'll detail the analysis and the fix after this explanation. == Background == There are an unknown number of Internet sites hosting Java applets that fail when using the icedtea plug-in but work using the Sun Java plug-in. The reason for the failure is usually a result of the historic mess that was made of the HTML EMBED, APPLET, and OBJECT tags. As a result of the various contrived work-arounds that web-site authors used to try and ensure that all browsers managed to load a Java applet, there are many combinations of these tags and the PARAM name/value attribute tags that attempt to use browser quirks to ensure the user does see the Java applet. There has never been a standard for the EMBED tag particularly, it having grown over time from its beginnings in Netscape Navigator. There have likewise been various unofficial extensions to the OBJECT tag - the only properly standardised tag - which should really replace the other two tags in modern browsers and web-applications. As a result users often suffer, caught between a rock and a hard place when things go wrong - such as this NullPointerException - since they have no influence over the web-site operators in most cases, and often get told by developers that it is the web-site's problem, not the plug-in, despite the widespread use of varying combinations of browser-specific tag combinations. (See, for example, the responses in Bug #151). == The Issue == In the cases I've dealt with the failures are caused by the use of the EMBED tag with no "code" attribute. However, the HTML author has attempted to ensure all browsers/Java plug-ins load the applet by including OBJECT and/or APPLET variations as well as using PARAM name/value pairs. The plug-in currently refuses to accept a tag-set passed by the browser plug-in *before it has been completely parsed* if the initial tag isn't of the form: ... It will also then ignore any PARAM name/value pairs as being "outside an APPLET tag". This is unfortunate since in many cases the PARAM pairs contain values that the plug-in can use to load the applet successfully. == The Solution == The patch I've created refines the way PluginAppletViewer.parse() deals with the EMBED tag. It adopts the same logic as is already present for the OBJECT tag, deferring rejection of the attributes until the closing tag, and thus allowing any PARAM name/value pairs after the opening tag to be parsed into the attributes Hash. When the closing EMBED tag is parsed, if there is still no "code" or "object" attribute, the patch makes one last attempt to locate the entry-point class. It first looks for the attribute "classid". If it is found, the patch further checks that the value is prefixed "java:". If so, a new "code" attribute is created and assigned the remaining characters of the "classid" value. This will allow the applet to start. E.g. If any of these attempts fail it nullifies the attributes hash and fails with the same message as previously. This patch allows the plug-in to work with many more combinations of OBJECT, APPLET, and EMBED tags and improves the user experience and perception of openjdk and icedtea. == Exception Analysis == This bug is caused when the Java plug-in hasn't had a window registered using PluginMain.registerWindow(), which will set PluginMain.currentWindow. Without PluginMain.currentWindow set (it is initialised to null), when the gcjwebplugin sends the applet the "width" message, the applet's PluginMain.start() message-reading loop reads the width correctly, but then tries to get the internal height property using: int height = currentWindow.getHeight(); Because currentWindow is NULL it causes the Null Pointer Exception on line 211. The problem is caused in PluginAppletViewer.parse(...). There are several overloaded versions of this function but they all pass through to the work-horse overload that takes a complete set of arguments. In PluginAppletViewer.parse() it scans the HTML APPLET/OBJECT/EMBED tag and extracts the attribute values. When it finds an EMBED tag it passes it to PluginAppletViewer.scanTag(). That method is responsible for scanning the attributes inside the EMBED tag and assigning them to the attributes Hash. When scanTag() returns the EMBED detection-logic does some sanity checks on the attributes to ensure it has what it needs to execute the applet successfully. It checks for the CODE, WIDTH, and HEIGHT attributes not being null. If any one of them is null it sets the attribute reference to null too - effectively wiping them all out. When the logic in PluginAppletViewer.parse() finds the closing tag it checks if the attributes reference IS NOT null and if so calls PluginAppletViewerFactory.createAppletViewer(). That in turn calls PluginMain.registerWindow() which, as I said at the beginning, sets PluginMain.currentWindow. But, because an attribute of the EMBED tag was missing, the attribute Hash reference was null and so PluginMain.registerWindow() wasn't called and PluginMain.currentWindow remained with its initialised value, which is null. Hence the bug. In the case of the sites here the missing attribute is "code", and you can see the warning in the output: Warning: tag requires code attribute. That really should say "Error" since it is fatal. Because the EMBED tag was not part of a W3C standard the definition of legal parameters is hazy. It has been introduced for HTML 5 *but* will not support the CODE attribute. == Patch == Currently the patch is included in a provisional Ubuntu openjdk-6 source package as debian/patches/plugin-embed-use-param-translate-classid-to-code.patch It would be preferable to have it included upstream since other distributions have bugs reported for the same issue. The patch could easily be moved to ./patches/ in the openjdk-6 source package, as long as it is applied after patches/icedtea-plugin.patch -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Mon Sep 1 17:09:14 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 02 Sep 2008 00:09:14 +0000 Subject: [Bug 189] NullPointerException due to confused OBJECT/EMBED/APPLET attributes and PARAMs Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=189 ------- Comment #1 from java at tjworld.net 2008-09-02 00:09 ------- Created an attachment (id=90) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=90&action=view) Defer EMBED attribute decision; accept wider range of OBJECT/EMBED/APPLET attribute permutations -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From cky944 at gmail.com Mon Sep 1 17:38:45 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Tue, 2 Sep 2008 12:38:45 +1200 Subject: [patch] Support New NIO in IcedTea In-Reply-To: <17c6771e0809011016y7755358dm5bd9cd7b6eb412ea@mail.gmail.com> References: <20080831004043.GA19370@bamboo.destinee.acro.gen.nz> <1220193693.3524.24.camel@hermans.wildebeest.org> <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> <17c6771e0809011016y7755358dm5bd9cd7b6eb412ea@mail.gmail.com> Message-ID: <20080902003845.GE19370@bamboo.destinee.acro.gen.nz> Hi Andrew, On Mon, Sep 01, 2008 at 06:16:43PM +0100, Andrew John Hughes wrote: > It's not javac, it's ecj. Ah, thank you. I looked through the build scripts and noticed that whatever compiler is used, there's a symlink called jdk1.6.0 that points to it, so the jdk1.6.0 is no indication of the compiler version or type. > > This is very odd. The first line in hotspot-tools-source-files.txt is > > indeed hotspot-tools/com/sun/codemodel/internal/ClassType.java, which > > means that whatever make system you have is not passing the '' argument > > before it. Either that, or the javac you have is disregarding it. > > Could be the opening " after bootclasspath without a closing one. That's two single quotes, not a double quote, so it should represent an empty string. Nonetheless, I'm testing it with ecj now and I'm seeing the same message. I'll be investigating this further once I have a complete build (by doing all the @Override stripping). > Yes, patches/icedtea-override.patch. Which compiler are you using with IcedTea? > The default build should use ecj unless you are building with an > existing IcedTea tree (--with-icedtea). I do all my builds with the OpenJDK supplied with Ubuntu 8.04, thus the options I use are --with-openjdk-home=/usr/lib/jvm/java-6-openjdk --with-openjdk. I wasn't aware of the default compiler used by IcedTea (probably because I'm a control freak that seldom uses defaults as is), so thanks for pointing that out. I'm doing my testing with ecj now; once I have the fixes for that, I'll be posting another patch! (The nio2 repository has had more updates since, so my new patches are tracking those updates, as well as the recent IcedTea6 merges that have occurred---oh, and by the way, thanks for applying my implicit-enable-hg patch!) Many thanks, ---Chris K. From bugzilla-daemon at icedtea.classpath.org Tue Sep 2 01:32:35 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 02 Sep 2008 08:32:35 +0000 Subject: [Bug 189] NullPointerException due to confused OBJECT/EMBED/APPLET attributes and PARAMs Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=189 mark at klomp.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dbhole at redhat.com ------- Comment #2 from mark at klomp.org 2008-09-02 08:32 ------- Deepak, you probably want to look into this one. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Tue Sep 2 05:56:21 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 02 Sep 2008 12:56:21 +0000 Subject: [Bug 188] Yahoo pool not working (probably not any game at all) Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=188 langel at redhat.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at icedtea.classpath|dbhole at redhat.com |.org | -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Tue Sep 2 05:56:42 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 02 Sep 2008 12:56:42 +0000 Subject: [Bug 189] NullPointerException due to confused OBJECT/EMBED/APPLET attributes and PARAMs Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=189 langel at redhat.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at icedtea.classpath|dbhole at redhat.com |.org | -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. You are the assignee for the bug, or are watching the assignee. From gnu_andrew at member.fsf.org Tue Sep 2 08:25:49 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Tue, 2 Sep 2008 16:25:49 +0100 Subject: [patch] Support New NIO in IcedTea In-Reply-To: <20080902003845.GE19370@bamboo.destinee.acro.gen.nz> References: <20080831004043.GA19370@bamboo.destinee.acro.gen.nz> <1220193693.3524.24.camel@hermans.wildebeest.org> <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> <17c6771e0809011016y7755358dm5bd9cd7b6eb412ea@mail.gmail.com> <20080902003845.GE19370@bamboo.destinee.acro.gen.nz> Message-ID: <17c6771e0809020825y1ca96d87g828ff903e7eb1da2@mail.gmail.com> 2008/9/2 C. K. Jester-Young : > Hi Andrew, > > On Mon, Sep 01, 2008 at 06:16:43PM +0100, Andrew John Hughes wrote: >> It's not javac, it's ecj. > > Ah, thank you. I looked through the build scripts and noticed that > whatever compiler is used, there's a symlink called jdk1.6.0 that > points to it, so the jdk1.6.0 is no indication of the compiler version > or type. > No it isn't, it's just to fake a JDK for the build. For an ecj build, it will be a javac generated from javac.in against the ecj.jar it finds. For an IcedTea build, it will be symlinked to javac. >> > This is very odd. The first line in hotspot-tools-source-files.txt is >> > indeed hotspot-tools/com/sun/codemodel/internal/ClassType.java, which >> > means that whatever make system you have is not passing the '' argument >> > before it. Either that, or the javac you have is disregarding it. >> >> Could be the opening " after bootclasspath without a closing one. > > That's two single quotes, not a double quote, so it should represent an > empty string. Sorry, hard to tell with whatever font GMail is using... Nonetheless, I'm testing it with ecj now and I'm seeing > the same message. I'll be investigating this further once I have a > complete build (by doing all the @Override stripping). > >> Yes, patches/icedtea-override.patch. Which compiler are you using with IcedTea? >> The default build should use ecj unless you are building with an >> existing IcedTea tree (--with-icedtea). > > I do all my builds with the OpenJDK supplied with Ubuntu 8.04, thus the > options I use are --with-openjdk-home=/usr/lib/jvm/java-6-openjdk > --with-openjdk. I wasn't aware of the default compiler used by IcedTea > (probably because I'm a control freak that seldom uses defaults as is), > so thanks for pointing that out. > Well that's actually IcedTea. I'm not sure what the difference is between --with-openjdk and --with-icedtea except that the latter is probably more well-tested. > I'm doing my testing with ecj now; once I have the fixes for that, I'll > be posting another patch! (The nio2 repository has had more updates > since, so my new patches are tracking those updates, as well as the > recent IcedTea6 merges that have occurred---oh, and by the way, thanks > for applying my implicit-enable-hg patch!) > These merges are fun aren't they... at least we aren't stuck with CVS! > Many thanks, > ---Chris K. > Thanks, -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From iivan at redhat.com Tue Sep 2 11:04:35 2008 From: iivan at redhat.com (Ioana Ivan) Date: Tue, 02 Sep 2008 18:04:35 +0000 Subject: changeset in /hg/pulseaudio: 2008-08-13 Ioana Ivan changeset fd7d965da555 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=fd7d965da555 description: 2008-08-13 Ioana Ivan * src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java: superclass for TargetPort and SourcePort * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java: implements the abstract methods required in PulseAudioPort * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java: implements the abstract methods required in PulseAudioPort * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourcePortTest.java * unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetPortTest.java: new tests diffstat: 14 files changed, 339 insertions(+), 273 deletions(-) ChangeLog | 12 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 2 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 7 src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java | 2 src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java | 143 ++++++++++ src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 2 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java | 113 ------- src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java | 126 -------- src/java/org/classpath/icedtea/pulseaudio/Stream.java | 2 src/native/org_classpath_icedtea_pulseaudio_PulseAudioSourcePort.c | 65 +++- src/native/org_classpath_icedtea_pulseaudio_PulseAudioTargetPort.c | 30 -- src/native/org_classpath_icedtea_pulseaudio_Stream.c | 10 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourcePortTest.java | 49 +++ unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetPortTest.java | 49 +++ diffs (truncated from 771 to 500 lines): diff -r e99d53a7bcfa -r fd7d965da555 ChangeLog --- a/ChangeLog Fri Aug 29 16:26:10 2008 -0400 +++ b/ChangeLog Tue Sep 02 14:02:34 2008 -0400 @@ -1,3 +1,15 @@ 2008-08-13 Ioana Ivan + * src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java: + superclass for TargetPort and SourcePort + * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java: + implements the abstract methods required in PulseAudioPort + * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java: + implements the abstract methods required in PulseAudioPort + * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourcePortTest.java + * unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetPortTest.java: + new tests + + 2008-08-13 Ioana Ivan * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java: diff -r e99d53a7bcfa -r fd7d965da555 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Aug 29 16:26:10 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 02 14:02:34 2008 -0400 @@ -352,7 +352,7 @@ public class PulseAudioClip extends Puls } - public int native_setVolume(float value) { + public long native_setVolume(float value) { return stream.native_setVolume(value); } diff -r e99d53a7bcfa -r fd7d965da555 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Fri Aug 29 16:26:10 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Tue Sep 02 14:02:34 2008 -0400 @@ -336,8 +336,12 @@ public class PulseAudioMixer implements return clip; } - if ((info.getLineClass() == Port.class) ) { + String portName; + boolean isSource; + + if (Port.Info.class.isInstance(info)) { Port.Info portInfo = (Port.Info) info; + portName = portInfo.getName(); if(portInfo.isSource()){ return new PulseAudioSourcePort(portInfo.getName(), eventLoop); } else { @@ -346,7 +350,6 @@ public class PulseAudioMixer implements } - throw new IllegalArgumentException(); } diff -r e99d53a7bcfa -r fd7d965da555 src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java Fri Aug 29 16:26:10 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java Tue Sep 02 14:02:34 2008 -0400 @@ -2,7 +2,7 @@ package org.classpath.icedtea.pulseaudio interface PulseAudioPlaybackLine { - public int native_setVolume(float value); + long native_setVolume(float value); boolean isMuted(); diff -r e99d53a7bcfa -r fd7d965da555 src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java Tue Sep 02 14:02:34 2008 -0400 @@ -0,0 +1,143 @@ +package org.classpath.icedtea.pulseaudio; + +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Control; +import javax.sound.sampled.FloatControl; +import javax.sound.sampled.LineEvent; +import javax.sound.sampled.LineListener; +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.Port; +import javax.sound.sampled.Control.Type; + +public abstract class PulseAudioPort extends PulseAudioLine implements Port, PulseAudioPlaybackLine { + + private String name; + private long contextPointer; + private EventLoop eventLoop; + private int channels; + private float volume; + private boolean muted; + private Control[] controls = null; + private PulseAudioMuteControl muteControl; + private PulseAudioVolumeControl volumeControl; + + + public PulseAudioPort(String name, EventLoop eventLoop) { + this.name = name; + this.contextPointer = eventLoop.getContextPointer(); + this.eventLoop = eventLoop; + updateVolumeInfo(); + + controls = new Control[2]; + volumeControl = new PulseAudioVolumeControl(this, eventLoop); + controls[0] = volumeControl; + muteControl = new PulseAudioMuteControl(this, volumeControl); + controls[1] = muteControl; + isOpen = true; + + System.out.println("Opened Target Port " + name); + } + + public abstract long native_setVolume(float newValue); + + public abstract long native_updateVolumeInfo(); + + public boolean isMuted() { + return muted; + } + + public void setMuted(boolean value) { + muted = value; + } + + public float getVolume() { + return this.volume; + } + + public void setVolume(float value) { + this.volume = value; + + } + + public synchronized void updateVolumeInfo() { + Operation op; + synchronized (eventLoop.threadLock) { + op = new Operation(native_updateVolumeInfo()); + } + + op.waitForCompletion(); + op.releaseReference(); + } + + public void update_channels_and_volume(int channels, float volume) { + this.channels = channels; + this.volume = volume; + } + + + @Override + public void close() { + native_setVolume((float)0); + isOpen = false; + fireLineEvent(new LineEvent(this,LineEvent.Type.CLOSE, AudioSystem.NOT_SPECIFIED)); + } + + + public Control getControl(Type control) { + if (!isOpen) { + throw new IllegalArgumentException( + "Controls only supported when line is open"); + } + + for (int i = 0; i < controls.length; i++) { + if (controls[i].getType().getClass() == control.getClass()) { + return controls[i]; + } + } + throw new IllegalArgumentException("Unsupported control type"); + } + + public Control[] getControls() { + if (isOpen) { + return controls; + } else { + return new Control[] {}; + } + + } + + @Override + public abstract javax.sound.sampled.Line.Info getLineInfo(); + + public boolean isControlSupported(Type control) { + for (Control myControl : controls) { + if (myControl.getType().getClass() == control.getClass()) { + return true; + } + } + return false; + } + + + @Override + public void open() throws LineUnavailableException { + native_setVolume(volume); + isOpen = true; + fireLineEvent(new LineEvent(this,LineEvent.Type.OPEN, AudioSystem.NOT_SPECIFIED)); + } + + public String getName() { + return this.name; + } + + + + + + + +} + + + + diff -r e99d53a7bcfa -r fd7d965da555 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Aug 29 16:26:10 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Tue Sep 02 14:02:34 2008 -0400 @@ -89,7 +89,7 @@ public class PulseAudioSourceDataLine ex } - public int native_setVolume(float value) { + public long native_setVolume(float value) { return stream.native_setVolume(value); } diff -r e99d53a7bcfa -r fd7d965da555 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java Fri Aug 29 16:26:10 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java Tue Sep 02 14:02:34 2008 -0400 @@ -1,113 +1,22 @@ package org.classpath.icedtea.pulseaudio package org.classpath.icedtea.pulseaudio; +import javax.sound.sampled.Port; -import java.util.LinkedList; -import java.util.List; -import javax.sound.sampled.Control; -import javax.sound.sampled.LineListener; -import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.Port; -import javax.sound.sampled.Control.Type; -public class PulseAudioSourcePort implements Port { - - private String name; - - @SuppressWarnings("unused") - private long contextPointer; - - private EventLoop eventLoop; - - private boolean isOpen; - - private List lineListeners = new LinkedList(); - +public class PulseAudioSourcePort extends PulseAudioPort { + public PulseAudioSourcePort(String name, EventLoop eventLoop) { - System.out.println("new SourcePort constructed"); - this.name = name; - this.contextPointer = eventLoop.getContextPointer(); - this.eventLoop = eventLoop; - System.out.println("Opened Source Port: " + name); + super(name, eventLoop); } - - @Override - public void addLineListener(LineListener listener) { - synchronized (lineListeners) { - lineListeners.add(listener); - } - } - - @Override - public void close() { - Operation operation; - -// synchronized (eventLoop.threadLock) { -// operation = new Operation(nativeClose()); -// } -// -// operation.waitForCompletion(); -// operation.releaseReference(); - - isOpen = false; - } - - private native long nativeClose(); - - @Override - public Control getControl(Type control) { - throw new IllegalArgumentException(control.toString() - + " not supported"); - } - - @Override - public Control[] getControls() { - return new Control[] {}; - } - + + public native long native_setVolume(float newValue); + + + public synchronized native long native_updateVolumeInfo(); + @Override public javax.sound.sampled.Line.Info getLineInfo() { - // TODO Auto-generated method stub - return null; - } - - public String getName() { - return this.name; - - } - - @Override - public boolean isControlSupported(Type control) { - return false; - } - - @Override - public boolean isOpen() { - return isOpen; - } - - @Override - public void open() throws LineUnavailableException { - System.out.println("SourcePort opened"); - Operation operation; - -// synchronized (eventLoop.threadLock) { -// operation = new Operation(nativeOpen()); -// } -// -// operation.waitForCompletion(); -// operation.releaseReference(); - - isOpen = true; - } - - private native long nativeOpen(); - - @Override - public void removeLineListener(LineListener listener) { - synchronized (lineListeners) { - lineListeners.remove(listener); - } - + return new Port.Info(Port.class, getName(), false); } } diff -r e99d53a7bcfa -r fd7d965da555 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java Fri Aug 29 16:26:10 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java Tue Sep 02 14:02:34 2008 -0400 @@ -1,132 +1,26 @@ package org.classpath.icedtea.pulseaudio package org.classpath.icedtea.pulseaudio; -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.Control; -import javax.sound.sampled.FloatControl; -import javax.sound.sampled.LineEvent; -import javax.sound.sampled.LineListener; -import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.Port; -import javax.sound.sampled.Control.Type; -public class PulseAudioTargetPort extends PulseAudioLine implements Port, PulseAudioPlaybackLine { - - private String name; - private long contextPointer; - private EventLoop eventLoop; - private int channels; - private float volume; - private boolean muted; - private Control[] controls = null; - private PulseAudioMuteControl muteControl; - private PulseAudioVolumeControl volumeControl; +public class PulseAudioTargetPort extends PulseAudioPort { public PulseAudioTargetPort(String name, EventLoop eventLoop) { - this.name = name; - this.contextPointer = eventLoop.getContextPointer(); - this.eventLoop = eventLoop; - updateVolumeInfo(); - - controls = new Control[2]; - volumeControl = new PulseAudioVolumeControl(this, eventLoop); - controls[0] = volumeControl; - muteControl = new PulseAudioMuteControl(this, volumeControl); - controls[1] = muteControl; - isOpen = true; - - System.out.println("Opened Target Port " + name); + super(name, eventLoop); } - public native int native_setVolume(float newValue); + public native long native_setVolume(float newValue); - public boolean isMuted() { - return muted; + + + public synchronized native long native_updateVolumeInfo(); + + @Override + public javax.sound.sampled.Line.Info getLineInfo() { + return new Port.Info(Port.class, getName(), false); } - public void setMuted(boolean value) { - muted = value; - } - public float getVolume() { - return this.volume; - } - - public void setVolume(float value) { - this.volume = value; - - } - - public synchronized native int native_updateVolumeInfo(); - - public synchronized void updateVolumeInfo() { - Operation op; - synchronized (eventLoop.threadLock) { - op = new Operation(native_updateVolumeInfo()); - } - - op.waitForCompletion(); - op.releaseReference(); - } - - public void update_channels_and_volume(int channels, float volume) { - this.channels = channels; - this.volume = volume; - } - - - @Override - public void close() { - native_setVolume((float)0); - isOpen = false; - fireLineEvent(new LineEvent(this,LineEvent.Type.CLOSE, AudioSystem.NOT_SPECIFIED)); - } - - - public Control getControl(Type control) { - if (!isOpen) { - throw new IllegalArgumentException( - "Controls only supported when line is open"); - } - - for (int i = 0; i < controls.length; i++) { - if (controls[i].getType().getClass() == control.getClass()) { - return controls[i]; - } - } - throw new IllegalArgumentException("Unsupported control type"); - } - - public Control[] getControls() { - if (isOpen) { - return controls; - } else { - return new Control[] {}; - } - - } - - @Override - public javax.sound.sampled.Line.Info getLineInfo() { - return new Port.Info(Port.class, name, false); - } - - public boolean isControlSupported(Type control) { - for (Control myControl : controls) { - if (myControl.getType().getClass() == control.getClass()) { - return true; - } - } - return false; - } - - - @Override - public void open() throws LineUnavailableException { - native_setVolume(volume); - isOpen = true; - fireLineEvent(new LineEvent(this,LineEvent.Type.OPEN, AudioSystem.NOT_SPECIFIED)); - } From omajid at redhat.com Wed Sep 3 07:59:35 2008 From: omajid at redhat.com (Omair Majid) Date: Wed, 03 Sep 2008 14:59:35 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-02 Omair Majid changeset 52c81c12f7d0 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=52c81c12f7d0 description: 2008-09-02 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/EventLoop.java Formatting fixes. * src/java/org/classpath/icedtea/pulseaudio/Operation.java (waitForCompletion): Removed redundant call to getState and the assert. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (writeFrames): Fixed the function to not hog the cpu completely even when there is nothing to do. Big performance gain. (open): Add the clip to the source lines currently open in the mixer. (close): Remoce the clip from the list of source lines currently open in the mixer. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Added license text. Removed unneeded imports. (open): Initial implementation of support for START and STOP events. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java. Added license text. Removed unneeded imports. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java sourceLines and targetLines are now lists of PulseAudioLine. They contain all the source and target lines open to the mixer. (getSourceLines): Return a Line[] instead of a derived class (close): Added a check to make sure all the lines have been closed. (addSourceDataLine): Renamed to addSourceLine. (removeSourceDataLine): Renamed to removeSourceLine. (addTargetDataLine): Renamed to addTargetLine. (removeTargetDataLine): Rename to removeTargetLine. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java Added license text. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java Likewise. (getName): Accessor function for the name of the port. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java (write): Fixed the function to not use ~90% CPU. Now stays around 10%. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java Added license text. (native_updateVolumeInfo): Returns a pointer as a long, not as an int. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Formatting fixes. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java Added license text. (native_updateVolumeInfo): Return a long instead of an int. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioRecorder.java Added license text. * src/java/org/classpath/icedtea/pulseaudio/Stream.java Likewise. * src/java/org/classpath/icedtea/pulseaudio/StreamBufferAttributes.java Likewise. * src/java/org/classpath/icedtea/pulseaudio/StreamSampleSpecification.java Likewise. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java (playTwoSoundFiles): Fixed test - complete playing and then exit properly. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java New test class. Tests the performance of the Eventloop when nothing is happeneing. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java (testSourceLinesOpenAndClose): Changed the test to work with ports. (testLongWait): Reduce the waiting time. Use PulseAudioEventLoopOverehead for longer durations. * unitests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java (testStartedStopped): New test. Checks for the START and STOP signals being emitted. diffstat: 20 files changed, 751 insertions(+), 210 deletions(-) src/java/org/classpath/icedtea/pulseaudio/EventLoop.java | 17 - src/java/org/classpath/icedtea/pulseaudio/Operation.java | 8 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 48 ++++ src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 70 ++++++- src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java | 52 +++-- src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 75 +++---- src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java | 51 ++++- src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java | 82 +++++--- src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 61 ++++-- src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java | 51 ++++- src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 8 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java | 59 ++++- src/java/org/classpath/icedtea/pulseaudio/SimpleAudioRecorder.java | 100 ++++++---- src/java/org/classpath/icedtea/pulseaudio/Stream.java | 44 +++- src/java/org/classpath/icedtea/pulseaudio/StreamBufferAttributes.java | 41 +++- src/java/org/classpath/icedtea/pulseaudio/StreamSampleSpecification.java | 40 +++- unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java | 13 + unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java | 67 ++++++ unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java | 7 unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java | 67 ++++++ diffs (truncated from 1610 to 500 lines): diff -r fd7d965da555 -r 52c81c12f7d0 src/java/org/classpath/icedtea/pulseaudio/EventLoop.java --- a/src/java/org/classpath/icedtea/pulseaudio/EventLoop.java Tue Sep 02 14:02:34 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/EventLoop.java Tue Sep 02 17:23:01 2008 -0400 @@ -71,7 +71,7 @@ public class EventLoop implements Runnab // private boolean eventLoopIsRunning = false; public Semaphore finished = new Semaphore(0); - + private List targetPortNameList = new ArrayList(); private List sourcePortNameList = new ArrayList(); @@ -243,10 +243,11 @@ public class EventLoop implements Runnab public long getMainLoopPointer() { return mainloopPointer; } - + private native int nativeUpdateTargetPortNameList(); + private native int nativeUpdateSourcePortNameList(); - + protected synchronized List updateTargetPortNameList() { targetPortNameList = new ArrayList(); Operation op; @@ -261,7 +262,7 @@ public class EventLoop implements Runnab op.releaseReference(); return targetPortNameList; } - + protected synchronized List updateSourcePortNameList() { sourcePortNameList = new ArrayList(); Operation op; @@ -276,14 +277,12 @@ public class EventLoop implements Runnab op.releaseReference(); return sourcePortNameList; } - - - public void source_callback(String name ) { + + public void source_callback(String name) { sourcePortNameList.add(name); } - - public void sink_callback(String name ) { + public void sink_callback(String name) { targetPortNameList.add(name); } diff -r fd7d965da555 -r 52c81c12f7d0 src/java/org/classpath/icedtea/pulseaudio/Operation.java --- a/src/java/org/classpath/icedtea/pulseaudio/Operation.java Tue Sep 02 14:02:34 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Operation.java Tue Sep 02 17:23:01 2008 -0400 @@ -63,7 +63,8 @@ public class Operation { String library = new java.io.File(".").getCanonicalPath() + java.io.File.separatorChar + System.mapLibraryName("pulse-java"); - System.out.println(Operation.class.getCanonicalName() + ": " + library); + System.out.println(Operation.class.getCanonicalName() + ": " + + library); System.load(library); } catch (IOException e) { assert ("Loading failed".endsWith("library")); @@ -77,7 +78,7 @@ public class Operation { private native int native_get_state(); public Operation(long operationPointer) { - assert(operationPointer != 0); + assert (operationPointer != 0); this.operationPointer = operationPointer; this.eventLoop = EventLoop.getEventLoop(); } @@ -132,9 +133,6 @@ public class Operation { public void waitForCompletion() { assert (operationPointer != 0); - State operationState = getState(); - assert (operationState != State.Done); - do { synchronized (eventLoop.threadLock) { if (getState() == Operation.State.Done) { diff -r fd7d965da555 -r 52c81c12f7d0 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 02 14:02:34 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 02 17:23:01 2008 -0400 @@ -53,6 +53,8 @@ import javax.sound.sampled.LineListener; import javax.sound.sampled.LineListener; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.Control.Type; + +import org.classpath.icedtea.pulseaudio.Stream.WriteListener; public class PulseAudioClip extends PulseAudioDataLine implements Clip, PulseAudioPlaybackLine { @@ -117,10 +119,41 @@ public class PulseAudioClip extends Puls private void writeFrames(int startingFrame, int lastFrame) { + WriteListener writeListener = new WriteListener() { + @Override + public void update() { + eventLoop.threadLock.notifyAll(); + } + }; + + stream.addWriteListener(writeListener); + int remainingFrames = lastFrame - startingFrame - 1; while (remainingFrames > 0) { synchronized (eventLoop.threadLock) { - int availableSize = stream.getWritableSize(); + int availableSize; + + do { + availableSize = stream.getWritableSize(); + if (availableSize < 0) { + Thread.currentThread().interrupt(); + stream.removeWriteListener(writeListener); + return; + } + if (availableSize == 0) { + try { + eventLoop.threadLock.wait(); + } catch (InterruptedException e) { + // FIXME what to do when this happens? + // e.printStackTrace(); + Thread.currentThread().interrupt(); + stream.removeWriteListener(writeListener); + return; + } + } + + } while (availableSize == 0); + int framesToWrite = Math.min(remainingFrames, availableSize / getFormat().getFrameSize()); stream.write(data, currentFrame * getFormat().getFrameSize(), @@ -134,6 +167,9 @@ public class PulseAudioClip extends Puls // System.out.println("remaining frames" + remainingFrames); } } + + stream.removeWriteListener(writeListener); + } public PulseAudioClip(EventLoop eventLoop, AudioFormat[] formats, @@ -174,6 +210,10 @@ public class PulseAudioClip extends Puls stream.disconnect(); isOpen = false; } + + PulseAudioMixer mixer = PulseAudioMixer.getInstance(); + mixer.removeSourceLine(this); + } @Override @@ -341,7 +381,6 @@ public class PulseAudioClip extends Puls this.data = new byte[bufferSize]; System.arraycopy(data, offset, this.data, 0, bufferSize); frameCount = bufferSize / format.getFrameSize(); - isOpen = true; PulseAudioVolumeControl volumeControl = new PulseAudioVolumeControl( this, eventLoop); @@ -350,6 +389,11 @@ public class PulseAudioClip extends Puls controls.add(volumeControl); controls.add(muteControl); + PulseAudioMixer mixer = PulseAudioMixer.getInstance(); + mixer.addSourceLine(this); + + isOpen = true; + } public long native_setVolume(float value) { diff -r fd7d965da555 -r 52c81c12f7d0 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Tue Sep 02 14:02:34 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Tue Sep 02 17:23:01 2008 -0400 @@ -1,17 +1,52 @@ package org.classpath.icedtea.pulseaudio +/* PulseAudioClip.java + Copyright (C) 2008 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + package org.classpath.icedtea.pulseaudio; -import java.util.ArrayList; -import java.util.List; import java.util.concurrent.Semaphore; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.LineEvent; -import javax.sound.sampled.LineListener; import javax.sound.sampled.LineUnavailableException; -public abstract class PulseAudioDataLine extends PulseAudioLine implements DataLine { +public abstract class PulseAudioDataLine extends PulseAudioLine implements + DataLine { protected static final int DEFAULT_BUFFER_SIZE = StreamBufferAttributes.SANE_DEFAULT; protected static final String PULSEAUDIO_FORMAT_KEY = "PulseAudioFormatKey"; @@ -20,7 +55,6 @@ public abstract class PulseAudioDataLine // true between open() and close(). ie represents when a line has acquire // resources - // true between start() and stop() protected boolean isStarted = false; @@ -85,6 +119,26 @@ public abstract class PulseAudioDataLine stream.addStateListener(openCloseListener); + Stream.UnderflowListener stoppedListener = new Stream.UnderflowListener() { + @Override + public void update() { + fireLineEvent(new LineEvent(PulseAudioDataLine.this, + LineEvent.Type.STOP, AudioSystem.NOT_SPECIFIED)); + } + }; + stream.addUnderflowListener(stoppedListener); + + Stream.PlaybackStartedListener startedListener = new Stream.PlaybackStartedListener() { + @Override + public void update() { + fireLineEvent(new LineEvent(PulseAudioDataLine.this, + LineEvent.Type.START, AudioSystem.NOT_SPECIFIED)); + } + + }; + + stream.addPlaybackStartedListener(startedListener); + synchronized (eventLoop.threadLock) { connectLine(bufferSize); } @@ -183,16 +237,12 @@ public abstract class PulseAudioDataLine return isEngagedInIo; } - - protected abstract void connectLine(int bufferSize); public abstract void drain(); - - public Stream getStream() { return stream; } - + } diff -r fd7d965da555 -r 52c81c12f7d0 src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Tue Sep 02 14:02:34 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Tue Sep 02 17:23:01 2008 -0400 @@ -1,22 +1,53 @@ package org.classpath.icedtea.pulseaudio +/* PulseAudioClip.java + Copyright (C) 2008 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + package org.classpath.icedtea.pulseaudio; import java.util.ArrayList; import java.util.List; -import javax.sound.sampled.Control; -import javax.sound.sampled.Line; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineListener; -import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.Control.Type; - abstract class PulseAudioLine { protected List lineListeners = new ArrayList(); protected boolean isOpen = false; - - + public void addLineListener(LineListener listener) { this.lineListeners.add(listener); } @@ -30,14 +61,9 @@ abstract class PulseAudioLine { lineListener.update(e); } } - + public boolean isOpen() { return isOpen; } - - - - - } diff -r fd7d965da555 -r 52c81c12f7d0 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Tue Sep 02 14:02:34 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Tue Sep 02 17:23:01 2008 -0400 @@ -63,7 +63,6 @@ import javax.sound.sampled.TargetDataLin import javax.sound.sampled.TargetDataLine; import javax.sound.sampled.AudioFormat.Encoding; import javax.sound.sampled.Control.Type; -import javax.sound.sampled.Port.Info; public class PulseAudioMixer implements javax.sound.sampled.Mixer { // singleton @@ -82,17 +81,15 @@ public class PulseAudioMixer implements private boolean isOpen = false; - private final List sourceLines = new ArrayList(); - private final List targetLines = new ArrayList(); - private final List clips = new ArrayList(); + private final List sourceLines = new ArrayList(); + private final List targetLines = new ArrayList(); private final List lineListeners = new ArrayList(); private PulseAudioMixer() { AudioFormat[] formats = getSupportedFormats(); List sourceLineInfoList = new ArrayList(); - sourceLineInfoList.add(new DataLine.Info( - SourceDataLine.class, formats, + sourceLineInfoList.add(new DataLine.Info(SourceDataLine.class, formats, StreamBufferAttributes.MIN_VALUE, StreamBufferAttributes.MAX_VALUE)); sourceLineInfos = new Line.Info[] { new DataLine.Info( @@ -331,25 +328,22 @@ public class PulseAudioMixer implements } if ((info.getLineClass() == Clip.class)) { - Clip clip = new PulseAudioClip(eventLoop, formats, defaultFormat); - clips.add((PulseAudioClip) clip); - return clip; - } - + return new PulseAudioClip(eventLoop, formats, defaultFormat); + } + String portName; boolean isSource; - + if (Port.Info.class.isInstance(info)) { Port.Info portInfo = (Port.Info) info; portName = portInfo.getName(); - if(portInfo.isSource()){ + if (portInfo.isSource()) { return new PulseAudioSourcePort(portInfo.getName(), eventLoop); } else { return new PulseAudioTargetPort(portInfo.getName(), eventLoop); } } - - + throw new IllegalArgumentException(); } @@ -386,7 +380,7 @@ public class PulseAudioMixer implements @Override public Line[] getSourceLines() { - return (Line[]) sourceLines.toArray(new PulseAudioSourceDataLine[0]); + return (Line[]) sourceLines.toArray(new Line[0]); } @@ -482,7 +476,16 @@ public class PulseAudioMixer implements // System.out.println(this.getClass().getName() + ": closed"); - this.isOpen = false; + isOpen = false; + + if (sourceLines.size() > 0) { + System.out.println("DEBUG: some source lines have not been closed"); + assert (sourceLines.size() < 0); + } + if (targetLines.size() > 0) { + System.out.println("DEBUG: some target lines have not been closed"); + assert (targetLines.size() < 0); + } synchronized (lineListeners) { lineListeners.clear(); @@ -522,23 +525,23 @@ public class PulseAudioMixer implements @Override public void open() throws LineUnavailableException { openLocal(); - //the sourceLineInfo and targetLineInfo arrays need to be updated with - //port infos, which can only be obtained after EventLoop had started - + // the sourceLineInfo and targetLineInfo arrays need to be updated with + // port infos, which can only be obtained after EventLoop had started + ArrayList sourceLineInfoList = new ArrayList(); sourceLineInfoList.add(sourceLineInfos[0]); - for(String portName : eventLoop.updateSourcePortNameList()){ + for (String portName : eventLoop.updateSourcePortNameList()) { sourceLineInfoList.add(new Port.Info(Port.class, portName, true)); } sourceLineInfos = sourceLineInfoList.toArray(new Line.Info[0]); - + ArrayList targetLineInfoList = new ArrayList(); targetLineInfoList.add(targetLineInfos[0]); - for(String portName : eventLoop.updateTargetPortNameList()){ + for (String portName : eventLoop.updateTargetPortNameList()) { targetLineInfoList.add(new Port.Info(Port.class, portName, false)); } targetLineInfos = targetLineInfoList.toArray(new Line.Info[0]); - + } public void open(String appName, String host) throws UnknownHostException, @@ -689,38 +692,38 @@ public class PulseAudioMixer implements AudioInputStream audioInputStream = AudioSystem .getAudioInputStream(soundFile); AudioFormat audioFormat = audioInputStream.getFormat(); From omajid at redhat.com Wed Sep 3 07:59:35 2008 From: omajid at redhat.com (Omair Majid) Date: Wed, 03 Sep 2008 14:59:35 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-03 Omair Majid changeset b191c8f8cb2d in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=b191c8f8cb2d description: 2008-09-03 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/Eventloop.java (nativeUpdateTargetPortNameList): Changed return type to long. (nativeUpdateSourcePortNameList): Likewise. * src/native/org_classpath_icedtea_pulseaudio_Eventloop.c (sink_list_success_cb): Added asserts to fail nosily on error. (source_list_success_cb): Likewise. (context_change_callback): Likewise. (poll_function): Likewise. (Java_org_classpath_icedtea_pulseaudio_EventLoop_nativeUpdateTargetPortNameList): Changed return type to jlong from jint. Added asserts. (Java_org_classpath_icedtea_pulseaudio_EventLoop_nativeUpdateSourcePortNameList): Likewise. (Java_org_classpath_icedtea_pulseaudio_EventLoop_native_1shutdown): Set pointer to NULL on cleanup. (Java_org_classpath_icedtea_pulseaudio_EventLoop_native_1set_1sink_1volume): Added asserts. * src/native/org_classpath_icedtea_pulseaudio_Operation.c (Java_org_classpath_icedtea_pulseaudio_Operation_native_1ref): Added asserts. (Java_org_classpath_icedtea_pulseaudio_Operation_native_1unref): Likewise. (Java_org_classpath_icedtea_pulseaudio_Operation_native_1get_1state): Likewise. * src/native/org_classpath_icedtea_pulseaudio_PulseAudioSourcePort.c (source_callback): Added asserts. (get_source_volume_callback): Likewise. (Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1updateVolumeInfo): Added checks for error conditions and asserts. (Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1setVolume): Likewise. * src/native/org_classpath_icedtea_pulseaudio_PulseAudioTargetPort.c (get_sink_volume_callback): Added asserts. (Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1updateVolumeInfo): Added asserts and checks for errors. (Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1setVolume): Likewise. * src/native/org_classpath_icedtea_pulseaudio_Stream.c (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1read): Added asserts. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1peek): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drop): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1writable_1size): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1readable_1size): Likewise. (drain_callback): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drain): Likewise. (cork_callback): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1cork): Likewise. (flush_callback): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1flush): Likewise. (trigger_callback): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1trigger): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1set_1name): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1sample_1spec): Added code for error checking and asserts. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1buffer_1attr): Adde asserts. (set_buffer_attr_callback): Likewise. (update_sample_rate_callback): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1setVolume): Likewise. diffstat: 6 files changed, 193 insertions(+), 60 deletions(-) src/java/org/classpath/icedtea/pulseaudio/EventLoop.java | 6 src/native/org_classpath_icedtea_pulseaudio_EventLoop.c | 90 ++++++---- src/native/org_classpath_icedtea_pulseaudio_Operation.c | 3 src/native/org_classpath_icedtea_pulseaudio_PulseAudioSourcePort.c | 50 ++++- src/native/org_classpath_icedtea_pulseaudio_PulseAudioTargetPort.c | 51 +++++ src/native/org_classpath_icedtea_pulseaudio_Stream.c | 53 ++++- diffs (truncated from 606 to 500 lines): diff -r 52c81c12f7d0 -r b191c8f8cb2d src/java/org/classpath/icedtea/pulseaudio/EventLoop.java --- a/src/java/org/classpath/icedtea/pulseaudio/EventLoop.java Tue Sep 02 17:23:01 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/EventLoop.java Wed Sep 03 10:47:27 2008 -0400 @@ -244,9 +244,9 @@ public class EventLoop implements Runnab return mainloopPointer; } - private native int nativeUpdateTargetPortNameList(); - - private native int nativeUpdateSourcePortNameList(); + private native long nativeUpdateTargetPortNameList(); + + private native long nativeUpdateSourcePortNameList(); protected synchronized List updateTargetPortNameList() { targetPortNameList = new ArrayList(); diff -r 52c81c12f7d0 -r b191c8f8cb2d src/native/org_classpath_icedtea_pulseaudio_EventLoop.c --- a/src/native/org_classpath_icedtea_pulseaudio_EventLoop.c Tue Sep 02 17:23:01 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_EventLoop.c Wed Sep 03 10:47:27 2008 -0400 @@ -49,27 +49,43 @@ static java_context_t* java_context = NU JNIEnv* pulse_thread_env = NULL; -void sink_list_success_cb(pa_context *context, const pa_sink_info *i, int eol, void *userdata) { - +void sink_list_success_cb(pa_context *context, const pa_sink_info *i, int eol, + void *userdata) { + if (eol == 0) { - jclass cls = (*pulse_thread_env)->GetObjectClass(pulse_thread_env, java_context->obj); + jclass cls = (*pulse_thread_env)->GetObjectClass(pulse_thread_env, + java_context->obj); + assert(cls); jstring name = (*pulse_thread_env)->NewStringUTF(pulse_thread_env, i->name); - jmethodID mid1 = (*pulse_thread_env)->GetMethodID(pulse_thread_env, cls, "sink_callback", "(Ljava/lang/String;)V"); - (*pulse_thread_env)->CallVoidMethod(pulse_thread_env, java_context->obj, mid1, name) ; - } else { + assert(name); + jmethodID mid1 = (*pulse_thread_env)->GetMethodID(pulse_thread_env, cls, + "sink_callback", "(Ljava/lang/String;)V"); + assert(mid1); + (*pulse_thread_env)->CallVoidMethod(pulse_thread_env, + java_context->obj, mid1, name) ; + } else { + assert(pulse_thread_env); notifyWaitingOperations(pulse_thread_env); } } -void source_list_success_cb(pa_context *context, const pa_source_info *i, int eol, void *userdata) { - +void source_list_success_cb(pa_context *context, const pa_source_info *i, + int eol, void *userdata) { + if (eol == 0) { - jclass cls = (*pulse_thread_env)->GetObjectClass(pulse_thread_env, java_context->obj); + jclass cls = (*pulse_thread_env)->GetObjectClass(pulse_thread_env, + java_context->obj); + assert(cls); jstring name = (*pulse_thread_env)->NewStringUTF(pulse_thread_env, i->name); - jmethodID mid1 = (*pulse_thread_env)->GetMethodID(pulse_thread_env, cls, "source_callback", "(Ljava/lang/String;)V"); - (*pulse_thread_env)->CallVoidMethod(pulse_thread_env, java_context->obj, mid1, name) ; - } else { + assert(name); + jmethodID mid1 = (*pulse_thread_env)->GetMethodID(pulse_thread_env, cls, + "source_callback", "(Ljava/lang/String;)V"); + assert(mid1); + (*pulse_thread_env)->CallVoidMethod(pulse_thread_env, + java_context->obj, mid1, name) ; + } else { + assert(pulse_thread_env); notifyWaitingOperations(pulse_thread_env); } @@ -85,20 +101,13 @@ static void context_change_callback(pa_c // printf("context state changed to %d\n", pa_context_get_state(context)); - /* Call the 'update' method in java + /* Call the EventLoop.update method in java * to handle all java-side events */ jclass cls = (*env)->GetObjectClass(env, obj); - if (cls == NULL) { - printf("unable to get class of object"); - return; - } + assert(cls); jmethodID mid = (*env)->GetMethodID(env, cls, "update", "(I)V"); - if (mid == NULL) { - printf("unable to get callback method\n"); - return; - - } + assert(mid); (*env)->CallVoidMethod(env, obj, mid, pa_context_get_state(context)); return; @@ -108,6 +117,7 @@ static int poll_function(struct pollfd * void *userdata) { JNIEnv* env = pulse_thread_env; + assert(env); jobject lockObject = getLockObject(env); (*env)->MonitorExit(env, lockObject); @@ -213,17 +223,21 @@ JNIEXPORT jint JNICALL Java_org_classpat } -JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_EventLoop_nativeUpdateTargetPortNameList(JNIEnv *env, jobject obj) { - pa_context* context = (pa_context*) getJavaPointer(env, obj, "contextPointer"); +JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_EventLoop_nativeUpdateTargetPortNameList(JNIEnv *env, jobject obj) { + pa_context* context = (pa_context*) getJavaPointer(env, obj, "contextPointer"); + assert(context); pa_operation *o = pa_context_get_sink_info_list(context, sink_list_success_cb, NULL); - return (jint) o; - } - - JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_EventLoop_nativeUpdateSourcePortNameList(JNIEnv *env, jobject obj) { - pa_context* context = (pa_context*) getJavaPointer(env, obj, "contextPointer"); + assert(o); + return convertPointerToJavaLong(o); +} + +JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_EventLoop_nativeUpdateSourcePortNameList(JNIEnv *env, jobject obj) { + pa_context* context = (pa_context*) getJavaPointer(env, obj, "contextPointer"); + assert(context); pa_operation *o = pa_context_get_source_info_list(context, source_list_success_cb, NULL); - return (jint) o; - } + assert(o); + return convertPointerToJavaLong(o); +} static void context_drain_complete_callback(pa_context* context, void* userdata) { pa_context_disconnect(context); @@ -257,6 +271,7 @@ JNIEXPORT void JNICALL Java_org_classpat (*env)->DeleteGlobalRef(env, java_context->obj); free(java_context); + java_context = NULL; setJavaPointer(env, obj, "mainloopPointer", NULL); setJavaPointer(env, obj, "contextPointer", NULL); @@ -272,7 +287,6 @@ static void sink_input_volume_change_com assert(userdata); free(userdata); assert(success); - printf("volume change complete\n"); } @@ -280,7 +294,6 @@ static void sink_input_change_volume(pa_ const pa_sink_input_info* i, int eol, void* userdata) { assert(c); - // end of list ? if (eol) { return; } @@ -317,10 +330,17 @@ static void sink_input_change_volume(pa_ */ JNIEXPORT void JNICALL Java_org_classpath_icedtea_pulseaudio_EventLoop_native_1set_1sink_1volume (JNIEnv* env, jobject obj, jlong streamPointer, jint volume) { + + pa_stream* stream = (pa_stream*) convertJavaLongToPointer(streamPointer); + assert(stream); + pa_context* context = (pa_context*) getJavaPointer(env, obj, "contextPointer"); + assert(context); + int* new_volume = malloc(sizeof(int)); *new_volume = volume; - int stream_id = pa_stream_get_index((pa_stream*) convertJavaLongToPointer(streamPointer)); - pa_context_get_sink_input_info((pa_context*) getJavaPointer(env, obj,"contextPointer") ,stream_id,sink_input_change_volume, new_volume); + + int stream_id = pa_stream_get_index(stream); + pa_context_get_sink_input_info(context, stream_id,sink_input_change_volume, new_volume); return; } diff -r 52c81c12f7d0 -r b191c8f8cb2d src/native/org_classpath_icedtea_pulseaudio_Operation.c --- a/src/native/org_classpath_icedtea_pulseaudio_Operation.c Tue Sep 02 17:23:01 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_Operation.c Wed Sep 03 10:47:27 2008 -0400 @@ -49,6 +49,7 @@ JNIEXPORT void JNICALL Java_org_classpat (JNIEnv* env, jobject obj) { pa_operation* operation = (pa_operation*) getJavaPointer(env, obj, "operationPointer"); + assert(operation); pa_operation_ref(operation); } @@ -62,6 +63,7 @@ JNIEXPORT void JNICALL Java_org_classpat (JNIEnv* env, jobject obj) { pa_operation* operation = (pa_operation*) getJavaPointer(env, obj, "operationPointer"); + assert(operation); pa_operation_unref(operation); } @@ -75,6 +77,7 @@ JNIEXPORT jint JNICALL Java_org_classpat (JNIEnv *env, jobject obj) { pa_operation* operation = (pa_operation*) getJavaPointer(env, obj, "operationPointer"); + assert(operation); int state = pa_operation_get_state(operation); return state; } diff -r 52c81c12f7d0 -r b191c8f8cb2d src/native/org_classpath_icedtea_pulseaudio_PulseAudioSourcePort.c --- a/src/native/org_classpath_icedtea_pulseaudio_PulseAudioSourcePort.c Tue Sep 02 17:23:01 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_PulseAudioSourcePort.c Wed Sep 03 10:47:27 2008 -0400 @@ -1,4 +1,3 @@ - #include "org_classpath_icedtea_pulseaudio_PulseAudioSourcePort.h" #include "jni-common.h" #include @@ -12,43 +11,80 @@ extern JNIEnv* pulse_thread_env; extern JNIEnv* pulse_thread_env; void source_callback(pa_context *context, int success, void *userdata) { + assert(context); + assert(pulse_thread_env); notifyWaitingOperations(pulse_thread_env); } -void get_source_volume_callback(pa_context *context, const pa_source_info *i, int eol, void *userdata) { - if(eol == 0) { - printf("%s\n", i->name); +void get_source_volume_callback(pa_context *context, const pa_source_info *i, + int eol, void *userdata) { + assert(context); + assert(pulse_thread_env); + + if (eol == 0) { + // printf("%s\n", i->name); jobject obj = (jobject) userdata; + assert(obj); jclass cls = (*pulse_thread_env)->GetObjectClass(pulse_thread_env, obj); - jmethodID mid1 = (*pulse_thread_env)->GetMethodID(pulse_thread_env, cls, "update_channels_and_volume", "(IF)V"); - (*pulse_thread_env)->CallVoidMethod(pulse_thread_env, obj, mid1, (int) (i->volume).channels, (float) (i->volume).values[0]) ; + assert(cls); + jmethodID mid1 = (*pulse_thread_env)->GetMethodID(pulse_thread_env, cls, + "update_channels_and_volume", "(IF)V"); + assert(mid1); + (*pulse_thread_env)->CallVoidMethod(pulse_thread_env, obj, mid1, + (int) (i->volume).channels, (float) (i->volume).values[0]) ; } else { notifyWaitingOperations(pulse_thread_env); } } - + JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1updateVolumeInfo(JNIEnv *env, jobject obj) { jclass cls = (*env)->GetObjectClass(env, obj); + assert(cls); jfieldID fid = (*env)->GetFieldID(env, cls, "name", "Ljava/lang/String;"); + assert(fid); jstring jstr = (*env)->GetObjectField(env, obj, fid); + assert(jstr); const char *name = (*env)->GetStringUTFChars(env, jstr, NULL); + if (name == NULL) { + return convertPointerToJavaLong(NULL); // oome + } + pa_context* context = (pa_context*) getJavaPointer(env, obj, "contextPointer"); + assert(context); obj = (*env)->NewGlobalRef(env, obj); pa_operation *o = pa_context_get_source_info_by_name (context, (char*) name, get_source_volume_callback, obj); + assert(o); return convertPointerToJavaLong(o); } JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1setVolume(JNIEnv *env, jobject obj, jfloat value) { jclass cls = (*env)->GetObjectClass(env, obj); + assert(cls); + jfieldID fid = (*env)->GetFieldID(env, cls, "name", "Ljava/lang/String;"); + assert(fid); + jstring jstr = (*env)->GetObjectField(env, obj, fid); + assert(jstr); + const char *name = (*env)->GetStringUTFChars(env, jstr, NULL); + if (name == NULL) { + return convertPointerToJavaLong(NULL); // oome + } + pa_context* context = (pa_context*) getJavaPointer(env, obj, "contextPointer"); + assert(context); + obj = (*env)->NewGlobalRef(env, obj); fid = (*env)->GetFieldID(env, cls, "channels", "I"); + assert(fid); + jint channels = (*env)->GetIntField(env, obj, fid); pa_cvolume cv; + pa_operation *o = pa_context_set_source_volume_by_name (context, (char*) name,pa_cvolume_set(&cv, channels, value), source_callback, obj); + assert(o); + return convertPointerToJavaLong(o); } diff -r 52c81c12f7d0 -r b191c8f8cb2d src/native/org_classpath_icedtea_pulseaudio_PulseAudioTargetPort.c --- a/src/native/org_classpath_icedtea_pulseaudio_PulseAudioTargetPort.c Tue Sep 02 17:23:01 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_PulseAudioTargetPort.c Wed Sep 03 10:47:27 2008 -0400 @@ -15,41 +15,80 @@ void sink_callback(pa_context *context, notifyWaitingOperations(pulse_thread_env); } -void get_sink_volume_callback(pa_context *context, const pa_sink_info *i, int eol, void *userdata) { - if(eol == 0) { - printf("%s\n", i->name); +void get_sink_volume_callback(pa_context *context, const pa_sink_info *i, + int eol, void *userdata) { + assert(context); + assert(pulse_thread_env); + + if (eol == 0) { + // printf("%s\n", i->name); jobject obj = (jobject) userdata; + assert(obj); jclass cls = (*pulse_thread_env)->GetObjectClass(pulse_thread_env, obj); - jmethodID mid1 = (*pulse_thread_env)->GetMethodID(pulse_thread_env, cls, "update_channels_and_volume", "(IF)V"); - (*pulse_thread_env)->CallVoidMethod(pulse_thread_env, obj, mid1, (int) (i->volume).channels, (float) (i->volume).values[0]) ; + assert(cls); + jmethodID mid1 = (*pulse_thread_env)->GetMethodID(pulse_thread_env, cls, + "update_channels_and_volume", "(IF)V"); + assert(mid1); + (*pulse_thread_env)->CallVoidMethod(pulse_thread_env, obj, mid1, + (int) (i->volume).channels, (float) (i->volume).values[0]) ; } else { notifyWaitingOperations(pulse_thread_env); } - } JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1updateVolumeInfo(JNIEnv *env, jobject obj) { jclass cls = (*env)->GetObjectClass(env, obj); + assert(cls); + jfieldID fid = (*env)->GetFieldID(env, cls, "name", "Ljava/lang/String;"); + assert(fid); + jstring jstr = (*env)->GetObjectField(env, obj, fid); + assert(jstr); + const char *name = (*env)->GetStringUTFChars(env, jstr, NULL); + if (name == NULL) { + return convertPointerToJavaLong(NULL); // oome + } + pa_context* context = (pa_context*) getJavaPointer(env, obj, "contextPointer"); + assert(context); + obj = (*env)->NewGlobalRef(env, obj); + pa_operation *o = pa_context_get_sink_info_by_name (context, (char*) name, get_sink_volume_callback, obj); + assert(o); + return convertPointerToJavaLong(o); } JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1setVolume(JNIEnv *env, jobject obj, jfloat value) { jclass cls = (*env)->GetObjectClass(env, obj); + assert(cls); + jfieldID fid = (*env)->GetFieldID(env, cls, "name", "Ljava/lang/String;"); + assert(fid); + jstring jstr = (*env)->GetObjectField(env, obj, fid); + assert(jstr); + const char *name = (*env)->GetStringUTFChars(env, jstr, NULL); + if (name == NULL) { + return convertPointerToJavaLong(NULL); // return oome + } + pa_context* context = (pa_context*) getJavaPointer(env, obj, "contextPointer"); + assert(context); + obj = (*env)->NewGlobalRef(env, obj); fid = (*env)->GetFieldID(env, cls, "channels", "I"); + assert(fid); + jint channels = (*env)->GetIntField(env, obj, fid); pa_cvolume cv; pa_operation *o = pa_context_set_sink_volume_by_name (context, (char*) name,pa_cvolume_set(&cv, channels, value), sink_callback, obj); + assert(o); + return convertPointerToJavaLong(o); } diff -r 52c81c12f7d0 -r b191c8f8cb2d src/native/org_classpath_icedtea_pulseaudio_Stream.c --- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c Tue Sep 02 17:23:01 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c Wed Sep 03 10:47:27 2008 -0400 @@ -11,12 +11,11 @@ typedef struct java_context { extern JNIEnv* pulse_thread_env; -static void set_sink_input_volume_callback(pa_context* context, int success,void* userdata) { +static void set_sink_input_volume_callback(pa_context* context, int success, + void* userdata) { notifyWaitingOperations(pulse_thread_env); } - - const char* getStringFromFormat(pa_sample_format_t format) { @@ -499,6 +498,7 @@ JNIEXPORT jint JNICALL Java_org_classpat JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1read (JNIEnv *env, jobject obj, jbyteArray array, jint length, jint offset) { pa_stream *stream = getJavaPointer(env, obj, "streamPointer"); + assert(stream); const void *read_data = NULL; size_t read_length = 0; pa_stream_peek(stream, &read_data, &read_length); @@ -520,6 +520,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl (JNIEnv* env, jobject obj) { pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + assert(stream); const void* startLocation; size_t count; @@ -546,6 +547,7 @@ JNIEXPORT jint JNICALL Java_org_classpat JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drop (JNIEnv* env, jobject obj) { pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + assert(stream); return pa_stream_drop(stream); } @@ -557,6 +559,7 @@ JNIEXPORT jint JNICALL Java_org_classpat JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1writable_1size (JNIEnv* env, jobject obj) { pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + assert(stream); size_t size = pa_stream_writable_size(stream); return size; @@ -570,6 +573,7 @@ JNIEXPORT jint JNICALL Java_org_classpat JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1readable_1size (JNIEnv* env, jobject obj) { pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + assert(stream); return pa_stream_readable_size(stream); } @@ -577,6 +581,7 @@ static void drain_callback(pa_stream* st assert(success); JNIEnv* env = pulse_thread_env; + assert(env); notifyWaitingOperations(env); } @@ -589,13 +594,16 @@ JNIEXPORT jlong JNICALL Java_org_classpa JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drain (JNIEnv* env, jobject obj) { pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + assert(stream); pa_operation* operation = pa_stream_drain(stream, drain_callback, NULL); + assert(operation); return convertPointerToJavaLong(operation); } static void cork_callback(pa_stream* stream, int success, void* userdata) { assert(success); JNIEnv* env = pulse_thread_env; + assert(env); notifyWaitingOperations(env); } @@ -608,13 +616,16 @@ JNIEXPORT jlong JNICALL Java_org_classpa JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1cork (JNIEnv* env, jobject obj, jint yes) { pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + assert(stream); pa_operation* operation = pa_stream_cork(stream, yes, cork_callback, NULL); + assert(operation); return convertPointerToJavaLong(operation); } static void flush_callback(pa_stream* stream, int success, void* userdata) { assert(success); JNIEnv* env = pulse_thread_env; + assert(env); notifyWaitingOperations(env); } @@ -627,13 +638,16 @@ JNIEXPORT jlong JNICALL Java_org_classpa JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1flush (JNIEnv* env, jobject obj) { pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + assert(stream); pa_operation* operation = pa_stream_flush(stream, flush_callback, NULL); From cky944 at gmail.com Wed Sep 3 08:09:49 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Thu, 4 Sep 2008 03:09:49 +1200 Subject: [patch] Support New NIO in IcedTea In-Reply-To: <17c6771e0809020825y1ca96d87g828ff903e7eb1da2@mail.gmail.com> References: <20080831004043.GA19370@bamboo.destinee.acro.gen.nz> <1220193693.3524.24.camel@hermans.wildebeest.org> <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> <17c6771e0809011016y7755358dm5bd9cd7b6eb412ea@mail.gmail.com> <20080902003845.GE19370@bamboo.destinee.acro.gen.nz> <17c6771e0809020825y1ca96d87g828ff903e7eb1da2@mail.gmail.com> Message-ID: <20080903150949.GA24121@bamboo.destinee.acro.gen.nz> Attached are some patches that help the current nio2 tip build with the current IcedTea tip. :-) The rest of the message is my reply to Andrew, which other readers probably won't care about. :-P On Tue, Sep 02, 2008 at 04:25:49PM +0100, Andrew John Hughes wrote: > >> Could be the opening " after bootclasspath without a closing one. > > > > That's two single quotes, not a double quote, so it should represent an > > empty string. > > Sorry, hard to tell with whatever font GMail is using... Yeah, it's a bit a shame that you can't choose to use a monospace font with Gmail...I personally use Mutt to do all my mailing list stuff, just because no webmail system I've seen does proper (strict) threading, list header fields (Mail-Followup-To, etc.), inline attachments, customisable attachment content types, or the like. I sang with joy the day I heard that Gmail supported IMAP access. > Well that's actually IcedTea. I'm not sure what the difference is > between --with-openjdk > and --with-icedtea except that the latter is probably more well-tested. >From what I can see, there isn't a difference between the two except the default directories that get used for each. > > I'm doing my testing with ecj now; once I have the fixes for that, I'll > > be posting another patch! (The nio2 repository has had more updates > > since, so my new patches are tracking those updates, as well as the > > recent IcedTea6 merges that have occurred---oh, and by the way, thanks > > for applying my implicit-enable-hg patch!) > > These merges are fun aren't they... at least we aren't stuck with CVS! True, true...well, I finally got them completed (at 3 am, no less: I'll be away for a whole week in 5 hours' time, and I wanted these changes to go through before the nio2 tip gets updated again and all my work has to be redone :-P). The @Override-stripping patch is quite large, and the nio2 updates have caused the gensrc changes to triple in size, so I've zipped those up. (Again, these both apply to the nio2 tip as of current writing, so you may need to repull your sources.) The main build script changes remain inline so they can be easily reviewed. So, hope you and Mark and maybe other interested parties have fun with them! Hopefully there won't be too many changes to the nio2 tip before I return.... :-) Enjoy, ---Chris K. -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-nio2-20080904.diff Type: text/x-diff Size: 1951 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080904/0f8a4d2a/icedtea-nio2-20080904.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-nio2-patches.zip Type: application/zip Size: 13847 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080904/0f8a4d2a/icedtea-nio2-patches.zip From omajid at redhat.com Wed Sep 3 12:12:02 2008 From: omajid at redhat.com (Omair Majid) Date: Wed, 03 Sep 2008 19:12:02 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-03 Omair Majid changeset 8ddfb8d274c7 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=8ddfb8d274c7 description: 2008-09-03 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Moved controls to PulseAudioDataLine. (PulseAudioClip): Removed lineListeners and controls - They are in a superclass of PulseAudioClip. (getBufferSize): Moved method to PulseAudioDataLine. (getControl): Moved method to PulseAudioLine. (getControls): Likewise. (getFormat): Moved method to PulseAudioDataLine. (getLevel): Likewise. (getLineInfo): Likewise. (isControlSupported): Moved to PulseAudioLine. (isOpen): Likewise. (isRunning): Moved to PulseAudioDataLine. (removeLineListeners): Moved to PulseAudioLine. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (open): Now sets isEngagedInIo when playback starts or stops. (close): Calls super.close and throws an exception if interrupted. (start): Removed comments. (stop): Likewise. (getBufferSize): New function. Moved from derived class to this class. (getLineInfo): Likewise. (getFormat): Likewise. (getLevel): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Added controls. (close): New function. Moved from derived class to this class. (getControl): Likewise. (getControls): Likewise. (isControlSupported): Likewise. (open): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java (getSupportedFormats): Removed redundant comments. (getLine): Removed unused variables. (addTargetLine): Renamed from addTargetDataLine. (removeTargetLine): Renamed from removeTargetDataLine. * src/java/org/classpath/icedtea/pulseaudio/PulseAduioPort.java Removed controls (open): Use the controls List from the parent class. (getControl): Moved to superclass. (getControls): Likewise. (isControlSupported): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Removed controls array. Uses the one from parent class. (open): Fixed to use the controls List. (write): Added an extra check. (getBufferSize): Moved to parent class. (getFormat): Likewise. (getLevel): Likewise. (getControl): Likewise. (getControls): Likewise. (getLineInfo): Likewise. (isControlSupported): Likewise. * src/java/org/classpath/icedate/pulseaudio/PulseAudioTargetDataLine.java (PulseAudioTargetDataLine): Use lineListeners from parent class. (close): Fixed function name to call in Mixer. (open): Likewise. (read): Added an extra check. (getBufferSize): Moved to parent class. (getFormat): Likewise. (getLevel): Likewise. (getControl): Likewise. (getControls): Likewise. (getLIneInfo): Likewise. (isControlSupported): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java Formatting fixes. * src/java/org/classpath/icedtea/pulseaudio/Stream.java (underflowCallback): Removed debug output. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java (testOpenEvent): New test. Checks the OPEN event from PulseAudioClip (testCloseEvent): New test. Check the CLOSE event from PulseAudioClip (testPlayTwoClips): Removed redundant try/catch block. (testSupportedControls): New test. Checks that PulseAudioClip supports at least two controls. (testMixerKnowsAboutOpenClips): New test. Checks that open clips are added to the mixer's list of open source lines. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java Fixed formatting. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java (testOpeneingAgain): Fixed test to detect the IllegalStateException thrown. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourcePortTest.java (tearDown): New function. Close the mixer at the end of the test. * unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java (testMixerKnowsAoubtOpenLines): Modified the test to check that the lines are actually the same. diffstat: 16 files changed, 364 insertions(+), 415 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 88 ----- src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 72 ++-- src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java | 62 +++ src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 61 --- src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java | 53 --- src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 71 ---- src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 57 --- src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java | 22 - src/java/org/classpath/icedtea/pulseaudio/Stream.java | 1 unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java | 166 ++++++++-- unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java | 18 - unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java | 5 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourcePortTest.java | 38 +- unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 24 + unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetPortTest.java | 37 +- unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java | 4 diffs (truncated from 1446 to 500 lines): diff -r b191c8f8cb2d -r 8ddfb8d274c7 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Wed Sep 03 10:47:27 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Wed Sep 03 15:11:46 2008 -0400 @@ -38,21 +38,13 @@ package org.classpath.icedtea.pulseaudio package org.classpath.icedtea.pulseaudio; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; import java.util.concurrent.Semaphore; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.BooleanControl; import javax.sound.sampled.Clip; -import javax.sound.sampled.Control; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.FloatControl; -import javax.sound.sampled.LineListener; import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.Control.Type; import org.classpath.icedtea.pulseaudio.Stream.WriteListener; @@ -72,8 +64,6 @@ public class PulseAudioClip extends Puls private int framesSinceOpen = 0; public static final String DEFAULT_CLIP_NAME = "Clip"; - - private List controls = null; private Object clipLock = new Object(); private boolean clipThreadStarted; @@ -176,12 +166,11 @@ public class PulseAudioClip extends Puls AudioFormat defaultFormat) { supportedFormats = formats; this.eventLoop = eventLoop; - this.lineListeners = new ArrayList(); this.defaultFormat = defaultFormat; this.currentFormat = defaultFormat; + this.volume = PulseAudioVolumeControl.MAX_VOLUME; + clipThread = new ClipThread(); - this.volume = PulseAudioVolumeControl.MAX_VOLUME; - controls = new ArrayList(); } @@ -241,46 +230,6 @@ public class PulseAudioClip extends Puls } @Override - public int getBufferSize() { - if (!isOpen) { - return DEFAULT_BUFFER_SIZE; - } - return bufferSize; - } - - @Override - public Control getControl(Type control) { - if (isOpen) { - if (control.getClass() == BooleanControl.Type.MUTE.getClass()) { - return controls.get(1); - } - - if (control.getClass() == FloatControl.Type.VOLUME.getClass()) { - return controls.get(0); - } - } - throw new IllegalArgumentException(control.toString() - + " not supported"); - } - - @Override - public Control[] getControls() { - if (!isOpen) { - return new Control[] {}; - } - - return (Control[]) controls.toArray(new Control[0]); - } - - @Override - public AudioFormat getFormat() { - if (!isOpen) { - return defaultFormat; - } - return currentFormat; - } - - @Override public int getFrameLength() { return frameCount; } @@ -288,18 +237,6 @@ public class PulseAudioClip extends Puls @Override public int getFramePosition() { return (int) framesSinceOpen; - } - - @Override - public float getLevel() { - return AudioSystem.NOT_SPECIFIED; - } - - @Override - public javax.sound.sampled.Line.Info getLineInfo() { - return new DataLine.Info(this.getClass(), supportedFormats, - StreamBufferAttributes.MIN_VALUE, - StreamBufferAttributes.MAX_VALUE); } @Override @@ -324,22 +261,6 @@ public class PulseAudioClip extends Puls synchronized (clipLock) { return framesSinceOpen / currentFormat.getFrameSize(); } - } - - @Override - public boolean isControlSupported(Type control) { - return false; - } - - @Override - public boolean isOpen() { - return isOpen; - } - - @Override - public boolean isRunning() { - // really confused about what this is supposed to do - return isActive(); } @Override @@ -429,11 +350,6 @@ public class PulseAudioClip extends Puls } @Override - public void removeLineListener(LineListener listener) { - lineListeners.remove(listener); - } - - @Override public void setFramePosition(int frames) { if (frames > frameCount) { diff -r b191c8f8cb2d -r 8ddfb8d274c7 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Wed Sep 03 10:47:27 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Wed Sep 03 15:11:46 2008 -0400 @@ -53,9 +53,6 @@ public abstract class PulseAudioDataLine protected String streamName = "Java Stream"; - // true between open() and close(). ie represents when a line has acquire - // resources - // true between start() and stop() protected boolean isStarted = false; @@ -76,9 +73,6 @@ public abstract class PulseAudioDataLine public void open(AudioFormat format, int bufferSize) throws LineUnavailableException { - if (isOpen) { - throw new IllegalStateException("Line is already open"); - } for (AudioFormat myFormat : supportedFormats) { if (format.matches(myFormat)) { @@ -90,7 +84,7 @@ public abstract class PulseAudioDataLine } currentFormat = format; - isOpen = true; + super.open(); } } // no matches found @@ -122,6 +116,7 @@ public abstract class PulseAudioDataLine Stream.UnderflowListener stoppedListener = new Stream.UnderflowListener() { @Override public void update() { + isEngagedInIo = false; fireLineEvent(new LineEvent(PulseAudioDataLine.this, LineEvent.Type.STOP, AudioSystem.NOT_SPECIFIED)); } @@ -131,6 +126,7 @@ public abstract class PulseAudioDataLine Stream.PlaybackStartedListener startedListener = new Stream.PlaybackStartedListener() { @Override public void update() { + isEngagedInIo = true; fireLineEvent(new LineEvent(PulseAudioDataLine.this, LineEvent.Type.START, AudioSystem.NOT_SPECIFIED)); } @@ -170,51 +166,31 @@ public abstract class PulseAudioDataLine } public void close() { - // FIXME what should be done here - assert (isOpen); + + super.close(); synchronized (eventLoop.threadLock) { - // drain(); + drain(); stream.disconnect(); } try { semaphore.acquire(); } catch (InterruptedException e) { - // throw new LineUnavailableException("unable to prepare - // stream"); - } - - isOpen = false; + throw new RuntimeException("unable to prepare stream"); + } } public void start() { - // if (isPaused) { - // synchronized (eventLoop.threadLock) { - // stream.cork(false); - // } - // isPaused = false; - // } - isStarted = true; - - /* - * for(LineListener l :listeners) { l.update(new LineEvent(this, - * LineEvent.Type.START, 0)); } - */ - } public void stop() { - // synchronized (eventLoop.threadLock) { - // stream.cork(true); - // } - // isPaused = true; - isStarted = false; - - } + } + + // A BIG FIXME ! /* * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4791152 : @@ -245,4 +221,30 @@ public abstract class PulseAudioDataLine return stream; } + @Override + public int getBufferSize() { + if (!isOpen) { + return DEFAULT_BUFFER_SIZE; + } + return bufferSize; + } + + public javax.sound.sampled.Line.Info getLineInfo() { + return new DataLine.Info(this.getClass(), supportedFormats, + StreamBufferAttributes.MIN_VALUE, + StreamBufferAttributes.MAX_VALUE); + } + + @Override + public AudioFormat getFormat() { + if (!isOpen) { + return defaultFormat; + } + return currentFormat; + } + + public float getLevel() { + return AudioSystem.NOT_SPECIFIED; + } + } diff -r b191c8f8cb2d -r 8ddfb8d274c7 src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Wed Sep 03 10:47:27 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Wed Sep 03 15:11:46 2008 -0400 @@ -40,20 +40,33 @@ import java.util.ArrayList; import java.util.ArrayList; import java.util.List; +import javax.sound.sampled.Control; +import javax.sound.sampled.Line; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineListener; +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.Control.Type; -abstract class PulseAudioLine { +abstract class PulseAudioLine implements Line { protected List lineListeners = new ArrayList(); + protected List controls = new ArrayList(); + + // true between open() and close(). ie represents when a line has acquire + // resources protected boolean isOpen = false; public void addLineListener(LineListener listener) { this.lineListeners.add(listener); } - public void removeLineListener(LineListener listener) { - this.lineListeners.remove(listener); + @Override + public void close() { + if (!isOpen) { + throw new IllegalStateException("Line is not open"); + } + + isOpen = false; } protected void fireLineEvent(LineEvent e) { @@ -62,8 +75,51 @@ abstract class PulseAudioLine { } } + @Override + public Control getControl(Type control) { + if (isOpen) { + for (Control aControl : controls) { + if (aControl.getType() == control) { + return aControl; + } + } + } + throw new IllegalArgumentException(control.toString() + + " not supported"); + } + + @Override + public Control[] getControls() { + if (!isOpen) { + return new Control[] {}; + } + + return (Control[]) controls.toArray(new Control[0]); + } + + public boolean isControlSupported(Type control) { + for (Control myControl : controls) { + if (myControl.getType().getClass() == control.getClass()) { + return true; + } + } + return false; + } + public boolean isOpen() { return isOpen; } + @Override + public void open() throws LineUnavailableException { + if (isOpen) { + throw new IllegalStateException("Line is already open"); + } + isOpen = true; + } + + public void removeLineListener(LineListener listener) { + lineListeners.remove(listener); + } + } diff -r b191c8f8cb2d -r 8ddfb8d274c7 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Wed Sep 03 10:47:27 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Wed Sep 03 15:11:46 2008 -0400 @@ -119,15 +119,17 @@ public class PulseAudioMixer implements Map properties; - int[] channelSizes = new int[] { 1, 2, 5 }; + /* + * frameSize = sample size (in bytes, not bits) x # of channels ^ From + * PulseAudio's sources + * http://git.0pointer.de/?p=pulseaudio.git;a=blob;f=src/pulse/sample.c;h=93da2465f4301e27af4976e82737c3a048124a68;hb=82ea8dde8abc51165a781c69bc3b38034d62d969#l63 + */ + + int[] channelSizes = new int[] { 1, 2, 5, 6, 8 }; for (int channelSize : channelSizes) { properties = new HashMap(); properties.put(PULSEAUDIO_FORMAT_KEY, "PA_SAMPLE_U8"); - // frameSize = sample size (in bytes, not bits) x # of channels - // ^ that's from PulseAudio sources, so it will pretty much break - // as soon as they change something - // FIXME ^ int sampleSize = 8; // in bits AudioFormat PA_SAMPLE_U8 = new AudioFormat(Encoding.PCM_UNSIGNED, // encoding AudioSystem.NOT_SPECIFIED, // sample rate @@ -145,11 +147,6 @@ public class PulseAudioMixer implements properties = new HashMap(); properties.put(PULSEAUDIO_FORMAT_KEY, "PA_SAMPLE_ALAW"); - // frameSize = sample size (in bytes, not bits) x # of channels - // ^ that's from PulseAudio sources, so it will pretty much break - // as soon as they change something - // FIXME ^ - int sampleSize = 8; final AudioFormat PA_SAMPLE_ALAW = new AudioFormat(Encoding.ALAW, // encoding AudioSystem.NOT_SPECIFIED, // sample rate @@ -167,11 +164,6 @@ public class PulseAudioMixer implements properties = new HashMap(); properties.put(PULSEAUDIO_FORMAT_KEY, "PA_SAMPLE_ULAW"); - // frameSize = sample size (in bytes, not bits) x # of channels - // ^ that's from PulseAudio sources, so it will pretty much break - // as soon as they change something - // FIXME ^ - int sampleSize = 8; final AudioFormat PA_SAMPLE_ULAW = new AudioFormat(Encoding.ULAW, // encoding AudioSystem.NOT_SPECIFIED, // sample rate @@ -188,11 +180,6 @@ public class PulseAudioMixer implements for (int channelSize : channelSizes) { properties = new HashMap(); properties.put(PULSEAUDIO_FORMAT_KEY, "PA_SAMPLE_S16BE"); - - // frameSize = sample size (in bytes, not bits) x # of channels - // ^ that's from PulseAudio sources, so it will pretty much break - // as soon as they change something - // FIXME ^ int sampleSize = 16; final AudioFormat PA_SAMPLE_S16BE = new AudioFormat( @@ -212,11 +199,6 @@ public class PulseAudioMixer implements properties = new HashMap(); properties.put(PULSEAUDIO_FORMAT_KEY, "PA_SAMPLE_S16LE"); - // frameSize = sample size (in bytes, not bits) x # of channels - // ^ that's from PulseAudio sources, so it will pretty much break - // as soon as they change something - // FIXME ^ - int sampleSize = 16; final AudioFormat A_SAMPLE_S16LE = new AudioFormat( Encoding.PCM_SIGNED, // encoding @@ -235,11 +217,6 @@ public class PulseAudioMixer implements properties = new HashMap(); properties.put(PULSEAUDIO_FORMAT_KEY, "PA_SAMPLE_S32BE"); - // frameSize = sample size (in bytes, not bits) x # of channels - // ^ that's from PulseAudio sources, so it will pretty much break - // as soon as they change something - // FIXME ^ - int sampleSize = 32; final AudioFormat PA_SAMPLE_S32BE = new AudioFormat( Encoding.PCM_SIGNED, // encoding @@ -258,11 +235,6 @@ public class PulseAudioMixer implements properties = new HashMap(); properties.put(PULSEAUDIO_FORMAT_KEY, "PA_SAMPLE_S32LE"); - // frameSize = sample size (in bytes, not bits) x # of channels - // ^ that's from PulseAudio sources, so it will pretty much break - // as soon as they change something - // FIXME ^ - int sampleSize = 32; final AudioFormat PA_SAMPLE_S32LE = new AudioFormat( Encoding.PCM_SIGNED, // encoding @@ -284,7 +256,7 @@ public class PulseAudioMixer implements public Line getLine(javax.sound.sampled.Line.Info info) throws LineUnavailableException { - if (!this.isOpen) { + if (!isOpen) { throw new LineUnavailableException(); } @@ -331,12 +303,8 @@ public class PulseAudioMixer implements return new PulseAudioClip(eventLoop, formats, defaultFormat); } - String portName; - boolean isSource; - if (Port.Info.class.isInstance(info)) { Port.Info portInfo = (Port.Info) info; - portName = portInfo.getName(); if (portInfo.isSource()) { return new PulseAudioSourcePort(portInfo.getName(), eventLoop); From gnu_andrew at member.fsf.org Thu Sep 4 01:45:15 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Thu, 4 Sep 2008 09:45:15 +0100 Subject: [patch] Support New NIO in IcedTea In-Reply-To: <20080903150949.GA24121@bamboo.destinee.acro.gen.nz> References: <20080831004043.GA19370@bamboo.destinee.acro.gen.nz> <1220193693.3524.24.camel@hermans.wildebeest.org> <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> <17c6771e0809011016y7755358dm5bd9cd7b6eb412ea@mail.gmail.com> <20080902003845.GE19370@bamboo.destinee.acro.gen.nz> <17c6771e0809020825y1ca96d87g828ff903e7eb1da2@mail.gmail.com> <20080903150949.GA24121@bamboo.destinee.acro.gen.nz> Message-ID: <17c6771e0809040145x1dd8a42dsa20e7df0e52509b6@mail.gmail.com> 2008/9/3 C. K. Jester-Young : > Attached are some patches that help the current nio2 tip build with the > current IcedTea tip. :-) The rest of the message is my reply to Andrew, > which other readers probably won't care about. :-P > > On Tue, Sep 02, 2008 at 04:25:49PM +0100, Andrew John Hughes wrote: >> >> Could be the opening " after bootclasspath without a closing one. >> > >> > That's two single quotes, not a double quote, so it should represent an >> > empty string. >> >> Sorry, hard to tell with whatever font GMail is using... > > Yeah, it's a bit a shame that you can't choose to use a monospace font > with Gmail...I personally use Mutt to do all my mailing list stuff, just > because no webmail system I've seen does proper (strict) threading, list > header fields (Mail-Followup-To, etc.), inline attachments, customisable > attachment content types, or the like. I sang with joy the day I heard > that Gmail supported IMAP access. > Yes, I have a bug list for it as long as my arm, trying to force top-posting being the main one. I reported this but they seem to have done nothing to fix it. I use Mutt for my university IMAP account but it's far too slow to use with the amount of mail I get and unsecured - this is probably down to the University's choice of mail server rather than IMAP itself. Is Google's IMAP access SSL-encrypted? >> Well that's actually IcedTea. I'm not sure what the difference is >> between --with-openjdk >> and --with-icedtea except that the latter is probably more well-tested. > > >From what I can see, there isn't a difference between the two except > the default directories that get used for each. > Yeah, there is still a lot of oddities in IcedTea that I don't really understand and pre-date its public availability. Another is that an ecj binary is detected, but I'm not sure it's even used any more. The ecj used by ecj builds is from javac.in which means it's always interpreted; this is actually what slows my build down the most noticeably, and I've been meaning to look into getting it to pre-compile ecj if gcj is detected. Using the system ecj would fix this too, but I guess there are some broken versions out there in various distros. >> > I'm doing my testing with ecj now; once I have the fixes for that, I'll >> > be posting another patch! (The nio2 repository has had more updates >> > since, so my new patches are tracking those updates, as well as the >> > recent IcedTea6 merges that have occurred---oh, and by the way, thanks >> > for applying my implicit-enable-hg patch!) >> >> These merges are fun aren't they... at least we aren't stuck with CVS! > > True, true...well, I finally got them completed (at 3 am, no less: I'll > be away for a whole week in 5 hours' time, and I wanted these changes > to go through before the nio2 tip gets updated again and all my work has > to be redone :-P). > > The @Override-stripping patch is quite large, and the nio2 updates have > caused the gensrc changes to triple in size, so I've zipped those up. > (Again, these both apply to the nio2 tip as of current writing, so you > may need to repull your sources.) The main build script changes remain > inline so they can be easily reviewed. > > So, hope you and Mark and maybe other interested parties have fun with > them! Hopefully there won't be too many changes to the nio2 tip before I > return.... :-) > Thanks! I'll try and give it a test drive this evening. > Enjoy, > ---Chris K. > -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From neugens at limasoftware.net Thu Sep 4 16:57:48 2008 From: neugens at limasoftware.net (Mario Torre) Date: Fri, 05 Sep 2008 01:57:48 +0200 Subject: Support BSD and Caciocavallo In-Reply-To: <17c6771e0808311301x7c7281a5od6ae9a8cbc35084a@mail.gmail.com> References: <17c6771e0808291839y2a26b031pd4cb226c8facb51c@mail.gmail.com> <1220193060.3524.12.camel@hermans.wildebeest.org> <17c6771e0808311301x7c7281a5od6ae9a8cbc35084a@mail.gmail.com> Message-ID: <1220572668.2895.10.camel@nirvana> Il giorno dom, 31/08/2008 alle 21.01 +0100, Andrew John Hughes ha scritto: > On 31/08/2008, Mark Wielaard wrote: > > Hi Andrew, > > > > > > On Sat, 2008-08-30 at 02:39 +0100, Andrew John Hughes wrote: > > > This patch adds support for downloading the BSD and Caciocavallo trees > > > to IcedTea. > > > You can choose a project using --with-project and a value of jdk7 (the > > > default), closures, cvmi, caciocavallo and bsd to select a tree. > > > > > > Heay, that is super cool! Hi Andrew! Hey I missed this, thanks! > > > > Yeah, this might be a bit of a pain to keep current. Either the projects > > supported need to sync often enough or we need to differentiate our > > patches. Neither is really that attractive. The best thing would > > probably be for us to help these projects get pushed into the main jdk7 > > tree sooner. > > > > Some patches are more prone to this than others, or, in other words, there are > some patches that break with just about every build drop as well. > I'll try and clean We have few patches in our cacio repo that are quite sensible to this, too, most notably the Font related patches. We need these in a couple of places, and we should discuss this with the Sun guys and find a good solution for the Font stuff because our patches there are hacky, but the current code is not much better, and this is one of the areas where the peers code is quite sensible. We are going on with the project anyway, and I think we will port the new stuff to a newer jdk drop in a couple of weeks or so (optimistically, there is always no real time for doing anything), so I think that the icedtea patches will apply cleanly again. I also think that we had to "steal" a couple of patches from icedtea, probably the ones related to gcc 4.3, so one reason why they don't apply cleanly maybe because they are already there? I'll try to give it a look this weekend. Thanks, Mario From bugzilla-daemon at icedtea.classpath.org Fri Sep 5 06:13:09 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 05 Sep 2008 13:13:09 +0000 Subject: [Bug 190] New: zero does not run JSR166 TCK Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=190 Summary: zero does not run JSR166 TCK Product: IcedTea Version: unspecified Platform: All OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: twisti at complang.tuwien.ac.at We are running nightly tests with IcedTea zero but there is a problem in running the JSR166 TCK: http://c1.complang.tuwien.ac.at/pipermail/cacao-testresults/2008-September/002187.html -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Sep 5 06:15:45 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 05 Sep 2008 13:15:45 +0000 Subject: [Bug 190] zero does not run JSR166 TCK Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=190 gbenson at redhat.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at icedtea.classpath|gbenson at redhat.com |.org | -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Fri Sep 5 06:44:27 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 05 Sep 2008 13:44:27 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-04 Omair Majid changeset c0fcd9764516 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=c0fcd9764516 description: 2008-09-04 Omair Majid * .hgignore: Added .swp files to ignore list diffstat: 1 file changed, 1 insertion(+) .hgignore | 1 + diffs (11 lines): diff -r 56be77eae7fe -r c0fcd9764516 .hgignore --- a/.hgignore Thu Sep 04 14:21:43 2008 -0400 +++ b/.hgignore Thu Sep 04 14:23:50 2008 -0400 @@ -7,6 +7,7 @@ org_classpath_icedtea_*.h org_classpath_icedtea_*.h *.log *.orig +*.swp bin/* lib/* Makefile From omajid at redhat.com Fri Sep 5 06:44:27 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 05 Sep 2008 13:44:27 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-04 Omair Majid changeset 56be77eae7fe in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=56be77eae7fe description: 2008-09-04 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (close): Delegate the actual closing of the stream to the parent. This handles any synchronization issues in calling the listeners. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java (open): Added a test in the beginning. Added a comment explaining how open and close guarenteed that any LineLinsteners are invoked. (close): moved the super.close() to the end of the function to ensure that this class cleans up before it asks the parent class to do so. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java (close): clear lineListeners. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java (close): Added comments explaining the asserts. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java (testClipOpenWrongUse): New name for testClipOpen to make the intention clear. There is another test called testClipOpens. (testCloseEvent): Removed the artifical delay after fixing the problem. (testStartedStopped): New function. Test the START and STOP events. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java (testStartedStopped): New function. Tests PulseAudioTargetDataLine for support of START and STOP events. * unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java (testStartedStopped): Enabled testing of START events. diffstat: 7 files changed, 150 insertions(+), 21 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 8 - src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 22 ++- src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java | 2 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 6 unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java | 69 ++++++++-- unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 62 ++++++++ unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java | 2 diffs (307 lines): diff -r 8ddfb8d274c7 -r 56be77eae7fe src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Wed Sep 03 15:11:46 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Thu Sep 04 14:21:43 2008 -0400 @@ -194,14 +194,10 @@ public class PulseAudioClip extends Puls e.printStackTrace(); } - synchronized (eventLoop.threadLock) { - drain(); - stream.disconnect(); - isOpen = false; - } - PulseAudioMixer mixer = PulseAudioMixer.getInstance(); mixer.removeSourceLine(this); + + super.close(); } diff -r 8ddfb8d274c7 -r 56be77eae7fe src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Wed Sep 03 15:11:46 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Thu Sep 04 14:21:43 2008 -0400 @@ -74,6 +74,10 @@ public abstract class PulseAudioDataLine public void open(AudioFormat format, int bufferSize) throws LineUnavailableException { + if (isOpen) { + throw new IllegalStateException("DataLine is already open"); + } + for (AudioFormat myFormat : supportedFormats) { if (format.matches(myFormat)) { synchronized (eventLoop.threadLock) { @@ -97,6 +101,20 @@ public abstract class PulseAudioDataLine @Override public void update() { synchronized (eventLoop.threadLock) { + + /* + * Not the order: first we notify all the listeners, and + * then return. this means no race conditions when the + * listeners are removed before they get called by close + * + * eg: + * + * line.close(); line.removeLineListener(listener) + * + * the listener is guaranteed to have run + * + */ + if (stream.getState() == Stream.State.READY) { fireLineEvent(new LineEvent(PulseAudioDataLine.this, LineEvent.Type.OPEN, AudioSystem.NOT_SPECIFIED)); @@ -167,8 +185,6 @@ public abstract class PulseAudioDataLine public void close() { - super.close(); - synchronized (eventLoop.threadLock) { drain(); stream.disconnect(); @@ -179,6 +195,8 @@ public abstract class PulseAudioDataLine } catch (InterruptedException e) { throw new RuntimeException("unable to prepare stream"); } + + super.close(); } diff -r 8ddfb8d274c7 -r 56be77eae7fe src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Wed Sep 03 15:11:46 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Thu Sep 04 14:21:43 2008 -0400 @@ -66,6 +66,8 @@ abstract class PulseAudioLine implements throw new IllegalStateException("Line is not open"); } + lineListeners.clear(); + isOpen = false; } diff -r 8ddfb8d274c7 -r 56be77eae7fe src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Wed Sep 03 15:11:46 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Thu Sep 04 14:21:43 2008 -0400 @@ -448,11 +448,11 @@ public class PulseAudioMixer implements if (sourceLines.size() > 0) { System.out.println("DEBUG: some source lines have not been closed"); - assert (sourceLines.size() < 0); + assert (sourceLines.size() < 0); // always fail } if (targetLines.size() > 0) { System.out.println("DEBUG: some target lines have not been closed"); - assert (targetLines.size() < 0); + assert (targetLines.size() < 0); // always fail } synchronized (lineListeners) { @@ -596,7 +596,7 @@ public class PulseAudioMixer implements if (eventLoop.getStatus() != 4) { /* * when exiting, wait for the thread to end otherwise we get one - * thread that inits the singletone with new data and the old + * thread that inits the singleton with new data and the old * thread then cleans up the singleton asserts fail all over the * place */ diff -r 8ddfb8d274c7 -r 56be77eae7fe unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Wed Sep 03 15:11:46 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Thu Sep 04 14:21:43 2008 -0400 @@ -45,6 +45,7 @@ import javax.sound.sampled.AudioSystem; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.sound.sampled.Control; +import javax.sound.sampled.DataLine; import javax.sound.sampled.Line; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineListener; @@ -91,7 +92,7 @@ public class PulseAudioClipTest { } @Test(expected = IllegalArgumentException.class) - public void testClipOpen() throws LineUnavailableException { + public void testClipOpenWrongUse() throws LineUnavailableException { Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); clip.open(); } @@ -222,19 +223,69 @@ public class PulseAudioClipTest { clip.open(audioInputStream); clip.close(); - try { - // wait a little while before removing the listener - // to ensure it is called before we remove it - Thread.sleep(100); - } catch (InterruptedException e) { - e.printStackTrace(); - } clip.removeLineListener(closeListener); Assert.assertEquals(1, closed); } - + + int started = 0; + int stopped = 0; + + @Test + public void testStartedStopped() throws LineUnavailableException, + UnsupportedAudioFileException, IOException { + + File soundFile = new File("testsounds/startup.wav"); + AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + AudioFormat audioFormat = audioInputStream.getFormat(); + + Clip clip; + clip = (Clip) mixer.getLine(new DataLine.Info( + Clip.class, audioFormat)); + Assert.assertNotNull(clip); + + started = 0; + stopped = 0; + + clip.open(audioInputStream); + + LineListener startStopListener = new LineListener() { + + @Override + public void update(LineEvent event) { + if (event.getType() == LineEvent.Type.START) { + started++; + Assert.assertEquals(1, started); + } + + if (event.getType() == LineEvent.Type.STOP) { + System.out.println("Stopped event"); + stopped++; + Assert.assertEquals(1, stopped); + } + } + + }; + + clip.addLineListener(startStopListener); + + clip.start(); + clip.drain(); + + clip.stop(); + clip.close(); + + Assert.assertEquals(1, started); + Assert.assertEquals(1, stopped); + + started = 0; + stopped = 0; + + } + + @Test public void testLoop0Clip() throws LineUnavailableException, IOException, UnsupportedAudioFileException { diff -r 8ddfb8d274c7 -r 56be77eae7fe unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Wed Sep 03 15:11:46 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Thu Sep 04 14:21:43 2008 -0400 @@ -1,6 +1,10 @@ package org.classpath.icedtea.pulseaudio package org.classpath.icedtea.pulseaudio; +import java.io.File; +import java.io.IOException; + import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.Line; @@ -10,6 +14,7 @@ import javax.sound.sampled.Mixer; import javax.sound.sampled.Mixer; import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.TargetDataLine; +import javax.sound.sampled.UnsupportedAudioFileException; import junit.framework.JUnit4TestAdapter; @@ -129,6 +134,63 @@ public class PulseAudioTargetDataLineTes } + int started = 0; + int stopped = 0; + + @Test + public void testStartedStopped() throws LineUnavailableException, + UnsupportedAudioFileException, IOException { + + File soundFile = new File("testsounds/startup.wav"); + AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + AudioFormat audioFormat = audioInputStream.getFormat(); + + TargetDataLine line; + line = (TargetDataLine) mixer.getLine(new DataLine.Info( + TargetDataLine.class, audioFormat)); + Assert.assertNotNull(line); + + started = 0; + stopped = 0; + + line.open(audioFormat); + + LineListener startStopListener = new LineListener() { + + @Override + public void update(LineEvent event) { + if (event.getType() == LineEvent.Type.START) { + started++; + Assert.assertEquals(1, started); + } + + if (event.getType() == LineEvent.Type.STOP) { + System.out.println("Stopped event"); + stopped++; + Assert.assertEquals(1, stopped); + } + } + + }; + + line.addLineListener(startStopListener); + + line.start(); + + line.drain(); + + line.stop(); + line.close(); + + Assert.assertEquals(1, started); + Assert.assertEquals(1, stopped); + + started = 0; + stopped = 0; + + } + @Test public void testMixerKnowsAboutOpenLines() throws LineUnavailableException { targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( diff -r 8ddfb8d274c7 -r 56be77eae7fe unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java Wed Sep 03 15:11:46 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java Thu Sep 04 14:21:43 2008 -0400 @@ -212,7 +212,7 @@ public class PulseSourceDataLineTest { line.stop(); line.close(); - // Assert.assertEquals(1, started); + Assert.assertEquals(1, started); Assert.assertEquals(1, stopped); started = 0; From A.Hughes at dcs.shef.ac.uk Fri Sep 5 08:14:49 2008 From: A.Hughes at dcs.shef.ac.uk (Andrew Hughes) Date: Fri, 5 Sep 2008 16:14:49 +0100 Subject: FYI: Minor fix for IcedTea Message-ID: <20080905151449.GA31473@omega.dcs.shef.ac.uk> We should make sure the stamps directory exists for hgforest.stamp (thanks Lillian!) ChangeLog: 2008-09-05 Andrew John Hughes Reported by: Lillian Angel * Makefile.am: Make sure we create the stamps directory for hgforest.stamp. -- A. :) Room 122, Department of Computer Science http://www.dcs.shef.ac.uk/~andrew PGP Key: 0D118B89 (http://subkeys.pgp.net) Fingerprint: 711E 2AC8 72FE F5CE BB0C 0637 9678 5E51 0D11 8B89 -------------- next part -------------- diff -r 50ffa5101de6 Makefile.am --- a/Makefile.am Mon Sep 01 04:21:47 2008 +0100 +++ b/Makefile.am Fri Sep 05 16:13:00 2008 +0100 @@ -436,6 +436,7 @@ endif endif endif + mkdir -p stamps touch stamps/hgforest.stamp clean-extract: From gnu_andrew at member.fsf.org Fri Sep 5 08:20:27 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Fri, 05 Sep 2008 15:20:27 +0000 Subject: changeset in /hg/icedtea: Make sure stamps directory exists for ... Message-ID: changeset 68862b0b79f4 in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=68862b0b79f4 description: Make sure stamps directory exists for hgforest.stamp 2008-09-05 Andrew John Hughes Reported by: Lillian Angel * Makefile.am: Make sure we create the stamps directory for hgforest.stamp. diffstat: 2 files changed, 7 insertions(+) ChangeLog | 6 ++++++ Makefile.am | 1 + diffs (24 lines): diff -r 50ffa5101de6 -r 68862b0b79f4 ChangeLog --- a/ChangeLog Mon Sep 01 04:21:47 2008 +0100 +++ b/ChangeLog Fri Sep 05 16:15:13 2008 +0100 @@ -1,3 +1,9 @@ 2008-08-31 Andrew John Hughes + + Reported by: Lillian Angel + * Makefile.am: Make sure we create + the stamps directory for hgforest.stamp. + 2008-08-31 Andrew John Hughes * Makefile.am: diff -r 50ffa5101de6 -r 68862b0b79f4 Makefile.am --- a/Makefile.am Mon Sep 01 04:21:47 2008 +0100 +++ b/Makefile.am Fri Sep 05 16:15:13 2008 +0100 @@ -436,6 +436,7 @@ endif endif endif endif + mkdir -p stamps touch stamps/hgforest.stamp clean-extract: From dbhole at redhat.com Fri Sep 5 09:12:03 2008 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 05 Sep 2008 16:12:03 +0000 Subject: changeset in /hg/icedtea6: - Added support for multiple simultan... Message-ID: changeset 4c642bbb2285 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=4c642bbb2285 description: - Added support for multiple simultaneous applet load (same tab or different) - http://www.w3.org/People/mimasa/test/object/java/clock - Added support for load via object/embed/applet tags with "classid" - i.e. everything here http://www.w3.org/People/mimasa/test/object/java/ - Improved shutdown subroutine for clean (er) exit - Added support for applets that specify height/width as %'s of window size - Fixed a couple of minor race condition issues diffstat: 6 files changed, 594 insertions(+), 282 deletions(-) ChangeLog | 12 IcedTeaPlugin.cc | 412 +++++++++++++--------- patches/icedtea-liveconnect.patch | 154 +++++--- patches/icedtea-webstart.patch | 275 +++++++++++--- rt/net/sourceforge/jnlp/NetxPanel.java | 16 rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 7 diffs (truncated from 1442 to 500 lines): diff -r 2cfd464ee271 -r 4c642bbb2285 ChangeLog --- a/ChangeLog Mon Sep 01 10:36:56 2008 +0200 +++ b/ChangeLog Fri Sep 05 12:11:57 2008 -0400 @@ -1,3 +1,15 @@ 2008-08-28 Mark Wielaard + + * IcedTeaPlugin.cc: Support for multiple simultaneous applet load. + * patches/icedtea-liveconnect.patch: Support for multiple simultaneous + applet load. Improved shutdown. + * patches/icedtea-webstart.patch: Added support for applets that specify + height/width as factor of window size. + * rt/net/sourceforge/jnlp/NetxPanel.java: Added synchronization for + JNLPRuntime initialization. + * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Added mutex object + around which initialization can be synchronized. + 2008-08-28 Mark Wielaard * patches/icedtea-clean-crypto.patch: New patch. diff -r 2cfd464ee271 -r 4c642bbb2285 IcedTeaPlugin.cc --- a/IcedTeaPlugin.cc Mon Sep 01 10:36:56 2008 +0200 +++ b/IcedTeaPlugin.cc Fri Sep 05 12:11:57 2008 -0400 @@ -246,6 +246,11 @@ static char* appletviewer_executable = N static char* appletviewer_executable = NULL; static char* libjvm_so = NULL; +class IcedTeaPluginFactory; + +static PRBool factory_created = PR_FALSE; +static IcedTeaPluginFactory* factory = NULL; + #include #include @@ -375,6 +380,26 @@ char const* TYPES[10] = { "Object", #define MESSAGE_SEND() \ factory->SendMessageToAppletViewer (message); +// FIXME: Right now, the macro below will exit only +// if error occured and we are in the middle of a +// shutdown (so that the permanent loop does not block +// proper exit). We need better error handling + +#define PROCESS_PENDING_EVENTS_REF(reference) \ + if (factory->shutting_down == PR_TRUE && \ + factory->resultMap[reference]->errorOccured == PR_TRUE) \ + { \ + printf("Error occured. Exiting function\n"); \ + return NS_ERROR_FAILURE; \ + } \ + PRBool hasPending; \ + factory->current->HasPendingEvents(&hasPending); \ + if (hasPending == PR_TRUE) { \ + PRBool processed = PR_FALSE; \ + factory->current->ProcessNextEvent(PR_TRUE, &processed); \ + } else { \ + PR_Sleep(PR_INTERVAL_NO_WAIT); \ + } #define PROCESS_PENDING_EVENTS \ PRBool hasPending; \ @@ -391,7 +416,7 @@ char const* TYPES[10] = { "Object", printf ("RECEIVE 1\n"); \ while (factory->resultMap[reference]->returnIdentifier == -1) \ { \ - PROCESS_PENDING_EVENTS; \ + PROCESS_PENDING_EVENTS_REF (reference); \ } \ printf ("RECEIVE 3\n"); \ if (factory->resultMap[reference]->returnIdentifier == 0) \ @@ -412,7 +437,7 @@ char const* TYPES[10] = { "Object", printf("RECEIVE ID 1\n"); \ while (factory->resultMap[reference]->returnIdentifier == -1) \ { \ - PROCESS_PENDING_EVENTS; \ + PROCESS_PENDING_EVENTS_REF (reference); \ } \ \ *id = reinterpret_cast \ @@ -426,7 +451,7 @@ char const* TYPES[10] = { "Object", printf("RECEIVE VALUE 1\n"); \ while (factory->resultMap[reference]->returnValue == "") \ { \ - PROCESS_PENDING_EVENTS; \ + PROCESS_PENDING_EVENTS_REF (reference); \ } \ *result = ParseValue (type, factory->resultMap[reference]->returnValue); // \ @@ -442,7 +467,7 @@ char const* TYPES[10] = { "Object", printf("RECEIVE SIZE 1\n"); \ while (factory->resultMap[reference]->returnValue == "") \ { \ - PROCESS_PENDING_EVENTS; \ + PROCESS_PENDING_EVENTS_REF (reference); \ } \ nsresult conversionResult; \ *result = factory->resultMap[reference]->returnValue.ToInteger (&conversionResult); \ @@ -458,7 +483,7 @@ char const* TYPES[10] = { "Object", printf("RECEIVE STRING 1\n"); \ while (factory->resultMap[reference]->returnValue == "") \ { \ - PROCESS_PENDING_EVENTS; \ + PROCESS_PENDING_EVENTS_REF (reference); \ } \ printf("Setting result to: %s\n", strdup (factory->resultMap[reference]->returnValue.get ())); \ *result = reinterpret_cast \ @@ -474,7 +499,7 @@ char const* TYPES[10] = { "Object", printf("RECEIVE STRING UCS 1\n"); \ while (factory->resultMap[reference]->returnValueUCS.IsEmpty()) \ { \ - PROCESS_PENDING_EVENTS; \ + PROCESS_PENDING_EVENTS_REF (reference); \ } \ int length = factory->resultMap[reference]->returnValueUCS.Length (); \ jchar* newstring = static_cast (PR_Malloc (length)); \ @@ -493,7 +518,7 @@ char const* TYPES[10] = { "Object", printf("RECEIVE BOOLEAN 1\n"); \ while (factory->resultMap[reference]->returnIdentifier == -1) \ { \ - PROCESS_PENDING_EVENTS; \ + PROCESS_PENDING_EVENTS_REF (reference); \ } \ *result = factory->resultMap[reference]->returnIdentifier; // res = factory->current->ProcessNextEvent (PR_TRUE, \ @@ -651,6 +676,7 @@ class ResultContainer PRUint32 returnIdentifier; nsCString returnValue; nsString returnValueUCS; + PRBool errorOccured; }; @@ -661,6 +687,7 @@ ResultContainer::ResultContainer () returnIdentifier = -1; returnValue.Truncate(); returnValueUCS.Truncate(); + errorOccured = PR_FALSE; } ResultContainer::~ResultContainer () @@ -680,6 +707,7 @@ ResultContainer::Clear() returnIdentifier = -1; returnValue.Truncate(); returnValueUCS.Truncate(); + errorOccured = PR_FALSE; } #include @@ -732,7 +760,10 @@ public: PRBool IsConnected (); nsCOMPtr async; nsCOMPtr current; + nsCOMPtr input; + nsCOMPtr output; ReferenceHashtable references; + PRBool shutting_down; // FIXME: make private? JNIEnv* proxyEnv; nsISecureEnv* secureEnv; @@ -755,11 +786,10 @@ private: nsresult StartAppletviewer (); void ProcessMessage(); void ConsumeMsgFromJVM(); + void CreateSocket(); nsCOMPtr processThread; nsCOMPtr sink; nsCOMPtr transport; - nsCOMPtr input; - nsCOMPtr output; nsCOMPtr applet_viewer_process; PRBool connected; PRUint32 next_instance_identifier; @@ -774,7 +804,6 @@ private: int string_identifier; int slot_index; int value_identifier; - PRBool shutting_down; /** * JNI I/O related code @@ -1113,6 +1142,77 @@ private: int contextCounter; }; + +#include +#include +#include +#include +#include +#include + +class IcedTeaRunnable : public nsIRunnable +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIRUNNABLE + + IcedTeaRunnable (); + + ~IcedTeaRunnable (); +}; + +NS_IMPL_ISUPPORTS1 (IcedTeaRunnable, nsIRunnable) + +IcedTeaRunnable::IcedTeaRunnable () +{ +} + +IcedTeaRunnable::~IcedTeaRunnable () +{ +} + +NS_IMETHODIMP +IcedTeaRunnable::Run () +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +template +class IcedTeaRunnableMethod : public IcedTeaRunnable +{ +public: + typedef void (T::*Method) (); + + IcedTeaRunnableMethod (T* object, Method method); + NS_IMETHOD Run (); + + ~IcedTeaRunnableMethod (); + + T* object; + Method method; +}; + +template +IcedTeaRunnableMethod::IcedTeaRunnableMethod (T* object, Method method) +: object (object), + method (method) +{ + NS_ADDREF (object); +} + +template +IcedTeaRunnableMethod::~IcedTeaRunnableMethod () +{ + NS_RELEASE (object); +} + +template NS_IMETHODIMP +IcedTeaRunnableMethod::Run () +{ + (object->*method) (); + return NS_OK; +} + NS_IMPL_ISUPPORTS6 (IcedTeaPluginFactory, nsIFactory, nsIPlugin, nsIJVMManager, nsIJVMPrefsWindow, nsIJVMPlugin, nsIInputStreamCallback) @@ -1141,6 +1241,8 @@ IcedTeaPluginFactory::~IcedTeaPluginFact // FIXME: why did this crash with threadManager == 0x0 on shutdown? PLUGIN_TRACE_FACTORY (); secureEnv = 0; + factory_created = PR_FALSE; + factory = NULL; printf ("DECONSTRUCTING FACTORY\n"); } @@ -1189,16 +1291,83 @@ IcedTeaPluginFactory::Initialize () PLUGIN_DEBUG_TWO ("Factory::Initialize: using", appletviewer_executable); + nsCOMPtr manager; + result = NS_GetComponentManager (getter_AddRefs (manager)); + +/** + * JNI I/O code + + // Initialize mutex to control access to the jvm + jvmPRMonitor = PR_NewMonitor(); +*/ + jvmMsgQueuePRMonitor = PR_NewMonitor(); + + nsCOMPtr threadManager; + result = manager->CreateInstanceByContractID + (NS_THREADMANAGER_CONTRACTID, nsnull, NS_GET_IID (nsIThreadManager), + getter_AddRefs (threadManager)); + PLUGIN_CHECK_RETURN ("thread manager", result); + + result = threadManager->GetCurrentThread (getter_AddRefs (current)); + PLUGIN_CHECK_RETURN ("current thread", result); + +/* + * + * Socket related code for TCP/IP communication + * + */ + + nsCOMPtr socketCreationThread; + nsCOMPtr socketCreationEvent = + new IcedTeaRunnableMethod + (this, &IcedTeaPluginFactory::IcedTeaPluginFactory::CreateSocket); + + NS_NewThread(getter_AddRefs(socketCreationThread), socketCreationEvent); + + PLUGIN_DEBUG ("Instance::Initialize: awaiting connection from appletviewer"); + PRBool processed; + + // FIXME: move this somewhere applet-window specific so it doesn't block page + // display. + // FIXME: this doesn't work with thisiscool.com. + while (!IsConnected ()) + { +// result = socketCreationThread->ProcessNextEvent (PR_TRUE, &processed); +// PLUGIN_CHECK_RETURN ("wait for connection: process next event", result); + } + PLUGIN_DEBUG ("Instance::Initialize:" + " got confirmation that appletviewer is running."); + + return NS_OK; +} + +void +IcedTeaPluginFactory::CreateSocket () +{ + + PRBool processed; + nsresult result; + // Start appletviewer process for this plugin instance. nsCOMPtr manager; result = NS_GetComponentManager (getter_AddRefs (manager)); - PLUGIN_CHECK_RETURN ("get component manager", result); + PLUGIN_CHECK ("get component manager", result); result = manager->CreateInstance (nsILiveconnect::GetCID (), nsnull, NS_GET_IID (nsILiveconnect), getter_AddRefs (liveconnect)); - PLUGIN_CHECK_RETURN ("liveconnect", result); + PLUGIN_CHECK ("liveconnect", result); + + nsCOMPtr threadManager; + nsCOMPtr curr_thread; + result = manager->CreateInstanceByContractID + (NS_THREADMANAGER_CONTRACTID, nsnull, NS_GET_IID (nsIThreadManager), + getter_AddRefs (threadManager)); + PLUGIN_CHECK ("thread manager", result); + + result = threadManager->GetCurrentThread (getter_AddRefs (curr_thread)); + /* * Socket initialization code for TCP/IP communication @@ -1210,73 +1379,27 @@ IcedTeaPluginFactory::Initialize () nsnull, NS_GET_IID (nsIServerSocket), getter_AddRefs (socket)); - PLUGIN_CHECK_RETURN ("create server socket", result); + PLUGIN_CHECK ("create server socket", result); // FIXME: hard-coded port result = socket->Init (50007, PR_TRUE, -1); - PLUGIN_CHECK_RETURN ("socket init", result); + PLUGIN_CHECK ("socket init", result); nsCOMPtr listener = new IcedTeaSocketListener (this); result = socket->AsyncListen (listener); - PLUGIN_CHECK_RETURN ("add socket listener", result); - -/** - * JNI I/O code - - // Initialize mutex to control access to the jvm - jvmPRMonitor = PR_NewMonitor(); -*/ - jvmMsgQueuePRMonitor = PR_NewMonitor(); + PLUGIN_CHECK ("add socket listener", result); result = StartAppletviewer (); - PLUGIN_CHECK_RETURN ("started appletviewer", result); - - nsCOMPtr threadManager; - result = manager->CreateInstanceByContractID - (NS_THREADMANAGER_CONTRACTID, nsnull, NS_GET_IID (nsIThreadManager), - getter_AddRefs (threadManager)); - PLUGIN_CHECK_RETURN ("thread manager", result); - - result = threadManager->GetCurrentThread (getter_AddRefs (current)); - PLUGIN_CHECK_RETURN ("current thread", result); - -/* - * - * Socket related code for TCP/IP communication - * - */ - - PLUGIN_DEBUG ("Instance::Initialize: awaiting connection from appletviewer"); - PRBool processed; - // FIXME: move this somewhere applet-window specific so it doesn't block page - // display. - // FIXME: this doesn't work with thisiscool.com. - while (!IsConnected ()) - { - result = current->ProcessNextEvent (PR_TRUE, &processed); - PLUGIN_CHECK_RETURN ("wait for connection: process next event", result); - } - PLUGIN_DEBUG ("Instance::Initialize:" - " got confirmation that appletviewer is running."); - - result = transport->OpenOutputStream (nsITransport::OPEN_BLOCKING, - nsnull, nsnull, - getter_AddRefs (output)); - PLUGIN_CHECK_RETURN ("output stream", result); - - result = transport->OpenInputStream (0, nsnull, nsnull, - getter_AddRefs (input)); - PLUGIN_CHECK_RETURN ("input stream", result); - - async = do_QueryInterface (input, &result); - PLUGIN_CHECK_RETURN ("async input stream", result); - - result = async->AsyncWait (this, 0, 0, current); - PLUGIN_CHECK_RETURN ("add async wait", result); - - return NS_OK; + PLUGIN_CHECK ("started appletviewer", result); + + while (!IsConnected()) + { + result = curr_thread->ProcessNextEvent (PR_TRUE, &processed); + PLUGIN_CHECK ("wait for connection: process next event", result); + } + } NS_IMETHODIMP @@ -1297,6 +1420,7 @@ IcedTeaPluginFactory::Shutdown () PRInt32 exitVal; applet_viewer_process->GetExitValue(&exitVal); +/* PRUint32 max_sleep_time = 2000; PRUint32 sleep_time = 0; while ((sleep_time < max_sleep_time) && (exitVal == -1)) { @@ -1312,6 +1436,7 @@ IcedTeaPluginFactory::Shutdown () printf("Appletviewer still appears to be running. Trying to kill it...\n"); applet_viewer_process->Kill(); } +*/ return NS_OK; } @@ -1949,6 +2074,15 @@ NS_IMETHODIMP NS_IMETHODIMP IcedTeaPluginInstance::GetPeer (nsIPluginInstancePeer** aPeer) { + + PRBool processed; + nsresult result; + while (!peer) + { + result = factory->current->ProcessNextEvent(PR_TRUE, &processed); + PLUGIN_CHECK_RETURN ("wait for peer: process next event", result); + } + printf ("GETTING PEER!!!: %p\n", peer); *aPeer = peer; // FIXME: where is this unref'd? @@ -2258,76 +2392,6 @@ IcedTeaPluginFactory::OnInputStreamReady nsresult result = async->AsyncWait (this, 0, 0, current); PLUGIN_CHECK_RETURN ("re-add async wait", result); - return NS_OK; -} - -#include -#include -#include -#include -#include -#include - -class IcedTeaRunnable : public nsIRunnable -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIRUNNABLE - - IcedTeaRunnable (); - - ~IcedTeaRunnable (); -}; - -NS_IMPL_ISUPPORTS1 (IcedTeaRunnable, nsIRunnable) - -IcedTeaRunnable::IcedTeaRunnable () -{ -} From bugzilla-daemon at icedtea.classpath.org Fri Sep 5 12:55:14 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 05 Sep 2008 19:55:14 +0000 Subject: [Bug 191] New: Openjdk Crash Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=191 Summary: Openjdk Crash Product: IcedTea Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: thelion85 at gmail.com One day i see these logs in my /home. Maybe in firefox 3 some java applets don't work. I don't know if they are related. http://rafb.net/p/QrSkQY15.html http://rafb.net/p/iWpV2f60.html http://rafb.net/p/WsOCsm90.html -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From Dalibor.Topic at Sun.COM Fri Sep 5 15:43:30 2008 From: Dalibor.Topic at Sun.COM (Dalibor Topic) Date: Sat, 06 Sep 2008 00:43:30 +0200 Subject: [patch] Support New NIO in IcedTea In-Reply-To: <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> References: <20080831004043.GA19370@bamboo.destinee.acro.gen.nz> <1220193693.3524.24.camel@hermans.wildebeest.org> <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> Message-ID: <48C1B612.2010504@sun.com> C. K. Jester-Young wrote: >> Also, how do you keep track of which commits are really nio2 related and >> which ones are the commits that just sync with the master jdk7 repo? It >> would be nice to have an easy way to see just those changes/commits made >> for the new nio support. >> > > Yes, I'm much wondering about the same question myself. A good place to ask about it would be on the nio-dev mailing list, I'm sure Alan would be able to explain it. cheers, dalibor topic -- ******************************************************************* Dalibor Topic Tel: (+49 40) 23 646 738 Java F/OSS Ambassador AIM: robiladonaim Sun Microsystems GmbH Mobile: (+49 177) 2664 192 Nagelsweg 55 http://openjdk.java.net D-20097 Hamburg mailto:Dalibor.Topic at sun.com Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten Amtsgericht M?nchen: HRB 161028 Gesch?ftsf?hrer: Thomas Schr?der, Wolfgang Engels, Dr. Roland B?mer Vorsitzender des Aufsichtsrates: Martin H?ring From bugzilla-daemon at icedtea.classpath.org Sun Sep 7 00:03:33 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sun, 07 Sep 2008 07:03:33 +0000 Subject: [Bug 100] Java crashes trying to run topcat Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=100 ------- Comment #14 from vadikus at gmail.com 2008-09-07 07:03 ------- I had the same problem. Firstly, there was no java installed on Ubuntu Hardy (8.04), so I just went to synaptic and installed java-common, java-gcj-compat and some other packages I thought would be needed. And I've got: >>java version "1.5.0" Nice! But topcat crashes, as was written in this bug report. Then I've installed icedtea-java7-jdk and icedtea-java7-jre. And now everything is just fine. Topcat is working as it should be. But still have no clue what was that problem all about. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Sun Sep 7 05:01:58 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sun, 07 Sep 2008 12:01:58 +0000 Subject: [Bug 191] Openjdk Crash Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=191 neugens at limasoftware.net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |neugens at limasoftware.net ------- Comment #1 from neugens at limasoftware.net 2008-09-07 12:01 ------- On Nopaste snippets expire after 24 hours. Can you upload them directly into bugzilla? Thanks -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Mon Sep 8 11:16:09 2008 From: omajid at redhat.com (Omair Majid) Date: Mon, 08 Sep 2008 18:16:09 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-08 Omair Majid changeset 6fa7b2b70780 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=6fa7b2b70780 description: 2008-09-08 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (writeFrames): Removed outdated comments * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java (close): Removed comment. Throws an IllegalStateException when called on a closed Mixer. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java (flush): Changed the comment from a TODO to a FIXME * src/java/org/classpath/icedtea/pulseaudio/StreamBufferAttributes.java Changed MAX_VALUE to a saner value. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java (testClosingAgain): Now expects the exception to be thrown. * unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java (tearDown): Fixed method to only close the mixer if it isnt alreay closed. diffstat: 6 files changed, 10 insertions(+), 10 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 3 +-- src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 2 +- src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 2 +- src/java/org/classpath/icedtea/pulseaudio/StreamBufferAttributes.java | 4 ++-- unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java | 4 ++-- unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java | 5 +++-- diffs (82 lines): diff -r 239695497634 -r 6fa7b2b70780 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Mon Sep 08 11:09:02 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Mon Sep 08 14:15:34 2008 -0400 @@ -134,8 +134,7 @@ public class PulseAudioClip extends Puls try { eventLoop.threadLock.wait(); } catch (InterruptedException e) { - // FIXME what to do when this happens? - // e.printStackTrace(); + // clean up and return Thread.currentThread().interrupt(); stream.removeWriteListener(writeListener); return; diff -r 239695497634 -r 6fa7b2b70780 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Mon Sep 08 11:09:02 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Mon Sep 08 14:15:34 2008 -0400 @@ -430,7 +430,7 @@ public class PulseAudioMixer implements synchronized public void close() { if (!this.isOpen) { - return; // TODO do we throw an exception too? + throw new IllegalStateException("Mixer is not open; cant close"); } eventLoopThread.interrupt(); diff -r 239695497634 -r 6fa7b2b70780 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Mon Sep 08 11:09:02 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Mon Sep 08 14:15:34 2008 -0400 @@ -147,7 +147,7 @@ public class PulseAudioTargetDataLine ex @Override public void flush() { - // TODO Auto-generated method stub + // FIXME how to flush a target data line } public int available() { diff -r 239695497634 -r 6fa7b2b70780 src/java/org/classpath/icedtea/pulseaudio/StreamBufferAttributes.java --- a/src/java/org/classpath/icedtea/pulseaudio/StreamBufferAttributes.java Mon Sep 08 11:09:02 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/StreamBufferAttributes.java Mon Sep 08 14:15:34 2008 -0400 @@ -41,9 +41,9 @@ public class StreamBufferAttributes { public static final int SANE_DEFAULT = 50000; - // FIXME need to set these to proper values + // set these to proper values // integer.max_value will crash the program! - public static final int MAX_VALUE = Integer.MAX_VALUE; + public static final int MAX_VALUE = 1000000; public static final int MIN_VALUE = 0; private int maxLength; diff -r 239695497634 -r 6fa7b2b70780 unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Mon Sep 08 11:09:02 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Mon Sep 08 14:15:34 2008 -0400 @@ -250,9 +250,9 @@ public class PulseAudioMixerTest { selectedMixer.open(); } - @Test + @Test(expected = IllegalStateException.class) public void testClosingAgain() throws LineUnavailableException, - UnsupportedOperationException { + IllegalStateException { selectedMixer.close(); selectedMixer.close(); } diff -r 239695497634 -r 6fa7b2b70780 unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java Mon Sep 08 11:09:02 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java Mon Sep 08 14:15:34 2008 -0400 @@ -576,8 +576,9 @@ public class PulseSourceDataLineTest { @After public void tearDown() throws Exception { - - mixer.close(); + if (mixer.isOpen()) { + mixer.close(); + } } } From omajid at redhat.com Mon Sep 8 11:16:09 2008 From: omajid at redhat.com (Omair Majid) Date: Mon, 08 Sep 2008 18:16:09 +0000 Subject: changeset in /hg/pulseaudio: 2009-09-08 Omair Majid changeset 239695497634 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=239695497634 description: 2009-09-08 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/EventLoop.java Changed type of contextPointer and mainloopPointer to byte[] from long. (native_set_sink_volume): Changed type of first paramter to byte[] to store a pointer reliably. (setVolume): Likewise. (getContextPointer): Changed return type to byte[]. (getMainLoopPointer): Likewise. (nativeUpdateTargetPortNameList): Likewise. (nativeUpdateSourcePortList): Likewise. * src/java/org/classpath/icedtea/pulseaudio/Operation.java Changed type of operationPoiter to byte[] from long. (Operation): Changed type of first prameter to byte[] from long. Fixed comparisons to work with byte[]. (finalize): Fixed comparisons to work with byte[]. (addReference): Likewise. (releaseReference): Likewise. (isNull): Likewise. (getState): Likewise. * src/java/org/classpath/icedtea/pusleaudio/PulseAudioClip.java (native_setVolume): Changed return type to byte[]. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java (native_setVolume): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java Changed type of contextPointer to byte[]. (native_setVolume): Changed return type to byte[]. (native_updateVolumeInfo): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java (native_setVolume): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAuiodSourcePort.java (native_setVolume): Likewise. (native_updateVolumeInfo): Likewise. * src/java/org/classpath/icedtea/pulseuaiod/PulseAudioTargetDataLine.java Changed type of streamPointer to byte[]. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java (native_setVolume): Changed return type to byte[]. (native_updateVolumeInfo): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java Changed type of streamPointer to byte[]. * src/java/org/classpath/icedtea/pulseaudio/Stream.java Changed type of streamPointer to byte[]. (native_pa_stream_new): Changed type of pointer paramters to byte[]. (native_pa_stream_get_context): Changed return type to byte[]. (native_pa_stream_connect_playback): Changed type of pointer parameters to byte[]. (native_pa_stream_connect_record): Likewise. (native_pa_stream_drain): Changed return type to byte[]. (native_pa_stream_cork): Likewise. (native_pa_stream_flush): Likewise. (native_pa_stream_trigger): Likewise. (native_pa_stream_set_name): Likewise. (native_pa_stream_set_buffer_attr): Likewise. (native_pa_stream_update_sample_rate): Likewise. (native_setVolume): Likewise. (Stream): Changed type of pointer paramters to byte[] from long. (getContextPointer): Changed return type to byte[]. (connectForPlayback): Changed parameter values to work with byte[]. (connectForRecording): Likewise. (getStreamPointer): Changed return type to byte[]. * src/native/jni-common.c (getJavaByteArrayField): New function. Returns the byte[] corresponding to an object's field. (setJavaByteArrayFiled): New function. Sets the byte[] of an object's field. (getLockObject): Fixed class descriptor. (notifyWaitingOperations): Likewise. (getJavaPointer): Use the byte[] to obtain the pointer's contents. (setJavaPointer): Use the byte[] to set the pointer's contents. (convertJavaLongToPointer): Removed method. (convertJavaPointerToNative): New method. Converts a byte[] into a void*. (convertJavaPointerToLong: Removed method. (convertNativePointerToJava): New method. Converts a void* into a byte[]. * src/native/jni-common.h Removed jPointer data type. (getByteArrayField): New method. (setByteArrayField): New method. (convertJavaLongToPointer): Removed method. (convertPointerToJavaLong): Likewise. (convertJavaPointerToNative): New method. (convertNativePointerToJava): Likewise. * src/native/org_classpath_icedtea_pulseaudio_EventLoop.c (Java_org_classpath_icedtea_pulseaudio_EventLoop_nativeUpdateTargetPortNameList): Fixed method to work with a byte[]. (Java_org_classpath_icedtea_pulseaudio_EventLoop_nativeUpdateSourcePortNameList): Likewise. (Java_org_classpath_icedtea_pulseaudio_EventLoop_native_1set_1sink_1volume): Likewise. * src/native/org_classapath_icedtea_pulseaudio_PulseAudioSourcePort.c (Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1updateVolumeInfo): Likewise. (Java_org_classpath_icedtea_pulseaudio_PulseAudioSourcePort_native_1setVolume): Likewise. * src/native/org_classpath_icedtea_pulseaudio_PulseAudioTargetPort.c (Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1updateVolumeInfo): Likewise. (Java_org_classpath_icedtea_pulseaudio_PulseAudioTargetPort_native_1setVolume): Likewise. * src/native/org_classpath_icedtea_pulseaudio_Stream.c (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1new): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1context): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1playback): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1record): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drain): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1cork): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1flush): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1trigger): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1set_1name): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1set_1buffer_1attr): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1update_1sample_1rate): Likewise. (JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1setVolume): Likewise. diffstat: 17 files changed, 308 insertions(+), 263 deletions(-) src/java/org/classpath/icedtea/pulseaudio/EventLoop.java | 18 - src/java/org/classpath/icedtea/pulseaudio/Operation.java | 20 - src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 2 src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java | 2 src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java | 6 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 2 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java | 4 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 2 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java | 4 src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java | 2 src/java/org/classpath/icedtea/pulseaudio/Stream.java | 46 +- src/native/jni-common.c | 180 ++++------ src/native/jni-common.h | 76 +--- src/native/org_classpath_icedtea_pulseaudio_EventLoop.c | 35 + src/native/org_classpath_icedtea_pulseaudio_PulseAudioSourcePort.c | 24 + src/native/org_classpath_icedtea_pulseaudio_PulseAudioTargetPort.c | 25 + src/native/org_classpath_icedtea_pulseaudio_Stream.c | 123 +++--- diffs (truncated from 1194 to 500 lines): diff -r c0fcd9764516 -r 239695497634 src/java/org/classpath/icedtea/pulseaudio/EventLoop.java --- a/src/java/org/classpath/icedtea/pulseaudio/EventLoop.java Thu Sep 04 14:23:50 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/EventLoop.java Mon Sep 08 11:09:02 2008 -0400 @@ -89,7 +89,7 @@ public class EventLoop implements Runnab private native void native_shutdown(); - private native void native_set_sink_volume(long streamPointer, int volume); + private native void native_set_sink_volume(byte[] streamPointer, int volume); /* * These fields hold pointers @@ -97,9 +97,9 @@ public class EventLoop implements Runnab * */ @SuppressWarnings("unused") - private long contextPointer; + private byte[] contextPointer; @SuppressWarnings("unused") - private long mainloopPointer; + private byte[] mainloopPointer; /* * @@ -230,23 +230,23 @@ public class EventLoop implements Runnab } - public void setVolume(long streamPointer, int volume) { + public void setVolume(byte[] streamPointer, int volume) { synchronized (threadLock) { native_set_sink_volume(streamPointer, volume); } } - public long getContextPointer() { + public byte[] getContextPointer() { return contextPointer; } - public long getMainLoopPointer() { + public byte[] getMainLoopPointer() { return mainloopPointer; } - private native long nativeUpdateTargetPortNameList(); - - private native long nativeUpdateSourcePortNameList(); + private native byte[] nativeUpdateTargetPortNameList(); + + private native byte[] nativeUpdateSourcePortNameList(); protected synchronized List updateTargetPortNameList() { targetPortNameList = new ArrayList(); diff -r c0fcd9764516 -r 239695497634 src/java/org/classpath/icedtea/pulseaudio/Operation.java --- a/src/java/org/classpath/icedtea/pulseaudio/Operation.java Thu Sep 04 14:23:50 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Operation.java Mon Sep 08 11:09:02 2008 -0400 @@ -51,7 +51,7 @@ import java.io.IOException; public class Operation { - long operationPointer; + byte[] operationPointer; EventLoop eventLoop; public enum State { @@ -77,8 +77,8 @@ public class Operation { private native int native_get_state(); - public Operation(long operationPointer) { - assert (operationPointer != 0); + public Operation(byte[] operationPointer) { + assert (operationPointer != null); this.operationPointer = operationPointer; this.eventLoop = EventLoop.getEventLoop(); } @@ -86,34 +86,34 @@ public class Operation { @Override protected void finalize() throws Throwable { // might catch operations which havent been released - assert (operationPointer == 0); + assert (operationPointer == null); super.finalize(); } public void addReference() { - assert (operationPointer != 0); + assert (operationPointer != null); synchronized (eventLoop.threadLock) { native_ref(); } } public void releaseReference() { - assert (operationPointer != 0); + assert (operationPointer != null); synchronized (eventLoop.threadLock) { native_unref(); } - operationPointer = 0; + operationPointer = null; } public boolean isNull() { - if (operationPointer == 0) { + if (operationPointer == null) { return true; } return false; } public State getState() { - assert (operationPointer != 0); + assert (operationPointer != null); int state; synchronized (eventLoop.threadLock) { state = native_get_state(); @@ -132,7 +132,7 @@ public class Operation { } public void waitForCompletion() { - assert (operationPointer != 0); + assert (operationPointer != null); do { synchronized (eventLoop.threadLock) { if (getState() == Operation.State.Done) { diff -r c0fcd9764516 -r 239695497634 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Thu Sep 04 14:23:50 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Mon Sep 08 11:09:02 2008 -0400 @@ -313,7 +313,7 @@ public class PulseAudioClip extends Puls } - public long native_setVolume(float value) { + public byte[] native_setVolume(float value) { return stream.native_setVolume(value); } diff -r c0fcd9764516 -r 239695497634 src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java Thu Sep 04 14:23:50 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPlaybackLine.java Mon Sep 08 11:09:02 2008 -0400 @@ -39,7 +39,7 @@ package org.classpath.icedtea.pulseaudio interface PulseAudioPlaybackLine { - long native_setVolume(float value); + byte[] native_setVolume(float value); boolean isMuted(); diff -r c0fcd9764516 -r 239695497634 src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java Thu Sep 04 14:23:50 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java Mon Sep 08 11:09:02 2008 -0400 @@ -51,7 +51,7 @@ public abstract class PulseAudioPort ext * Variable used in native code */ @SuppressWarnings("unused") - private long contextPointer; + private byte[] contextPointer; @SuppressWarnings("unused") private int channels; @@ -78,9 +78,9 @@ public abstract class PulseAudioPort ext System.out.println("Opened Target Port " + name); } - public abstract long native_setVolume(float newValue); + public abstract byte[] native_setVolume(float newValue); - public abstract long native_updateVolumeInfo(); + public abstract byte[] native_updateVolumeInfo(); public boolean isMuted() { return muted; diff -r c0fcd9764516 -r 239695497634 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Thu Sep 04 14:23:50 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Mon Sep 08 11:09:02 2008 -0400 @@ -82,7 +82,7 @@ public class PulseAudioSourceDataLine ex } - public long native_setVolume(float value) { + public byte[] native_setVolume(float value) { return stream.native_setVolume(value); } diff -r c0fcd9764516 -r 239695497634 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java Thu Sep 04 14:23:50 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java Mon Sep 08 11:09:02 2008 -0400 @@ -45,9 +45,9 @@ public class PulseAudioSourcePort extend super(name, eventLoop); } - public native long native_setVolume(float newValue); + public native byte[] native_setVolume(float newValue); - public synchronized native long native_updateVolumeInfo(); + public synchronized native byte[] native_updateVolumeInfo(); @Override public javax.sound.sampled.Line.Info getLineInfo() { diff -r c0fcd9764516 -r 239695497634 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Thu Sep 04 14:23:50 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Mon Sep 08 11:09:02 2008 -0400 @@ -47,7 +47,7 @@ public class PulseAudioTargetDataLine ex private long currentFramePosition = 0; @SuppressWarnings("unused") - private long streamPointer; + private byte[] streamPointer; public PulseAudioTargetDataLine(EventLoop eventLoop, AudioFormat[] formats, AudioFormat defaultFormat) { diff -r c0fcd9764516 -r 239695497634 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java Thu Sep 04 14:23:50 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java Mon Sep 08 11:09:02 2008 -0400 @@ -45,9 +45,9 @@ public class PulseAudioTargetPort extend super(name, eventLoop); } - public native long native_setVolume(float newValue); + public native byte[] native_setVolume(float newValue); - public synchronized native long native_updateVolumeInfo(); + public synchronized native byte[] native_updateVolumeInfo(); @Override public javax.sound.sampled.Line.Info getLineInfo() { diff -r c0fcd9764516 -r 239695497634 src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java Thu Sep 04 14:23:50 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java Mon Sep 08 11:09:02 2008 -0400 @@ -56,7 +56,7 @@ class PulseAudioVolumeControl extends Fl } @SuppressWarnings("unused") - private long streamPointer; + private byte[] streamPointer; private EventLoop eventLoop; private PulseAudioPlaybackLine line; diff -r c0fcd9764516 -r 239695497634 src/java/org/classpath/icedtea/pulseaudio/Stream.java --- a/src/java/org/classpath/icedtea/pulseaudio/Stream.java Thu Sep 04 14:23:50 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Stream.java Mon Sep 08 11:09:02 2008 -0400 @@ -96,7 +96,7 @@ public class Stream { public static final String DEFAULT_DEVICE = null; @SuppressWarnings("unused") - private long streamPointer; + private byte[] streamPointer; static { try { @@ -123,12 +123,12 @@ public class Stream { private List movedListeners; private List suspendedListeners; - private native void native_pa_stream_new(long contextPointer, String name, + private native void native_pa_stream_new(byte[] contextPointer, String name, String format, int sampleRate, int channels); private native int native_pa_stream_get_state(); - private native long native_pa_stream_get_context(); + private native byte[] native_pa_stream_get_context(); private native int native_pa_stream_get_index(); @@ -141,14 +141,14 @@ public class Stream { private native int native_pa_stream_connect_playback(String name, int bufferMaxLength, int bufferTargetLength, int bufferPreBuffering, int bufferMinimumRequest, - int bufferFragmentSize, int flags, long volumePointer, - long sync_streamPointer); + int bufferFragmentSize, int flags, byte[] volumePointer, + byte[] sync_streamPointer); private native int native_pa_stream_connect_record(String name, int bufferMaxLength, int bufferTargetLength, int bufferPreBuffering, int bufferMinimumRequest, - int bufferFragmentSize, int flags, long volumePointer, - long sync_streamPointer); + int bufferFragmentSize, int flags, byte[] volumePointer, + byte[] sync_streamPointer); private native int native_pa_stream_disconnect(); @@ -166,7 +166,7 @@ public class Stream { private native int native_pa_stream_readable_size(); - private native long native_pa_stream_drain(); + private native byte[] native_pa_stream_drain(); /* * pa_operation pa_stream_update_timing_info (pa_stream *p, @@ -174,9 +174,9 @@ public class Stream { * structure update for a stream. */ - private native long native_pa_stream_cork(int b); - - private native long native_pa_stream_flush(); + private native byte[] native_pa_stream_cork(int b); + + private native byte[] native_pa_stream_flush(); /* * pa_operation pa_stream_prebuf (pa_stream *s, pa_stream_success_cb_t cb, @@ -184,10 +184,10 @@ public class Stream { * structure. */ - private native long native_pa_stream_trigger(); + private native byte[] native_pa_stream_trigger(); /* returns an operationPointer */ - private native long native_pa_stream_set_name(String name); + private native byte[] native_pa_stream_set_name(String name); /* Return the current playback/recording time */ private native long native_pa_stream_get_time(); @@ -209,11 +209,11 @@ public class Stream { */ native StreamBufferAttributes native_pa_stream_get_buffer_attr(); - native long native_pa_stream_set_buffer_attr(StreamBufferAttributes info); - - private native long native_pa_stream_update_sample_rate(int rate); - - public native long native_setVolume(float newValue); + native byte[] native_pa_stream_set_buffer_attr(StreamBufferAttributes info); + + private native byte[] native_pa_stream_update_sample_rate(int rate); + + public native byte[] native_setVolume(float newValue); /* * pa_operation pa_stream_proplist_update (pa_stream *s, pa_update_mode_t @@ -229,7 +229,7 @@ public class Stream { * pa_stream_set_monitor_stream() ebfore. */ - public Stream(long contextPointer, String name, Format format, + public Stream(byte[] contextPointer, String name, Format format, int sampleRate, int channels) { // System.out.println("format: " + format.toString()); @@ -380,7 +380,7 @@ public class Stream { } - public long getContextPointer() { + public byte[] getContextPointer() { return native_pa_stream_get_context(); } @@ -429,7 +429,7 @@ public class Stream { bufferAttributes.getMaxLength(), bufferAttributes .getTargetLength(), bufferAttributes.getPreBuffering(), bufferAttributes.getMinimumRequest(), bufferAttributes - .getFragmentSize(), 0, 0, 0); + .getFragmentSize(), 0, null, null); assert (returnValue == 0); } @@ -444,7 +444,7 @@ public class Stream { bufferAttributes.getMaxLength(), bufferAttributes .getTargetLength(), bufferAttributes.getPreBuffering(), bufferAttributes.getMinimumRequest(), bufferAttributes - .getFragmentSize(), 0, 0, 0); + .getFragmentSize(), 0, null, null); assert (returnValue == 0); } @@ -718,7 +718,7 @@ public class Stream { } - public long getStreamPointer() { + public byte[] getStreamPointer() { return streamPointer; } diff -r c0fcd9764516 -r 239695497634 src/native/jni-common.c --- a/src/native/jni-common.c Thu Sep 04 14:23:50 2008 -0400 +++ b/src/native/jni-common.c Mon Sep 08 11:09:02 2008 -0400 @@ -38,6 +38,7 @@ #include "jni-common.h" #include +#include /* * Throw an exception by name @@ -85,6 +86,30 @@ void setJavaLongField(JNIEnv* env, jobje (*env)->SetLongField(env, obj, fid, value); } +jbyteArray getJavaByteArrayField(JNIEnv* env, jobject obj, char* name) { + + jclass cls = (*env)->GetObjectClass(env, obj); + assert(cls); + jfieldID fid = (*env)->GetFieldID(env, cls, name, "[B"); + assert(fid); + jbyteArray array = (*env)->GetObjectField(env, obj, fid); + assert(array); + return array; + +} + +void setJavaByteArrayField(JNIEnv* env, jobject obj, char* name, + jbyteArray array) { + + jclass cls = (*env)->GetObjectClass(env, obj); + assert(cls); + jfieldID fid = (*env)->GetFieldID(env, cls, name, "[B"); + assert(fid); + + (*env)->SetObjectField(env, obj, fid, array); + return; +} + void callJavaVoidMethod(JNIEnv* env, jobject obj, const char* method_name) { jclass cls = (*env)->GetObjectClass(env, obj); @@ -105,9 +130,10 @@ void callJavaVoidMethod(JNIEnv* env, job } jobject getLockObject(JNIEnv* env) { - + const char* eventLoopClassName = - "Lorg/classpath/icedtea/pulseaudio/EventLoop;"; + "org/classpath/icedtea/pulseaudio/EventLoop"; + jclass eventLoopClass = (*env)->FindClass(env, eventLoopClassName); assert(eventLoopClass); @@ -135,7 +161,7 @@ void notifyWaitingOperations(JNIEnv* env (*env)->MonitorEnter(env, lockObject); - jclass objectClass = (*env)->FindClass(env, "Ljava/lang/Object;"); + jclass objectClass = (*env)->FindClass(env, "java/lang/Object"); assert(objectClass); jmethodID notifyAllID = (*env)->GetMethodID(env, objectClass, "notifyAll", "()V"); assert(notifyAllID); @@ -146,93 +172,65 @@ void notifyWaitingOperations(JNIEnv* env } -/* - * - * - * The functions below are going to cause headaches when porting - * - * - */ - void* getJavaPointer(JNIEnv* env, jobject obj, char* name) { - /* - * on a 64 bit machine, the value of the long is 64 bits, which should be the pointer - * size and everything should be ok - * - * So the problem is 32 bit architectures: - * - * A reference snippet - * - int a_int = 0x1020; - long a_long = 0x102030; - long long a_long_long = 0x1020304150607080; - printf("size of int: %d\nsize of long: %d\nsize of long long: %d\n", - sizeof(int), sizeof(long), sizeof(long long)); - printf("int to long long: %X -> %llX\n", a_int, (long long) a_int); - printf("long long to int: %llX -> %X\n", a_long_long, (int)a_long_long); - - * this shows that long long -> int does a bitwise mask to get the lower order bits only - * this is a guess at how it works: - * - * raw data in register is 0x 10203040 50607080 - * 32 bits 32 bits - * - * we are interested in the 50607080 part of data - * - * Big endian: - * 10 <-- Pointer < 32bit pointer (for an int) - * 20 < - * 30 < - * 40 < - * 50 - * 60 - * 70 - * 80 - * (for big endian, will need to do masking and shifting) - * - * - * Little Endian - * 80 <-- Pointer < 32bit pointer (for an int) From omajid at redhat.com Wed Sep 10 07:29:09 2008 From: omajid at redhat.com (Omair Majid) Date: Wed, 10 Sep 2008 14:29:09 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-09 Omair Majid changeset 95fa206a3e1d in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=95fa206a3e1d description: 2008-09-09 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java (openRemove): Make the eventloop thread a daemon thread. diffstat: 1 file changed, 6 insertions(+), 1 deletion(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 7 ++++++- diffs (17 lines): diff -r 6fa7b2b70780 -r 95fa206a3e1d src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Mon Sep 08 14:15:34 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Tue Sep 09 11:06:05 2008 -0400 @@ -587,7 +587,12 @@ public class PulseAudioMixer implements eventLoopThread = new Thread(eventLoop, "PulseAudio Eventloop Thread"); - eventLoopThread.setDaemon(false); + /* + * Make the thread exit if by some weird error it is the only thread + * running. The application should be able to exit if the main thread + * doesn't or can't (perhaps an assert?) do a mixer.close(). + */ + eventLoopThread.setDaemon(true); eventLoopThread.start(); try { From omajid at redhat.com Wed Sep 10 07:29:09 2008 From: omajid at redhat.com (Omair Majid) Date: Wed, 10 Sep 2008 14:29:09 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-10 Omair Majid changeset 83ebae76a9a9 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=83ebae76a9a9 description: 2008-09-10 Omair Majid * src/native/org_classpath_icedtea_pulseaudio_EventLoop.c (Java_org_classpath_icedtea_pulseaudio_EventLoop_native_1shutdown): Unref the context when we are done with it. Works with PulseAudio 0.9.12. * src/native/org_classpath_icedtea_pulseaudio_Stream.c (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1disconnect): Unref the stream when we are done with it. Works with PusleAudio 0.9.12. diffstat: 2 files changed, 5 insertions(+), 2 deletions(-) src/native/org_classpath_icedtea_pulseaudio_EventLoop.c | 3 ++- src/native/org_classpath_icedtea_pulseaudio_Stream.c | 4 +++- diffs (27 lines): diff -r 95fa206a3e1d -r 83ebae76a9a9 src/native/org_classpath_icedtea_pulseaudio_EventLoop.c --- a/src/native/org_classpath_icedtea_pulseaudio_EventLoop.c Tue Sep 09 11:06:05 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_EventLoop.c Wed Sep 10 10:28:43 2008 -0400 @@ -281,7 +281,8 @@ JNIEXPORT void JNICALL Java_org_classpat } else { pa_operation_unref(o); } - + + pa_context_unref(context); (*env)->DeleteGlobalRef(env, java_context->obj); free(java_context); diff -r 95fa206a3e1d -r 83ebae76a9a9 src/native/org_classpath_icedtea_pulseaudio_Stream.c --- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c Tue Sep 09 11:06:05 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c Wed Sep 10 10:28:43 2008 -0400 @@ -478,7 +478,9 @@ JNIEXPORT jint JNICALL Java_org_classpat (JNIEnv* env, jobject obj) { pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); assert(stream); - return pa_stream_disconnect(stream); + int return_value = pa_stream_disconnect(stream); + pa_stream_unref(stream); + return return_value; } /* From langel at redhat.com Wed Sep 10 10:37:13 2008 From: langel at redhat.com (Lillian Angel) Date: Wed, 10 Sep 2008 17:37:13 +0000 Subject: changeset in /hg/icedtea6: 2008-09-10 Lillian Angel changeset aacc3e8a8e16 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=aacc3e8a8e16 description: 2008-09-10 Lillian Angel * patches/icedtea-lc_ctype.patch: New patch to fix this issue: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=497666 * Makefile.am: Added patch to list. diffstat: 3 files changed, 19 insertions(+), 1 deletion(-) ChangeLog | 6 ++++++ Makefile.am | 3 ++- patches/icedtea-lc_ctype.patch | 11 +++++++++++ diffs (41 lines): diff -r 4c642bbb2285 -r aacc3e8a8e16 ChangeLog --- a/ChangeLog Fri Sep 05 12:11:57 2008 -0400 +++ b/ChangeLog Wed Sep 10 13:37:08 2008 -0400 @@ -1,3 +1,9 @@ 2008-08-26 Deepak Bhole + + * patches/icedtea-lc_ctype.patch: New patch to fix this issue: + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=497666 + * Makefile.am: Added patch to list. + 2008-08-26 Deepak Bhole * IcedTeaPlugin.cc: Support for multiple simultaneous applet load. diff -r 4c642bbb2285 -r aacc3e8a8e16 Makefile.am --- a/Makefile.am Fri Sep 05 12:11:57 2008 -0400 +++ b/Makefile.am Wed Sep 10 13:37:08 2008 -0400 @@ -507,7 +507,8 @@ ICEDTEA_PATCHES = \ patches/icedtea-clean-crypto.patch \ $(SHARK_PATCH) \ $(GCC_PATCH) \ - patches/icedtea-arch.patch + patches/icedtea-arch.patch \ + patches/icedtea-lc_ctype.patch if WITH_RHINO ICEDTEA_PATCHES += \ diff -r 4c642bbb2285 -r aacc3e8a8e16 patches/icedtea-lc_ctype.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/icedtea-lc_ctype.patch Wed Sep 10 13:37:08 2008 -0400 @@ -0,0 +1,11 @@ +--- java_props_md.c 2008-09-10 12:36:05.000000000 -0400 ++++ openjdk/jdk/src/solaris/native/java/lang/java_props_md.c 2008-09-10 12:36:13.000000000 -0400 +@@ -211,7 +211,7 @@ + * _.@ + * , , and are optional. + */ +- char temp[64]; ++ char temp[strlen(lc)]; + char *language = NULL, *country = NULL, *variant = NULL, + *encoding = NULL; + char *std_language = NULL, *std_country = NULL, *std_variant = NULL, From omajid at redhat.com Thu Sep 11 07:05:45 2008 From: omajid at redhat.com (Omair Majid) Date: Thu, 11 Sep 2008 14:05:45 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-10 Omair Majid changeset 81eff60b8606 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=81eff60b8606 description: 2008-09-10 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/Stream.java (playbackStartedCallback): Removed assert. * src/native/org_classpath_icedtea_pulseaudio_Stream.c (stream_started_callback): Uncommented this function. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1new): Added a stream_started_callback as a callback handler. diffstat: 2 files changed, 28 insertions(+), 35 deletions(-) src/java/org/classpath/icedtea/pulseaudio/Stream.java | 5 - src/native/org_classpath_icedtea_pulseaudio_Stream.c | 58 +++++++---------- diffs (159 lines): diff -r 83ebae76a9a9 -r 81eff60b8606 src/java/org/classpath/icedtea/pulseaudio/Stream.java --- a/src/java/org/classpath/icedtea/pulseaudio/Stream.java Wed Sep 10 10:28:43 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Stream.java Wed Sep 10 11:00:26 2008 -0400 @@ -123,8 +123,8 @@ public class Stream { private List movedListeners; private List suspendedListeners; - private native void native_pa_stream_new(byte[] contextPointer, String name, - String format, int sampleRate, int channels); + private native void native_pa_stream_new(byte[] contextPointer, + String name, String format, int sampleRate, int channels); private native int native_pa_stream_get_state(); @@ -572,7 +572,6 @@ public class Stream { */ @SuppressWarnings("unused") private void playbackStartedCallback() { - assert (false); synchronized (playbackStartedListeners) { for (PlaybackStartedListener listener : playbackStartedListeners) { listener.update(); diff -r 83ebae76a9a9 -r 81eff60b8606 src/native/org_classpath_icedtea_pulseaudio_Stream.c --- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c Wed Sep 10 10:28:43 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c Wed Sep 10 11:00:26 2008 -0400 @@ -152,23 +152,23 @@ static void stream_underflow_callback(pa } // requires pulseaudio 0.9.11 :( -/* - static void stream_started_callback(pa_stream *p, void *userdata) { - printf("stream_started_callback called\n"); - java_context* context = userdata; - assert(stream); - assert(context); - assert(context->env); - assert(context->obj); - - if (pa_stream_get_state(stream) == PA_STREAM_CREATING) { - callJavaVoidMethod(context->env, context->obj, "playbackStartedCallback"); - } else { - callJavaVoidMethod(pulse_thread_env, context->obj, "playbackStartedCallback"); - } - - } - */ +static void stream_started_callback(pa_stream *stream, void *userdata) { + // printf("stream_started_callback called\n"); + java_context* context = userdata; + assert(stream); + assert(context); + assert(context->env); + assert(context->obj); + + if (pa_stream_get_state(stream) == PA_STREAM_CREATING) { + callJavaVoidMethod(context->env, context->obj, + "playbackStartedCallback"); + } else { + callJavaVoidMethod(pulse_thread_env, context->obj, + "playbackStartedCallback"); + } + +} static void stream_latency_update_callback(pa_stream *stream, void *userdata) { // printf("stream_latency_update_callback called\n"); @@ -221,7 +221,6 @@ static void stream_suspended_callback(pa } - /* * Class: org_classpath_icedtea_pulseaudio_Stream * Method: native_pa_stream_new @@ -229,7 +228,7 @@ static void stream_suspended_callback(pa */ JNIEXPORT void JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1new (JNIEnv* env, jobject obj, jbyteArray contextPointer, jstring nameString, -jstring encodingString, jint sampleRate, jint channels) { + jstring encodingString, jint sampleRate, jint channels) { // printf("creating a new PulseAudio stream\n"); @@ -291,7 +290,7 @@ jstring encodingString, jint sampleRate, pa_stream_set_read_callback (stream, stream_read_callback, j_context); pa_stream_set_overflow_callback (stream, stream_overflow_callback, j_context); pa_stream_set_underflow_callback (stream, stream_underflow_callback, j_context); - // pa_stream_set_started_callback (stream, stream_started_callback, j_context); + pa_stream_set_started_callback (stream, stream_started_callback, j_context); pa_stream_set_latency_update_callback (stream, stream_latency_update_callback, j_context); pa_stream_set_moved_callback (stream, stream_moved_callback, j_context); pa_stream_set_suspended_callback (stream, stream_suspended_callback, j_context); @@ -310,7 +309,6 @@ JNIEXPORT jint JNICALL Java_org_classpat return pa_stream_get_state(stream); } - /* * Class: org_classpath_icedtea_pulseaudio_Stream * Method: native_pa_stream_get_context @@ -376,17 +374,16 @@ JNIEXPORT jint JNICALL Java_org_classpat return pa_stream_is_suspended(stream); } - /* * Class: org_classpath_icedtea_pulseaudio_Stream * Method: native_pa_stream_connect_playback * Signature: (Ljava/lang/String;IIIIII[B[B)I */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1playback -(JNIEnv* env, jobject obj, jstring device, jint bufferMaxLength, - jint bufferTargetLength, jint bufferPreBuffering, - jint bufferMinimumRequest, jint bufferFragmentSize, jint flags, - jbyteArray volumePointer, jbyteArray sync_streamPointer) { +(JNIEnv* env, jobject obj, jstring device, jint bufferMaxLength, + jint bufferTargetLength, jint bufferPreBuffering, + jint bufferMinimumRequest, jint bufferFragmentSize, jint flags, + jbyteArray volumePointer, jbyteArray sync_streamPointer) { pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); @@ -430,9 +427,9 @@ JNIEXPORT jint JNICALL Java_org_classpat */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1record (JNIEnv* env, jobject obj, jstring device, jint bufferMaxLength, - jint bufferTargetLength, jint bufferPreBuffereing, - jint bufferMinimumRequest, jint bufferFragmentSize, jint flags, - jbyteArray volumePointer, jbyteArray sync_streamPointer) { + jint bufferTargetLength, jint bufferPreBuffereing, + jint bufferMinimumRequest, jint bufferFragmentSize, jint flags, + jbyteArray volumePointer, jbyteArray sync_streamPointer) { pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); assert(stream); @@ -659,7 +656,6 @@ static void trigger_callback(pa_stream* } - /* * Class: org_classpath_icedtea_pulseaudio_Stream * Method: native_pa_stream_trigger @@ -680,7 +676,6 @@ static void set_name_callback(pa_stream* notifyWaitingOperations(env); } - /* * Class: org_classpath_icedtea_pulseaudio_Stream @@ -818,7 +813,6 @@ static void set_buffer_attr_callback(pa_ } - /* * Class: org_classpath_icedtea_pulseaudio_Stream * Method: native_pa_stream_set_buffer_attr From mark at klomp.org Thu Sep 11 11:48:02 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 11 Sep 2008 18:48:02 +0000 Subject: changeset in /hg/icedtea6: Updated Gervill from upstream CVS (Se... Message-ID: changeset 8b0e11483252 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=8b0e11483252 description: Updated Gervill from upstream CVS (September 1, 2008) 2008-09-11 Mark Wielaard * patches/icedtea-gervill.patch: Updated patch for old tests. * overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/*: New Gervill files (sept 1). - Add: More JTreg tests added: EmergencySoundbank SoftFilter AudioFloatConverter.ToFloatArray (improved) - Change: SoftReverb optimized, about 2 times faster. - Fix: ModelByteBuffer.skip called super.skip instead to call to RandomAccessFile directly. JTreg tests added: ModelByteBuffer/RandomFileInputStream/*.java - Fix: ModelByteBuffer.len was being modified in inner class RandomFileInputStream. The variable was made final and RandomFileInputStream.read methods where fixed. - Fix: ArrayOutOfException error in ModelInstrument.getKeys(), Keys array was to small, it couldn't hold all possible midi notes (0..127). Version 1.0.1 - Fix: Created dummy SourceDataline so that following jtreg test can be tested without using a real Audio Device SourceDataLine. javax/sound/midi/Gervill/SoftAudioSynthesizer/Open.java javax/sound/midi/Gervill/SoftSynthesizer/GetLatency.java javax/sound/midi/Gervill/SoftSynthesizer/GetReceiver.java javax/sound/midi/Gervill/SoftSynthesizer/GetReceiver2.java javax/sound/midi/Gervill/SoftSynthesizer/GetReceivers.java javax/sound/midi/Gervill/SoftSynthesizer/GetTransmitter.java javax/sound/midi/Gervill/SoftSynthesizer/GetTransmitters.java javax/sound/midi/Gervill/SoftSynthesizer/ImplicitOpenClose.java javax/sound/midi/Gervill/SoftSynthesizer/Open.java - Fix: Make open SoftSynthesizer garbage-collectable when user don't have reference to it and it is not producing any sound. - Fix: SoftReverb silent detection improved. - Added: SoftSynthesizer.getPropertyInfo returns current properties values if it is open. - Fix: Restrict input values in SoftChannel to 7 and 14 bit in these methods: noteOn noteOff setPolyPressure setChannelPressure controlChange programChange(program) programChange(bank, program) setPitchBend - Fix: Store generated soundbank to disk for faster future use. diffstat: 21 files changed, 727 insertions(+), 218 deletions(-) ChangeLog | 6 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/CHANGES.txt | 44 + overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java | 26 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/ModelInstrument.java | 4 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java | 52 + overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftCubicResampler.java | 2 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java | 51 + overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixer.java | 56 + overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftReverb.java | 341 +++++----- overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java | 220 +++++- overlays/openjdk/jdk/test/com/sun/media/sound/AudioFloatConverter/ToFloatArray.java | 29 overlays/openjdk/jdk/test/com/sun/media/sound/SoftAudioSynthesizer/Open.java | 2 overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/GetLatency.java | 2 overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/GetReceiver.java | 2 overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/GetReceiver2.java | 2 overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/GetReceivers.java | 2 overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/GetTransmitter.java | 2 overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/GetTransmitters.java | 2 overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/ImplicitOpenClose.java | 6 overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/Open.java | 6 patches/icedtea-gervill.patch | 88 ++ diffs (truncated from 1627 to 500 lines): diff -r aacc3e8a8e16 -r 8b0e11483252 ChangeLog --- a/ChangeLog Wed Sep 10 13:37:08 2008 -0400 +++ b/ChangeLog Thu Sep 11 20:47:50 2008 +0200 @@ -1,3 +1,9 @@ 2008-09-10 Lillian Angel + + * patches/icedtea-gervill.patch: Updated patch for old tests. + * overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/*: + New Gervill files (sept 1). + 2008-09-10 Lillian Angel * patches/icedtea-lc_ctype.patch: New patch to fix this issue: diff -r aacc3e8a8e16 -r 8b0e11483252 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/CHANGES.txt --- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/CHANGES.txt Wed Sep 10 13:37:08 2008 -0400 +++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/CHANGES.txt Thu Sep 11 20:47:50 2008 +0200 @@ -1,3 +1,47 @@ + - Add: More JTreg tests added: + EmergencySoundbank + SoftFilter + AudioFloatConverter.ToFloatArray (improved) + - Change: SoftReverb optimized, about 2 times faster. + - Fix: ModelByteBuffer.skip called super.skip + instead to call to RandomAccessFile directly. + JTreg tests added: ModelByteBuffer/RandomFileInputStream/*.java + - Fix: ModelByteBuffer.len was being modified in inner + class RandomFileInputStream. The variable was made final + and RandomFileInputStream.read methods where fixed. + - Fix: ArrayOutOfException error in ModelInstrument.getKeys(), + Keys array was to small, it couldn't + hold all possible midi notes (0..127). + +Version 1.0.1 + - Fix: Created dummy SourceDataline so that following + jtreg test can be tested without using + a real Audio Device SourceDataLine. + javax/sound/midi/Gervill/SoftAudioSynthesizer/Open.java + javax/sound/midi/Gervill/SoftSynthesizer/GetLatency.java + javax/sound/midi/Gervill/SoftSynthesizer/GetReceiver.java + javax/sound/midi/Gervill/SoftSynthesizer/GetReceiver2.java + javax/sound/midi/Gervill/SoftSynthesizer/GetReceivers.java + javax/sound/midi/Gervill/SoftSynthesizer/GetTransmitter.java + javax/sound/midi/Gervill/SoftSynthesizer/GetTransmitters.java + javax/sound/midi/Gervill/SoftSynthesizer/ImplicitOpenClose.java + javax/sound/midi/Gervill/SoftSynthesizer/Open.java + - Fix: Make open SoftSynthesizer garbage-collectable + when user don't have reference to it and it is not + producing any sound. + - Fix: SoftReverb silent detection improved. + - Added: SoftSynthesizer.getPropertyInfo returns + current properties values if it is open. + - Fix: Restrict input values in SoftChannel to 7 and 14 bit in these methods: + noteOn + noteOff + setPolyPressure + setChannelPressure + controlChange + programChange(program) + programChange(bank, program) + setPitchBend + - Fix: Store generated soundbank to disk for faster future use. - Cleanup: Make inner classes static AudioFloatFormatConverter.AudioFloatFormatConverterInputStream AudioFloatFormatConverter.AudioFloatInputStreamChannelMixer diff -r aacc3e8a8e16 -r 8b0e11483252 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java --- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java Wed Sep 10 13:37:08 2008 -0400 +++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java Thu Sep 11 20:47:50 2008 +0200 @@ -45,7 +45,7 @@ public class ModelByteBuffer { private long fileoffset; private byte[] buffer; private long offset; - private long len; + private final long len; private class RandomFileInputStream extends InputStream { @@ -85,11 +85,12 @@ public class ModelByteBuffer { } public long skip(long n) throws IOException { + if( n < 0) + return 0; if (n > left) n = left; - n = super.skip(n); - if (n == -1) - return -1; + long p = raf.getFilePointer(); + raf.seek(p + n); left -= n; return n; } @@ -107,11 +108,12 @@ public class ModelByteBuffer { } public int read(byte[] b) throws IOException { + int len = b.length; if (len > left) len = (int)left; if (left == 0) return -1; - int len = raf.read(b); + len = raf.read(b, 0, len); if (len == -1) return -1; left -= len; @@ -119,12 +121,12 @@ public class ModelByteBuffer { } public int read() throws IOException { - if (len == 0) + if (left == 0) return -1; int b = raf.read(); if (b == -1) return -1; - len--; + left--; return b; } @@ -137,15 +139,15 @@ public class ModelByteBuffer { long beginIndex, long endIndex, boolean independent) { this.root = parent.root; this.offset = 0; - this.len = parent.len; + long parent_len = parent.len; if (beginIndex < 0) beginIndex = 0; - if (beginIndex > len) - beginIndex = len; + if (beginIndex > parent_len) + beginIndex = parent_len; if (endIndex < 0) endIndex = 0; - if (endIndex > len) - endIndex = len; + if (endIndex > parent_len) + endIndex = parent_len; if (beginIndex > endIndex) beginIndex = endIndex; offset = beginIndex; diff -r aacc3e8a8e16 -r 8b0e11483252 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/ModelInstrument.java --- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/ModelInstrument.java Wed Sep 10 13:37:08 2008 -0400 +++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/ModelInstrument.java Thu Sep 11 20:47:50 2008 +0200 @@ -88,10 +88,10 @@ public abstract class ModelInstrument ex // This information is generated from ModelPerformer.getName() // returned from getPerformers(). public String[] getKeys() { - String[] keys = new String[127]; + String[] keys = new String[128]; for (ModelPerformer performer : getPerformers()) { for (int k = performer.getKeyFrom(); k <= performer.getKeyTo(); k++) { - if (keys[k] == null) { + if (k >= 0 && k < 128 && keys[k] == null) { String name = performer.getName(); if (name == null) name = "untitled"; diff -r aacc3e8a8e16 -r 8b0e11483252 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java --- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java Wed Sep 10 13:37:08 2008 -0400 +++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java Thu Sep 11 20:47:50 2008 +0200 @@ -194,6 +194,20 @@ public class SoftChannel implements Midi return v; } }; + + private static int restrict7Bit(int value) + { + if(value < 0) return 0; + if(value > 127) return 127; + return value; + } + + private static int restrict14Bit(int value) + { + if(value < 0) return 0; + if(value > 16256) return 16256; + return value; + } public SoftChannel(SoftSynthesizer synth, int channel) { this.channel = channel; @@ -386,8 +400,8 @@ public class SoftChannel implements Midi } public void noteOn(int noteNumber, int velocity) { - - if(noteNumber < 0 || noteNumber > 127) return; + noteNumber = restrict7Bit(noteNumber); + velocity = restrict7Bit(velocity); noteOn_internal(noteNumber, velocity); if (current_mixer != null) current_mixer.noteOn(noteNumber, velocity); @@ -415,7 +429,7 @@ public class SoftChannel implements Midi sustain = true; } - mainmixer.msec_last_activity = mainmixer.msec_pos; + mainmixer.activity(); if (mono) { if (portamento) { @@ -515,7 +529,8 @@ public class SoftChannel implements Midi } public void noteOff(int noteNumber, int velocity) { - if(noteNumber < 0 || noteNumber > 127) return; + noteNumber = restrict7Bit(noteNumber); + velocity = restrict7Bit(velocity); noteOff_internal(noteNumber, velocity); if (current_mixer != null) @@ -534,7 +549,7 @@ public class SoftChannel implements Midi } } - mainmixer.msec_last_activity = mainmixer.msec_pos; + mainmixer.activity(); for (int i = 0; i < voices.length; i++) { if (voices[i].on && voices[i].channel == channel && voices[i].note == noteNumber @@ -617,11 +632,14 @@ public class SoftChannel implements Midi } public void setPolyPressure(int noteNumber, int pressure) { + noteNumber = restrict7Bit(noteNumber); + pressure = restrict7Bit(pressure); + if (current_mixer != null) current_mixer.setPolyPressure(noteNumber, pressure); synchronized (control_mutex) { - mainmixer.msec_last_activity = mainmixer.msec_pos; + mainmixer.activity(); co_midi[noteNumber].get(0, "poly_pressure")[0] = pressure*(1.0/128.0); polypressure[noteNumber] = pressure; for (int i = 0; i < voices.length; i++) { @@ -637,11 +655,12 @@ public class SoftChannel implements Midi } } - public void setChannelPressure(int pressure) { + public void setChannelPressure(int pressure) { + pressure = restrict7Bit(pressure); if (current_mixer != null) current_mixer.setChannelPressure(pressure); synchronized (control_mutex) { - mainmixer.msec_last_activity = mainmixer.msec_pos; + mainmixer.activity(); co_midi_channel_pressure[0] = pressure * (1.0 / 128.0); channelpressure = pressure; for (int i = 0; i < voices.length; i++) { @@ -1006,6 +1025,8 @@ 121 |79H |**Coarse Tuning |0 } public void controlChange(int controller, int value) { + controller = restrict7Bit(controller); + value = restrict7Bit(value); if (current_mixer != null) current_mixer.controlChange(controller, value); @@ -1210,13 +1231,15 @@ 121 |79H |**Coarse Tuning |0 } } - public void programChange(int program) { + public void programChange(int program) { programChange(bank, program); } public void programChange(int bank, int program) { - synchronized (control_mutex) { - mainmixer.msec_last_activity = mainmixer.msec_pos; + bank = restrict7Bit(bank); + program = restrict7Bit(program); + synchronized (control_mutex) { + mainmixer.activity(); this.bank = bank; this.program = program; current_instrument = null; @@ -1230,10 +1253,11 @@ 121 |79H |**Coarse Tuning |0 } public void setPitchBend(int bend) { - if (current_mixer != null) + bend = restrict14Bit(bend); + if (current_mixer != null) current_mixer.setPitchBend(bend); synchronized (control_mutex) { - mainmixer.msec_last_activity = mainmixer.msec_pos; + mainmixer.activity(); co_midi_pitch[0] = bend * (1.0 / 16384.0); pitchbend = bend; for (int i = 0; i < voices.length; i++) @@ -1349,7 +1373,7 @@ 121 |79H |**Coarse Tuning |0 public void resetAllControllers(boolean allControls) { synchronized (control_mutex) { - mainmixer.msec_last_activity = mainmixer.msec_pos; + mainmixer.activity(); for (int i = 0; i < 128; i++) { setPolyPressure(i, 0); diff -r aacc3e8a8e16 -r 8b0e11483252 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftCubicResampler.java --- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftCubicResampler.java Wed Sep 10 13:37:08 2008 -0400 +++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftCubicResampler.java Thu Sep 11 20:47:50 2008 +0200 @@ -5,7 +5,7 @@ * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this - * particular file as suabject to the "Classpath" exception as provided + * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT diff -r aacc3e8a8e16 -r 8b0e11483252 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java --- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java Wed Sep 10 13:37:08 2008 -0400 +++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java Thu Sep 11 20:47:50 2008 +0200 @@ -59,15 +59,17 @@ public class SoftMainMixer { public final static int CHANNEL_CHANNELMIXER_LEFT = 14; public final static int CHANNEL_CHANNELMIXER_RIGHT = 15; protected boolean active_sensing_on = false; - protected long msec_last_activity = -1; - protected long msec_pos = 0; + private long msec_last_activity = -1; + private boolean pusher_silent = false; + private int pusher_silent_count = 0; + private long msec_pos = 0; protected boolean readfully = true; private Object control_mutex; private SoftSynthesizer synth; private int nrofchannels = 2; private SoftVoice[] voicestatus = null; private SoftAudioBuffer[] buffers; - private SoftAudioProcessor reverb; + private SoftReverb reverb; private SoftAudioProcessor chorus; private SoftAudioProcessor agc; private long msec_buffer_len = 0; @@ -106,7 +108,7 @@ public class SoftMainMixer { private void processSystemExclusiveMessage(byte[] data) { synchronized (synth.control_mutex) { - msec_last_activity = msec_pos; + activity(); // Universal Non-Real-Time SysEx if ((data[1] & 0xFF) == 0x7E) { @@ -597,10 +599,39 @@ public class SoftMainMixer { } } + + if(buffers[CHANNEL_LEFT].isSilent() + && buffers[CHANNEL_RIGHT].isSilent()) + { + pusher_silent_count++; + if(pusher_silent_count > 5) + { + pusher_silent_count = 0; + synchronized (control_mutex) { + pusher_silent = true; + if(synth.weakstream != null) + synth.weakstream.setInputStream(null); + } + } + } + else + pusher_silent_count = 0; if (synth.agc_on) agc.processAudio(); + } + + // Must only we called within control_mutex synchronization + public void activity() + { + msec_last_activity = msec_pos; + if(pusher_silent) + { + pusher_silent = false; + if(synth.weakstream != null) + synth.weakstream.setInputStream(ais); + } } public void stopMixer(ModelChannelMixer mixer) { @@ -650,6 +681,8 @@ public class SoftMainMixer { chorus.init(samplerate, controlrate); agc.init(samplerate, controlrate); + reverb.setLightMode(synth.reverb_light); + reverb.setMixMode(true); chorus.setMixMode(true); agc.setMixMode(false); @@ -686,7 +719,13 @@ public class SoftMainMixer { private byte[] single = new byte[1]; public void fillBuffer() { - processAudioBuffers(); + /* + boolean pusher_silent2; + synchronized (control_mutex) { + pusher_silent2 = pusher_silent; + } + if(!pusher_silent2)*/ + processAudioBuffers(); for (int i = 0; i < nrofchannels; i++) buffers[i].get(bbuffer, i); bbuffer_pos = 0; @@ -884,7 +923,7 @@ public class SoftMainMixer { public void processMessage(int ch, int cmd, int data1, int data2) { synchronized (synth.control_mutex) { - msec_last_activity = msec_pos; + activity(); } if (cmd == 0xF0) { diff -r aacc3e8a8e16 -r 8b0e11483252 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixer.java --- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixer.java Wed Sep 10 13:37:08 2008 -0400 +++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixer.java Thu Sep 11 20:47:50 2008 +0200 @@ -62,7 +62,7 @@ public class SoftMixingMixer implements protected static final String INFO_DESCRIPTION = "Software Sound Mixer"; - protected static final String INFO_VERSION = "0.9"; + protected static final String INFO_VERSION = "1.0"; protected final static Mixer.Info info = new Info(); @@ -354,9 +354,6 @@ public class SoftMixingMixer implements AudioInputStream ais = openStream(getFormat()); if (line == null) { - DataLine.Info info = new DataLine.Info( - SourceDataLine.class, format); - synchronized (SoftMixingMixerProvider.mutex) { SoftMixingMixerProvider.lockthread = Thread .currentThread(); @@ -365,8 +362,55 @@ public class SoftMixingMixer implements try { Mixer defaultmixer = AudioSystem.getMixer(null); if (defaultmixer != null) - line = (SourceDataLine) defaultmixer.getLine(info); - else + { + // Search for suitable line + + DataLine.Info idealinfo = null; + AudioFormat idealformat = null; + + Line.Info[] lineinfos = defaultmixer.getSourceLineInfo(); + idealFound: + for (int i = 0; i < lineinfos.length; i++) { + if(lineinfos[i].getLineClass() == SourceDataLine.class) + { + DataLine.Info info = (DataLine.Info)lineinfos[i]; + AudioFormat[] formats = info.getFormats(); + for (int j = 0; j < formats.length; j++) { + AudioFormat format = formats[j]; + if(format.getChannels() == 2 || + format.getChannels() == AudioSystem.NOT_SPECIFIED) + if(format.getEncoding().equals(Encoding.PCM_SIGNED) || + format.getEncoding().equals(Encoding.PCM_UNSIGNED)) + if(format.getSampleRate() == AudioSystem.NOT_SPECIFIED || + format.getSampleRate() == 48000.0) + if(format.getSampleSizeInBits() == AudioSystem.NOT_SPECIFIED || + format.getSampleSizeInBits() == 16) + { + idealinfo = info; + int ideal_channels = format.getChannels(); + boolean ideal_signed = format.getEncoding().equals(Encoding.PCM_SIGNED); + float ideal_rate = format.getSampleRate(); + boolean ideal_endian = format.isBigEndian(); + int ideal_bits = format.getSampleSizeInBits(); + if(ideal_bits == AudioSystem.NOT_SPECIFIED) ideal_bits = 16; + if(ideal_channels == AudioSystem.NOT_SPECIFIED) ideal_channels = 2; + if(ideal_rate == AudioSystem.NOT_SPECIFIED) ideal_rate = 48000; + idealformat = new AudioFormat(ideal_rate, ideal_bits, + ideal_channels, ideal_signed, ideal_endian); + break idealFound; + } + } + } + } + + if(idealformat != null) + { + format = idealformat; + line = (SourceDataLine) defaultmixer.getLine(idealinfo); + } + } + + if(line == null) line = AudioSystem.getSourceDataLine(format); } finally { From mark at klomp.org Thu Sep 11 11:49:05 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 11 Sep 2008 20:49:05 +0200 Subject: New Gervill imported into IcedTea Message-ID: <1221158945.3246.48.camel@dijkstra.wildebeest.org> Hi, Since Joe was working on getting an updated Gervill into openjdk(6) and adopting any remaining patches to the new version, I made sure to sync our Gervill import into icedtea6 with the latest Gervill from CVS (September 1st). We only have a few small patches left against upstream Gervill (attached). All jtreg tests, both the com/sun/media/sound ones from upstream, as the older javax/sound/midi in openjdk6 (which are almost all a copy of the upstream tests renamed into a different package) pass, with only a small patch needed for the old tests now that SoftLimiter.init() changed arguments. See the patches/icedtea-gervill.patch. Attached are the actual changes to the icedtea overlays. 2008-09-11 Mark Wielaard * patches/icedtea-gervill.patch: Updated patch for old tests. * overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/*: New Gervill files (sept 1). The actual changes to Gervill since our last import: - Add: More JTreg tests added: EmergencySoundbank SoftFilter AudioFloatConverter.ToFloatArray (improved) - Change: SoftReverb optimized, about 2 times faster. - Fix: ModelByteBuffer.skip called super.skip instead to call to RandomAccessFile directly. JTreg tests added: ModelByteBuffer/RandomFileInputStream/*.java - Fix: ModelByteBuffer.len was being modified in inner class RandomFileInputStream. The variable was made final and RandomFileInputStream.read methods where fixed. - Fix: ArrayOutOfException error in ModelInstrument.getKeys(), Keys array was to small, it couldn't hold all possible midi notes (0..127). Version 1.0.1 - Fix: Created dummy SourceDataline so that following jtreg test can be tested without using a real Audio Device SourceDataLine. javax/sound/midi/Gervill/SoftAudioSynthesizer/Open.java javax/sound/midi/Gervill/SoftSynthesizer/GetLatency.java javax/sound/midi/Gervill/SoftSynthesizer/GetReceiver.java javax/sound/midi/Gervill/SoftSynthesizer/GetReceiver2.java javax/sound/midi/Gervill/SoftSynthesizer/GetReceivers.java javax/sound/midi/Gervill/SoftSynthesizer/GetTransmitter.java javax/sound/midi/Gervill/SoftSynthesizer/GetTransmitters.java javax/sound/midi/Gervill/SoftSynthesizer/ImplicitOpenClose.java javax/sound/midi/Gervill/SoftSynthesizer/Open.java - Fix: Make open SoftSynthesizer garbage-collectable when user don't have reference to it and it is not producing any sound. - Fix: SoftReverb silent detection improved. - Added: SoftSynthesizer.getPropertyInfo returns current properties values if it is open. - Fix: Restrict input values in SoftChannel to 7 and 14 bit in these methods: noteOn noteOff setPolyPressure setChannelPressure controlChange programChange(program) programChange(bank, program) setPitchBend - Fix: Store generated soundbank to disk for faster future use. -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-gervill.diff Type: text/x-patch Size: 3657 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080911/059adb06/icedtea-gervill.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: gervill-overlays.diff.gz Type: application/x-gzip Size: 10496 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080911/059adb06/gervill-overlays.diff.gz From bugzilla-daemon at icedtea.classpath.org Thu Sep 11 12:06:05 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 11 Sep 2008 19:06:05 +0000 Subject: [Bug 192] New: com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 Summary: com.sun.image.codec.jpeg doesn't work with ImageJ Product: IcedTea Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: adam at spicenitz.org ImageJ is a widely used image processing system for Java. Unfortunately, it doesn't build with icedtea6, because there are missing methods in com.sun.image.codec.jpeg. It also throws a runtime error when attempting to save a JPEG, because com.sun.image.codec.jpeg.JPEGImageEncoder is supposed to be an interface, not a class. First, the source problem: [javac] /home/agoode/ij-source/source/ij/plugin/JpegWriter.java:46: cannot find symbol [javac] symbol : method setHorizontalSubsampling(int,int) [javac] location: class com.sun.image.codec.jpeg.JPEGEncodeParam [javac] param.setHorizontalSubsampling(1, 1); [javac] ^ [javac] /home/agoode/ij-source/source/ij/plugin/JpegWriter.java:47: cannot find symbol [javac] symbol : method setHorizontalSubsampling(int,int) [javac] location: class com.sun.image.codec.jpeg.JPEGEncodeParam [javac] param.setHorizontalSubsampling(2, 1); [javac] ^ [javac] /home/agoode/ij-source/source/ij/plugin/JpegWriter.java:48: cannot find symbol [javac] symbol : method setVerticalSubsampling(int,int) [javac] location: class com.sun.image.codec.jpeg.JPEGEncodeParam [javac] param.setVerticalSubsampling(1, 1); [javac] ^ [javac] /home/agoode/ij-source/source/ij/plugin/JpegWriter.java:49: cannot find symbol [javac] symbol : method setVerticalSubsampling(int,int) [javac] location: class com.sun.image.codec.jpeg.JPEGEncodeParam [javac] param.setVerticalSubsampling(2, 1); Second, the runtime problem: java.lang.IncompatibleClassChangeError: Found class com.sun.image.codec.jpeg.JPEGImageEncoder, but interface was expected at ij.plugin.JpegWriter.saveAsJpeg(JpegWriter.java:42) at ij.plugin.JpegWriter.run(JpegWriter.java:27) at ij.IJ.runPlugIn(IJ.java:146) at ij.IJ.runPlugIn(IJ.java:119) at ij.io.FileSaver.saveAsJpeg(FileSaver.java:247) at ij.io.FileSaver.saveAsJpeg(FileSaver.java:238) at ij.plugin.filter.Writer.run(Writer.java:24) at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:243) at ij.plugin.filter.PlugInFilterRunner.(PlugInFilterRunner.java:102) at ij.IJ.runPlugIn(IJ.java:148) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:636) -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Thu Sep 11 12:06:58 2008 From: omajid at redhat.com (Omair Majid) Date: Thu, 11 Sep 2008 19:06:58 +0000 Subject: changeset in /hg/pulseaudio: 2009-09-11 Omair Majid changeset 850570c7af31 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=850570c7af31 description: 2009-09-11 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Removed streamPointer - it is declared in parent class. (start): New function. Manually fires START event for a TargetDataLine. (stop): New function. Manually fires STOP event for TargetDataLine. diffstat: 1 file changed, 24 insertions(+), 3 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 27 ++++++++-- diffs (50 lines): diff -r 29f7e9dc42dd -r 850570c7af31 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Thu Sep 11 14:40:42 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Thu Sep 11 15:06:49 2008 -0400 @@ -38,6 +38,8 @@ package org.classpath.icedtea.pulseaudio package org.classpath.icedtea.pulseaudio; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.TargetDataLine; @@ -45,9 +47,6 @@ public class PulseAudioTargetDataLine ex TargetDataLine { private long currentFramePosition = 0; - - @SuppressWarnings("unused") - private byte[] streamPointer; public PulseAudioTargetDataLine(EventLoop eventLoop, AudioFormat[] formats, AudioFormat defaultFormat) { @@ -168,4 +167,26 @@ public class PulseAudioTargetDataLine ex return (long) (currentFramePosition / currentFormat.getFrameRate()); } + /* + * A TargetData starts when we ask it to and continues playing until we ask + * it to stop. there are no buffer underruns/overflows or anything so we + * will just fire the LineEvents manually + */ + + @Override + public void start() { + super.start(); + + fireLineEvent(new LineEvent(this, LineEvent.Type.START, + AudioSystem.NOT_SPECIFIED)); + } + + @Override + public void stop() { + super.stop(); + + fireLineEvent(new LineEvent(this, LineEvent.Type.STOP, + AudioSystem.NOT_SPECIFIED)); + } + } \ No newline at end of file From omajid at redhat.com Thu Sep 11 12:06:58 2008 From: omajid at redhat.com (Omair Majid) Date: Thu, 11 Sep 2008 19:06:58 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-11 Omair Majid changeset c2664adb0201 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=c2664adb0201 description: 2008-09-11 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java (setName): New function. Sets the name of a stream. (getName): New function. Rerturns the name of a stream. * unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java (testSettingStreamName): New funtion. Tests if the name of a stream can be set. For more correct testing, this needs to use introspection to ask the PulseAudio daemon about the sink input name. diffstat: 2 files changed, 66 insertions(+) src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 25 ++++++ unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java | 41 ++++++++++ diffs (91 lines): diff -r 81eff60b8606 -r c2664adb0201 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Wed Sep 10 11:00:26 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Thu Sep 11 10:42:34 2008 -0400 @@ -265,4 +265,29 @@ public abstract class PulseAudioDataLine return AudioSystem.NOT_SPECIFIED; } + public void setName(String streamName) { + if (isOpen) { + /* + * Note: setting the name of the stream after it's created wont + * work. In fact, it sets the name of the application! This is a bug + * in PulseAudio 0.9.12 but fixed in git. + */ + + Operation o; + synchronized (eventLoop.threadLock) { + o = stream.setName(streamName); + } + o.waitForCompletion(); + o.releaseReference(); + + } + + this.streamName = streamName; + + } + + public String getName() { + return streamName; + } + } diff -r 81eff60b8606 -r c2664adb0201 unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java Wed Sep 10 11:00:26 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java Thu Sep 11 10:42:34 2008 -0400 @@ -54,6 +54,7 @@ import javax.sound.sampled.Mixer; import javax.sound.sampled.Mixer; import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.UnsupportedAudioFileException; +import javax.sound.sampled.DataLine.Info; import junit.framework.JUnit4TestAdapter; @@ -553,6 +554,46 @@ public class PulseSourceDataLineTest { } @Test + public void testSettingStreamName() throws LineUnavailableException, + UnsupportedAudioFileException, IOException { + File soundFile = new File("testsounds/logout.wav"); + AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + AudioFormat audioFormat = audioInputStream.getFormat(); + + PulseAudioSourceDataLine line; + line = (PulseAudioSourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, audioFormat)); + + String name = "Knights Who Say ... Oh my god, i am so sorry, i didnt mean it..."; + line.setName(name); + + line.open(audioFormat); + line.start(); + + byte[] abData = new byte[1000]; + int bytesRead = 0; + + while (bytesRead >= 0) { + bytesRead = audioInputStream.read(abData, 0, abData.length); + if (bytesRead > 0) { + line.write(abData, 0, bytesRead); + } + } + + Assert.assertTrue(line.getName() == name); + /* + * FIXME test that PulseAudio also knows this correctly using + * introspection + */ + + line.drain(); + line.stop(); + line.close(); + + } + + @Test public void messWithStreams() throws LineUnavailableException { System.out .println("This test tries to unCork a stream which hasnt been corked"); From omajid at redhat.com Thu Sep 11 12:06:58 2008 From: omajid at redhat.com (Omair Majid) Date: Thu, 11 Sep 2008 19:06:58 +0000 Subject: changeset in /hg/pulseaudio: 2009-09-11 Omair Majid changeset 29f7e9dc42dd in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=29f7e9dc42dd description: 2009-09-11 Omair Majid * unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java (setUp): Initialize started and stopped to 0. (testStartNotificationOnCork): New test. Tests if cork/uncork fire START and STOP events. (tearDown): set started/stopped to 0. diffstat: 1 file changed, 94 insertions(+), 9 deletions(-) unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java | 103 +++++++++- diffs (155 lines): diff -r c2664adb0201 -r 29f7e9dc42dd unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java Thu Sep 11 10:42:34 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java Thu Sep 11 14:40:42 2008 -0400 @@ -54,7 +54,6 @@ import javax.sound.sampled.Mixer; import javax.sound.sampled.Mixer; import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.UnsupportedAudioFileException; -import javax.sound.sampled.DataLine.Info; import junit.framework.JUnit4TestAdapter; @@ -68,6 +67,9 @@ public class PulseSourceDataLineTest { private int listenerCalled = 0; + int started = 0; + int stopped = 0; + AudioFormat aSupportedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 10, true); @@ -79,6 +81,9 @@ public class PulseSourceDataLineTest { public void setUp() throws Exception { mixer = PulseAudioMixer.getInstance(); mixer.open(); + + started = 0; + stopped = 0; } @@ -156,9 +161,6 @@ public class PulseSourceDataLineTest { } - int started = 0; - int stopped = 0; - @Test public void testStartedStopped() throws LineUnavailableException, UnsupportedAudioFileException, IOException { @@ -172,9 +174,6 @@ public class PulseSourceDataLineTest { line = (PulseAudioSourceDataLine) mixer.getLine(new DataLine.Info( SourceDataLine.class, audioFormat)); Assert.assertNotNull(line); - - started = 0; - stopped = 0; line.open(audioFormat); @@ -216,8 +215,91 @@ public class PulseSourceDataLineTest { Assert.assertEquals(1, started); Assert.assertEquals(1, stopped); - started = 0; - stopped = 0; + } + + @Test + public void testStartNotificationOnCork() + throws UnsupportedAudioFileException, IOException, + LineUnavailableException { + + File soundFile = new File("testsounds/startup.wav"); + AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + AudioFormat audioFormat = audioInputStream.getFormat(); + + PulseAudioSourceDataLine line; + line = (PulseAudioSourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, audioFormat)); + Assert.assertNotNull(line); + + line.open(audioFormat); + + LineListener startStopListener = new LineListener() { + + @Override + public void update(LineEvent event) { + if (event.getType() == LineEvent.Type.START) { + started++; + } + + if (event.getType() == LineEvent.Type.STOP) { + stopped++; + } + } + + }; + + line.addLineListener(startStopListener); + + byte[] abData = new byte[1000]; + int bytesRead = 0; + + line.start(); + int count = 0; + + while (bytesRead >= 0) { + bytesRead = audioInputStream.read(abData, 0, abData.length); + if (bytesRead > 0) { + line.write(abData, 0, bytesRead); + count++; + /* + * keep count high. if it is too low, the line wont even start + * playing so stopping is out of the question + */ + if (count == 100) { + Operation o; + synchronized (EventLoop.getEventLoop().threadLock) { + o = line.getStream().cork(); + } + + o.waitForCompletion(); + o.releaseReference(); + + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + synchronized (EventLoop.getEventLoop().threadLock) { + o = line.getStream().unCork(); + } + + o.waitForCompletion(); + o.releaseReference(); + + } + } + } + + line.drain(); + + line.stop(); + line.close(); + + Assert.assertEquals(2, started); + Assert.assertEquals(2, stopped); } @@ -617,6 +699,9 @@ public class PulseSourceDataLineTest { @After public void tearDown() throws Exception { + started = 0; + stopped = 0; + if (mixer.isOpen()) { mixer.close(); } From bugzilla-daemon at icedtea.classpath.org Thu Sep 11 12:20:17 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 11 Sep 2008 19:20:17 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #1 from adam at spicenitz.org 2008-09-11 19:20 ------- Looks like this all could pretty easily be implemented by using the ImageIO stuff. Is copyright assignment required for this project? -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Thu Sep 11 12:32:33 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 11 Sep 2008 19:32:33 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #2 from mark at klomp.org 2008-09-11 19:32 ------- (In reply to comment #1) > Looks like this all could pretty easily be implemented by using the ImageIO > stuff. Is copyright assignment required for this project? Not necessarily for icedtea proper, but we encourage people to also push any changes into GNU Classpath and OpenJDK upstream to keep divergence as small as possible. Those project do normally require some kind of copyright assignment. com.sun.image.codec.jpeg is an deprecated package though, so it isn't clear any of them would necessarily want a new (wrapper) implementation. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Thu Sep 11 13:52:42 2008 From: omajid at redhat.com (Omair Majid) Date: Thu, 11 Sep 2008 20:52:42 +0000 Subject: changeset in /hg/pulseaudio: 2009-09-11 Omair Majid changeset 3f2e4077fcbb in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=3f2e4077fcbb description: 2009-09-11 Omair Majid * README: Added build instructions. * build.xml: Updated the file to build everything and run all the tests * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java (testHeadphonePortExists): Added the @Ignore tag. Ignore this test. (testSpeakerPortExists): Likewise. (testLineInPortExists): Likewise. (testCdPortExists): Likewise. (testLineOutPortExists): Likewise. (testMicrophoneExists): Likewise. diffstat: 3 files changed, 71 insertions(+), 36 deletions(-) README | 13 + build.xml | 87 +++++----- unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java | 7 diffs (203 lines): diff -r 850570c7af31 -r 3f2e4077fcbb README --- a/README Thu Sep 11 15:06:49 2008 -0400 +++ b/README Thu Sep 11 16:49:43 2008 -0400 @@ -2,6 +2,19 @@ An audio SPI implementation for java tha An audio SPI implementation for java that uses PulseAudio as a mixer (so as a bonus you get all of the ear candy that PulseAudio provides) +How To Build? + + autoreconf && ./configure && ant && make + +Note: Building requires PulseAudio 0.9.12 and java-devel etc.. + +How To Run the Tests? + +After building, do: + + ant test + + (a few tests might fail; they test the networking capabilities of PulseAudio Where does it come from? All of the code was written by the authors diff -r 850570c7af31 -r 3f2e4077fcbb build.xml --- a/build.xml Thu Sep 11 15:06:49 2008 -0400 +++ b/build.xml Thu Sep 11 16:49:43 2008 -0400 @@ -1,71 +1,86 @@ - - - - + + + + - + - - - - + + + + - + - + - - + + - - - + + + + + - - - - + + + + + + - - - - - + + + + + - - - + + + - + - + - + - - + + - - + + + + + + + + + + + + + + diff -r 850570c7af31 -r 3f2e4077fcbb unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Thu Sep 11 15:06:49 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Thu Sep 11 16:49:43 2008 -0400 @@ -56,6 +56,7 @@ import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; public class PulseAudioMixerTest { @@ -208,36 +209,42 @@ public class PulseAudioMixerTest { } + @Ignore @Test public void testHeadphonePortExists() throws LineUnavailableException { selectedMixer.open(); selectedMixer.getLine(Port.Info.HEADPHONE); } + @Ignore @Test public void testSpeakerPortExists() throws LineUnavailableException { selectedMixer.open(); selectedMixer.getLine(Port.Info.SPEAKER); } + @Ignore @Test public void testLineInPortExists() throws LineUnavailableException { selectedMixer.open(); selectedMixer.getLine(Port.Info.LINE_IN); } + @Ignore @Test public void testCdPortExists() throws LineUnavailableException { selectedMixer.open(); selectedMixer.getLine(Port.Info.COMPACT_DISC); } + @Ignore @Test public void testLineOutPortExists() throws LineUnavailableException { selectedMixer.open(); selectedMixer.getLine(Port.Info.LINE_OUT); } + @Ignore @Test public void testMicrophonePortExists() throws LineUnavailableException { selectedMixer.open(); From bugzilla-daemon at icedtea.classpath.org Thu Sep 11 13:57:37 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 11 Sep 2008 20:57:37 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #3 from matthew.flaschen at gatech.edu 2008-09-11 20:57 ------- I'm not sure exactly what the latest status is on this. A while ago, I did a partial implementation and got it committed to icedtea (http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=21e34c9b472a). It was then copied over to icedtea6 at some point and later removed from both icedtea6 (http://icedtea.classpath.org/hg/icedtea6/rev/38e6eb354632) and icedtea (http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=ade93840d3f3). As you note, the Classpath code doesn't work. Thus, if we want an implementation in IcedTea, some form of my code should probably be re-added. I agree com.sun.image is not only deprecated, but actually was never part of the standard. But I still think it should be included as it is widely used. A patch is attached that puts in the code that was there immediately following my original patch. This is basically a functional (though incomplete) combination of Classpath code and code I wrote. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Thu Sep 11 13:59:28 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 11 Sep 2008 20:59:28 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #4 from matthew.flaschen at gatech.edu 2008-09-11 20:59 ------- Created an attachment (id=91) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=91&action=view) Partial implementation of com.sun.image.codec.jpeg -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Thu Sep 11 19:51:48 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 12 Sep 2008 02:51:48 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #5 from adam at spicenitz.org 2008-09-12 02:51 ------- Looks like Matthew's patch is the same one as is shipped with Fedora. I agree it would be useful to have this old class implemented, since some software does use it. My initial comments are applicable to this patch. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Thu Sep 11 21:38:48 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 12 Sep 2008 04:38:48 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #6 from matthew.flaschen at gatech.edu 2008-09-12 04:38 ------- Which version of Fedora are you using, and where do you see the code? I can't find it in the Fedora 8 or 9 SRPM. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Sep 12 04:56:34 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 12 Sep 2008 11:56:34 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #7 from adam at spicenitz.org 2008-09-12 11:56 ------- (In reply to comment #6) It is from http://icedtea.classpath.org/download/source/icedtea6-1.2.tar.gz In patches/icedtea-jpegclasses.patch The specfile uses icedtea6-1.2.tar.gz. http://cvs.fedoraproject.org/viewvc/rpms/java-1.6.0-openjdk/F-9/java-1.6.0-openjdk.spec?view=markup -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From xerxes at zafena.se Fri Sep 12 07:07:16 2008 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Fri, 12 Sep 2008 16:07:16 +0200 Subject: icedtea zero M68K atomic patch Message-ID: <48CA7794.8050603@zafena.se> Greetings! Here is a patch for the M68K zero port to deal with missing atomic operations in M68K hardware, here implemented using a processor specific CAS instruction found on most 680X0 CPUs. It will priobably work on 68020 68030 68040 and 68060. Suggestions are welcome how to make improve it to work on all M68K cpus compatible with Linux/M68K like the ColdFire who lacks the CAS instruction. I have included a small testprogram as well that can be build with g++ to test the zero atomic headerfile without compiling the whole hotspot. xerxes at aranym-m68k:~/test$ g++ atomictest.cpp xerxes at aranym-m68k:~/test$ ./a.out start of test testing Atomic::xchg testing Atomic::xchg_ptr a=C0FFEE b=CAFEBABE Atomic::xchg() works! c=EFE6A938 &b=EFE6A938 d=EFE6A93C &a=EFE6A93C Atomic::xchg_ptr() works! Have a great day! Xerxes -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: m68k.atomic.zero.icedtea6.12sept.patch Url: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080912/4b1fa238/m68k.atomic.zero.icedtea6.12sept.patch -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: atomictest.cpp Url: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080912/4b1fa238/atomictest.cpp From gbenson at redhat.com Fri Sep 12 07:20:14 2008 From: gbenson at redhat.com (Gary Benson) Date: Fri, 12 Sep 2008 14:20:14 +0000 Subject: changeset in /hg/icedtea6: 2008-09-12 Gary Benson changeset 8306580ee906 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=8306580ee906 description: 2008-09-12 Gary Benson Xerxes R?nby * ports/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp (__m68k_cmpxchg): New function. (m68k_compare_and_swap): Likewise. (m68k_add_and_fetch): Likewise. (m68k_lock_test_and_set): Likewise. (Atomic::add): Use the above on m68k. (Atomic::add_ptr): Likewise. (Atomic::xchg): Likewise. (Atomic::xchg_ptr): Likewise. (Atomic::cmpxchg): Likewise. (Atomic::cmpxchg_ptr): Likewise. diffstat: 2 files changed, 114 insertions(+) ChangeLog | 15 + ports/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp | 99 ++++++++++ diffs (184 lines): diff -r 8b0e11483252 -r 8306580ee906 ChangeLog --- a/ChangeLog Thu Sep 11 20:47:50 2008 +0200 +++ b/ChangeLog Fri Sep 12 15:20:06 2008 +0100 @@ -1,3 +1,18 @@ 2008-09-11 Mark Wielaard + Xerxes R??nby + + * ports/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp + (__m68k_cmpxchg): New function. + (m68k_compare_and_swap): Likewise. + (m68k_add_and_fetch): Likewise. + (m68k_lock_test_and_set): Likewise. + (Atomic::add): Use the above on m68k. + (Atomic::add_ptr): Likewise. + (Atomic::xchg): Likewise. + (Atomic::xchg_ptr): Likewise. + (Atomic::cmpxchg): Likewise. + (Atomic::cmpxchg_ptr): Likewise. + 2008-09-11 Mark Wielaard * patches/icedtea-gervill.patch: Updated patch for old tests. diff -r 8b0e11483252 -r 8306580ee906 ports/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp --- a/ports/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp Thu Sep 11 20:47:50 2008 +0200 +++ b/ports/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp Fri Sep 12 15:20:06 2008 +0100 @@ -24,6 +24,81 @@ */ // Implementation of class atomic + +#ifdef M68K + +/* + * __m68k_cmpxchg + * + * Atomically store newval in *ptr if *ptr is equal to oldval for user space. + * Returns newval on success and oldval if no exchange happened. + * This implementation is processor specific and works on + * 68020 68030 68040 and 68060. + * + * It will not work on ColdFire, 68000 and 68010 since they lack the CAS + * instruction. + * Using a kernelhelper would be better for arch complete implementation. + * + */ + +static inline int __m68k_cmpxchg(int oldval, int newval, volatile int *ptr) +{ + int ret; + __asm __volatile ("cas%.l %0,%2,%1" + : "=d" (ret), "+m" (*(ptr)) + : "d" (newval), "0" (oldval)); + return ret; +} + +/* Perform an atomic compare and swap: if the current value of `*PTR' + is OLDVAL, then write NEWVAL into `*PTR'. Return the contents of + `*PTR' before the operation.*/ +static inline int m68k_compare_and_swap(volatile int *ptr, + int oldval, + int newval) +{ + for (;;) + { + int prev = *ptr; + if (prev != oldval) + return prev; + + if (__m68k_cmpxchg (prev, newval, ptr) == newval) + // Success. + return prev; + + // We failed even though prev == oldval. Try again. + } +} + +/* Atomically add an int to memory. */ +static inline int m68k_add_and_fetch(volatile int *ptr, int add_value) +{ + for (;;) + { + // Loop until success. + + int prev = *ptr; + + if (__m68k_cmpxchg (prev, prev + add_value, ptr) == prev + add_value) + return prev + add_value; + } +} + +/* Atomically write VALUE into `*PTR' and returns the previous + contents of `*PTR'. */ +static inline int m68k_lock_test_and_set(volatile int *ptr, int newval) +{ + for (;;) + { + // Loop until success. + int prev = *ptr; + + if (__m68k_cmpxchg (prev, newval, ptr) == prev) + return prev; + } +} +#endif // M68K #ifdef ARM @@ -107,7 +182,11 @@ inline jint Atomic::add(jint add_value, #ifdef ARM return arm_add_and_fetch(dest, add_value); #else +#ifdef M68K + return m68k_add_and_fetch(dest, add_value); +#else return __sync_add_and_fetch(dest, add_value); +#endif // M68K #endif // ARM } @@ -116,7 +195,11 @@ inline intptr_t Atomic::add_ptr(intptr_t #ifdef ARM return arm_add_and_fetch(dest, add_value); #else +#ifdef M68K + return m68k_add_and_fetch(dest, add_value); +#else return __sync_add_and_fetch(dest, add_value); +#endif // M68K #endif // ARM } @@ -159,12 +242,16 @@ inline jint Atomic::xchg(jint exchange_v { #ifdef ARM return arm_lock_test_and_set(dest, exchange_value); +#else +#ifdef M68K + return m68k_lock_test_and_set(dest, exchange_value); #else // __sync_lock_test_and_set is a bizarrely named atomic exchange // operation. Note that some platforms only support this with the // limitation that the only valid value to store is the immediate // constant 1. There is a test for this in JNI_CreateJavaVM(). return __sync_lock_test_and_set (dest, exchange_value); +#endif // M68K #endif // ARM } @@ -173,7 +260,11 @@ inline intptr_t Atomic::xchg_ptr(intptr_ #ifdef ARM return arm_lock_test_and_set(dest, exchange_value); #else +#ifdef M68K + return m68k_lock_test_and_set(dest, exchange_value); +#else return __sync_lock_test_and_set (dest, exchange_value); +#endif // M68K #endif // ARM } @@ -189,7 +280,11 @@ inline jint Atomic::cmpxchg(jint exchang #ifdef ARM return arm_compare_and_swap(dest, compare_value, exchange_value); #else +#ifdef M68K + return m68k_compare_and_swap(dest, compare_value, exchange_value); +#else return __sync_val_compare_and_swap(dest, compare_value, exchange_value); +#endif // M68K #endif // ARM } @@ -206,7 +301,11 @@ inline intptr_t Atomic::cmpxchg_ptr(intp #ifdef ARM return arm_compare_and_swap(dest, compare_value, exchange_value); #else +#ifdef M68K + return m68k_compare_and_swap(dest, compare_value, exchange_value); +#else return __sync_val_compare_and_swap(dest, compare_value, exchange_value); +#endif // M68K #endif // ARM } From gbenson at redhat.com Fri Sep 12 07:21:19 2008 From: gbenson at redhat.com (Gary Benson) Date: Fri, 12 Sep 2008 15:21:19 +0100 Subject: icedtea zero M68K atomic patch In-Reply-To: <48CA7794.8050603@zafena.se> References: <48CA7794.8050603@zafena.se> Message-ID: <20080912142118.GA3848@redhat.com> Xerxes R?nby wrote: > Here is a patch for the M68K zero port to deal with missing atomic > operations in M68K hardware, here implemented using a processor > specific CAS instruction found on most 680X0 CPUs. It will priobably > work on 68020 68030 68040 and 68060. Committed, thank you. Cheers, Gary -- http://gbenson.net/ From doko at ubuntu.com Fri Sep 12 10:01:13 2008 From: doko at ubuntu.com (Matthias Klose) Date: Fri, 12 Sep 2008 19:01:13 +0200 Subject: Adding version info for a package? Message-ID: <48CAA059.1050006@ubuntu.com> How to add version information for a package build? $ java -version java version "1.6.0_0" OpenJDK Runtime Environment (build 1.6.0_0-b11) OpenJDK Server VM (build 1.6.0_0-b11, mixed mode) does changing this to $ java -version java version "1.6.0_0" OpenJDK Runtime Environment (build 1.6.0_0-b11, Ubuntu 6b11-1ubuntu1) OpenJDK Server VM (build 1.6.0_0-b11, mixed mode) break something? Or should an extra line be added (same thing for the crash report)? Matthias From bugzilla-daemon at icedtea.classpath.org Fri Sep 12 10:18:51 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 12 Sep 2008 17:18:51 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #8 from mark at klomp.org 2008-09-12 17:18 ------- I agree that it would be good to have real wrapper classes that use imageio to provide the functionality. But it should be more that what the suggested patch has. That might be good for compiling some stuff, but if the result then still doesn't run it doesn't do much good for the end user. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Sep 12 11:01:39 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 12 Sep 2008 18:01:39 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #9 from adam at spicenitz.org 2008-09-12 18:01 ------- (In reply to comment #8) Yes, agreed. Fortunately, after a quick look at the javadocs for javax.imageio, I am pretty sure the missing functionality is completely implementable pretty easily. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From David.Herron at Sun.COM Fri Sep 12 11:01:08 2008 From: David.Herron at Sun.COM (David Herron) Date: Fri, 12 Sep 2008 11:01:08 -0700 Subject: Adding version info for a package? In-Reply-To: <48CAA059.1050006@ubuntu.com> References: <48CAA059.1050006@ubuntu.com> Message-ID: <48CAAE64.1020302@sun.com> Matthias Klose wrote: > How to add version information for a package build? > > $ java -version > java version "1.6.0_0" > OpenJDK Runtime Environment (build 1.6.0_0-b11) > OpenJDK Server VM (build 1.6.0_0-b11, mixed mode) > > does changing this to > > $ java -version > java version "1.6.0_0" > OpenJDK Runtime Environment (build 1.6.0_0-b11, Ubuntu 6b11-1ubuntu1) > OpenJDK Server VM (build 1.6.0_0-b11, mixed mode) > > break something? Or should an extra line be added (same thing for the crash report)? > > Matthias > The exact syntax of the -version output isn't well specified. But there is a guideline here:- http://java.sun.com/j2se/versioning_naming.html That suggests you might use: 1.6.0_0-b11-1ubuntu1 ?? Are you also modifying the value of the system property java.version ?? Another thought is the -version:string option which the java command uses to select from multiple versions. Okay, sure, Ubuntu has its own alternatives mechanism, but you could also modify the handling of -version:string and how would your modified version string affect this? Related docs http://java.sun.com/javase/6/docs/technotes/guides/versioning/spec/versioningTOC.html http://java.sun.com/javase/6/docs/api/java/lang/System.html#getProperties() http://java.sun.com/javase/6/docs/technotes/tools/solaris/java.html From bugzilla-daemon at icedtea.classpath.org Fri Sep 12 13:02:33 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 12 Sep 2008 20:02:33 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #10 from matthew.flaschen at gatech.edu 2008-09-12 20:02 ------- Thanks for pointing that out, Adam. I failed to extract everything before my rgrep. Anyway, the code was certainly not meant to make the compiler happy. Adam notes correctly that there is not yet a correct definition of com.sun.image.codec.jpeg.JPEGImageEncoder. However, com.sun.image.codec.jpeg.JPEGImageDecoder and the associated implementation class /are/ defined. In other words, decoding JPEGs (e.g. converting them to PNG) worked fine when I committed; I haven't tested lately. The tests I used then are attached. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Sep 12 13:06:07 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 12 Sep 2008 20:06:07 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #11 from matthew.flaschen at gatech.edu 2008-09-12 20:06 ------- Created an attachment (id=92) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=92&action=view) Tests Decode functionality of com.sun.image.codec.jpeg -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From doko at ubuntu.com Fri Sep 12 13:37:16 2008 From: doko at ubuntu.com (doko at ubuntu.com) Date: Fri, 12 Sep 2008 20:37:16 +0000 Subject: changeset in /hg/icedtea6: 2008-09-12 Matthias Klose changeset 16c322628d9f in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=16c322628d9f description: 2008-09-12 Matthias Klose * fsg.sh: Update for b12 code drop. * Makefile.am, NEWS: Update for b12. * patches/icedtea-LCMS-setTagData.patch: Remove, applied upstream. * patches/icedtea-color-createcontext.patch: Likewise. * patches/icedtea-hotspot-citypeflow.patch: Likewise. * patches/icedtea-hotspot-gcc-pr36917.patch: Likewise. * patches/icedtea-lcms-leak.patch: Likewise. * patches/icedtea-corba.patch: Likewise. * patches/icedtea-gervill.patch: Likewise. * patches/icedtea-directaudio-close-trick.patch: Likewise. * patches/icedtea-generated.patch: Remove, obsolete. * patches/icedtea-version.patch: Update. * patches/icedtea-ecj.patch: Update. * patches/icedtea-javafiles.patch: Regenerate. * HACKING: Update for b12. diffstat: 17 files changed, 71 insertions(+), 768 deletions(-) ChangeLog | 18 + HACKING | 7 Makefile.am | 15 - NEWS | 2 fsg.sh | 4 patches/icedtea-LCMS-setTagData.patch | 296 ------------------------- patches/icedtea-color-createcontext.patch | 36 --- patches/icedtea-corba.patch | 14 - patches/icedtea-directaudio-close-trick.patch | 193 ---------------- patches/icedtea-ecj.patch | 5 patches/icedtea-generated.patch | 10 patches/icedtea-gervill.patch | 99 -------- patches/icedtea-hotspot-citypeflow.patch | 11 patches/icedtea-hotspot-gcc-pr36917.patch | 9 patches/icedtea-javafiles.patch | 78 +++--- patches/icedtea-lcms-leak.patch | 11 patches/icedtea-version.patch | 31 -- diffs (truncated from 1027 to 500 lines): diff -r 8306580ee906 -r 16c322628d9f ChangeLog --- a/ChangeLog Fri Sep 12 15:20:06 2008 +0100 +++ b/ChangeLog Fri Sep 12 22:35:46 2008 +0200 @@ -1,3 +1,21 @@ 2008-09-12 Gary Benson + + * fsg.sh: Update for b12 code drop. + * Makefile.am, NEWS: Update for b12. + * patches/icedtea-LCMS-setTagData.patch: Remove, applied upstream. + * patches/icedtea-color-createcontext.patch: Likewise. + * patches/icedtea-hotspot-citypeflow.patch: Likewise. + * patches/icedtea-hotspot-gcc-pr36917.patch: Likewise. + * patches/icedtea-lcms-leak.patch: Likewise. + * patches/icedtea-corba.patch: Likewise. + * patches/icedtea-gervill.patch: Likewise. + * patches/icedtea-directaudio-close-trick.patch: Likewise. + * patches/icedtea-generated.patch: Remove, obsolete. + * patches/icedtea-version.patch: Update. + * patches/icedtea-ecj.patch: Update. + * patches/icedtea-javafiles.patch: Regenerate. + * HACKING: Update for b12. + 2008-09-12 Gary Benson Xerxes R??nby diff -r 8306580ee906 -r 16c322628d9f HACKING --- a/HACKING Fri Sep 12 15:20:06 2008 +0100 +++ b/HACKING Fri Sep 12 22:35:46 2008 +0200 @@ -17,21 +17,16 @@ The following patches are currently appl * icedtea-ant.patch: Remove use of $(ANT_HOME). * icedtea-uname.patch: Handle output of uname on arm and mips{,el}. * icedtea-bytebuffer-compact.patch: Add clearMark() method to java.nio.Buffer (PR60). -* icedtea-color-createcontext.patch: Add support for a PaintContext to java.awt.Color. * icedtea-copy-plugs.patch: Add IcedTea's 'plugs' for Java WebStart support, add cast to getAnnotation and trapAuthenticationFailure variable to com.sun.jmx.snmp.SnmpPduTrap. -* icedtea-corba.patch: Adds additional files to org.omg.CORBA Makefile. * icedtea-core-build.patch: Add support for building IcedTea core VM. * icedtea-debuginfo.patch: Add -g option to build to generate debugging information. * icedtea-demos.patch: Fix building of JVMTI demo. -* icedtea-directaudio-close-trick.patch: Allow hardware sound device to be reopened. * icedtea-enum-bug-181.patch: Fixes class type check (PR181/S6736248) * icedtea-float-double-trailing-zeros.patch: Remove trailing zeros from Double/Float (PR29/30) * icedtea-fonts.patch: Add Fedora fontconfig. * icedtea-gcc-4.3.patch: Fix code to compile with GCC 4.3 and turn off -Werror. * icedtea-gcc-suffix.patch: Append $(GCC_SUFFIX) to end of 'gcc' binary name. -* icedtea-generated.patch: Force use of /bin/bash. -* icedtea-gervill.patch: Add support for Gervill from the overlay. * icedtea-graphics.patch: Fix word wrap in JTextArea (PR57/S6593649) * icedtea-ia64-fdlibm.patch: Fix name of ia64 architecture from _M_IA64 to ia64. * icedtea-javafiles.patch: Add missing Java files to list. @@ -61,8 +56,6 @@ The following patches are currently appl * icedtea-webservices.patch: Add applet support. * icedtea-zero-build.patch: Add support for the zero assembler build. * icedtea-shark-build.patch: Add support for building the Shark JIT. -* icedtea-hotspot-gcc-pr36917.patch: Work around miscompilation with GCC 4.3 (PR 36917). -* icedtea-hotspot-citypeflow.patch: Fix hotspot miscompilation with GCC 4.3 on x86. * icedtea-alpha-fixes.patch: Fix build issues on alpha-linux. * icedtea-arch.patch: Add support for additional architectures. * icedtea-alt-jar.patch: Add support for using an alternate jar tool in JDK building. diff -r 8306580ee906 -r 16c322628d9f Makefile.am --- a/Makefile.am Fri Sep 12 15:20:06 2008 +0100 +++ b/Makefile.am Fri Sep 12 22:35:46 2008 +0200 @@ -1,6 +1,6 @@ OPENJDK_DATE = 10_jul_2008 -OPENJDK_DATE = 10_jul_2008 -OPENJDK_MD5SUM = 8e60cdac02ec1b2d8ddb9d7369be69df -OPENJDK_VERSION = b11 +OPENJDK_DATE = 28_aug_2008 +OPENJDK_MD5SUM = b53e1ef643909ce82721ee4c970d958b +OPENJDK_VERSION = b12 CACAO_VERSION = 0.99.3 CACAO_MD5SUM = 80de3ad344c1a20c086ec5f1390bd1b8 @@ -467,24 +467,17 @@ ICEDTEA_PATCHES = \ patches/icedtea-sunsrc.patch \ patches/icedtea-libraries.patch \ patches/icedtea-javafiles.patch \ - patches/icedtea-corba.patch \ patches/icedtea-core-build.patch \ patches/icedtea-linker-options.patch \ patches/icedtea-static-libstdc++.patch \ - patches/icedtea-lcms-leak.patch \ patches/icedtea-timerqueue.patch \ - patches/icedtea-generated.patch \ patches/icedtea-lib64.patch \ patches/icedtea-zero-build.patch \ patches/icedtea-print-lsb-release.patch \ patches/icedtea-jpegclasses.patch \ patches/icedtea-uname.patch \ patches/icedtea-ia64-fdlibm.patch \ - patches/icedtea-LCMS-setTagData.patch \ - patches/icedtea-color-createcontext.patch \ patches/icedtea-fonts.patch \ - patches/icedtea-gervill.patch \ - patches/icedtea-directaudio-close-trick.patch \ patches/icedtea-sparc.patch \ patches/icedtea-sparc64-linux.patch \ patches/icedtea-sparc-ptracefix.patch \ @@ -496,8 +489,6 @@ ICEDTEA_PATCHES = \ patches/icedtea-jdk-docs-target.patch \ patches/icedtea-nomotif-6706121.patch \ patches/icedtea-nomotif.patch \ - patches/icedtea-hotspot-gcc-pr36917.patch \ - patches/icedtea-hotspot-citypeflow.patch \ patches/icedtea-alpha-fixes.patch \ patches/icedtea-alt-jar.patch \ patches/icedtea-enum-bug-181.patch \ diff -r 8306580ee906 -r 16c322628d9f NEWS --- a/NEWS Fri Sep 12 15:20:06 2008 +0100 +++ b/NEWS Fri Sep 12 22:35:46 2008 +0200 @@ -1,6 +1,6 @@ New in release UNRELEASED (2008-xx-xx) New in release UNRELEASED (2008-xx-xx) -- Updated to b11 build. +- Updated to b12 build. New in release 1.2 (2008-05-28) diff -r 8306580ee906 -r 16c322628d9f fsg.sh --- a/fsg.sh Fri Sep 12 15:20:06 2008 +0100 +++ b/fsg.sh Fri Sep 12 22:35:46 2008 +0200 @@ -87,9 +87,5 @@ rm -f \ openjdk/jdk/test/javax/xml/crypto/dsig/data/xml-stylesheet \ openjdk/jdk/test/javax/xml/crypto/dsig/data/xml-stylesheet.b64 -# PR157, S6713083 -rm -f \ - openjdk/jdk/src/share/classes/java/lang/instrument/package.html - # END Debian/Ubuntu additions diff -r 8306580ee906 -r 16c322628d9f patches/icedtea-LCMS-setTagData.patch --- a/patches/icedtea-LCMS-setTagData.patch Fri Sep 12 15:20:06 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,296 +0,0 @@ -*** openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/lcms.h.orig 2008-04-11 19:17:54.000000000 -0700 ---- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/lcms.h 2008-04-11 19:19:48.000000000 -0700 -*************** LCMSAPI BOOL LCMSEXPORT _cmsSaveProfile( -*** 1244,1250 **** - LCMSAPI BOOL LCMSEXPORT _cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr, - size_t* BytesNeeded); - -! - - // PostScript ColorRenderingDictionary and ColorSpaceArray - ---- 1244,1251 ---- - LCMSAPI BOOL LCMSEXPORT _cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr, - size_t* BytesNeeded); - -! // Modify data for a tag in a profile -! LCMSAPI BOOL LCMSEXPORT _cmsModifyTagData(cmsHPROFILE hProfile, icTagSignature sig, void *data, size_t size); - - // PostScript ColorRenderingDictionary and ColorSpaceArray - -*************** typedef struct _lcms_iccprofile_struct { -*** 1838,1843 **** ---- 1839,1845 ---- - BOOL (* Seek)(struct _lcms_iccprofile_struct* Icc, size_t offset); - BOOL (* Close)(struct _lcms_iccprofile_struct* Icc); - size_t (* Tell)(struct _lcms_iccprofile_struct* Icc); -+ BOOL (* Grow)(struct _lcms_iccprofile_struct* Icc, size_t amount); - - // Writting - -*** openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c.orig 2008-04-11 19:18:43.000000000 -0700 ---- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c 2008-04-11 19:19:48.000000000 -0700 -*************** JNIEXPORT void JNICALL Java_sun_java2d_c -*** 347,353 **** - JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_setTagData - (JNIEnv *env, jobject obj, jlong id, jint tagSig, jbyteArray data) - { -! fprintf(stderr, "setTagData operation is not implemented"); - } - - void* getILData (JNIEnv *env, jobject img, jint* pDataType, ---- 347,368 ---- - JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_setTagData - (JNIEnv *env, jobject obj, jlong id, jint tagSig, jbyteArray data) - { -! cmsHPROFILE profile; -! storeID_t sProf; -! jbyte* dataArray; -! int tagSize; -! -! if (tagSig == SigHead) { -! fprintf(stderr, "setTagData on icSigHead not permitted"); -! return; -! } -! -! sProf.j = id; -! profile = (cmsHPROFILE) sProf.pf; -! dataArray = (*env)->GetByteArrayElements(env, data, 0); -! tagSize =(*env)->GetArrayLength(env, data); -! _cmsModifyTagData(profile, (icTagSignature) tagSig, dataArray, tagSize); -! (*env)->ReleaseByteArrayElements(env, data, dataArray, 0); - } - - void* getILData (JNIEnv *env, jobject img, jint* pDataType, -*** openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c.orig 2008-04-11 19:17:54.000000000 -0700 ---- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c 2008-04-11 19:19:48.000000000 -0700 -*************** BOOL MemoryWrite(struct _lcms_iccprofile -*** 157,164 **** - if (size == 0) return TRUE; - - if (ResData != NULL) -! CopyMemory(ResData ->Block + Icc ->UsedSpace, Ptr, size); - - Icc->UsedSpace += size; - - return TRUE; ---- 157,165 ---- - if (size == 0) return TRUE; - - if (ResData != NULL) -! CopyMemory(ResData ->Block + ResData ->Pointer, Ptr, size); - -+ ResData->Pointer += size; - Icc->UsedSpace += size; - - return TRUE; -*************** BOOL MemoryWrite(struct _lcms_iccprofile -*** 166,171 **** ---- 167,184 ---- - - - static -+ BOOL MemoryGrow(struct _lcms_iccprofile_struct* Icc, size_t size) -+ { -+ FILEMEM* ResData = (FILEMEM*) Icc->stream; -+ ResData->Size += size; -+ ResData->Block = realloc(ResData->Block, ResData->Size); -+ if (!ResData->Block) -+ return FALSE; -+ return TRUE; -+ } -+ -+ -+ static - BOOL MemoryClose(struct _lcms_iccprofile_struct* Icc) - { - FILEMEM* ResData = (FILEMEM*) Icc ->stream; -*************** BOOL FileWrite(struct _lcms_iccprofile_s -*** 239,244 **** ---- 252,264 ---- - - - static -+ BOOL FileGrow(struct _lcms_iccprofile_struct* Icc, size_t size) -+ { -+ return TRUE; -+ } -+ -+ -+ static - BOOL FileClose(struct _lcms_iccprofile_struct* Icc) - { - return fclose((FILE*) Icc ->stream); -*************** LPLCMSICCPROFILE _cmsCreateProfileFromFi -*** 382,387 **** ---- 402,408 ---- - NewIcc ->Seek = FileSeek; - NewIcc ->Tell = FileTell; - NewIcc ->Close = FileClose; -+ NewIcc ->Grow = FileGrow; - NewIcc ->Write = NULL; - - NewIcc ->IsWrite = FALSE; -*************** LPLCMSICCPROFILE _cmsCreateProfileFromMe -*** 419,425 **** - NewIcc ->Seek = MemorySeek; - NewIcc ->Tell = MemoryTell; - NewIcc ->Close = MemoryClose; -! NewIcc ->Write = NULL; - - NewIcc ->IsWrite = FALSE; - ---- 440,447 ---- - NewIcc ->Seek = MemorySeek; - NewIcc ->Tell = MemoryTell; - NewIcc ->Close = MemoryClose; -! NewIcc ->Grow = MemoryGrow; -! NewIcc ->Write = MemoryWrite; - - NewIcc ->IsWrite = FALSE; - -*** openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio1.c.orig 2008-04-11 19:17:54.000000000 -0700 ---- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio1.c 2008-04-11 19:19:48.000000000 -0700 -*************** CleanUp: -*** 3661,3663 **** ---- 3661,3800 ---- - CopyMemory(Icc, &Keep, sizeof(LCMSICCPROFILE)); - return FALSE; - } -+ -+ BOOL LCMSEXPORT _cmsModifyTagData(cmsHPROFILE hProfile, icTagSignature sig, -+ void *data, size_t size) -+ { -+ BOOL isNew; -+ int i, idx, delta, count; -+ LPBYTE padChars[3] = {0, 0, 0}; -+ LPBYTE beforeBuf, afterBuf, ptr; -+ size_t beforeSize, afterSize; -+ icUInt32Number profileSize, temp; -+ LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile; -+ -+ isNew = FALSE; -+ idx = _cmsSearchTag(Icc, sig, FALSE); -+ if (idx < 0) -+ { -+ isNew = TRUE; -+ idx = Icc->TagCount++; -+ if (Icc->TagCount >= MAX_TABLE_TAG) -+ { -+ fprintf(stderr, "Too many tags (%d)\n", Icc->TagCount); -+ Icc->TagCount = MAX_TABLE_TAG-1; -+ return FALSE; -+ } -+ } -+ -+ /* Read in size from header */ -+ Icc->Seek(Icc, 0); -+ Icc->Read(&profileSize, sizeof(icUInt32Number), 1, Icc); -+ AdjustEndianess32((LPBYTE) &profileSize); -+ -+ /* Compute the change in profile size */ -+ if (isNew) -+ delta = sizeof(icTag) + ALIGNLONG(size); -+ else -+ delta = ALIGNLONG(size) - ALIGNLONG(Icc->TagSizes[idx]); -+ -+ /* Add tag to internal structures */ -+ ptr = malloc(size); -+ CopyMemory(ptr, data, size); -+ Icc->TagSizes[idx] = size; -+ Icc->TagNames[idx] = sig; -+ if (Icc->TagPtrs[idx]) -+ free(Icc->TagPtrs[idx]); -+ Icc->TagPtrs[idx] = ptr; -+ if (isNew) -+ Icc->TagOffsets[idx] = profileSize; -+ -+ /* Compute size of tag data before/after the modified tag */ -+ beforeSize = Icc->TagOffsets[idx] - Icc->TagOffsets[0]; -+ if (Icc->TagCount == (idx + 1)) -+ afterSize = 0; -+ else -+ afterSize = profileSize - Icc->TagOffsets[idx+1]; -+ -+ /* Make copies of the data before/after the modified tag */ -+ if (beforeSize > 0) -+ { -+ beforeBuf = malloc(beforeSize); -+ Icc->Seek(Icc, Icc->TagOffsets[0]); -+ Icc->Read(beforeBuf, beforeSize, 1, Icc); -+ } -+ -+ if (afterSize > 0) -+ { -+ afterBuf = malloc(afterSize); -+ Icc->Seek(Icc, Icc->TagOffsets[idx+1]); -+ Icc->Read(afterBuf, afterSize, 1, Icc); -+ } -+ -+ /* Update the profile size in the header */ -+ profileSize += delta; -+ Icc->Seek(Icc, 0); -+ temp = TransportValue32(profileSize); -+ Icc->Write(Icc, sizeof(icUInt32Number), &temp); -+ -+ Icc->Grow(Icc, delta); -+ -+ /* Adjust tag offsets: if the tag is new, we must account -+ for the new tag table entry; otherwise, only those tags after -+ the modified tag are changed (by delta) */ -+ if (isNew) -+ { -+ for (i = 0; i < Icc->TagCount; ++i) -+ Icc->TagOffsets[i] += sizeof(icTag); -+ } -+ else -+ { -+ for (i = idx+1; i < Icc->TagCount; ++i) -+ Icc->TagOffsets[i] += delta; -+ } -+ -+ /* Write out a new tag table */ -+ count = 0; -+ for (i = 0; i < Icc->TagCount; ++i) -+ { -+ if (Icc->TagNames[i] != 0) -+ ++count; -+ } -+ Icc->Seek(Icc, sizeof(icHeader)); -+ temp = TransportValue32(count); -+ Icc->Write(Icc, sizeof(icUInt32Number), &temp); -+ -+ for (i = 0; i < Icc->TagCount; ++i) -+ { -+ if (Icc->TagNames[i] != 0) -+ { -+ icTag tag; -+ tag.sig = TransportValue32(Icc->TagNames[i]); -+ tag.offset = TransportValue32((icInt32Number) Icc->TagOffsets[i]); -+ tag.size = TransportValue32((icInt32Number) Icc->TagSizes[i]); -+ Icc->Write(Icc, sizeof(icTag), &tag); -+ } -+ } -+ -+ /* Write unchanged data before the modified tag */ -+ if (beforeSize > 0) -+ { -+ Icc->Write(Icc, beforeSize, beforeBuf); -+ free(beforeBuf); -+ } -+ -+ /* Write modified tag data */ -+ Icc->Write(Icc, size, data); -+ if (size % 4) -+ Icc->Write(Icc, 4 - (size % 4), padChars); -+ -+ /* Write unchanged data after the modified tag */ -+ if (afterSize > 0) -+ { -+ Icc->Write(Icc, afterSize, afterBuf); -+ free(afterBuf); -+ } -+ -+ return TRUE; -+ } -+ diff -r 8306580ee906 -r 16c322628d9f patches/icedtea-color-createcontext.patch --- a/patches/icedtea-color-createcontext.patch Fri Sep 12 15:20:06 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -*** openjdk/jdk/src/share/classes/java/awt/Color.java.orig 2008-04-02 17:12:00.000000000 -0700 ---- openjdk/jdk/src/share/classes/java/awt/Color.java 2008-04-02 17:29:29.000000000 -0700 -*************** public class Color implements Paint, jav -*** 251,256 **** ---- 251,262 ---- - */ - private ColorSpace cs = null; - -+ /** -+ * The PaintContext for this solid color. -+ * @see #createContext -+ */ -+ private transient PaintContext context; -+ - /* - * JDK 1.1 serialVersionUID - */ -*************** public class Color implements Paint, jav -*** 1205,1211 **** - Rectangle2D r2d, - AffineTransform xform, - RenderingHints hints) { -! return new ColorPaintContext(getRGB(), cm); - } - - /** ---- 1211,1219 ---- - Rectangle2D r2d, - AffineTransform xform, - RenderingHints hints) { -! if (context == null || !context.getColorModel().equals(cm)) -! context = new ColorPaintContext(getRGB(), cm); -! return context; - } - - /** diff -r 8306580ee906 -r 16c322628d9f patches/icedtea-corba.patch --- a/patches/icedtea-corba.patch Fri Sep 12 15:20:06 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ ---- openjdk.old/corba/make/org/omg/CORBA/Makefile 2007-10-12 03:49:14.000000000 -0400 -+++ openjdk/corba/make/org/omg/CORBA/Makefile 2007-11-06 13:57:24.000000000 -0500 -@@ -49,7 +49,10 @@ - FILES_java = \ - $(ORG_OMG_SENDINGCONTEXT_java) \ - $(ORG_OMG_CORBA_2_3_java) \ -- $(ORG_OMG_CORBA_java) -+ $(ORG_OMG_CORBA_java) \ -+ $(org_omg_SENDINGCONTEXT_java) \ -+ $(org_omg_CORBA_2_3_java) \ -+ $(org_omg_CORBA_java) - - # - # Include diff -r 8306580ee906 -r 16c322628d9f patches/icedtea-directaudio-close-trick.patch --- a/patches/icedtea-directaudio-close-trick.patch Fri Sep 12 15:20:06 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ ---- /home/mark/src/openjdk/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java 2008-04-13 01:05:30.000000000 +0200 -+++ openjdk/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java 2008-05-09 02:18:21.000000000 +0200 -@@ -394,7 +394,12 @@ - private float leftGain, rightGain; - protected volatile boolean noService = false; // do not run the nService method - -+ // Guards all native calls. - protected Object lockNative = new Object(); From omajid at redhat.com Fri Sep 12 13:40:23 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 12 Sep 2008 20:40:23 +0000 Subject: changeset in /hg/pulseaudio: 2009-09-12 Omair Majid changeset 9eb090e7c22c in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=9eb090e7c22c description: 2009-09-12 Omair Majid * .hgignore: ignore any changes in classes and testclasses folders diffstat: 1 file changed, 2 insertions(+) .hgignore | 2 ++ diffs (12 lines): diff -r 3f2e4077fcbb -r 9eb090e7c22c .hgignore --- a/.hgignore Thu Sep 11 16:49:43 2008 -0400 +++ b/.hgignore Fri Sep 12 09:43:49 2008 -0400 @@ -2,6 +2,8 @@ syntax: glob syntax: glob *.class +classes/* +testclasses/* *.o *~ org_classpath_icedtea_*.h From omajid at redhat.com Fri Sep 12 13:40:23 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 12 Sep 2008 20:40:23 +0000 Subject: changeset in /hg/pulseaudio: 2009-09-12 Omair Majid changeset 7ba42a599d59 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=7ba42a599d59 description: 2009-09-12 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Changed sourceLineInfos and targetLineInfos to List from Line.Info[]. (PulseAudioMixer): Fixed to work with the change in sourceLineInfos and targetLineInfos. (getSourceLineInfo): Likewise. (getSourceLineInfo): Likewise. (getTargetLineInfo): Likewise. (isLineSupported): Likewise. (open): Moved the initialization of Port infomration to the actual implementation in openRemote. (openRemote): Added the Port initialization info. Now it doesnt overwrite any Clip info. * unittests/org/classpath/icedtea/pulseaudio/OtherSourndProvidersAvailableTest.java (testOtherSoundProviders): Made the test more verbose and not fail if using the default Mixer. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerProviderTest.java Made the test more verbose and print out more information. Also tries to open a source line. * unittests/org/classpath/icedtea/pulseaudio/PulseAUdioMixerTest.java (testSourceLinesExist): Now tests if at least one SourceDataLine, Clip and Port are available. diffstat: 4 files changed, 151 insertions(+), 109 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 75 +++------ unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java | 81 +++++---- unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerProviderTest.java | 83 ++++++---- unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java | 21 ++ diffs (435 lines): diff -r 9eb090e7c22c -r 7ba42a599d59 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Fri Sep 12 09:43:49 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Fri Sep 12 11:19:27 2008 -0400 @@ -70,9 +70,8 @@ public class PulseAudioMixer implements public EventLoop eventLoop; public Thread eventLoopThread; - private Line.Info[] sourceLineInfos; - private Line.Info[] targetLineInfos; - private Line.Info[] clipInfos; + private List sourceLineInfos = new ArrayList(); + private List targetLineInfos = new ArrayList(); private static PulseAudioMixer _instance = null; @@ -88,21 +87,17 @@ public class PulseAudioMixer implements private PulseAudioMixer() { AudioFormat[] formats = getSupportedFormats(); - List sourceLineInfoList = new ArrayList(); - sourceLineInfoList.add(new DataLine.Info(SourceDataLine.class, formats, + + sourceLineInfos.add(new DataLine.Info(SourceDataLine.class, formats, StreamBufferAttributes.MIN_VALUE, StreamBufferAttributes.MAX_VALUE)); - sourceLineInfos = new Line.Info[] { new DataLine.Info( - SourceDataLine.class, formats, + sourceLineInfos.add(new DataLine.Info(Clip.class, formats, StreamBufferAttributes.MIN_VALUE, - StreamBufferAttributes.MAX_VALUE) }; - targetLineInfos = new Line.Info[] { new DataLine.Info( - TargetDataLine.class, formats, + StreamBufferAttributes.MAX_VALUE)); + + targetLineInfos.add(new DataLine.Info(TargetDataLine.class, formats, StreamBufferAttributes.MIN_VALUE, - StreamBufferAttributes.MAX_VALUE) }; - clipInfos = new Line.Info[] { new DataLine.Info(Clip.class, formats, - StreamBufferAttributes.MIN_VALUE, - StreamBufferAttributes.MAX_VALUE) }; + StreamBufferAttributes.MAX_VALUE)); } @@ -327,16 +322,13 @@ public class PulseAudioMixer implements } public javax.sound.sampled.Line.Info[] getSourceLineInfo() { - Line.Info[] localArray = new Line.Info[sourceLineInfos.length]; - System.arraycopy(sourceLineInfos, 0, localArray, 0, - sourceLineInfos.length); - return localArray; + return sourceLineInfos.toArray(new Line.Info[0]); } @Override public javax.sound.sampled.Line.Info[] getSourceLineInfo( javax.sound.sampled.Line.Info info) { - ArrayList infos = new ArrayList(); + ArrayList infos = new ArrayList(); for (Line.Info supportedInfo : sourceLineInfos) { if (info.matches(supportedInfo)) { @@ -354,10 +346,7 @@ public class PulseAudioMixer implements @Override public javax.sound.sampled.Line.Info[] getTargetLineInfo() { - Line.Info[] localArray = new Line.Info[targetLineInfos.length]; - System.arraycopy(targetLineInfos, 0, localArray, 0, - targetLineInfos.length); - return localArray; + return targetLineInfos.toArray(new Line.Info[0]); } @Override @@ -381,23 +370,18 @@ public class PulseAudioMixer implements @Override public boolean isLineSupported(javax.sound.sampled.Line.Info info) { if (info != null) { - for (int i = 0; i < sourceLineInfos.length; i++) { - if (info.matches(sourceLineInfos[i])) { + for (Line.Info myInfo : sourceLineInfos) { + if (info.matches(myInfo)) { return true; } } - for (int i = 0; i < targetLineInfos.length; i++) { - if (info.matches(targetLineInfos[i])) { + for (Line.Info myInfo : targetLineInfos) { + if (info.matches(myInfo)) { return true; } } - for (Line.Info clipInfo : clipInfos) { - if (info.matches(clipInfo)) { - return true; - } - } } return false; @@ -493,22 +477,6 @@ public class PulseAudioMixer implements @Override public void open() throws LineUnavailableException { openLocal(); - // the sourceLineInfo and targetLineInfo arrays need to be updated with - // port infos, which can only be obtained after EventLoop had started - - ArrayList sourceLineInfoList = new ArrayList(); - sourceLineInfoList.add(sourceLineInfos[0]); - for (String portName : eventLoop.updateSourcePortNameList()) { - sourceLineInfoList.add(new Port.Info(Port.class, portName, true)); - } - sourceLineInfos = sourceLineInfoList.toArray(new Line.Info[0]); - - ArrayList targetLineInfoList = new ArrayList(); - targetLineInfoList.add(targetLineInfos[0]); - for (String portName : eventLoop.updateTargetPortNameList()) { - targetLineInfoList.add(new Port.Info(Port.class, portName, false)); - } - targetLineInfos = targetLineInfoList.toArray(new Line.Info[0]); } @@ -621,6 +589,17 @@ public class PulseAudioMixer implements this.isOpen = true; + // sourceLineInfo and targetLineInfo need to be updated with + // port infos, which can only be obtained after EventLoop had started + + for (String portName : eventLoop.updateSourcePortNameList()) { + sourceLineInfos.add(new Port.Info(Port.class, portName, true)); + } + + for (String portName : eventLoop.updateTargetPortNameList()) { + targetLineInfos.add(new Port.Info(Port.class, portName, false)); + } + } @Override diff -r 9eb090e7c22c -r 7ba42a599d59 unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java Fri Sep 12 09:43:49 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java Fri Sep 12 11:19:27 2008 -0400 @@ -33,8 +33,7 @@ this exception to your version of the li this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. -*/ - + */ package org.classpath.icedtea.pulseaudio; @@ -48,58 +47,72 @@ import junit.framework.JUnit4TestAdapter import org.junit.Test; +public class OtherSoundProvidersAvailableTest { -public class OtherSoundProvidersAvailableTest { - - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(OtherSoundProvidersAvailableTest.class); + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(OtherSoundProvidersAvailableTest.class); } - + @Test public void testOtherSoundProviders() { + System.out.println("This tests if alsa mixers are still available"); - Mixer.Info mixerInfos [] = AudioSystem.getMixerInfo(); + Mixer.Info mixerInfos[] = AudioSystem.getMixerInfo(); Mixer.Info selectedMixerInfo = null; Mixer selectedMixer; - + + boolean selected = false; int i = 0; - for ( Mixer.Info info: mixerInfos) { - System.out.println("Mixer Line " + i++ + ": " + info.getName() + " " + info.getDescription()); - if ( info.getName().contains("0,4")) { - selectedMixerInfo = info; + System.out.println("Available Mixers:"); + // use 0,0 or the default + for (Mixer.Info info : mixerInfos) { + System.out.println("Mixer Line " + i++ + ": " + info.getName() + + " " + info.getDescription()); + if (info.getName().contains("0,0") && !selected) { + System.out.println("^ selecting as the mixer to use"); + selectedMixerInfo = info; + selected = true; } } - System.out.println(selectedMixerInfo.toString()); - System.out.println("getting information from selected mixer:"); - - // use 0,4 or the default + + if (selectedMixerInfo != null) { + System.out.println(selectedMixerInfo.toString()); + } + + System.out.print("Selected mixer is of class: "); + selectedMixer = AudioSystem.getMixer(selectedMixerInfo); - System.out.println(selectedMixer.toString()); + System.out.println(selectedMixer.getClass().toString()); try { Line.Info sourceDataLineInfo = null; - - selectedMixer.open(); // initialize the mixer - + + selectedMixer.open(); // initialize the mixer + Line.Info allLineInfo[] = selectedMixer.getSourceLineInfo(); + System.out.println("Source lines supported by mixer: "); int j = 0; - for ( Line.Info lineInfo : allLineInfo) { - System.out.println("Source Line " + j++ + ": " + lineInfo.getLineClass()); - if ( lineInfo.getLineClass().toString().contains("SourceDataLine")) { + for (Line.Info lineInfo : allLineInfo) { + System.out.println("Source Line " + j++ + ": " + + lineInfo.getLineClass()); + if (lineInfo.toString().contains("SourceDataLine")) { sourceDataLineInfo = lineInfo; } + } - - SourceDataLine sourceDataLine = (SourceDataLine) selectedMixer.getLine(sourceDataLineInfo); - sourceDataLine.open(); - //sourceDataLine.write('a', 0, 2); - sourceDataLine.close(); - - } catch ( LineUnavailableException e ) { + if (sourceDataLineInfo == null) { + System.out.println("Mixer supports no SourceDataLines"); + } else { + SourceDataLine sourceDataLine = (SourceDataLine) selectedMixer + .getLine(sourceDataLineInfo); + + sourceDataLine.open(); + // sourceDataLine.write('a', 0, 2); + sourceDataLine.close(); + } + } catch (LineUnavailableException e) { System.out.println("Line unavailable"); } - - - + } } diff -r 9eb090e7c22c -r 7ba42a599d59 unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerProviderTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerProviderTest.java Fri Sep 12 09:43:49 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerProviderTest.java Fri Sep 12 11:19:27 2008 -0400 @@ -33,61 +33,92 @@ this exception to your version of the li this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. -*/ + */ package org.classpath.icedtea.pulseaudio; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Line; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.Mixer; +import javax.sound.sampled.SourceDataLine; import junit.framework.JUnit4TestAdapter; -import org.junit.After; -import org.junit.Before; import org.junit.Test; public class PulseAudioMixerProviderTest { - private Mixer selectedMixer; - private Mixer.Info selectedMixerInfo; + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(PulseAudioMixerProviderTest.class); + } + + AudioFormat aSupportedFormat = new AudioFormat( + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(PulseAudioMixerProviderTest.class); - } + @Test + public void testMixerProvider() throws LineUnavailableException { - @Before - public void setUp() throws Exception { + System.out + .println("This test checks that the PulseAudio mixer exists and is usable"); - Mixer.Info mixerInfos [] = AudioSystem.getMixerInfo(); + Mixer selectedMixer = null; + Mixer.Info selectedMixerInfo = null; + + Mixer.Info mixerInfos[] = AudioSystem.getMixerInfo(); int i = 0; - for ( Mixer.Info info: mixerInfos) { - System.out.println("Mixer Line " + i++ + ": " + info.getName() + " " + info.getDescription()); - if ( info.getName().contains("PulseAudio")) { - selectedMixerInfo = info; + for (Mixer.Info info : mixerInfos) { + System.out.println("Mixer Line " + i++ + ": " + info.getName() + + " " + info.getDescription()); + if (info.getName().contains("PulseAudio")) { + System.out.println(" ^ found PulseAudio Mixer!"); + selectedMixerInfo = info; } } + assertNotNull(selectedMixerInfo); - } - @Test - public void testMixerProvider() throws LineUnavailableException { - System.out.println(selectedMixerInfo.toString()); - System.out.println("getting information from selected mixer:"); + System.out.println("Getting information from selected mixer:"); + System.out.println("Name: "+ selectedMixerInfo.getName()); + System.out.println("Version: " + selectedMixerInfo.getVersion()); + selectedMixer = AudioSystem.getMixer(selectedMixerInfo); assertNotNull(selectedMixer); - System.out.println(selectedMixer.toString()); - } + System.out.println("Implemented in class: " + selectedMixer.getClass().toString()); + selectedMixer.open(); // initialize the mixer - @After - public void tearDown() throws Exception { + Line.Info sourceDataLineInfo = null; + Line.Info allLineInfo[] = selectedMixer.getSourceLineInfo(); + System.out.println("Source lines supported by mixer: "); + int j = 0; + for (Line.Info lineInfo : allLineInfo) { + System.out.println("Source Line " + j++ + ": " + + lineInfo.getLineClass()); + if (lineInfo.toString().contains("SourceDataLine")) { + sourceDataLineInfo = lineInfo; + } + + } + + if (sourceDataLineInfo == null) { + System.out.println("Mixer supports no SourceDataLines"); + } else { + SourceDataLine sourceDataLine = (SourceDataLine) selectedMixer + .getLine(sourceDataLineInfo); + + sourceDataLine.open(aSupportedFormat); + // sourceDataLine.write('a', 0, 2); + sourceDataLine.close(); + } + + selectedMixer.close(); } - } diff -r 9eb090e7c22c -r 7ba42a599d59 unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Fri Sep 12 09:43:49 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Fri Sep 12 11:19:27 2008 -0400 @@ -64,7 +64,7 @@ public class PulseAudioMixerTest { PulseAudioMixer selectedMixer; AudioFormat aSupportedFormat = new AudioFormat( - AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 10, true); + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); public static junit.framework.Test suite() { return new JUnit4TestAdapter(PulseAudioMixerTest.class); @@ -147,19 +147,38 @@ public class PulseAudioMixerTest { @Test public void testSourceLinesExist() throws LineUnavailableException { + System.out.println("This tests that source lines exist"); selectedMixer.open(); Line.Info allLineInfo[] = selectedMixer.getSourceLineInfo(); Assert.assertNotNull(allLineInfo); Assert.assertTrue(allLineInfo.length > 0); + + boolean foundSourceDataLine = false; + boolean foundClip = false; + boolean foundPort = false; + int j = 0; for (Line.Info lineInfo : allLineInfo) { System.out.println("Source Line " + j++ + ": " + lineInfo.getLineClass()); + if (lineInfo.getLineClass().toString().contains("SourceDataLine")) { + foundSourceDataLine = true; + } else if (lineInfo.getLineClass().toString().contains("Clip")) { + foundClip = true; + } else if (lineInfo.getLineClass().toString().contains("Port")) { + foundPort = true; + } else { + Assert.assertFalse("Found a new type of Line", true); + } Line sourceLine = (Line) selectedMixer.getLine(lineInfo); assertNotNull(sourceLine); } + Assert.assertTrue("Couldnt find a SourceDataLine", foundSourceDataLine); + Assert.assertTrue("Couldnt find a Clip", foundClip); + Assert.assertTrue("Couldnt find a Port", foundPort); + } @Test From omajid at redhat.com Fri Sep 12 13:40:24 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 12 Sep 2008 20:40:24 +0000 Subject: changeset in /hg/pulseaudio: 2009-09-12 Mark Wielaard changeset b10eef873d2d in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=b10eef873d2d description: 2009-09-12 Mark Wielaard * build.xml: Dont stop on failing a test and show output of tests. diffstat: 1 file changed, 1 insertion(+), 1 deletion(-) build.xml | 2 +- diffs (12 lines): diff -r 7ba42a599d59 -r b10eef873d2d build.xml --- a/build.xml Fri Sep 12 11:19:27 2008 -0400 +++ b/build.xml Fri Sep 12 11:26:43 2008 -0400 @@ -62,7 +62,7 @@ - + From omajid at redhat.com Fri Sep 12 13:40:24 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 12 Sep 2008 20:40:24 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-12 Omair Majid changeset d4bb2fa0df23 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=d4bb2fa0df23 description: 2008-09-12 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/Eventloop.java Fixed static initializer. Removed debug output from static initializer. * src/java/org/classpath/icedtea/pulseaudio/Operation.java Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java Likewise. * src/java/org/classpath/icedtea/pulseaudio/Stream.java Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Added staticSourceLineInfos and staticTargetLineInfos to store Line.Info objects which are initialized only in the constructor. sourceLineInfos and targetLineInfos are now rebuilt whenever the mixer is opened. (PulseAudioMixer): Initialize static{Source,Target}LineInfos. (close): Call refreshSourceAndTargetLines to remove the Ports. (open): Likewise. (refreshSourceAndTargetLines): clear the {source,target}LineInfos and use the static version to initialize new ones. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java (testTargetLinesExist): Now tests for the existance of Port and TargetDataLine. (testSaneNumberOfPorts): New test. Checks that not too many ports are exported (which whould be a bug). (testGetTargetPortInfo): Now checks that the object is a Port and is not a source port. (testGetSourcePortInfo): Now checks that the ojbect is a Port ans is not a target port. diffstat: 9 files changed, 177 insertions(+), 61 deletions(-) src/java/org/classpath/icedtea/pulseaudio/EventLoop.java | 4 src/java/org/classpath/icedtea/pulseaudio/Operation.java | 4 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 32 +- src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java | 17 + src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java | 15 + src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java | 15 + src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java | 4 src/java/org/classpath/icedtea/pulseaudio/Stream.java | 4 unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java | 143 ++++++---- diffs (439 lines): diff -r b10eef873d2d -r d4bb2fa0df23 src/java/org/classpath/icedtea/pulseaudio/EventLoop.java --- a/src/java/org/classpath/icedtea/pulseaudio/EventLoop.java Fri Sep 12 11:26:43 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/EventLoop.java Fri Sep 12 12:44:34 2008 -0400 @@ -110,8 +110,8 @@ public class EventLoop implements Runnab String library = new java.io.File(".").getCanonicalPath() + java.io.File.separatorChar + System.mapLibraryName("pulse-java"); - System.out.println(EventLoop.class.getCanonicalName() + ": " - + library); + // System.out.println(EventLoop.class.getCanonicalName() + ": " + // + library); System.load(library); } catch (IOException e) { assert ("Loading failed".endsWith("library")); diff -r b10eef873d2d -r d4bb2fa0df23 src/java/org/classpath/icedtea/pulseaudio/Operation.java --- a/src/java/org/classpath/icedtea/pulseaudio/Operation.java Fri Sep 12 11:26:43 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Operation.java Fri Sep 12 12:44:34 2008 -0400 @@ -63,8 +63,8 @@ public class Operation { String library = new java.io.File(".").getCanonicalPath() + java.io.File.separatorChar + System.mapLibraryName("pulse-java"); - System.out.println(Operation.class.getCanonicalName() + ": " - + library); + // System.out.println(Operation.class.getCanonicalName() + ": " + // + library); System.load(library); } catch (IOException e) { assert ("Loading failed".endsWith("library")); diff -r b10eef873d2d -r d4bb2fa0df23 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Fri Sep 12 11:26:43 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Fri Sep 12 12:44:34 2008 -0400 @@ -71,7 +71,10 @@ public class PulseAudioMixer implements public Thread eventLoopThread; private List sourceLineInfos = new ArrayList(); + private List staticSourceLineInfos = new ArrayList(); + private List targetLineInfos = new ArrayList(); + private List staticTargetLineInfos = new ArrayList(); private static PulseAudioMixer _instance = null; @@ -88,15 +91,15 @@ public class PulseAudioMixer implements private PulseAudioMixer() { AudioFormat[] formats = getSupportedFormats(); - sourceLineInfos.add(new DataLine.Info(SourceDataLine.class, formats, + staticSourceLineInfos.add(new DataLine.Info(SourceDataLine.class, + formats, StreamBufferAttributes.MIN_VALUE, + StreamBufferAttributes.MAX_VALUE)); + staticSourceLineInfos.add(new DataLine.Info(Clip.class, formats, StreamBufferAttributes.MIN_VALUE, StreamBufferAttributes.MAX_VALUE)); - sourceLineInfos.add(new DataLine.Info(Clip.class, formats, - StreamBufferAttributes.MIN_VALUE, - StreamBufferAttributes.MAX_VALUE)); - - targetLineInfos.add(new DataLine.Info(TargetDataLine.class, formats, - StreamBufferAttributes.MIN_VALUE, + + staticTargetLineInfos.add(new DataLine.Info(TargetDataLine.class, + formats, StreamBufferAttributes.MIN_VALUE, StreamBufferAttributes.MAX_VALUE)); } @@ -442,6 +445,8 @@ public class PulseAudioMixer implements synchronized (lineListeners) { lineListeners.clear(); } + + refreshSourceAndTargetLines(); } @@ -592,6 +597,8 @@ public class PulseAudioMixer implements // sourceLineInfo and targetLineInfo need to be updated with // port infos, which can only be obtained after EventLoop had started + refreshSourceAndTargetLines(); + for (String portName : eventLoop.updateSourcePortNameList()) { sourceLineInfos.add(new Port.Info(Port.class, portName, true)); } @@ -680,4 +687,15 @@ public class PulseAudioMixer implements targetLines.remove(line); } + void refreshSourceAndTargetLines() { + + sourceLineInfos.clear(); + targetLineInfos.clear(); + + sourceLineInfos.addAll(staticSourceLineInfos); + + targetLineInfos.addAll(staticTargetLineInfos); + + } + } diff -r b10eef873d2d -r d4bb2fa0df23 src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java Fri Sep 12 11:26:43 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java Fri Sep 12 12:44:34 2008 -0400 @@ -37,6 +37,8 @@ exception statement from your version. package org.classpath.icedtea.pulseaudio; +import java.io.IOException; + import javax.sound.sampled.AudioSystem; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineUnavailableException; @@ -63,6 +65,19 @@ public abstract class PulseAudioPort ext private PulseAudioMuteControl muteControl; private PulseAudioVolumeControl volumeControl; + static { + try { + String library = new java.io.File(".").getCanonicalPath() + + java.io.File.separatorChar + + System.mapLibraryName("pulse-java"); + // System.out.println(PulseAudioVolumeControl.class.getCanonicalName() + // + ": " + library); + System.load(library); + } catch (IOException e) { + assert ("Loading failed".endsWith("library")); + } + } + public PulseAudioPort(String name, EventLoop eventLoop) { this.name = name; this.contextPointer = eventLoop.getContextPointer(); @@ -75,7 +90,7 @@ public abstract class PulseAudioPort ext controls.add(muteControl); isOpen = true; - System.out.println("Opened Target Port " + name); + // System.out.println("Opened Target Port " + name); } public abstract byte[] native_setVolume(float newValue); diff -r b10eef873d2d -r d4bb2fa0df23 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java Fri Sep 12 11:26:43 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java Fri Sep 12 12:44:34 2008 -0400 @@ -37,9 +37,24 @@ exception statement from your version. package org.classpath.icedtea.pulseaudio; +import java.io.IOException; + import javax.sound.sampled.Port; public class PulseAudioSourcePort extends PulseAudioPort { + + static { + try { + String library = new java.io.File(".").getCanonicalPath() + + java.io.File.separatorChar + + System.mapLibraryName("pulse-java"); + // System.out.println(PulseAudioVolumeControl.class.getCanonicalName() + // + ": " + library); + System.load(library); + } catch (IOException e) { + assert ("Loading failed".endsWith("library")); + } + } public PulseAudioSourcePort(String name, EventLoop eventLoop) { super(name, eventLoop); diff -r b10eef873d2d -r d4bb2fa0df23 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java Fri Sep 12 11:26:43 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java Fri Sep 12 12:44:34 2008 -0400 @@ -37,9 +37,24 @@ exception statement from your version. package org.classpath.icedtea.pulseaudio; +import java.io.IOException; + import javax.sound.sampled.Port; public class PulseAudioTargetPort extends PulseAudioPort { + + static { + try { + String library = new java.io.File(".").getCanonicalPath() + + java.io.File.separatorChar + + System.mapLibraryName("pulse-java"); + // System.out.println(PulseAudioVolumeControl.class.getCanonicalName() + // + ": " + library); + System.load(library); + } catch (IOException e) { + assert ("Loading failed".endsWith("library")); + } + } public PulseAudioTargetPort(String name, EventLoop eventLoop) { super(name, eventLoop); diff -r b10eef873d2d -r d4bb2fa0df23 src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java Fri Sep 12 11:26:43 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioVolumeControl.java Fri Sep 12 12:44:34 2008 -0400 @@ -66,8 +66,8 @@ class PulseAudioVolumeControl extends Fl String library = new java.io.File(".").getCanonicalPath() + java.io.File.separatorChar + System.mapLibraryName("pulse-java"); - System.out.println(PulseAudioVolumeControl.class.getCanonicalName() - + ": " + library); + // System.out.println(PulseAudioVolumeControl.class.getCanonicalName() + // + ": " + library); System.load(library); } catch (IOException e) { assert ("Loading failed".endsWith("library")); diff -r b10eef873d2d -r d4bb2fa0df23 src/java/org/classpath/icedtea/pulseaudio/Stream.java --- a/src/java/org/classpath/icedtea/pulseaudio/Stream.java Fri Sep 12 11:26:43 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Stream.java Fri Sep 12 12:44:34 2008 -0400 @@ -103,8 +103,8 @@ public class Stream { String library = new java.io.File(".").getCanonicalPath() + java.io.File.separatorChar + System.mapLibraryName("pulse-java"); - System.out - .println(Stream.class.getCanonicalName() + ": " + library); + // System.out + // .println(Stream.class.getCanonicalName() + ": " + library); System.load(library); } catch (IOException e) { assert ("Loading failed".endsWith("library")); diff -r b10eef873d2d -r d4bb2fa0df23 unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Fri Sep 12 11:26:43 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Fri Sep 12 12:44:34 2008 -0400 @@ -50,6 +50,7 @@ import javax.sound.sampled.Mixer; import javax.sound.sampled.Mixer; import javax.sound.sampled.Port; import javax.sound.sampled.TargetDataLine; +import javax.sound.sampled.DataLine.Info; import junit.framework.JUnit4TestAdapter; @@ -152,11 +153,11 @@ public class PulseAudioMixerTest { Line.Info allLineInfo[] = selectedMixer.getSourceLineInfo(); Assert.assertNotNull(allLineInfo); Assert.assertTrue(allLineInfo.length > 0); - + boolean foundSourceDataLine = false; boolean foundClip = false; boolean foundPort = false; - + int j = 0; for (Line.Info lineInfo : allLineInfo) { System.out.println("Source Line " + j++ + ": " @@ -178,34 +179,125 @@ public class PulseAudioMixerTest { Assert.assertTrue("Couldnt find a SourceDataLine", foundSourceDataLine); Assert.assertTrue("Couldnt find a Clip", foundClip); Assert.assertTrue("Couldnt find a Port", foundPort); - + } @Test public void testTargetLinesExist() throws LineUnavailableException { + System.out.println("This tests if target Lines exist"); selectedMixer.open(); Line.Info allLineInfo[] = selectedMixer.getTargetLineInfo(); Assert.assertNotNull(allLineInfo); Assert.assertTrue(allLineInfo.length > 0); + + boolean foundTargetDataLine = false; + boolean foundPort = false; + int j = 0; for (Line.Info lineInfo : allLineInfo) { System.out.println("Target Line " + j++ + ": " + lineInfo.getLineClass()); + if (lineInfo.getLineClass().toString().contains("TargetDataLine")) { + foundTargetDataLine = true; + } else if (lineInfo.getLineClass().toString().contains("Port")) { + foundPort = true; + } else { + Assert.assertTrue("Found invalid type of target line", true); + } Line targetLine = (Line) selectedMixer.getLine(lineInfo); assertNotNull(targetLine); } + Assert.assertTrue("Couldnt find a TargetDataLine", foundTargetDataLine); + Assert.assertTrue("Couldnt find a target Port", foundPort); + + } + + @Ignore + @Test + public void testHeadphonePortExists() throws LineUnavailableException { + selectedMixer.open(); + selectedMixer.getLine(Port.Info.HEADPHONE); + } + + @Ignore + @Test + public void testSpeakerPortExists() throws LineUnavailableException { + selectedMixer.open(); + selectedMixer.getLine(Port.Info.SPEAKER); + } + + @Ignore + @Test + public void testLineInPortExists() throws LineUnavailableException { + selectedMixer.open(); + selectedMixer.getLine(Port.Info.LINE_IN); + } + + @Ignore + @Test + public void testCdPortExists() throws LineUnavailableException { + selectedMixer.open(); + selectedMixer.getLine(Port.Info.COMPACT_DISC); + } + + @Ignore + @Test + public void testLineOutPortExists() throws LineUnavailableException { + selectedMixer.open(); + selectedMixer.getLine(Port.Info.LINE_OUT); + } + + @Ignore + @Test + public void testMicrophonePortExists() throws LineUnavailableException { + selectedMixer.open(); + selectedMixer.getLine(Port.Info.MICROPHONE); + } + + @Test + public void testSaneNumberOfPorts() throws LineUnavailableException { + System.out + .println("This test checks that a sane number of ports are detected"); + selectedMixer.open(); + Line.Info[] lineInfos = selectedMixer.getSourceLineInfo(); + Assert.assertNotNull(lineInfos); + + int ports = 0; + for (Line.Info info : lineInfos) { + if (info instanceof Port.Info) { + ports++; + } + } + Assert.assertTrue("Too few Source ports", ports > 0); + Assert.assertTrue("Too many Source ports... this looks wrong", + ports < 5); + + lineInfos = selectedMixer.getTargetLineInfo(); + ports = 0; + for (Line.Info info : lineInfos) { + if (info instanceof Port.Info) { + ports++; + } + } + Assert.assertTrue("Too few Target ports", ports > 0); + Assert.assertTrue("Too many Target ports... this looks wrong", + ports < 5); + } @Test public void testGetTargetPortInfo() throws LineUnavailableException { + System.out.println("This test checks target ports"); selectedMixer.open(); Line.Info[] lineInfos = selectedMixer.getTargetLineInfo(); int i = 0; for (Line.Info info : lineInfos) { if (info instanceof Port.Info) { Port.Info portInfo = (Port.Info) info; + Assert.assertTrue(portInfo.isSource() == false); + Assert.assertTrue(portInfo.getLineClass() == Port.class); System.out.println("Port " + ++i + ": " + portInfo.getName() + " - " + portInfo.getLineClass()); } @@ -215,59 +307,20 @@ public class PulseAudioMixerTest { @Test public void testGetSourcePortInfo() throws LineUnavailableException { + System.out.println("This test checks source ports"); selectedMixer.open(); Line.Info[] lineInfos = selectedMixer.getSourceLineInfo(); int i = 0; for (Line.Info info : lineInfos) { if (info instanceof Port.Info) { Port.Info portInfo = (Port.Info) info; + Assert.assertTrue(portInfo.isSource() == true); + Assert.assertTrue(portInfo.getLineClass() == Port.class); System.out.println("Port " + ++i + ": " + portInfo.getName() + " - " + portInfo.getLineClass()); } } - } - - @Ignore - @Test - public void testHeadphonePortExists() throws LineUnavailableException { - selectedMixer.open(); - selectedMixer.getLine(Port.Info.HEADPHONE); - } - - @Ignore - @Test - public void testSpeakerPortExists() throws LineUnavailableException { - selectedMixer.open(); - selectedMixer.getLine(Port.Info.SPEAKER); - } - - @Ignore - @Test - public void testLineInPortExists() throws LineUnavailableException { - selectedMixer.open(); - selectedMixer.getLine(Port.Info.LINE_IN); - } - - @Ignore - @Test - public void testCdPortExists() throws LineUnavailableException { - selectedMixer.open(); - selectedMixer.getLine(Port.Info.COMPACT_DISC); - } - - @Ignore - @Test - public void testLineOutPortExists() throws LineUnavailableException { - selectedMixer.open(); - selectedMixer.getLine(Port.Info.LINE_OUT); - } - - @Ignore - @Test - public void testMicrophonePortExists() throws LineUnavailableException { - selectedMixer.open(); - selectedMixer.getLine(Port.Info.MICROPHONE); } @Test(expected = IllegalStateException.class) From omajid at redhat.com Fri Sep 12 13:40:24 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 12 Sep 2008 20:40:24 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-12 Omair Majid changeset cd7041f7a655 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=cd7041f7a655 description: 2008-09-12 Omair Majid * build.xml: Rearranged the tests to run in order of importance. If the first ones fail there's probably a big problem somewhere. * unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java Fixed name of file in the license. Renamed selectedMixer to mixer. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Fixed the frameRate paramter for aSupportedFormat. (testObtainingAClip): Added output describing the test. (testClipOpenWrongUse): Likewise. (testPlayTwoClips): Assert that both clips are now closed. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java Added license text. Renamed selectedMixer to mixer. (setUp): Removed usage of PulseAudioMixer. (tearDown): Close the mixer. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java This file tests those capabilites of PulseAudioMixer which are not exposed by the sampled.Mixer interface. (testOpen): Removed function. (testLocalOpen): New function. (testLocalOpenAppName): New function. (testRemoveOpenWithInvalidPort): Likewise. (testRemoveOpenWithValidPort): Likewise. (testRemoteOpen): Likewise. (testInvalidRemoteOpen): Likewise. (tearDown): Close the mixer. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java This file tests capabilites of PulseAudioMixer which are exposed by the sampled.Mixer interface. Changed type of selectedMixer to Mixer. (setUp): Removed cast to PulseAudioMixer. (testOpenClose): New function. Tests that open and close methods work. (testLocalOpen): Moved method to PulseAudioMixerRawTest.java. (testLocalOpenAppName): Likewise. (testRemoteOpenWithInvalidPort): Likewise. (testRemoteOpenWithValidPort): Likewise. (testRemoteOpen): Likewise. (testInvalidRemoteOpen): Likewise. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java New file. Tests those capabilites of PulseAudioSourceDataLine which are not exposed through the SourceDataLine interface. (setUp): New function. (testStartNotificationOnCork): Likewise. (testVolumeAndMute): Likewise. (testSettingStreamName): Likewise. (messWithStreams): Likewise. (tearDown): Likewise. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Renamed PulseSourceDataLineTest.java * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourcePortTest.java Added license. (setUp): Removed dependency on knowing the internals of PulseAudioMixer. It uses the AudioSystem to get the mixer. (tearDown): Close the mixer if it isnt closed already. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Added license. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetPortTest.java Added license. (setUp): Removed dependency on knowing the interals of PulseAudioMixer. Uses AudioSystem to get the mixer now. (tearDown): Close the mixer if it isnt closed. * unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java Renamed file to PulseAudioSourceDataLineTest.java diffstat: 12 files changed, 1161 insertions(+), 810 deletions(-) build.xml | 16 unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java | 16 unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java | 16 unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java | 57 unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java | 59 unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java | 74 - unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java | 281 +++ unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java | 580 ++++++++ unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourcePortTest.java | 63 unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 37 unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetPortTest.java | 62 unittests/org/classpath/icedtea/pulseaudio/PulseSourceDataLineTest.java | 710 ---------- diffs (truncated from 2261 to 500 lines): diff -r d4bb2fa0df23 -r cd7041f7a655 build.xml --- a/build.xml Fri Sep 12 12:44:34 2008 -0400 +++ b/build.xml Fri Sep 12 16:28:22 2008 -0400 @@ -70,16 +70,22 @@ - + + + + + - - - + + + + + - + diff -r d4bb2fa0df23 -r cd7041f7a655 unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java Fri Sep 12 12:44:34 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java Fri Sep 12 16:28:22 2008 -0400 @@ -1,4 +1,4 @@ -/* PulseAudioStreamVolumeControl.java +/* OtherSoundProvidersAvailableTest.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. @@ -59,7 +59,7 @@ public class OtherSoundProvidersAvailabl Mixer.Info mixerInfos[] = AudioSystem.getMixerInfo(); Mixer.Info selectedMixerInfo = null; - Mixer selectedMixer; + Mixer mixer; boolean selected = false; int i = 0; @@ -81,14 +81,14 @@ public class OtherSoundProvidersAvailabl System.out.print("Selected mixer is of class: "); - selectedMixer = AudioSystem.getMixer(selectedMixerInfo); - System.out.println(selectedMixer.getClass().toString()); + mixer = AudioSystem.getMixer(selectedMixerInfo); + System.out.println(mixer.getClass().toString()); try { Line.Info sourceDataLineInfo = null; - selectedMixer.open(); // initialize the mixer + mixer.open(); // initialize the mixer - Line.Info allLineInfo[] = selectedMixer.getSourceLineInfo(); + Line.Info allLineInfo[] = mixer.getSourceLineInfo(); System.out.println("Source lines supported by mixer: "); int j = 0; for (Line.Info lineInfo : allLineInfo) { @@ -103,7 +103,7 @@ public class OtherSoundProvidersAvailabl if (sourceDataLineInfo == null) { System.out.println("Mixer supports no SourceDataLines"); } else { - SourceDataLine sourceDataLine = (SourceDataLine) selectedMixer + SourceDataLine sourceDataLine = (SourceDataLine) mixer .getLine(sourceDataLineInfo); sourceDataLine.open(); @@ -112,6 +112,8 @@ public class OtherSoundProvidersAvailabl } } catch (LineUnavailableException e) { System.out.println("Line unavailable"); + } finally { + mixer.close(); } } diff -r d4bb2fa0df23 -r cd7041f7a655 unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Fri Sep 12 12:44:34 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Fri Sep 12 16:28:22 2008 -0400 @@ -64,7 +64,7 @@ public class PulseAudioClipTest { Mixer mixer; AudioFormat aSupportedFormat = new AudioFormat( - AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 10, true); + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); public static junit.framework.Test suite() { return new JUnit4TestAdapter(PulseAudioClipTest.class); @@ -87,12 +87,15 @@ public class PulseAudioClipTest { @Test public void testObtainingAClip() throws LineUnavailableException { + System.out + .println("This tests if a clip can be obtained from the mixer"); Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); Assert.assertNotNull(clip); } @Test(expected = IllegalArgumentException.class) public void testClipOpenWrongUse() throws LineUnavailableException { + System.out.println("This test checks "); Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); clip.open(); } @@ -228,7 +231,7 @@ public class PulseAudioClipTest { Assert.assertEquals(1, closed); } - + int started = 0; int stopped = 0; @@ -242,8 +245,7 @@ public class PulseAudioClipTest { AudioFormat audioFormat = audioInputStream.getFormat(); Clip clip; - clip = (Clip) mixer.getLine(new DataLine.Info( - Clip.class, audioFormat)); + clip = (Clip) mixer.getLine(new DataLine.Info(Clip.class, audioFormat)); Assert.assertNotNull(clip); started = 0; @@ -284,8 +286,7 @@ public class PulseAudioClipTest { stopped = 0; } - - + @Test public void testLoop0Clip() throws LineUnavailableException, IOException, UnsupportedAudioFileException { @@ -345,6 +346,9 @@ public class PulseAudioClipTest { clip1.close(); clip2.close(); + Assert.assertFalse(clip1.isOpen()); + Assert.assertFalse(clip2.isOpen()); + } @Test diff -r d4bb2fa0df23 -r cd7041f7a655 unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java Fri Sep 12 12:44:34 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java Fri Sep 12 16:28:22 2008 -0400 @@ -1,3 +1,40 @@ package org.classpath.icedtea.pulseaudio +/* PulseAudioEventLoopOverhead.java + Copyright (C) 2008 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + package org.classpath.icedtea.pulseaudio; import static org.junit.Assert.assertNotNull; @@ -19,7 +56,7 @@ public class PulseAudioEventLoopOverhead return new JUnit4TestAdapter(PulseAudioEventLoopOverhead.class); } - Mixer selectedMixer; + Mixer mixer; @Before public void setUp() { @@ -34,18 +71,18 @@ public class PulseAudioEventLoopOverhead } } assertNotNull(selectedMixerInfo); - selectedMixer = (PulseAudioMixer) AudioSystem - .getMixer(selectedMixerInfo); - assertNotNull(selectedMixer); - if (selectedMixer.isOpen()) { - selectedMixer.close(); + mixer = AudioSystem.getMixer(selectedMixerInfo); + assertNotNull(mixer); + if (mixer.isOpen()) { + mixer.close(); } } - @Test @Ignore + @Test + @Ignore public void testLongWait() throws LineUnavailableException { - selectedMixer.open(); + mixer.open(); try { /* * While this test is running, the java procces shouldnt be hogging @@ -61,7 +98,9 @@ public class PulseAudioEventLoopOverhead @After public void tearDown() { - + if (mixer.isOpen()) { + mixer.close(); + } } } diff -r d4bb2fa0df23 -r cd7041f7a655 unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java Fri Sep 12 12:44:34 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java Fri Sep 12 16:28:22 2008 -0400 @@ -37,8 +37,9 @@ exception statement from your version. package org.classpath.icedtea.pulseaudio; +import java.net.UnknownHostException; + import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.Mixer; import org.junit.After; import org.junit.Before; @@ -46,7 +47,7 @@ import org.junit.Test; public class PulseAudioMixerRawTest { - Mixer mixer = null; + PulseAudioMixer mixer = null; @Before public void setUp() { @@ -54,15 +55,63 @@ public class PulseAudioMixerRawTest { } @Test - public void testOpen() throws LineUnavailableException { - mixer.open(); + public void testLocalOpen() throws LineUnavailableException { + System.out.println("This test tries to open to the local system"); + mixer.openLocal(); + } + + @Test + public void testLocalOpenAppName() throws LineUnavailableException { + System.out + .println("This test tries to connect to the local system while using an application name"); + mixer.openLocal("JunitTest"); + + } + + @Test(expected = LineUnavailableException.class) + public void testRemoteOpenWithInvalidPort() throws UnknownHostException, + LineUnavailableException { + System.out + .println("this test tries to connect to an invalid remote system"); + mixer.openRemote("JUnitTest", "128.0.0.1", 10); + + } + + /* + * This test assumes a computer named 'town' is in the network with + * pulseaudio listening on port 4173 + */ + @Test + public void testRemoteOpenWithValidPort() throws UnknownHostException, + LineUnavailableException { + System.out.println("This test tries to connect a valid remote system"); + mixer.openRemote("JUnitTest", "town", 4713); mixer.close(); + } + /* + * This test assumes a computer named 'town' is in the network with + * pulseaudio listening + */ + @Test + public void testRemoteOpen() throws UnknownHostException, + LineUnavailableException { + mixer.openRemote("JUnitTest", "town"); + mixer.close(); + } + + @Test(expected = LineUnavailableException.class) + public void testInvalidRemoteOpen() throws UnknownHostException, + LineUnavailableException { + mixer.openRemote("JUnitTest", "127.0.0.1"); + mixer.close(); } @After public void tearDown() { - + if (mixer.isOpen()) { + mixer.close(); + } } } diff -r d4bb2fa0df23 -r cd7041f7a655 unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Fri Sep 12 12:44:34 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Fri Sep 12 16:28:22 2008 -0400 @@ -1,4 +1,4 @@ -/* PulseAudioStreamVolumeControl.java +/* PulseAudioMixerTest.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. @@ -37,10 +37,6 @@ exception statement from your version. package org.classpath.icedtea.pulseaudio; -import static org.junit.Assert.assertNotNull; - -import java.net.UnknownHostException; - import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Line; @@ -50,7 +46,6 @@ import javax.sound.sampled.Mixer; import javax.sound.sampled.Mixer; import javax.sound.sampled.Port; import javax.sound.sampled.TargetDataLine; -import javax.sound.sampled.DataLine.Info; import junit.framework.JUnit4TestAdapter; @@ -62,7 +57,7 @@ import org.junit.Test; public class PulseAudioMixerTest { - PulseAudioMixer selectedMixer; + Mixer selectedMixer; AudioFormat aSupportedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); @@ -83,10 +78,9 @@ public class PulseAudioMixerTest { selectedMixerInfo = info; } } - assertNotNull(selectedMixerInfo); - selectedMixer = (PulseAudioMixer) AudioSystem - .getMixer(selectedMixerInfo); - assertNotNull(selectedMixer); + Assert.assertNotNull(selectedMixerInfo); + selectedMixer = AudioSystem.getMixer(selectedMixerInfo); + Assert.assertNotNull(selectedMixer); if (selectedMixer.isOpen()) { selectedMixer.close(); } @@ -94,56 +88,10 @@ public class PulseAudioMixerTest { } @Test - public void testLocalOpen() throws LineUnavailableException { - System.out.println("This test tries to open to the local system"); - selectedMixer.openLocal(); - } - - @Test - public void testLocalOpenAppName() throws LineUnavailableException { - System.out - .println("This test tries to connect to the local system while using an application name"); - selectedMixer.openLocal("JunitTest"); - - } - - @Test(expected = LineUnavailableException.class) - public void testRemoteOpenWithInvalidPort() throws UnknownHostException, - LineUnavailableException { - System.out - .println("this test tries to connect to an invalid remote system"); - selectedMixer.openRemote("JUnitTest", "128.0.0.1", 10); - - } - - /* - * This test assumes a computer named 'town' is in the network with - * pulseaudio listening on port 4173 - */ - @Test - public void testRemoteOpenWithValidPort() throws UnknownHostException, - LineUnavailableException { - System.out.println("This test tries to connect a valid remote system"); - selectedMixer.openRemote("JUnitTest", "town", 4713); - selectedMixer.close(); - } - - /* - * This test assumes a computer named 'town' is in the network with - * pulseaudio listening - */ - @Test - public void testRemoteOpen() throws UnknownHostException, - LineUnavailableException { - selectedMixer.openRemote("JUnitTest", "town"); - selectedMixer.close(); - } - - @Test(expected = LineUnavailableException.class) - public void testInvalidRemoteOpen() throws UnknownHostException, - LineUnavailableException { - selectedMixer.openRemote("JUnitTest", "127.0.0.1"); - selectedMixer.close(); + public void testOpenClose() throws LineUnavailableException { + selectedMixer.open(); + selectedMixer.close(); + } @Test @@ -172,7 +120,7 @@ public class PulseAudioMixerTest { Assert.assertFalse("Found a new type of Line", true); } Line sourceLine = (Line) selectedMixer.getLine(lineInfo); - assertNotNull(sourceLine); + Assert.assertNotNull(sourceLine); } @@ -205,7 +153,7 @@ public class PulseAudioMixerTest { Assert.assertTrue("Found invalid type of target line", true); } Line targetLine = (Line) selectedMixer.getLine(lineInfo); - assertNotNull(targetLine); + Assert.assertNotNull(targetLine); } diff -r d4bb2fa0df23 -r cd7041f7a655 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java Fri Sep 12 16:28:22 2008 -0400 @@ -0,0 +1,281 @@ +/* PulseAudioSourceDataLineRawTest.java + Copyright (C) 2008 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not From doko at ubuntu.com Fri Sep 12 14:27:21 2008 From: doko at ubuntu.com (doko at ubuntu.com) Date: Fri, 12 Sep 2008 21:27:21 +0000 Subject: changeset in /hg/icedtea6: 2008-09-12 Matthias Klose changeset a26c5e78d8f4 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=a26c5e78d8f4 description: 2008-09-12 Matthias Klose * generated/com/sun/corba/se/impl/logging/*: Regenerate. diffstat: 11 files changed, 39 insertions(+), 8 deletions(-) ChangeLog | 1 generated/com/sun/corba/se/impl/logging/ActivationSystemException.java | 2 generated/com/sun/corba/se/impl/logging/IORSystemException.java | 2 generated/com/sun/corba/se/impl/logging/InterceptorsSystemException.java | 2 generated/com/sun/corba/se/impl/logging/LogStrings.properties | 1 generated/com/sun/corba/se/impl/logging/NamingSystemException.java | 2 generated/com/sun/corba/se/impl/logging/OMGSystemException.java | 2 generated/com/sun/corba/se/impl/logging/ORBUtilSystemException.java | 30 +++++++++- generated/com/sun/corba/se/impl/logging/ORBUtilSystemException.resource | 1 generated/com/sun/corba/se/impl/logging/POASystemException.java | 2 generated/com/sun/corba/se/impl/logging/UtilSystemException.java | 2 diffs (164 lines): diff -r 16c322628d9f -r a26c5e78d8f4 ChangeLog --- a/ChangeLog Fri Sep 12 22:35:46 2008 +0200 +++ b/ChangeLog Fri Sep 12 23:25:49 2008 +0200 @@ -15,6 +15,7 @@ 2008-09-12 Matthias Klose Xerxes R??nby diff -r 16c322628d9f -r a26c5e78d8f4 generated/com/sun/corba/se/impl/logging/ActivationSystemException.java --- a/generated/com/sun/corba/se/impl/logging/ActivationSystemException.java Fri Sep 12 22:35:46 2008 +0200 +++ b/generated/com/sun/corba/se/impl/logging/ActivationSystemException.java Fri Sep 12 23:25:49 2008 +0200 @@ -1,7 +1,7 @@ // Log wrapper class for Sun private system exceptions in group ACTIVATION // // Generated by MC.java version 1.0, DO NOT EDIT BY HAND! -// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/Activation.mc on Sun Jun 22 23:48:17 BST 2008 +// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/Activation.mc on Fri Sep 12 21:18:58 GMT 2008 package com.sun.corba.se.impl.logging ; diff -r 16c322628d9f -r a26c5e78d8f4 generated/com/sun/corba/se/impl/logging/IORSystemException.java --- a/generated/com/sun/corba/se/impl/logging/IORSystemException.java Fri Sep 12 22:35:46 2008 +0200 +++ b/generated/com/sun/corba/se/impl/logging/IORSystemException.java Fri Sep 12 23:25:49 2008 +0200 @@ -1,7 +1,7 @@ // Log wrapper class for Sun private system exceptions in group IOR // // Generated by MC.java version 1.0, DO NOT EDIT BY HAND! -// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/IOR.mc on Sun Jun 22 23:48:17 BST 2008 +// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/IOR.mc on Fri Sep 12 21:18:58 GMT 2008 package com.sun.corba.se.impl.logging ; diff -r 16c322628d9f -r a26c5e78d8f4 generated/com/sun/corba/se/impl/logging/InterceptorsSystemException.java --- a/generated/com/sun/corba/se/impl/logging/InterceptorsSystemException.java Fri Sep 12 22:35:46 2008 +0200 +++ b/generated/com/sun/corba/se/impl/logging/InterceptorsSystemException.java Fri Sep 12 23:25:49 2008 +0200 @@ -1,7 +1,7 @@ // Log wrapper class for Sun private system exceptions in group INTERCEPTORS // // Generated by MC.java version 1.0, DO NOT EDIT BY HAND! -// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/Interceptors.mc on Sun Jun 22 23:48:17 BST 2008 +// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/Interceptors.mc on Fri Sep 12 21:18:58 GMT 2008 package com.sun.corba.se.impl.logging ; diff -r 16c322628d9f -r a26c5e78d8f4 generated/com/sun/corba/se/impl/logging/LogStrings.properties --- a/generated/com/sun/corba/se/impl/logging/LogStrings.properties Fri Sep 12 22:35:46 2008 +0200 +++ b/generated/com/sun/corba/se/impl/logging/LogStrings.properties Fri Sep 12 23:25:49 2008 +0200 @@ -294,6 +294,7 @@ ORBUTIL.securityExceptionInAccept="IOP00 ORBUTIL.securityExceptionInAccept="IOP00410214: (COMM_FAILURE) Unexpected {0}, has permissions {1}" ORBUTIL.transportReadTimeoutExceeded="IOP00410215: (COMM_FAILURE) Read of full message failed : bytes requested = {0} bytes read = {1} max wait time = {2} total time spent waiting = {3}" ORBUTIL.createListenerFailed="IOP00410216: (COMM_FAILURE) Unable to create listener thread on the specified port: {0}" +ORBUTIL.bufferReadManagerTimeout="IOP00410217: (COMM_FAILURE) Timeout while reading data in buffer manager" ORBUTIL.badStringifiedIorLen="IOP02410201: (DATA_CONVERSION) A character did not map to the transmission code set" ORBUTIL.badStringifiedIor="IOP02410202: (DATA_CONVERSION) Bad stringified IOR" ORBUTIL.badModifier="IOP02410203: (DATA_CONVERSION) Unable to perform resolve_initial_references due to bad host or port configuration" diff -r 16c322628d9f -r a26c5e78d8f4 generated/com/sun/corba/se/impl/logging/NamingSystemException.java --- a/generated/com/sun/corba/se/impl/logging/NamingSystemException.java Fri Sep 12 22:35:46 2008 +0200 +++ b/generated/com/sun/corba/se/impl/logging/NamingSystemException.java Fri Sep 12 23:25:49 2008 +0200 @@ -1,7 +1,7 @@ // Log wrapper class for Sun private system exceptions in group NAMING // // Generated by MC.java version 1.0, DO NOT EDIT BY HAND! -// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/Naming.mc on Sun Jun 22 23:48:18 BST 2008 +// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/Naming.mc on Fri Sep 12 21:18:58 GMT 2008 package com.sun.corba.se.impl.logging ; diff -r 16c322628d9f -r a26c5e78d8f4 generated/com/sun/corba/se/impl/logging/OMGSystemException.java --- a/generated/com/sun/corba/se/impl/logging/OMGSystemException.java Fri Sep 12 22:35:46 2008 +0200 +++ b/generated/com/sun/corba/se/impl/logging/OMGSystemException.java Fri Sep 12 23:25:49 2008 +0200 @@ -1,7 +1,7 @@ // Log wrapper class for standard exceptions // // Generated by MC.java version 1.0, DO NOT EDIT BY HAND! -// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/OMG.mc on Sun Jun 22 23:48:18 BST 2008 +// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/OMG.mc on Fri Sep 12 21:18:59 GMT 2008 package com.sun.corba.se.impl.logging ; diff -r 16c322628d9f -r a26c5e78d8f4 generated/com/sun/corba/se/impl/logging/ORBUtilSystemException.java --- a/generated/com/sun/corba/se/impl/logging/ORBUtilSystemException.java Fri Sep 12 22:35:46 2008 +0200 +++ b/generated/com/sun/corba/se/impl/logging/ORBUtilSystemException.java Fri Sep 12 23:25:49 2008 +0200 @@ -1,7 +1,7 @@ // Log wrapper class for Sun private system exceptions in group ORBUTIL // // Generated by MC.java version 1.0, DO NOT EDIT BY HAND! -// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc on Sun Jun 22 23:48:18 BST 2008 +// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc on Fri Sep 12 21:18:59 GMT 2008 package com.sun.corba.se.impl.logging ; @@ -2627,6 +2627,34 @@ public class ORBUtilSystemException exte return createListenerFailed( CompletionStatus.COMPLETED_NO, null, arg0 ) ; } + public static final int BUFFER_READ_MANAGER_TIMEOUT = SUNVMCID.value + 217 ; + + public COMM_FAILURE bufferReadManagerTimeout( CompletionStatus cs, Throwable t ) { + COMM_FAILURE exc = new COMM_FAILURE( BUFFER_READ_MANAGER_TIMEOUT, cs ) ; + if (t != null) + exc.initCause( t ) ; + + if (logger.isLoggable( Level.WARNING )) { + Object[] parameters = null ; + doLog( Level.WARNING, "ORBUTIL.bufferReadManagerTimeout", + parameters, ORBUtilSystemException.class, exc ) ; + } + + return exc ; + } + + public COMM_FAILURE bufferReadManagerTimeout( CompletionStatus cs ) { + return bufferReadManagerTimeout( cs, null ) ; + } + + public COMM_FAILURE bufferReadManagerTimeout( Throwable t ) { + return bufferReadManagerTimeout( CompletionStatus.COMPLETED_NO, t ) ; + } + + public COMM_FAILURE bufferReadManagerTimeout( ) { + return bufferReadManagerTimeout( CompletionStatus.COMPLETED_NO, null ) ; + } + /////////////////////////////////////////////////////////// // DATA_CONVERSION /////////////////////////////////////////////////////////// diff -r 16c322628d9f -r a26c5e78d8f4 generated/com/sun/corba/se/impl/logging/ORBUtilSystemException.resource --- a/generated/com/sun/corba/se/impl/logging/ORBUtilSystemException.resource Fri Sep 12 22:35:46 2008 +0200 +++ b/generated/com/sun/corba/se/impl/logging/ORBUtilSystemException.resource Fri Sep 12 23:25:49 2008 +0200 @@ -87,6 +87,7 @@ ORBUTIL.securityExceptionInAccept="IOP00 ORBUTIL.securityExceptionInAccept="IOP00410214: (COMM_FAILURE) Unexpected {0}, has permissions {1}" ORBUTIL.transportReadTimeoutExceeded="IOP00410215: (COMM_FAILURE) Read of full message failed : bytes requested = {0} bytes read = {1} max wait time = {2} total time spent waiting = {3}" ORBUTIL.createListenerFailed="IOP00410216: (COMM_FAILURE) Unable to create listener thread on the specified port: {0}" +ORBUTIL.bufferReadManagerTimeout="IOP00410217: (COMM_FAILURE) Timeout while reading data in buffer manager" ORBUTIL.badStringifiedIorLen="IOP02410201: (DATA_CONVERSION) A character did not map to the transmission code set" ORBUTIL.badStringifiedIor="IOP02410202: (DATA_CONVERSION) Bad stringified IOR" ORBUTIL.badModifier="IOP02410203: (DATA_CONVERSION) Unable to perform resolve_initial_references due to bad host or port configuration" diff -r 16c322628d9f -r a26c5e78d8f4 generated/com/sun/corba/se/impl/logging/POASystemException.java --- a/generated/com/sun/corba/se/impl/logging/POASystemException.java Fri Sep 12 22:35:46 2008 +0200 +++ b/generated/com/sun/corba/se/impl/logging/POASystemException.java Fri Sep 12 23:25:49 2008 +0200 @@ -1,7 +1,7 @@ // Log wrapper class for Sun private system exceptions in group POA // // Generated by MC.java version 1.0, DO NOT EDIT BY HAND! -// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/POA.mc on Sun Jun 22 23:48:19 BST 2008 +// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/POA.mc on Fri Sep 12 21:18:59 GMT 2008 package com.sun.corba.se.impl.logging ; diff -r 16c322628d9f -r a26c5e78d8f4 generated/com/sun/corba/se/impl/logging/UtilSystemException.java --- a/generated/com/sun/corba/se/impl/logging/UtilSystemException.java Fri Sep 12 22:35:46 2008 +0200 +++ b/generated/com/sun/corba/se/impl/logging/UtilSystemException.java Fri Sep 12 23:25:49 2008 +0200 @@ -1,7 +1,7 @@ // Log wrapper class for Sun private system exceptions in group UTIL // // Generated by MC.java version 1.0, DO NOT EDIT BY HAND! -// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/Util.mc on Sun Jun 22 23:48:19 BST 2008 +// Generated from input file ../../../../src/share/classes/com/sun/corba/se/spi/logging/data/Util.mc on Fri Sep 12 21:18:59 GMT 2008 package com.sun.corba.se.impl.logging ; From gnu_andrew at member.fsf.org Fri Sep 12 15:33:44 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Fri, 12 Sep 2008 23:33:44 +0100 Subject: FYI: Allow ecj/GNU Classpath to build Spp.java Message-ID: <20080912223344.GA20877@rivendell.middle-earth.co.uk> OpenJDK6 b12 brings across the Spp Java-based replacement from OpenJDK. This patch fixes it so it can work without java.util.Scanner (only recently added to GNU Classpath) and avoids the reset() bug (also recently fixed in GNU Classpath). I also took this opportunity to allow ECJ patching to support multiple patches. Long term, it would be preferable if we could split up the ever-growing ECJ patch so that the individual issues handled are more clear and it is easier to drop/rebuild individual fixes. ChangeLog: 2008-09-12 Andrew John Hughes * Makefile.am: Turn ICEDTEA_ECJ_PATCH into ICEDTEA_ECJ_PATCHES and add an equivalent rule to that for PATCHES and FSG_PATCHES. * patches/icedtea-ecj-spp.patch: New patch to fix the use of java.util.Scanner and avoid the use of reset() in Spp.java. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -------------- next part -------------- diff -r a26c5e78d8f4 Makefile.am --- a/Makefile.am Fri Sep 12 23:25:49 2008 +0200 +++ b/Makefile.am Fri Sep 12 23:28:43 2008 +0100 @@ -694,29 +694,56 @@ touch stamps/ports-ecj.stamp # Patch OpenJDK for plug replacements and ecj. -ICEDTEA_ECJ_PATCH = $(srcdir)/patches/icedtea-ecj.patch +ICEDTEA_ECJ_PATCHES = patches/icedtea-ecj.patch \ + patches/icedtea-ecj-spp.patch stamps/patch-ecj.stamp: stamps/extract-ecj.stamp - echo Checking $(ICEDTEA_ECJ_PATCH) ; \ - if $(PATCH) -p0 -l --dry-run -s -t -f < $(ICEDTEA_ECJ_PATCH) ; \ - then \ - echo Applying $(ICEDTEA_ECJ_PATCH) ; \ - $(PATCH) -p0 -l < $(ICEDTEA_ECJ_PATCH) ; \ - mkdir -p stamps; \ - touch stamps/patch-ecj.stamp; \ - else \ + mkdir -p stamps; \ + rm -f stamps/patch-ecj.stamp.tmp ; \ + touch stamps/patch-ecj.stamp.tmp ; \ + all_patches_ok=yes; \ + for p in $(ICEDTEA_ECJ_PATCHES) ; \ + do \ + if test x$${all_patches_ok} = "xyes" \ + && echo Checking $$p \ + && $(PATCH) -l -p0 --dry-run -s -t -f \ + -F 0 < $(abs_top_srcdir)/$$p ; \ + then \ + echo Applying $$p ; \ + $(PATCH) -l -p0 < $(abs_top_srcdir)/$$p ; \ + if ! grep "^\* $$(basename $$p)" $(abs_top_srcdir)/HACKING \ + >> stamps/patch-ecj.stamp.tmp ; \ + then \ + echo "* $$(basename $$p): UNDOCUMENTED" \ + >> stamps/patch-ecj.stamp.tmp ; \ + fi ; \ + else \ + test x$${all_patches_ok} = "xyes" && all_patches_ok=$$p ; \ + fi ; \ + done ; \ + mv stamps/patch-ecj.stamp.tmp stamps/patch-ecj.stamp ; \ + if ! test x$${all_patches_ok} = "xyes"; then \ + echo ERROR patch $${all_patches_ok} FAILED! ; \ + echo WARNING make clean-patch before retrying a fix ; \ false; \ fi clean-patch-ecj: rm -f stamps/patch-ecj.stamp - echo Checking $(ICEDTEA_ECJ_PATCH) ; \ - if $(PATCH) -l -p0 -R --dry-run -s -t -f < $(ICEDTEA_ECJ_PATCH) ; \ - then \ - echo Reverting $(ICEDTEA_ECJ_PATCH) ; \ - $(PATCH) -p0 -l -R < $(ICEDTEA_ECJ_PATCH) ; \ - else \ - false; \ + all_patches_ok=yes; \ + for p in $(ICEDTEA_ECJ_PATCHES) ; \ + do \ + echo Checking $$p ; \ + if $(PATCH) -l -p0 -R --dry-run -s -t -f < $(abs_top_srcdir)/$$p ; \ + then \ + echo Reverting $$p ; \ + $(PATCH) -l -p0 -R < $(abs_top_srcdir)/$$p ; \ + else \ + all_patches_ok=no ; \ + fi ; \ + done ; \ + if ! test x$${all_patches_ok} = "xyes" ; then \ + echo "WARNING Not all patches reverted cleanly" ; \ fi # Bootstrap Directory Targets diff -r a26c5e78d8f4 patches/icedtea-ecj-spp.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/icedtea-ecj-spp.patch Fri Sep 12 23:28:43 2008 +0100 @@ -0,0 +1,65 @@ +diff -Nru openjdk-ecj.orig/jdk/make/tools/src/build/tools/spp/Spp.java openjdk-ecj/jdk/make/tools/src/build/tools/spp/Spp.java +--- openjdk-ecj.orig/jdk/make/tools/src/build/tools/spp/Spp.java 2008-09-11 08:44:09.000000000 +0100 ++++ openjdk-ecj/jdk/make/tools/src/build/tools/spp/Spp.java 2008-09-12 21:34:38.000000000 +0100 +@@ -25,6 +25,10 @@ + + package build.tools.spp; + ++import java.io.BufferedReader; ++import java.io.InputStreamReader; ++import java.io.IOException; ++ + import java.util.*; + import java.util.regex.*; + +@@ -83,7 +87,7 @@ + } + + StringBuffer out = new StringBuffer(); +- new Spp().spp(new Scanner(System.in), ++ new Spp().spp(new BufferedReader(new InputStreamReader(System.in)), + out, "", + keys, vars, be, + false); +@@ -104,12 +108,12 @@ + Matcher ifkey = Pattern.compile("^#if\\[(!)?" + KEY + "\\]").matcher(""); + Matcher elsekey = Pattern.compile("^#else\\[(!)?" + KEY + "\\]").matcher(""); + Matcher endkey = Pattern.compile("^#end\\[(!)?" + KEY + "\\]").matcher(""); +- Matcher vardef = Pattern.compile("\\{#if\\[(!)?" + KEY + "\\]\\?" + TEXT + "(:"+ TEXT + ")?\\}|\\$" + VAR + "\\$").matcher(""); ++ Pattern pvardef = Pattern.compile("\\{#if\\[(!)?" + KEY + "\\]\\?" + TEXT + "(:"+ TEXT + ")?\\}|\\$" + VAR + "\\$"); + Matcher vardef2 = Pattern.compile("\\$" + VAR + "\\$").matcher(""); + + void append(StringBuffer buf, String ln, + Set keys, Map vars) { +- vardef.reset(ln); ++ Matcher vardef = pvardef.matcher(ln); + while (vardef.find()) { + String repl = ""; + if (vardef.group(GN_VAR) != null) +@@ -133,19 +137,20 @@ + } + + // return true if #end[key], #end or EOF reached +- boolean spp(Scanner in, StringBuffer buf, String key, ++ boolean spp(BufferedReader in, StringBuffer buf, String key, + Set keys, Map vars, +- boolean be, boolean skip) { +- while (in.hasNextLine()) { +- String ln = in.nextLine(); ++ boolean be, boolean skip) throws IOException { ++ while (true) { ++ String ln = in.readLine(); ++ if (ln == null) ++ break; + if (be) { + if (ln.startsWith("#begin")) { + buf.setLength(0); //clean up to this line + continue; + } + if (ln.equals("#end")) { +- while (in.hasNextLine()) +- in.nextLine(); ++ do { } while (in.readLine() != null); + return true; //discard the rest to EOF + } + } From gnu_andrew at member.fsf.org Fri Sep 12 17:08:19 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Sat, 13 Sep 2008 01:08:19 +0100 Subject: FYI: Update IcedTea to OpenJDK b35 Message-ID: <20080913000819.GA2875@rivendell.middle-earth.co.uk> Necessary changes for transition to b33->b35: * Remove citypeflow patch; applied upstream. * Recreate the ecj patch due to changes in sa.make. * Add javax.script to the hotspot-tools pre-build so that the new HotSpot SOQL tool. ChangeLog: 2008-09-13 Andrew John Hughes * patches/icedtea-hotspot-citypeflow.patch: Removed, fixed upstream. * Makefile.am: Bump to b35, remove citypeflow patch. * patches/icedtea-ecj.patch: Recreated against b35. * tools-copy/tools-jdk-copy-files.txt: Add javax.script. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -------------- next part -------------- diff -r 264a3aa199a0 Makefile.am --- a/Makefile.am Fri Sep 05 16:19:11 2008 +0100 +++ b/Makefile.am Sat Sep 13 01:00:10 2008 +0100 @@ -1,6 +1,6 @@ -OPENJDK_DATE = 14_aug_2008 -OPENJDK_MD5SUM = 536c8f7b35bfb2640bdda31482d2693f -OPENJDK_VERSION = b33 +OPENJDK_DATE = 11_sep_2008 +OPENJDK_MD5SUM = 324ee7ead3c2e548a129730685815da4 +OPENJDK_VERSION = b35 CACAO_VERSION = 0.99.3 CACAO_MD5SUM = 80de3ad344c1a20c086ec5f1390bd1b8 @@ -555,7 +555,6 @@ patches/icedtea-jdk-docs-target.patch \ patches/icedtea-mbeanintrospector.patch \ patches/icedtea-hotspot-gcc-pr36917.patch \ - patches/icedtea-hotspot-citypeflow.patch \ patches/icedtea-alpha-fixes.patch \ patches/icedtea-alt-jar.patch \ patches/icedtea-enum-bug-181.patch \ diff -r 264a3aa199a0 patches/icedtea-ecj.patch --- a/patches/icedtea-ecj.patch Fri Sep 05 16:19:11 2008 +0100 +++ b/patches/icedtea-ecj.patch Sat Sep 13 01:00:10 2008 +0100 @@ -1,6 +1,6 @@ diff -Nru openjdk-ecj.orig/corba/make/com/sun/corba/se/Makefile openjdk-ecj/corba/make/com/sun/corba/se/Makefile ---- openjdk-ecj.orig/corba/make/com/sun/corba/se/Makefile 2008-08-14 08:39:29.000000000 +0100 -+++ openjdk-ecj/corba/make/com/sun/corba/se/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/corba/make/com/sun/corba/se/Makefile 2008-09-11 08:40:17.000000000 +0100 ++++ openjdk-ecj/corba/make/com/sun/corba/se/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -42,7 +42,7 @@ # the rmic iiop backend needs some classes that are part of the impl/util # package. These classes use log wrappers, so they must be built after @@ -12,7 +12,7 @@ diff -Nru openjdk-ecj.orig/corba/make/com/sun/corba/se/org/Makefile openjdk-ecj/corba/make/com/sun/corba/se/org/Makefile --- openjdk-ecj.orig/corba/make/com/sun/corba/se/org/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ openjdk-ecj/corba/make/com/sun/corba/se/org/Makefile 2008-08-21 01:49:52.000000000 +0100 ++++ openjdk-ecj/corba/make/com/sun/corba/se/org/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -0,0 +1,38 @@ +# +# Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. @@ -53,8 +53,8 @@ +# +include $(BUILDDIR)/common/Classes.gmk diff -Nru openjdk-ecj.orig/corba/make/common/Defs.gmk openjdk-ecj/corba/make/common/Defs.gmk ---- openjdk-ecj.orig/corba/make/common/Defs.gmk 2008-08-14 08:39:29.000000000 +0100 -+++ openjdk-ecj/corba/make/common/Defs.gmk 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/corba/make/common/Defs.gmk 2008-09-11 08:40:17.000000000 +0100 ++++ openjdk-ecj/corba/make/common/Defs.gmk 2008-09-12 21:34:38.000000000 +0100 @@ -53,6 +53,13 @@ _OUTPUTDIR=$(TOPDIR)/build/$(PLATFORM)-$(ARCH) @@ -88,9 +88,9 @@ vpath %.java $(VPATH.java) vpath %.class $(CLASSBINDIR) diff -Nru openjdk-ecj.orig/corba/make/common/Defs-linux.gmk openjdk-ecj/corba/make/common/Defs-linux.gmk ---- openjdk-ecj.orig/corba/make/common/Defs-linux.gmk 2008-08-21 01:28:49.000000000 +0100 -+++ openjdk-ecj/corba/make/common/Defs-linux.gmk 2008-08-21 01:49:52.000000000 +0100 -@@ -262,7 +262,7 @@ +--- openjdk-ecj.orig/corba/make/common/Defs-linux.gmk 2008-09-12 21:22:58.000000000 +0100 ++++ openjdk-ecj/corba/make/common/Defs-linux.gmk 2008-09-12 21:34:38.000000000 +0100 +@@ -276,7 +276,7 @@ fi; \ done) JVMLIB = -L$(BOOTDIR)/jre/lib/$(LIBARCH)/$(VM_NAME) -ljvm @@ -100,8 +100,8 @@ # # We want to privatize JVM symbols on Solaris. This is so the user can diff -Nru openjdk-ecj.orig/corba/make/common/Rules.gmk openjdk-ecj/corba/make/common/Rules.gmk ---- openjdk-ecj.orig/corba/make/common/Rules.gmk 2008-08-14 08:39:29.000000000 +0100 -+++ openjdk-ecj/corba/make/common/Rules.gmk 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/corba/make/common/Rules.gmk 2008-09-11 08:40:17.000000000 +0100 ++++ openjdk-ecj/corba/make/common/Rules.gmk 2008-09-12 21:34:38.000000000 +0100 @@ -197,8 +197,10 @@ $(ECHO) "# Java sources to be compiled: (listed in file $(JAVA_SOURCE_LIST))"; \ $(CAT) $(JAVA_SOURCE_LIST); \ @@ -116,8 +116,8 @@ @$(java-vm-cleanup) diff -Nru openjdk-ecj.orig/corba/make/common/shared/Defs-java.gmk openjdk-ecj/corba/make/common/shared/Defs-java.gmk ---- openjdk-ecj.orig/corba/make/common/shared/Defs-java.gmk 2008-08-14 08:39:29.000000000 +0100 -+++ openjdk-ecj/corba/make/common/shared/Defs-java.gmk 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/corba/make/common/shared/Defs-java.gmk 2008-09-11 08:40:17.000000000 +0100 ++++ openjdk-ecj/corba/make/common/shared/Defs-java.gmk 2008-09-12 21:34:38.000000000 +0100 @@ -117,31 +117,13 @@ JAVACFLAGS += $(OTHER_JAVACFLAGS) @@ -155,8 +155,8 @@ # Override of what javac to use (see deploy workspace) ifdef JAVAC diff -Nru openjdk-ecj.orig/corba/make/org/omg/sources/Makefile openjdk-ecj/corba/make/org/omg/sources/Makefile ---- openjdk-ecj.orig/corba/make/org/omg/sources/Makefile 2008-08-14 08:39:29.000000000 +0100 -+++ openjdk-ecj/corba/make/org/omg/sources/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/corba/make/org/omg/sources/Makefile 2008-09-11 08:40:17.000000000 +0100 ++++ openjdk-ecj/corba/make/org/omg/sources/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -93,8 +93,6 @@ POAHELHOLFILES = $(POA_GENERATED_HELP_HOL_java:%=$(GENSRCDIR)/%) @@ -234,8 +234,8 @@ pi.compile: $(PIGENERATEDFILES) diff -Nru openjdk-ecj.orig/corba/make/sun/rmi/corbalogsources/Makefile openjdk-ecj/corba/make/sun/rmi/corbalogsources/Makefile ---- openjdk-ecj.orig/corba/make/sun/rmi/corbalogsources/Makefile 2008-08-21 01:28:48.000000000 +0100 -+++ openjdk-ecj/corba/make/sun/rmi/corbalogsources/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/corba/make/sun/rmi/corbalogsources/Makefile 2008-09-12 21:22:57.000000000 +0100 ++++ openjdk-ecj/corba/make/sun/rmi/corbalogsources/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -172,7 +172,6 @@ ACTIVATIONFILES = $(com_sun_corba_se_spi_activation_java:%=$(GENSRCDIR)/%) @@ -253,8 +253,8 @@ portableactivation.idl.compile: $(PORTABLEACTIVATIONFILES) diff -Nru openjdk-ecj.orig/hotspot/make/linux/Makefile openjdk-ecj/hotspot/make/linux/Makefile ---- openjdk-ecj.orig/hotspot/make/linux/Makefile 2008-08-21 01:28:49.000000000 +0100 -+++ openjdk-ecj/hotspot/make/linux/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/hotspot/make/linux/Makefile 2008-09-12 21:22:58.000000000 +0100 ++++ openjdk-ecj/hotspot/make/linux/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -263,28 +263,24 @@ $(TARGETS_C2): $(SUBDIRS_C2) @@ -285,20 +285,22 @@ cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install endif diff -Nru openjdk-ecj.orig/hotspot/make/linux/makefiles/sa.make openjdk-ecj/hotspot/make/linux/makefiles/sa.make ---- openjdk-ecj.orig/hotspot/make/linux/makefiles/sa.make 2008-08-21 01:28:49.000000000 +0100 -+++ openjdk-ecj/hotspot/make/linux/makefiles/sa.make 2008-08-21 01:49:52.000000000 +0100 -@@ -72,7 +72,7 @@ - $(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \ +--- openjdk-ecj.orig/hotspot/make/linux/makefiles/sa.make 2008-09-12 21:22:58.000000000 +0100 ++++ openjdk-ecj/hotspot/make/linux/makefiles/sa.make 2008-09-12 21:39:40.000000000 +0100 +@@ -74,8 +74,8 @@ mkdir -p $(SA_CLASSDIR); \ fi -- $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH) -g -d $(SA_CLASSDIR) $(AGENT_ALLFILES) -+ $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH):$(BOOT_JAVA_HOME)/jre/lib/rt.jar -g -d $(SA_CLASSDIR) $(AGENT_ALLFILES) + +- $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -g -d $(SA_CLASSDIR) $(AGENT_FILES1) +- $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -g -d $(SA_CLASSDIR) $(AGENT_FILES2) ++ $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH):$(BOOT_JAVA_HOME)/jre/lib/rt.jar -sourcepath $(AGENT_SRC_DIR) -g -d $(SA_CLASSDIR) $(AGENT_FILES1) ++ $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH):$(BOOT_JAVA_HOME)/jre/lib/rt.jar -sourcepath $(AGENT_SRC_DIR) -g -d $(SA_CLASSDIR) $(AGENT_FILES2) + $(QUIETLY) $(REMOTE) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer $(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) - $(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ . diff -Nru openjdk-ecj.orig/jaxp/make/build.xml openjdk-ecj/jaxp/make/build.xml ---- openjdk-ecj.orig/jaxp/make/build.xml 2008-08-14 08:40:25.000000000 +0100 -+++ openjdk-ecj/jaxp/make/build.xml 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jaxp/make/build.xml 2008-09-11 08:41:13.000000000 +0100 ++++ openjdk-ecj/jaxp/make/build.xml 2008-09-12 21:34:38.000000000 +0100 @@ -71,7 +71,10 @@ diff -Nru openjdk-ecj.orig/jaxp/make/Makefile openjdk-ecj/jaxp/make/Makefile ---- openjdk-ecj.orig/jaxp/make/Makefile 2008-08-21 01:28:49.000000000 +0100 -+++ openjdk-ecj/jaxp/make/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jaxp/make/Makefile 2008-09-12 21:22:58.000000000 +0100 ++++ openjdk-ecj/jaxp/make/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -80,7 +80,7 @@ endif @@ -335,8 +337,8 @@ ifdef ALT_OUTPUTDIR diff -Nru openjdk-ecj.orig/jaxws/make/build.properties openjdk-ecj/jaxws/make/build.properties ---- openjdk-ecj.orig/jaxws/make/build.properties 2008-08-14 08:40:44.000000000 +0100 -+++ openjdk-ecj/jaxws/make/build.properties 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jaxws/make/build.properties 2008-09-12 21:22:58.000000000 +0100 ++++ openjdk-ecj/jaxws/make/build.properties 2008-09-12 21:34:38.000000000 +0100 @@ -37,7 +37,7 @@ # set the following to -version to verify the versions of javac being used javac.version.opt = @@ -347,8 +349,8 @@ # JVM memory size javac.memoryInitialSize = 128m diff -Nru openjdk-ecj.orig/jaxws/make/build.xml openjdk-ecj/jaxws/make/build.xml ---- openjdk-ecj.orig/jaxws/make/build.xml 2008-08-21 01:28:49.000000000 +0100 -+++ openjdk-ecj/jaxws/make/build.xml 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jaxws/make/build.xml 2008-09-12 21:22:58.000000000 +0100 ++++ openjdk-ecj/jaxws/make/build.xml 2008-09-12 21:34:38.000000000 +0100 @@ -84,7 +84,10 @@ diff -Nru openjdk-ecj.orig/jaxws/make/Makefile openjdk-ecj/jaxws/make/Makefile ---- openjdk-ecj.orig/jaxws/make/Makefile 2008-08-21 01:28:49.000000000 +0100 -+++ openjdk-ecj/jaxws/make/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jaxws/make/Makefile 2008-09-12 21:22:58.000000000 +0100 ++++ openjdk-ecj/jaxws/make/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -80,8 +80,8 @@ endif @@ -394,8 +396,8 @@ ifdef ALT_OUTPUTDIR diff -Nru openjdk-ecj.orig/jdk/make/common/BuildToolJar.gmk openjdk-ecj/jdk/make/common/BuildToolJar.gmk ---- openjdk-ecj.orig/jdk/make/common/BuildToolJar.gmk 2008-08-14 08:42:49.000000000 +0100 -+++ openjdk-ecj/jdk/make/common/BuildToolJar.gmk 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/common/BuildToolJar.gmk 2008-09-11 08:44:06.000000000 +0100 ++++ openjdk-ecj/jdk/make/common/BuildToolJar.gmk 2008-09-12 21:34:38.000000000 +0100 @@ -43,7 +43,8 @@ @$(prep-target) @$(MKDIR) -p $(BUILDTOOLCLASSDIR) @@ -407,8 +409,8 @@ -C $(BUILDTOOLCLASSDIR) $(PKGDIR) \ $(BOOT_JAR_JFLAGS) || $(RM) $@ diff -Nru openjdk-ecj.orig/jdk/make/common/Release.gmk openjdk-ecj/jdk/make/common/Release.gmk ---- openjdk-ecj.orig/jdk/make/common/Release.gmk 2008-08-21 01:28:49.000000000 +0100 -+++ openjdk-ecj/jdk/make/common/Release.gmk 2008-08-21 02:23:31.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/common/Release.gmk 2008-09-12 21:22:58.000000000 +0100 ++++ openjdk-ecj/jdk/make/common/Release.gmk 2008-09-12 21:34:38.000000000 +0100 @@ -651,10 +651,19 @@ $(RES_JAR_ARGLIST): $(RES_JAR_FILELIST) $(prep-target) @@ -490,8 +492,8 @@ $(call copy-man-pages,$(JDK_IMAGE_DIR),$(JDK_MAN_PAGES)) endif # !windows diff -Nru openjdk-ecj.orig/jdk/make/common/Rules.gmk openjdk-ecj/jdk/make/common/Rules.gmk ---- openjdk-ecj.orig/jdk/make/common/Rules.gmk 2008-08-14 08:42:49.000000000 +0100 -+++ openjdk-ecj/jdk/make/common/Rules.gmk 2008-08-26 00:30:58.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/common/Rules.gmk 2008-09-11 08:44:06.000000000 +0100 ++++ openjdk-ecj/jdk/make/common/Rules.gmk 2008-09-12 21:34:38.000000000 +0100 @@ -237,8 +237,9 @@ $(ECHO) "# Java sources to be compiled: (listed in file $<)"; \ $(CAT) $<.filtered; \ @@ -518,8 +520,8 @@ @$(TOUCH) $@ diff -Nru openjdk-ecj.orig/jdk/make/common/shared/Defs-java.gmk openjdk-ecj/jdk/make/common/shared/Defs-java.gmk ---- openjdk-ecj.orig/jdk/make/common/shared/Defs-java.gmk 2008-08-21 01:28:48.000000000 +0100 -+++ openjdk-ecj/jdk/make/common/shared/Defs-java.gmk 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/common/shared/Defs-java.gmk 2008-09-12 21:22:58.000000000 +0100 ++++ openjdk-ecj/jdk/make/common/shared/Defs-java.gmk 2008-09-12 21:34:38.000000000 +0100 @@ -121,30 +121,19 @@ JAVACFLAGS += $(OTHER_JAVACFLAGS) @@ -553,8 +555,8 @@ # Override of what javac to use (see deploy workspace) diff -Nru openjdk-ecj.orig/jdk/make/java/nio/Makefile openjdk-ecj/jdk/make/java/nio/Makefile ---- openjdk-ecj.orig/jdk/make/java/nio/Makefile 2008-08-14 08:42:49.000000000 +0100 -+++ openjdk-ecj/jdk/make/java/nio/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/java/nio/Makefile 2008-09-11 08:44:06.000000000 +0100 ++++ openjdk-ecj/jdk/make/java/nio/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -31,7 +31,7 @@ PACKAGE = java.nio LIBRARY = nio @@ -565,8 +567,8 @@ NIO_SRC = $(SHARE_SRC)/classes/java/nio diff -Nru openjdk-ecj.orig/jdk/make/java/text/Makefile openjdk-ecj/jdk/make/java/text/Makefile ---- openjdk-ecj.orig/jdk/make/java/text/Makefile 2008-08-14 08:42:49.000000000 +0100 -+++ openjdk-ecj/jdk/make/java/text/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/java/text/Makefile 2008-09-11 08:44:06.000000000 +0100 ++++ openjdk-ecj/jdk/make/java/text/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -80,8 +80,8 @@ -sourcepath $(TEXT_SRCDIR) \ $(TEXT_SOURCES) @@ -579,8 +581,8 @@ -spec $(UNICODEDATA)/UnicodeData.txt @$(java-vm-cleanup) diff -Nru openjdk-ecj.orig/jdk/make/Makefile openjdk-ecj/jdk/make/Makefile ---- openjdk-ecj.orig/jdk/make/Makefile 2008-08-14 08:42:48.000000000 +0100 -+++ openjdk-ecj/jdk/make/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/Makefile 2008-09-11 08:44:05.000000000 +0100 ++++ openjdk-ecj/jdk/make/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -239,7 +239,7 @@ all build:: sanity-all post-sanity-all @@ -591,8 +593,8 @@ $(SUBDIRS-loop) diff -Nru openjdk-ecj.orig/jdk/make/sun/awt/FILES_export_unix.gmk openjdk-ecj/jdk/make/sun/awt/FILES_export_unix.gmk ---- openjdk-ecj.orig/jdk/make/sun/awt/FILES_export_unix.gmk 2008-08-25 23:11:34.000000000 +0100 -+++ openjdk-ecj/jdk/make/sun/awt/FILES_export_unix.gmk 2008-08-25 23:13:37.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/sun/awt/FILES_export_unix.gmk 2008-09-11 08:44:07.000000000 +0100 ++++ openjdk-ecj/jdk/make/sun/awt/FILES_export_unix.gmk 2008-09-12 21:34:38.000000000 +0100 @@ -223,3 +223,5 @@ sun/awt/CausedFocusEvent.java \ sun/awt/motif/MEmbedCanvasPeer.java @@ -600,8 +602,8 @@ +EXPORTED_inner = \ + sun.java2d.opengl.OGLContext$$OGLContextCaps diff -Nru openjdk-ecj.orig/jdk/make/sun/awt/Makefile openjdk-ecj/jdk/make/sun/awt/Makefile ---- openjdk-ecj.orig/jdk/make/sun/awt/Makefile 2008-08-14 08:42:50.000000000 +0100 -+++ openjdk-ecj/jdk/make/sun/awt/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/sun/awt/Makefile 2008-09-11 08:44:07.000000000 +0100 ++++ openjdk-ecj/jdk/make/sun/awt/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -395,10 +395,9 @@ COMPILEFONTCONFIG_JARFILE = $(BUILDTOOLJARDIR)/compilefontconfig.jar @@ -617,8 +619,8 @@ fontconfigs.clean : diff -Nru openjdk-ecj.orig/jdk/make/sun/javazic/Makefile openjdk-ecj/jdk/make/sun/javazic/Makefile ---- openjdk-ecj.orig/jdk/make/sun/javazic/Makefile 2008-08-14 08:42:50.000000000 +0100 -+++ openjdk-ecj/jdk/make/sun/javazic/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/sun/javazic/Makefile 2008-09-11 08:44:07.000000000 +0100 ++++ openjdk-ecj/jdk/make/sun/javazic/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -62,7 +62,8 @@ $(WORKDIR)/$(MAPFILE): $(BUILDTOOLJARDIR)/javazic.jar $(TZFILES) $(RM) -r $(@D) @@ -630,8 +632,8 @@ $(INSTALLDIR)/$(MAPFILE): $(WORKDIR)/$(MAPFILE) diff -Nru openjdk-ecj.orig/jdk/make/sun/text/Makefile openjdk-ecj/jdk/make/sun/text/Makefile ---- openjdk-ecj.orig/jdk/make/sun/text/Makefile 2008-08-14 08:42:50.000000000 +0100 -+++ openjdk-ecj/jdk/make/sun/text/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/sun/text/Makefile 2008-09-11 08:44:08.000000000 +0100 ++++ openjdk-ecj/jdk/make/sun/text/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -85,8 +85,9 @@ $(BOOT_JAVAC_CMD) -d $(TEXT_CLASSES) \ -sourcepath $(TEXT_SRCDIR) \ @@ -645,8 +647,8 @@ -spec $(UNICODEDATA)/UnicodeData.txt \ -language th diff -Nru openjdk-ecj.orig/jdk/make/sun/xawt/Makefile openjdk-ecj/jdk/make/sun/xawt/Makefile ---- openjdk-ecj.orig/jdk/make/sun/xawt/Makefile 2008-08-14 08:42:50.000000000 +0100 -+++ openjdk-ecj/jdk/make/sun/xawt/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/sun/xawt/Makefile 2008-09-11 08:44:08.000000000 +0100 ++++ openjdk-ecj/jdk/make/sun/xawt/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -276,11 +276,7 @@ TEMPDIR_CLASSES = $(TEMPDIR)/classes @@ -684,8 +686,8 @@ done $(TOUCH) $@ diff -Nru openjdk-ecj.orig/jdk/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java openjdk-ecj/jdk/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java ---- openjdk-ecj.orig/jdk/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java 2008-08-14 08:42:51.000000000 +0100 -+++ openjdk-ecj/jdk/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java 2008-09-11 08:44:08.000000000 +0100 ++++ openjdk-ecj/jdk/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java 2008-09-12 21:34:38.000000000 +0100 @@ -647,9 +647,6 @@ throws FileNotFoundException, IOException { BufferedReader in = new BufferedReader(new FileReader(theTemplateFileName)); @@ -705,8 +707,8 @@ if (plane == 0 && bLatin1 == false) { genCaseMapTableDeclaration(result); diff -Nru openjdk-ecj.orig/jdk/make/tools/src/build/tools/spp/Spp.java openjdk-ecj/jdk/make/tools/src/build/tools/spp/Spp.java ---- openjdk-ecj.orig/jdk/make/tools/src/build/tools/spp/Spp.java 2008-08-21 02:50:19.000000000 +0100 -+++ openjdk-ecj/jdk/make/tools/src/build/tools/spp/Spp.java 2008-08-22 00:38:35.000000000 +0100 +--- openjdk-ecj.orig/jdk/make/tools/src/build/tools/spp/Spp.java 2008-09-11 08:44:09.000000000 +0100 ++++ openjdk-ecj/jdk/make/tools/src/build/tools/spp/Spp.java 2008-09-12 21:34:38.000000000 +0100 @@ -25,6 +25,10 @@ package build.tools.spp; @@ -770,8 +772,8 @@ } } diff -Nru openjdk-ecj.orig/jdk/src/share/classes/java/lang/Double.java openjdk-ecj/jdk/src/share/classes/java/lang/Double.java ---- openjdk-ecj.orig/jdk/src/share/classes/java/lang/Double.java 2008-08-14 08:43:00.000000000 +0100 -+++ openjdk-ecj/jdk/src/share/classes/java/lang/Double.java 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/src/share/classes/java/lang/Double.java 2008-09-11 08:44:19.000000000 +0100 ++++ openjdk-ecj/jdk/src/share/classes/java/lang/Double.java 2008-09-12 21:34:38.000000000 +0100 @@ -76,7 +76,7 @@ * {@code 0x1.fffffffffffffP+1023} and also equal to * {@code Double.longBitsToDouble(0x7fefffffffffffffL)}. @@ -800,8 +802,8 @@ /** * Maximum exponent a finite {@code double} variable may have. diff -Nru openjdk-ecj.orig/jdk/src/share/classes/java/lang/Float.java openjdk-ecj/jdk/src/share/classes/java/lang/Float.java ---- openjdk-ecj.orig/jdk/src/share/classes/java/lang/Float.java 2008-08-14 08:43:00.000000000 +0100 -+++ openjdk-ecj/jdk/src/share/classes/java/lang/Float.java 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/jdk/src/share/classes/java/lang/Float.java 2008-09-11 08:44:19.000000000 +0100 ++++ openjdk-ecj/jdk/src/share/classes/java/lang/Float.java 2008-09-12 21:34:38.000000000 +0100 @@ -76,7 +76,7 @@ * {@code 0x1.fffffeP+127f} and also equal to * {@code Float.intBitsToFloat(0x7f7fffff)}. @@ -830,8 +832,8 @@ /** * Maximum exponent a finite {@code float} variable may have. It diff -Nru openjdk-ecj.orig/jdk/src/share/native/sun/java2d/opengl/OGLContext.h openjdk-ecj/jdk/src/share/native/sun/java2d/opengl/OGLContext.h ---- openjdk-ecj.orig/jdk/src/share/native/sun/java2d/opengl/OGLContext.h 2008-08-29 23:11:06.000000000 +0100 -+++ openjdk-ecj/jdk/src/share/native/sun/java2d/opengl/OGLContext.h 2008-08-29 23:47:34.000000000 +0100 +--- openjdk-ecj.orig/jdk/src/share/native/sun/java2d/opengl/OGLContext.h 2008-09-11 08:44:50.000000000 +0100 ++++ openjdk-ecj/jdk/src/share/native/sun/java2d/opengl/OGLContext.h 2008-09-12 21:34:38.000000000 +0100 @@ -27,6 +27,7 @@ #define OGLContext_h_Included @@ -897,8 +899,8 @@ /** * Evaluates to true if the given capability bitmask is present for the diff -Nru openjdk-ecj.orig/langtools/make/build.xml openjdk-ecj/langtools/make/build.xml ---- openjdk-ecj.orig/langtools/make/build.xml 2008-08-14 08:44:07.000000000 +0100 -+++ openjdk-ecj/langtools/make/build.xml 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/langtools/make/build.xml 2008-09-11 08:45:37.000000000 +0100 ++++ openjdk-ecj/langtools/make/build.xml 2008-09-12 21:34:38.000000000 +0100 @@ -498,7 +498,10 @@ includes="@{includes}" sourcepath="" @@ -937,8 +939,8 @@ classname="CompilePropertiesTask" classpath="${build.toolclasses.dir}/"/> diff -Nru openjdk-ecj.orig/langtools/make/Makefile openjdk-ecj/langtools/make/Makefile ---- openjdk-ecj.orig/langtools/make/Makefile 2008-08-21 01:28:49.000000000 +0100 -+++ openjdk-ecj/langtools/make/Makefile 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/langtools/make/Makefile 2008-09-12 21:22:58.000000000 +0100 ++++ openjdk-ecj/langtools/make/Makefile 2008-09-12 21:34:38.000000000 +0100 @@ -113,7 +113,7 @@ ifdef ALT_BOOTDIR @@ -949,8 +951,8 @@ ifdef ALT_OUTPUTDIR diff -Nru openjdk-ecj.orig/make/jdk-rules.gmk openjdk-ecj/make/jdk-rules.gmk ---- openjdk-ecj.orig/make/jdk-rules.gmk 2008-08-21 01:28:49.000000000 +0100 -+++ openjdk-ecj/make/jdk-rules.gmk 2008-08-21 01:49:52.000000000 +0100 +--- openjdk-ecj.orig/make/jdk-rules.gmk 2008-09-12 21:22:58.000000000 +0100 ++++ openjdk-ecj/make/jdk-rules.gmk 2008-09-12 21:34:38.000000000 +0100 @@ -58,7 +58,7 @@ endif diff -r 264a3aa199a0 patches/icedtea-hotspot-citypeflow.patch --- a/patches/icedtea-hotspot-citypeflow.patch Fri Sep 05 16:19:11 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- openjdk/hotspot/src/share/vm/ci/ciTypeFlow.hpp~ 2008-07-10 22:04:30.000000000 +0200 -+++ openjdk/hotspot/src/share/vm/ci/ciTypeFlow.hpp 2008-07-25 14:32:03.544802121 +0200 -@@ -130,7 +130,7 @@ - - // Used as a combined index for locals and temps - enum Cell { -- Cell_0 -+ Cell_0, Cell_max = UINT_MAX - }; - - // A StateVector summarizes the type information at some diff -r 264a3aa199a0 tools-copy/tools-jdk-copy-files.txt --- a/tools-copy/tools-jdk-copy-files.txt Fri Sep 05 16:19:11 2008 +0100 +++ b/tools-copy/tools-jdk-copy-files.txt Sat Sep 13 01:00:10 2008 +0100 @@ -37,3 +37,4 @@ sun/tools/serialver/ sun/tools/tree/ sun/tools/util/ +javax/script/ From gnu_andrew at member.fsf.org Fri Sep 12 18:47:52 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Sat, 13 Sep 2008 02:47:52 +0100 Subject: FYI: Versioning support for IcedTea Message-ID: <20080913014752.GA22999@rivendell.middle-earth.co.uk> This patch adds support for reporting the IcedTea version and Mercurial revision from the resulting build: $ ~/builder/icedtea/openjdk/build/linux-amd64/bin/java -version java version "1.7.0_0" IcedTea 1.8-pre-r1223 Runtime Environment (build 1.7.0_0-b35) OpenJDK 64-Bit Server VM (build 1.7.0_0-b35, mixed mode) For releases, just the version is reported i.e. "IcedTea 1.8". Comments welcome. It would be nice to have this support in IcedTea6 too for tracking bugs more easily. I also fixed a minor issue in that 'hg' was being used directly. We now always check for a hg binary, but only fail if it's missing when --enable-hg is set. ChangeLog: 2008-09-13 Andrew John Hughes * Makefile.am: Patch the OpenJDK build with the version of IcedTea being used. Use $(HG) instead of 'hg'. * configure.ac: Always check for Mercurial, but only fail if --enable-hg is active. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -------------- next part -------------- diff -r 15c4a75ee541 Makefile.am --- a/Makefile.am Sat Sep 13 01:08:32 2008 +0100 +++ b/Makefile.am Sat Sep 13 02:43:32 2008 +0100 @@ -252,7 +252,7 @@ # Mercurial snapshot. snapshot: dist - mv $(DIST_ARCHIVES) $(distdir)-`hg tip --template '{node}'`.tar.gz + mv $(DIST_ARCHIVES) $(distdir)-`$(HG) tip --template '{node}'`.tar.gz # Creates archive of openjdk. dist-openjdk: stamps/extract-cacao.stamp @@ -319,19 +319,19 @@ if USE_ALT_OPENJDK_SRC_ZIP else if USE_CLOSURES - hg fclone $(CLOSURES_HG_URL) openjdk; + $(HG) fclone $(CLOSURES_HG_URL) openjdk; else if USE_CVMI - hg fclone $(CVMI_HG_URL) openjdk; + $(HG) fclone $(CVMI_HG_URL) openjdk; else if USE_CACIOCAVALLO - hg fclone $(CACIOCAVALLO_HG_URL) openjdk; + $(HG) fclone $(CACIOCAVALLO_HG_URL) openjdk; else if USE_BSD - hg fclone $(BSD_HG_URL) openjdk; + $(HG) fclone $(BSD_HG_URL) openjdk; else if USE_HG - hg fclone -r jdk7-$(OPENJDK_VERSION) $(OPENJDK_HG_URL) openjdk; + $(HG) fclone -r jdk7-$(OPENJDK_VERSION) $(OPENJDK_HG_URL) openjdk; else if ! echo "$(OPENJDK_MD5SUM) $(OPENJDK_SRC_ZIP)" \ | $(MD5SUM) --check ; \ @@ -415,7 +415,7 @@ else if !USE_HG else - if ! hg fclone -h; \ + if ! $(HG) fclone -h; \ then \ echo "No forest extension found. Please refer to" \ "http://selenic.com/mercurial/wiki/index.cgi/ForestExtension"; \ @@ -678,7 +678,12 @@ echo ERROR patch $${all_patches_ok} FAILED! ; \ echo WARNING make clean-patch before retrying a fix ; \ false; \ - fi + fi ; \ + if [ -e $(abs_top_srcdir)/.hg ]; then \ + revision="-r`(cd $(srcdir); $(HG) tip|grep changeset|cut -d':' -f2|sed -r 's#\W+##')`" ; \ + fi ; \ + icedtea_version="$(PACKAGE_VERSION)$${revision}" ; \ + sed -i "s#IcedTea#IcedTea $${icedtea_version}#" openjdk/jdk/make/common/shared/Defs.gmk clean-patch: rm -f stamps/patch.stamp diff -r 15c4a75ee541 configure.ac --- a/configure.ac Sat Sep 13 01:08:32 2008 +0100 +++ b/configure.ac Sat Sep 13 02:43:32 2008 +0100 @@ -228,9 +228,13 @@ WITH_PROJECT ENABLE_HG +AC_PATH_TOOL([HG],[hg]) if test "x${enable_hg}" = "xyes"; then - FIND_TOOL([MERCURIAL],[hg]) + if test "x${HG}" = x; then + AC_MSG_ERROR([Mercurial not found; this is required for a hg build]) + fi fi +AC_SUBST([HG]) dnl pkgconfig cannot be used to find these headers and libraries. AC_CHECK_HEADERS([cups/cups.h cups/ppd.h],[] From gnu_andrew at member.fsf.org Fri Sep 12 19:54:04 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Sat, 13 Sep 2008 03:54:04 +0100 Subject: FYI: Version suffix support for IcedTea Message-ID: <20080913025404.GA12509@rivendell.middle-earth.co.uk> This patch allows a version suffix (e.g. '-ubuntu') to be added to the JDK version. It also will add '-' if something other than jdk7 is being built, so we can end up with something like 1.7.0_0-b35-caciocavallo-happy. ChangeLog: 2008-09-13 Andrew John Hughes * Makefile.am: Add the project name and version suffix to the JDK version number. * acinclude.m4: Add support for --with-version-suffix and add a Makefile variable, PROJECT_NAME. * configure.ac: Enable --with-version-suffix. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -------------- next part -------------- diff -r 08b2f6478462 Makefile.am --- a/Makefile.am Sat Sep 13 02:48:10 2008 +0100 +++ b/Makefile.am Sat Sep 13 03:46:47 2008 +0100 @@ -683,7 +683,15 @@ revision="-r`(cd $(srcdir); $(HG) tip|grep changeset|cut -d':' -f2|sed -r 's#\W+##')`" ; \ fi ; \ icedtea_version="$(PACKAGE_VERSION)$${revision}" ; \ - sed -i "s#IcedTea#IcedTea $${icedtea_version}#" openjdk/jdk/make/common/shared/Defs.gmk + if test x"$(PROJECT_NAME)" != "xjdk7"; then \ + proj_suffix="-$(PROJECT_NAME)"; \ + fi ; \ + if test x"$(VERSION_SUFFIX)" != "x"; then \ + ver_suffix="-$(VERSION_SUFFIX)"; \ + fi ; \ + sed -i "s#IcedTea#IcedTea $${icedtea_version}#" openjdk/jdk/make/common/shared/Defs.gmk ; \ + sed -i "s#BUILD_VARIANT_RELEASE)#BUILD_VARIANT_RELEASE)$${proj_suffix}$${ver_suffix}#" \ + openjdk/jdk/make/common/shared/Defs.gmk clean-patch: rm -f stamps/patch.stamp diff -r 08b2f6478462 acinclude.m4 --- a/acinclude.m4 Sat Sep 13 02:48:10 2008 +0100 +++ b/acinclude.m4 Sat Sep 13 03:46:47 2008 +0100 @@ -891,6 +891,34 @@ AM_CONDITIONAL([USE_HG], test x"${enable_hg}" = "xyes") ]) +AC_DEFUN([WITH_VERSION_SUFFIX], +[ + AC_MSG_CHECKING(if a version suffix has been specified) + AC_ARG_WITH([version-suffix], + [AS_HELP_STRING(--with-version-suffix,appends the given text to the JDK version)], + [ + case "${withval}" in + yes) + version_suffix= + AC_MSG_RESULT([no]) + ;; + no) + version_suffix= + AC_MSG_RESULT([no]) + ;; + *) + version_suffix=${withval} + AC_MSG_RESULT([${version_suffix}]) + ;; + esac + ], + [ + version_suffix= + AC_MSG_RESULT([no]) + ]) + AC_SUBST(VERSION_SUFFIX, $version_suffix) +]) + AC_DEFUN([WITH_PROJECT], [ AC_MSG_CHECKING(which OpenJDK project is being used) @@ -913,6 +941,7 @@ project=jdk7 ]) AC_MSG_RESULT([${project}]) + AC_SUBST(PROJECT_NAME, $project) AM_CONDITIONAL([USE_CLOSURES], test x"${project}" = "xclosures") AM_CONDITIONAL([USE_CVMI], test x"${project}" = "xcvmi") AM_CONDITIONAL([USE_CACIOCAVALLO], test x"${project}" = "xcaciocavallo") diff -r 08b2f6478462 configure.ac --- a/configure.ac Sat Sep 13 02:48:10 2008 +0100 +++ b/configure.ac Sat Sep 13 03:46:47 2008 +0100 @@ -225,6 +225,7 @@ ENABLE_OPTIMIZATIONS ENABLE_ZERO_BUILD SET_CORE_OR_SHARK_BUILD +WITH_VERSION_SUFFIX WITH_PROJECT ENABLE_HG From cky944 at gmail.com Fri Sep 12 22:09:58 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Sat, 13 Sep 2008 17:09:58 +1200 Subject: [patch] Support New NIO in IcedTea In-Reply-To: <17c6771e0809040145x1dd8a42dsa20e7df0e52509b6@mail.gmail.com> References: <20080831004043.GA19370@bamboo.destinee.acro.gen.nz> <1220193693.3524.24.camel@hermans.wildebeest.org> <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> <17c6771e0809011016y7755358dm5bd9cd7b6eb412ea@mail.gmail.com> <20080902003845.GE19370@bamboo.destinee.acro.gen.nz> <17c6771e0809020825y1ca96d87g828ff903e7eb1da2@mail.gmail.com> <20080903150949.GA24121@bamboo.destinee.acro.gen.nz> <17c6771e0809040145x1dd8a42dsa20e7df0e52509b6@mail.gmail.com> Message-ID: <20080913050958.GB11685@bamboo.destinee.acro.gen.nz> I'm working on a patch for the latest changes for both NIO2 and IcedTea (though in the long run, after a discussion with Alan Bateman, I've decided it'd be a better idea to implement support for IcedTea to check out specific tags of NIO2, just as is done with the jdk7 forest), so I'll write again once I have something working, but meanwhile, I should respond to this. :-) On Thu, Sep 04, 2008 at 09:45:15AM +0100, Andrew John Hughes wrote: [Re: Gmail] > Yes, I have a bug list for it as long as my arm, trying to force > top-posting being the main one. I reported this but they seem to have > done nothing to fix it. I use Mutt for my university IMAP account but > it's far too slow to use with the amount of mail I get and unsecured - > this is probably down to the University's choice of mail server rather > than IMAP itself. Is Google's IMAP access SSL-encrypted? Haha, that reminded me of my Google onsite interview half a year ago, where I was asked what I felt could be improved with Google products. I had my fair list of things too. :-) Gmail's IMAP access is, as far as I know, SSL-required (port 143 is inaccessible). I have these settings in Mutt, which you're most welcome to adapt as required: set spoolfile="imaps://cky944%40gmail.com at imap.gmail.com/" set smtp_url="smtps://cky944%40gmail.com at smtp.gmail.com/" unset record # since Gmail saves your mail when sent via their SMTP subscribe distro-pkg-dev at openjdk.java.net # ...plus similar subscribe lines for other mailing lists I'm on Remember to enable IMAP access in your Gmail account settings, or else you won't be able to log in. :-) > Yeah, there is still a lot of oddities in IcedTea that I don't really > understand and pre-date its public availability. Another is that an > ecj binary is detected, but I'm not sure it's even used any more. > The ecj used by ecj builds is from javac.in which means it's always > interpreted; this is actually what slows my build down the most > noticeably, and I've been meaning to look into getting it to pre-compile > ecj if gcj is detected. Using the system ecj would fix this too, but > I guess there are some broken versions out there in various distros. As far as I know, IcedTea _does_ use the system ecj when compiling; if it weren't so, it'd be trivial to use a newer version that supported @Override annotations in interface methods, for instance. Oh, you're talking about the ecj shell script, not ecj.jar. Well, it should be easy for you to copy the shell script into javac.in before you build. :-) [Re: my pre-trip patches] > Thanks! I'll try and give it a test drive this evening. I haven't heard any feedback during my time away, so I gathered it may not have been working too well. Oh well. Hopefully the upcoming patches will work better. :-) Cheers, ---Chris K. From cky944 at gmail.com Fri Sep 12 22:19:22 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Sat, 13 Sep 2008 17:19:22 +1200 Subject: [patch] Support New NIO in IcedTea In-Reply-To: <48C1B612.2010504@sun.com> References: <20080831004043.GA19370@bamboo.destinee.acro.gen.nz> <1220193693.3524.24.camel@hermans.wildebeest.org> <20080901064900.GC19370@bamboo.destinee.acro.gen.nz> <48C1B612.2010504@sun.com> Message-ID: <20080913051922.GC11685@bamboo.destinee.acro.gen.nz> Hi Dalibor, On Sat, Sep 06, 2008 at 12:43:30AM +0200, Dalibor Topic wrote: > C. K. Jester-Young wrote: > >> Also, how do you keep track of which commits are really nio2 related and > >> which ones are the commits that just sync with the master jdk7 repo? It > >> would be nice to have an easy way to see just those changes/commits made > >> for the new nio support. > >> > > > > Yes, I'm much wondering about the same question myself. > A good place to ask about it would be on the nio-dev mailing list, I'm > sure Alan would be able to explain it. Thanks for that; Alan has been in touch with me via private email, and he's explained how the synchronisation works. In short, all the syncs come off of the jdk7/tl forest, so I'm hoping then that a diff between that and the nio/nio forest will provide all the NIO2-specific changes. Cheers, ---Chris K. From doko at ubuntu.com Sat Sep 13 00:34:10 2008 From: doko at ubuntu.com (doko at ubuntu.com) Date: Sat, 13 Sep 2008 07:34:10 +0000 Subject: changeset in /hg/icedtea6: 2008-09-12 Matthias Klose changeset c46e727121a8 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=c46e727121a8 description: 2008-09-12 Matthias Klose * Makefile.am, HACKING: Update for b12 zero patch. * patches/icedtea-hotspot-6b11-7b24.patch: Remove. * patches/icedtea-hotspot-6b12-7b24.patch: New. diffstat: 4 files changed, 56987 insertions(+), 2 deletions(-) ChangeLog | 6 HACKING | 2 Makefile.am | 2 patches/icedtea-hotspot-6b12-7b24.patch |56979 +++++++++++++++++++++++++++++++ diffs (truncated from 57020 to 500 lines): diff -r f2a1e7f88c53 -r c46e727121a8 ChangeLog --- a/ChangeLog Fri Sep 12 23:30:45 2008 +0100 +++ b/ChangeLog Sat Sep 13 09:32:12 2008 +0200 @@ -1,3 +1,9 @@ 2008-09-12 Andrew John Hughes + + * Makefile.am, HACKING: Update for b12 zero patch. + * patches/icedtea-hotspot-6b11-7b24.patch: Remove. + * patches/icedtea-hotspot-6b12-7b24.patch: New. + 2008-09-12 Andrew John Hughes * Makefile.am: diff -r f2a1e7f88c53 -r c46e727121a8 HACKING --- a/HACKING Fri Sep 12 23:30:45 2008 +0100 +++ b/HACKING Sat Sep 13 09:32:12 2008 +0200 @@ -83,7 +83,7 @@ The following patches are only applied f * icedtea-bytecodeInterpreter.patch: Replace fast opcodes with opc_default. * icedtea-bytecodeInterpreterWithChecks.patch: Same as icedtea-xslfix.patch (OpenJDK6 only, S6707485). * icedtea-eclipse-hotspot-6614100-7b24.patch: Fix Eclipse crash (S6614100). Fixed in OpenJDK7 b29/hs13. -* icedtea-hotspot-6b11-7b24.patch: Upgrade to HotSpot from OpenJDK b24 (OpenJDK6 only). +* icedtea-hotspot-6b12-7b24.patch: Upgrade to HotSpot from OpenJDK b24 (OpenJDK6 only). - Never edit this patch. It should be regenerated by unzipping the openjdk6 build you're using into openjdk6, and the openjdk7 build you want to use into openjdk, then running: diff -r f2a1e7f88c53 -r c46e727121a8 Makefile.am --- a/Makefile.am Fri Sep 12 23:30:45 2008 +0100 +++ b/Makefile.am Sat Sep 13 09:32:12 2008 +0200 @@ -415,7 +415,7 @@ endif # If ZERO_BUILD is set then we are building zero and need # to patch up to OpenJDK 7 HotSpot for the C++ interpreter. ZERO_PATCHES = \ - patches/icedtea-hotspot-6b11-7b24.patch \ + patches/icedtea-hotspot-6b12-7b24.patch \ patches/icedtea-hotspot7-build-fixes.patch \ patches/icedtea-bytecodeInterpreter.patch \ patches/icedtea-bytecodeInterpreterWithChecks.patch \ diff -r f2a1e7f88c53 -r c46e727121a8 patches/icedtea-hotspot-6b12-7b24.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/icedtea-hotspot-6b12-7b24.patch Sat Sep 13 09:32:12 2008 +0200 @@ -0,0 +1,56979 @@ +diff -ruNb openjdk6/hotspot/src/share/tools/MakeDeps/BuildConfig.java openjdk/hotspot/src/share/tools/MakeDeps/BuildConfig.java +--- openjdk6/hotspot/src/share/tools/MakeDeps/BuildConfig.java 2008-08-28 10:23:06.000000000 +0200 ++++ openjdk/hotspot/src/share/tools/MakeDeps/BuildConfig.java 2007-12-14 08:57:02.000000000 +0100 +@@ -704,6 +704,3 @@ + receiver.add(attr); receiver.add(value); + } + } +- +- +- +diff -ruNb openjdk6/hotspot/src/share/tools/MakeDeps/Macro.java openjdk/hotspot/src/share/tools/MakeDeps/Macro.java +--- openjdk6/hotspot/src/share/tools/MakeDeps/Macro.java 2008-08-28 10:23:06.000000000 +0200 ++++ openjdk/hotspot/src/share/tools/MakeDeps/Macro.java 2007-12-14 08:57:02.000000000 +0100 +@@ -26,4 +26,3 @@ + public String name; + public String contents; + } +- +diff -ruNb openjdk6/hotspot/src/share/tools/MakeDeps/Platform.java openjdk/hotspot/src/share/tools/MakeDeps/Platform.java +--- openjdk6/hotspot/src/share/tools/MakeDeps/Platform.java 2008-08-28 10:23:06.000000000 +0200 ++++ openjdk/hotspot/src/share/tools/MakeDeps/Platform.java 2007-12-14 08:57:02.000000000 +0100 +@@ -169,7 +169,7 @@ + + /** max is 31 on mac, so warn */ + public int fileNameLengthLimit() { +- return 40; ++ return 45; + } + + public int defaultGrandIncludeThreshold() { +diff -ruNb openjdk6/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC6.java openjdk/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC6.java +--- openjdk6/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC6.java 2008-08-28 10:23:06.000000000 +0200 ++++ openjdk/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC6.java 2007-12-14 08:57:02.000000000 +0100 +@@ -236,7 +236,7 @@ + " /nologo /base:\"0x8000000\" /subsystem:windows /dll" + + " /export:JNI_GetDefaultJavaVMInitArgs /export:JNI_CreateJavaVM /export:JNI_GetCreatedJavaVMs "+ + " /export:jio_snprintf /export:jio_printf /export:jio_fprintf /export:jio_vfprintf "+ +- " /export:jio_vsnprintf /export:JVM_EnqueueOperation "); ++ " /export:jio_vsnprintf "); + rv.add("SUBTRACT LINK32 /pdb:none /map"); + + return rv; +diff -ruNb openjdk6/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java openjdk/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java +--- openjdk6/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java 2008-08-28 10:23:06.000000000 +0200 ++++ openjdk/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java 2007-12-14 08:57:02.000000000 +0100 +@@ -262,6 +262,8 @@ + + rv.add(new SpecificNameFilter("JVMTI Generated", new String[] {"^jvmti.+"})); + ++ rv.add(new SpecificNameFilter("C++ Interpreter Generated", new String[] {"^bytecodeInterpreterWithChecks.+"})); ++ + rv.add(new SpecificNameFilter("Include DBs", new String[] {"^includeDB_.+"})); + + // this one is to catch files not caught by other filters +@@ -574,8 +576,7 @@ + "/export:JNI_GetCreatedJavaVMs "+ + "/export:jio_snprintf /export:jio_printf "+ + "/export:jio_fprintf /export:jio_vfprintf "+ +- "/export:jio_vsnprintf "+ +- "/export:JVM_EnqueueOperation "); ++ "/export:jio_vsnprintf "); + addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib"); + addAttr(rv, "OutputFile", outDll); + addAttr(rv, "LinkIncremental", "1"); +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/adlc.hpp openjdk/hotspot/src/share/vm/adlc/adlc.hpp +--- openjdk6/hotspot/src/share/vm/adlc/adlc.hpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/adlc.hpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_HDR +-#pragma ident "@(#)adlc.hpp 1.28 07/05/05 17:04:59 JVM" +-#endif + /* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/adlparse.cpp openjdk/hotspot/src/share/vm/adlc/adlparse.cpp +--- openjdk6/hotspot/src/share/vm/adlc/adlparse.cpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/adlparse.cpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_SRC +-#pragma ident "@(#)adlparse.cpp 1.205 07/05/05 17:05:00 JVM" +-#endif + /* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/adlparse.hpp openjdk/hotspot/src/share/vm/adlc/adlparse.hpp +--- openjdk6/hotspot/src/share/vm/adlc/adlparse.hpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/adlparse.hpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_HDR +-#pragma ident "@(#)adlparse.hpp 1.79 07/05/05 17:05:00 JVM" +-#endif + /* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -273,5 +270,3 @@ + static bool is_int_token(const char* token, int& intval); + static void trim(char* &token); // trim leading & trailing spaces + }; +- +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/archDesc.cpp openjdk/hotspot/src/share/vm/adlc/archDesc.cpp +--- openjdk6/hotspot/src/share/vm/adlc/archDesc.cpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/archDesc.cpp 2007-12-14 08:57:02.000000000 +0100 +@@ -22,6 +22,7 @@ + // + // + ++ + // archDesc.cpp - Internal format for architecture definition + #include "adlc.hpp" + +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/arena.cpp openjdk/hotspot/src/share/vm/adlc/arena.cpp +--- openjdk6/hotspot/src/share/vm/adlc/arena.cpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/arena.cpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_SRC +-#pragma ident "@(#)arena.cpp 1.16 07/05/05 17:05:00 JVM" +-#endif + /* + * Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -173,4 +170,3 @@ + void CHeapObj::operator delete(void* p){ + free(p); + } +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/arena.hpp openjdk/hotspot/src/share/vm/adlc/arena.hpp +--- openjdk6/hotspot/src/share/vm/adlc/arena.hpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/arena.hpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_HDR +-#pragma ident "@(#)arena.hpp 1.17 07/05/05 17:05:00 JVM" +-#endif + /* + * Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -158,4 +155,3 @@ + size_t size_in_bytes() const { return _size_in_bytes; } + void set_size_in_bytes(size_t size) { _size_in_bytes = size; } + }; +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/dfa.cpp openjdk/hotspot/src/share/vm/adlc/dfa.cpp +--- openjdk6/hotspot/src/share/vm/adlc/dfa.cpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/dfa.cpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_SRC +-#pragma ident "@(#)dfa.cpp 1.83 07/05/05 17:04:59 JVM" +-#endif + /* + * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -1022,4 +1019,3 @@ + void ProductionState::print() { + _production.print(print_key, print_production); + } +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/dict2.cpp openjdk/hotspot/src/share/vm/adlc/dict2.cpp +--- openjdk6/hotspot/src/share/vm/adlc/dict2.cpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/dict2.cpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_SRC +-#pragma ident "@(#)dict2.cpp 1.19 07/05/05 17:04:59 JVM" +-#endif + /* + * Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -354,5 +351,3 @@ + } + _key = _value = NULL; + } +- +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/dict2.hpp openjdk/hotspot/src/share/vm/adlc/dict2.hpp +--- openjdk6/hotspot/src/share/vm/adlc/dict2.hpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/dict2.hpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_HDR +-#pragma ident "@(#)dict2.hpp 1.16 07/05/05 17:05:01 JVM" +-#endif + /* + * Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -121,5 +118,3 @@ + }; + + #endif // _DICT_ +- +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/filebuff.cpp openjdk/hotspot/src/share/vm/adlc/filebuff.cpp +--- openjdk6/hotspot/src/share/vm/adlc/filebuff.cpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/filebuff.cpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_SRC +-#pragma ident "@(#)filebuff.cpp 1.30 07/05/05 17:05:01 JVM" +-#endif + /* + * Copyright 1997-2002 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -297,4 +294,3 @@ + va_end(args); + _AD._no_output = 1; + } +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/filebuff.hpp openjdk/hotspot/src/share/vm/adlc/filebuff.hpp +--- openjdk6/hotspot/src/share/vm/adlc/filebuff.hpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/filebuff.hpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_HDR +-#pragma ident "@(#)filebuff.hpp 1.27 07/05/05 17:05:01 JVM" +-#endif + /* + * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/forms.cpp openjdk/hotspot/src/share/vm/adlc/forms.cpp +--- openjdk6/hotspot/src/share/vm/adlc/forms.cpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/forms.cpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_SRC +-#pragma ident "@(#)forms.cpp 1.161 07/05/05 17:04:59 JVM" +-#endif + /* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -386,4 +383,3 @@ + void SourceForm::output(FILE *fp) { + fprintf(fp,"\n//%s\n%s\n",classname(),(_code?_code:"")); + } +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/forms.hpp openjdk/hotspot/src/share/vm/adlc/forms.hpp +--- openjdk6/hotspot/src/share/vm/adlc/forms.hpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/forms.hpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_HDR +-#pragma ident "@(#)forms.hpp 1.150 07/05/05 17:05:00 JVM" +-#endif + /* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -587,6 +584,3 @@ + void print_asserts(FILE *fp); + void dump(); + }; +- +- +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/formsopt.cpp openjdk/hotspot/src/share/vm/adlc/formsopt.cpp +--- openjdk6/hotspot/src/share/vm/adlc/formsopt.cpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/formsopt.cpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_SRC +-#pragma ident "@(#)formsopt.cpp 1.53 07/05/05 17:05:01 JVM" +-#endif + /* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -725,4 +722,3 @@ + void PeepReplace::output(FILE *fp) { // Write info to output files + fprintf(fp,"PeepReplace:\n"); + } +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/formsopt.hpp openjdk/hotspot/src/share/vm/adlc/formsopt.hpp +--- openjdk6/hotspot/src/share/vm/adlc/formsopt.hpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/formsopt.hpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_HDR +-#pragma ident "@(#)formsopt.hpp 1.54 07/05/05 17:05:01 JVM" +-#endif + /* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -549,4 +546,3 @@ + void dump(); + void output(FILE *fp); + }; +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/formssel.cpp openjdk/hotspot/src/share/vm/adlc/formssel.cpp +--- openjdk6/hotspot/src/share/vm/adlc/formssel.cpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/formssel.cpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_SRC +-#pragma ident "@(#)formssel.cpp 1.183 07/09/06 15:24:29 JVM" +-#endif + /* + * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -236,23 +233,58 @@ + return _matrule ? _matrule->is_ideal_copy() : 0; + } + +-// Return 'true' if this instruction matches an ideal 'CosD' node ++// Return 'true' if this instruction is too complex to rematerialize. + int InstructForm::is_expensive() const { +- if (_matrule == NULL) return 0; + // We can prove it is cheap if it has an empty encoding. + // This helps with platform-specific nops like ThreadLocal and RoundFloat. ++ if (is_empty_encoding()) ++ return 0; ++ ++ if (is_tls_instruction()) ++ return 1; ++ ++ if (_matrule == NULL) return 0; ++ ++ return _matrule->is_expensive(); ++} ++ ++// Has an empty encoding if _size is a constant zero or there ++// are no ins_encode tokens. ++int InstructForm::is_empty_encoding() const { + if (_insencode != NULL) { + _insencode->reset(); + if (_insencode->encode_class_iter() == NULL) { +- return 0; ++ return 1; + } + } + if (_size != NULL && strcmp(_size, "0") == 0) { ++ return 1; ++ } + return 0; ++} ++ ++int InstructForm::is_tls_instruction() const { ++ if (_ident != NULL && ++ ( ! strcmp( _ident,"tlsLoadP") || ++ ! strncmp(_ident,"tlsLoadP_",9)) ) { ++ return 1; + } +- return _matrule->is_expensive(); ++ ++ if (_matrule != NULL && _insencode != NULL) { ++ const char* opType = _matrule->_opType; ++ if (strcmp(opType, "Set")==0) ++ opType = _matrule->_rChild->_opType; ++ if (strcmp(opType,"ThreadLocal")==0) { ++ fprintf(stderr, "Warning: ThreadLocal instruction %s should be named 'tlsLoadP_*'\n", ++ (_ident == NULL ? "NULL" : _ident)); ++ return 1; ++ } ++ } ++ ++ return 0; + } + ++ + // Return 'true' if this instruction matches an ideal 'Copy*' node + bool InstructForm::is_ideal_unlock() const { + return _matrule ? _matrule->is_ideal_unlock() : false; +@@ -492,6 +524,10 @@ + if( _components.count() == 1 && _components[0]->is(Component::USE_DEF) ) + rematerialize = true; + ++ // Pseudo-constants (values easily available to the runtime) ++ if (is_empty_encoding() && is_tls_instruction()) ++ rematerialize = true; ++ + // 1-input, 1-output, such as copies or increments. + if( _components.count() == 2 && + _components[0]->is(Component::DEF) && +@@ -1171,9 +1207,9 @@ + // Output the format call for this operand + fprintf(fp,"opnd_array(%d)->",idx); + if (idx == 0) +- fprintf(fp,"int_format(ra, this); // %s\n", rep_var); ++ fprintf(fp,"int_format(ra, this, st); // %s\n", rep_var); + else +- fprintf(fp,"ext_format(ra, this,idx%d); // %s\n", idx, rep_var ); ++ fprintf(fp,"ext_format(ra, this,idx%d, st); // %s\n", idx, rep_var ); + } + } + +@@ -2329,11 +2365,11 @@ + + void OperandForm::format_constant(FILE *fp, uint const_index, uint const_type) { + switch(const_type) { +- case Form::idealI: fprintf(fp,"tty->print(\"#%%d\", _c%d);\n", const_index); break; +- case Form::idealP: fprintf(fp,"_c%d->dump();\n", const_index); break; +- case Form::idealL: fprintf(fp,"tty->print(\"#%%lld\", _c%d);\n", const_index); break; +- case Form::idealF: fprintf(fp,"tty->print(\"#%%f\", _c%d);\n", const_index); break; +- case Form::idealD: fprintf(fp,"tty->print(\"#%%f\", _c%d);\n", const_index); break; ++ case Form::idealI: fprintf(fp,"st->print(\"#%%d\", _c%d);\n", const_index); break; ++ case Form::idealP: fprintf(fp,"_c%d->dump_on(st);\n", const_index); break; ++ case Form::idealL: fprintf(fp,"st->print(\"#%%lld\", _c%d);\n", const_index); break; ++ case Form::idealF: fprintf(fp,"st->print(\"#%%f\", _c%d);\n", const_index); break; ++ case Form::idealD: fprintf(fp,"st->print(\"#%%f\", _c%d);\n", const_index); break; + default: + assert( false, "ShouldNotReachHere()"); + } +@@ -3725,6 +3761,17 @@ + int MatchRule::is_ideal_copy() const { + if( _rChild ) { + const char *opType = _rChild->_opType; ++ if( strcmp(opType,"CastII")==0 ) ++ return 1; ++ // Do not treat *CastPP this way, because it ++ // may transfer a raw pointer to an oop. ++ // If the register allocator were to coalesce this ++ // into a single LRG, the GC maps would be incorrect. ++ //if( strcmp(opType,"CastPP")==0 ) ++ // return 1; ++ //if( strcmp(opType,"CheckCastPP")==0 ) ++ // return 1; ++ // + // Do not treat CastX2P or CastP2X this way, because + // raw pointers and int types are treated differently + // when saving local & stack info for safepoints in +@@ -3773,7 +3820,6 @@ + strcmp(opType,"ConvL2I")==0 || + strcmp(opType,"RoundDouble")==0 || + strcmp(opType,"RoundFloat")==0 || +- strcmp(opType,"ThreadLocal")==0 || + strcmp(opType,"ReverseBytesI")==0 || + strcmp(opType,"ReverseBytesL")==0 || + strcmp(opType,"Replicate16B")==0 || +@@ -3951,4 +3997,3 @@ + fprintf(fp,"\nFormat Rule: \n%s", (_temp?_temp:"")); + fprintf(fp,"\n"); + } +- +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/formssel.hpp openjdk/hotspot/src/share/vm/adlc/formssel.hpp +--- openjdk6/hotspot/src/share/vm/adlc/formssel.hpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/formssel.hpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_HDR +-#pragma ident "@(#)formssel.hpp 1.76 07/05/17 15:49:19 JVM" +-#endif + /* + * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -139,6 +136,8 @@ + // ideal opcode enumeration + virtual const char *ideal_Opcode(FormDict &globals) const; + virtual int is_expensive() const; // node matches ideal 'CosD' ++ virtual int is_empty_encoding() const; // _size=0 and/or _insencode empty ++ virtual int is_tls_instruction() const; // tlsLoadP rule or ideal ThreadLocal + virtual int is_ideal_copy() const; // node matches ideal 'Copy*' + virtual bool is_ideal_unlock() const; // node matches ideal 'Unlock' + virtual bool is_ideal_call_leaf() const; // node matches ideal 'CallLeaf' +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/output_c.cpp openjdk/hotspot/src/share/vm/adlc/output_c.cpp +--- openjdk6/hotspot/src/share/vm/adlc/output_c.cpp 2008-08-28 10:23:07.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/adlc/output_c.cpp 2007-12-14 08:57:02.000000000 +0100 +@@ -1,6 +1,3 @@ +-#ifdef USE_PRAGMA_IDENT_SRC +-#pragma ident "@(#)output_c.cpp 1.184 07/05/17 15:49:23 JVM" +-#endif + /* + * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -2199,7 +2196,7 @@ + const char* reg_conversion(const char* rep_var) { + if (strcmp(rep_var,"$Register") == 0) return "as_Register"; + if (strcmp(rep_var,"$FloatRegister") == 0) return "as_FloatRegister"; +-#if defined(IA32) ++#if defined(IA32) || defined(AMD64) + if (strcmp(rep_var,"$XMMRegister") == 0) return "as_XMMRegister"; + #endif + return NULL; +diff -ruNb openjdk6/hotspot/src/share/vm/adlc/output_h.cpp openjdk/hotspot/src/share/vm/adlc/output_h.cpp +--- openjdk6/hotspot/src/share/vm/adlc/output_h.cpp 2008-08-28 10:23:07.000000000 +0200 From fw at deneb.enyo.de Sat Sep 13 01:27:19 2008 From: fw at deneb.enyo.de (Florian Weimer) Date: Sat, 13 Sep 2008 10:27:19 +0200 Subject: [patch] fix build on architectures with a signed size_t In-Reply-To: <4895EC16.6030406@ubuntu.com> (Matthias Klose's message of "Sun, 03 Aug 2008 19:34:14 +0200") References: <4895EC16.6030406@ubuntu.com> Message-ID: <8763p0mowo.fsf@mid.deneb.enyo.de> * Matthias Klose: > attached are three patches to build on architectures with a signed size_t > (s390-linux-gnu). > > - jdk-signed-size_t.diff, there's already a compat SSIZE_T macro in the code, > just use it. > > - hotspot-idx_t-signed-size_t.diff, the BitMap code assumes a unsigned > size_t. > > - hotspot-params-signed-size_t.diff, command line parameters of type > size_t currently are not supported. As a workaround, add casts. This > may be better addressed. So what has happened to this patch? From twisti at complang.tuwien.ac.at Sat Sep 13 03:11:56 2008 From: twisti at complang.tuwien.ac.at (Christian Thalinger) Date: Sat, 13 Sep 2008 12:11:56 +0200 Subject: FYI: Versioning support for IcedTea In-Reply-To: <20080913014752.GA22999@rivendell.middle-earth.co.uk> References: <20080913014752.GA22999@rivendell.middle-earth.co.uk> Message-ID: <1221300716.3557.7.camel@workstation> On Sat, 2008-09-13 at 02:47 +0100, Andrew John Hughes wrote: > This patch adds support for reporting the IcedTea > version and Mercurial revision from the resulting build: > > $ ~/builder/icedtea/openjdk/build/linux-amd64/bin/java -version > java version "1.7.0_0" > IcedTea 1.8-pre-r1223 Runtime Environment (build 1.7.0_0-b35) > OpenJDK 64-Bit Server VM (build 1.7.0_0-b35, mixed mode) That is a very cool patch. I'll add something similar to CACAO. > diff -r 15c4a75ee541 Makefile.am > --- a/Makefile.am Sat Sep 13 01:08:32 2008 +0100 > +++ b/Makefile.am Sat Sep 13 02:43:32 2008 +0100 > @@ -252,7 +252,7 @@ > > # Mercurial snapshot. > snapshot: dist > - mv $(DIST_ARCHIVES) $(distdir)-`hg tip --template '{node}'`.tar.gz > + mv $(DIST_ARCHIVES) $(distdir)-`$(HG) tip --template '{node}'`.tar.gz > + if [ -e $(abs_top_srcdir)/.hg ]; then \ > + revision="-r`(cd $(srcdir); $(HG) tip|grep changeset|cut -d':' -f2|sed -r 's#\W+##')`" ; \ > + fi ; \ > + icedtea_version="$(PACKAGE_VERSION)$${revision}" ; \ > + sed -i "s#IcedTea#IcedTea $${icedtea_version}#" openjdk/jdk/make/common/shared/Defs.gmk I wonder, as you're using tip --template already above, why not doing this instead of the grep-cut-sed magic: hg tip --template '{rev}' - twisti From bugzilla-daemon at icedtea.classpath.org Sat Sep 13 08:39:19 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sat, 13 Sep 2008 15:39:19 +0000 Subject: [Bug 193] New: Java VM crashes in V [libjvm.so+0x45360c] Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=193 Summary: Java VM crashes in V [libjvm.so+0x45360c] Product: IcedTea Version: unspecified Platform: PC URL: http://www.cfa.harvard.edu/~tkurosu/OnE/ErrorLogs/JavaVM / OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: tkurosu at cfa.harvard.edu On a regular basis Java VM crashes inside Mozilla Firefox on http://www.shockwave.com/gamelanding/sol_addiction.jsp (and other pages with the same game), killing the Java applet and, on occasion, freezing up the whole desktop. The crash occurs during the game, but I am unable to determine any pattern/moves/game plan that triggers the crash. Six recent error logs created by the crashes are available on http://wwww.cfa.harvard.edu/~tkurosu/OnE/ErrorLogs/JavaVM/ -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From gnu_andrew at member.fsf.org Sat Sep 13 18:26:26 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Sun, 14 Sep 2008 02:26:26 +0100 Subject: FYI: Versioning support for IcedTea In-Reply-To: <1221300716.3557.7.camel@workstation> References: <20080913014752.GA22999@rivendell.middle-earth.co.uk> <1221300716.3557.7.camel@workstation> Message-ID: <17c6771e0809131826j45fccb13ud67fa259da42ba44@mail.gmail.com> 2008/9/13 Christian Thalinger : > On Sat, 2008-09-13 at 02:47 +0100, Andrew John Hughes wrote: >> This patch adds support for reporting the IcedTea >> version and Mercurial revision from the resulting build: >> >> $ ~/builder/icedtea/openjdk/build/linux-amd64/bin/java -version >> java version "1.7.0_0" >> IcedTea 1.8-pre-r1223 Runtime Environment (build 1.7.0_0-b35) >> OpenJDK 64-Bit Server VM (build 1.7.0_0-b35, mixed mode) > > That is a very cool patch. I'll add something similar to CACAO. > Thanks! >> diff -r 15c4a75ee541 Makefile.am >> --- a/Makefile.am Sat Sep 13 01:08:32 2008 +0100 >> +++ b/Makefile.am Sat Sep 13 02:43:32 2008 +0100 >> @@ -252,7 +252,7 @@ >> >> # Mercurial snapshot. >> snapshot: dist >> - mv $(DIST_ARCHIVES) $(distdir)-`hg tip --template '{node}'`.tar.gz >> + mv $(DIST_ARCHIVES) $(distdir)-`$(HG) tip --template '{node}'`.tar.gz > >> + if [ -e $(abs_top_srcdir)/.hg ]; then \ >> + revision="-r`(cd $(srcdir); $(HG) tip|grep changeset|cut -d':' -f2|sed -r 's#\W+##')`" ; \ >> + fi ; \ >> + icedtea_version="$(PACKAGE_VERSION)$${revision}" ; \ >> + sed -i "s#IcedTea#IcedTea $${icedtea_version}#" openjdk/jdk/make/common/shared/Defs.gmk > > I wonder, as you're using tip --template already above, why not doing > this instead of the grep-cut-sed magic: > > hg tip --template '{rev}' > Because I didn't know about it :) I saw the existing use of tip --template and tried to find something suitable. Unfortunately, hg's help system proved unhelpful. Anyway, I'll switch to that. > - twisti > > -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From mark at klomp.org Sun Sep 14 01:52:27 2008 From: mark at klomp.org (Mark Wielaard) Date: Sun, 14 Sep 2008 10:52:27 +0200 Subject: Mercurial repo for openjdk6 drops Message-ID: <1221382347.22691.29.camel@hermans.wildebeest.org> Hi, To make it easier to examine the various changes that go into openjdk6 I imported all tar balls into a mercurial repo that you can hg clone and hg diff as much as you like. hg clone http://icedtea.classpath.org/hg/openjdk6 (It is approx. 175 MB or 500MB for a fully exploded bxx.) The import was basically done by going over each tar ball and date for a bxx drop from b05 (2008-02-12) till b12 (2008-08-28) and do: $ rm -rf * $ tar zxf ../openjdk-6-src-b[XX]*.gz $ hg addremove -s 95 $ hg commit -m "Import b[XX]" -d [date] $ hg tag -d [date] b[XX] I'll keep it up to date with any future openjdk6 drops. Cheers, Mark From mark at klomp.org Sun Sep 14 07:19:31 2008 From: mark at klomp.org (Mark Wielaard) Date: Sun, 14 Sep 2008 16:19:31 +0200 Subject: OpenJDK 6 build 12 source posted (build fixes) In-Reply-To: <48CAB08F.6010407@sun.com> References: <48CAB08F.6010407@sun.com> Message-ID: <1221401971.3542.37.camel@dijkstra.wildebeest.org> Hi Joe, On Fri, 2008-09-12 at 11:10 -0700, Joseph D. Darcy wrote: > * Various build fixes, including the gcc ciTypeFlow.cpp issue. [4] Thanks this cleans up the icedtea-corba.patch and some of the build things in icedtea-ecj.patch, plus icedtea-hotspot-citypeflow.patch. Saw that nio spp.sh was replaced by a Spp.java, that makes bootstrapping a little less convenient. Andrew has some fixes so that this java version can also be run on alternative free runtimes. See icedtea-ecj-spp.patch. Cheers, Mark From mark at klomp.org Sun Sep 14 07:22:04 2008 From: mark at klomp.org (Mark Wielaard) Date: Sun, 14 Sep 2008 16:22:04 +0200 Subject: OpenJDK 6 build 12 source posted (directaudio/alsa backend) In-Reply-To: <48CAB08F.6010407@sun.com> References: <48CAB08F.6010407@sun.com> Message-ID: <1221402124.3542.40.camel@dijkstra.wildebeest.org> Hi Joe, Although not in your changelogs, I saw you also included two of my fixes for the ALSA directaudio backend which I posted back in May on sound-dev, and which are included in icedtea already. - The sloppy open/close patch: http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000053.html - The ALSA native lock patch: http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000054.html Although it makes some applets that use some primitive sound output work better I never got a real response. Did you get someone from the sound team to look at these patches? They do seem to work for me and the few test users of those applets, but a full review by one of the sound engineers would be appreciated. They don't seem to be in the JDK7 tree. Karl did correctly pointed out back then that we just need a better/new sound backend. I do hope in time the pulseaudio backend that Ioana and Omair are working on will be that backend. Cheers, Mark From gnu_andrew at member.fsf.org Sun Sep 14 07:31:06 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Sun, 14 Sep 2008 15:31:06 +0100 Subject: OpenJDK 6 build 12 source posted (build fixes) In-Reply-To: <1221401971.3542.37.camel@dijkstra.wildebeest.org> References: <48CAB08F.6010407@sun.com> <1221401971.3542.37.camel@dijkstra.wildebeest.org> Message-ID: <17c6771e0809140731o3a6470e1pcc1c49b7dddf8d16@mail.gmail.com> 2008/9/14 Mark Wielaard : > Hi Joe, > > On Fri, 2008-09-12 at 11:10 -0700, Joseph D. Darcy wrote: >> * Various build fixes, including the gcc ciTypeFlow.cpp issue. [4] > > Thanks this cleans up the icedtea-corba.patch and some of the build > things in icedtea-ecj.patch, plus icedtea-hotspot-citypeflow.patch. > The latter was also fixed in OpenJDK b34 or b35, being part of HotSpot (not sure which as it isn't documented in the lists for these build drops, and we went from b33 to b35). > Saw that nio spp.sh was replaced by a Spp.java, that makes bootstrapping > a little less convenient. Andrew has some fixes so that this java > version can also be run on alternative free runtimes. See > icedtea-ecj-spp.patch. > Spp.java is preferable in the long term, as it removes the reported problems with shells like /bin/dash. Note that the current CVS of GNU Classpath has fixes that will allow this to work unmodified, and these fixes are being ported for GCJ 4.4. The patch is only needed for the current status quo. I did find it rather strange that java.util.Scanner was used not for its scanner facilities but simply as an input stream! It made the replacement simple though, so I'm not complaining :) > Cheers, > > Mark > > Cheers, -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From bugzilla-daemon at icedtea.classpath.org Sun Sep 14 16:25:34 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sun, 14 Sep 2008 23:25:34 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #12 from matthew.flaschen at gatech.edu 2008-09-14 23:25 ------- I just retested with the latest version of Icedtea6. It seems "ImageIO.write" doesn't work with PNG. However, I made a new version of the test that uses other methods of ImageIO, and works fine. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Sun Sep 14 16:26:39 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sun, 14 Sep 2008 23:26:39 +0000 Subject: [Bug 192] com.sun.image.codec.jpeg doesn't work with ImageJ Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=192 ------- Comment #13 from matthew.flaschen at gatech.edu 2008-09-14 23:26 ------- Created an attachment (id=93) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=93&action=view) Tests decode functionality of com.sun.image.codec.jpeg without using ImageIO.write -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From martinrb at google.com Sun Sep 14 19:21:30 2008 From: martinrb at google.com (Martin Buchholz) Date: Sun, 14 Sep 2008 19:21:30 -0700 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <1221382347.22691.29.camel@hermans.wildebeest.org> References: <1221382347.22691.29.camel@hermans.wildebeest.org> Message-ID: <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> Hi Mark, I think this is great. I would prefer if the tag for a release was consistent with the naming convention in OpenJDK7, i.e. something like "jdk6-b12" Joe, as I mentioned to you offline, I think having some history for the mercurial repos at creation time would be valuable. I bet the community would do the conversion down to the changeset if Sun provided the history in Teamware form. Martin On Sun, Sep 14, 2008 at 01:52, Mark Wielaard wrote: > Hi, > > To make it easier to examine the various changes that go into openjdk6 I > imported all tar balls into a mercurial repo that you can hg clone and > hg diff as much as you like. > hg clone http://icedtea.classpath.org/hg/openjdk6 > (It is approx. 175 MB or 500MB for a fully exploded bxx.) > > The import was basically done by going over each tar ball and date for a > bxx drop from b05 (2008-02-12) till b12 (2008-08-28) and do: > $ rm -rf * > $ tar zxf ../openjdk-6-src-b[XX]*.gz > $ hg addremove -s 95 > $ hg commit -m "Import b[XX]" -d [date] > $ hg tag -d [date] b[XX] > > I'll keep it up to date with any future openjdk6 drops. > > Cheers, > > Mark > > From martinrb at google.com Sun Sep 14 21:32:47 2008 From: martinrb at google.com (Martin Buchholz) Date: Sun, 14 Sep 2008 21:32:47 -0700 Subject: FYI: Versioning support for IcedTea In-Reply-To: <20080913014752.GA22999@rivendell.middle-earth.co.uk> References: <20080913014752.GA22999@rivendell.middle-earth.co.uk> Message-ID: <1ccfd1c10809142132j63f88ac0saf354c37ef1af032@mail.gmail.com> Andrew et al, Thanks for making IcedTea builds more self-identifying. I would prefer: - instead of "java version ..." as with the proprietary release, either "IcedTea openjdk version ..." or "openjdk version ..." as with "regular" openjdk. - remove the "_0". The number following the underscore is the "update release", a concept which the openjdks don't (yet) use, and which makes no sense for IcedTea. - report the version of hotspot, similar to the one reported upstream. Especially important if you are mixing and matching JVMs and class libraries. The increased choice provided by open source java does provide increased confusion, so version strings are more valuable. Thanks, Martin On Fri, Sep 12, 2008 at 18:47, Andrew John Hughes wrote: > This patch adds support for reporting the IcedTea > version and Mercurial revision from the resulting build: > > $ ~/builder/icedtea/openjdk/build/linux-amd64/bin/java -version > java version "1.7.0_0" > IcedTea 1.8-pre-r1223 Runtime Environment (build 1.7.0_0-b35) > OpenJDK 64-Bit Server VM (build 1.7.0_0-b35, mixed mode) > > For releases, just the version is reported i.e. "IcedTea 1.8". > Comments welcome. It would be nice to have this support in > IcedTea6 too for tracking bugs more easily. > > I also fixed a minor issue in that 'hg' was being used directly. > We now always check for a hg binary, but only fail if it's missing > when --enable-hg is set. > > ChangeLog: > > 2008-09-13 Andrew John Hughes > > * Makefile.am: > Patch the OpenJDK build with the version > of IcedTea being used. Use $(HG) instead of 'hg'. > * configure.ac: > Always check for Mercurial, but only fail > if --enable-hg is active. > > -- > Andrew :) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 > From bugzilla-daemon at icedtea.classpath.org Sun Sep 14 22:19:08 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 15 Sep 2008 05:19:08 +0000 Subject: [Bug 183] Build error: Argument list too long Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 dj at linuxfromscratch.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dj at linuxfromscratch.org ------- Comment #1 from dj at linuxfromscratch.org 2008-09-15 05:19 ------- 20080914 I too am seeing this error on a {B}LFS host. Grabbed a bz2 from mercweb around 1700 GMT today. This is my first attempt at building IcedTea. Don't worry, no plans to add it to BLFS. ;-) Well, until a release is deemed "stable," just want to be preped for it. FYI, the 'jar' being used ultimately points to /opt/GCJ-4.3.2/bin/gjar (followed roughly the Debian instructions for using gcj-compat package to setup the links. [dj at name25 icedtea6-c46e727121a8]# which sh /bin/sh [dj at name25 icedtea6-c46e727121a8]# ls -l /bin/sh lrwxrwxrwx 1 root root 4 2007-12-22 21:10 /bin/sh -> bash [dj at name25 icedtea6-c46e727121a8]# ls -l /bin/bash -rwxr-xr-x 1 root root 1550422 2007-12-23 00:53 /bin/bash [dj at name25 icedtea6-c46e727121a8]# /bin/sh --version GNU bash, version 3.2.17(1)-release (i686-pc-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc. Error Message from make: /home/dj/icedtea6-c46e727121a8/bootstrap/jdk1.6.0/bin/jar c0mf /home/dj/icedtea6-c46e727121a8/openjdk-ecj/control/build/linux-i586/tmp/manifest.tmp /home/dj/icedtea6-c46e727121a8/openjdk-ecj/control/build/linux-i586/tmp/rt-orig.jar \ -J-client -J-Xmx754m -J-Xms128m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m `/bin/cat /home/dj/icedtea6-c46e727121a8/openjdk-ecj/control/build/linux-i586/tmp/jarfilelists/rt_jar_list`) /bin/sh: line 1: /home/dj/icedtea6-c46e727121a8/bootstrap/jdk1.6.0/bin/jar: Argument list too long make[2]: *** [/home/dj/icedtea6-c46e727121a8/openjdk-ecj/control/build/linux-i586/tmp/rt-orig.jar] Error 126 make[2]: Leaving directory `/home/dj/icedtea6-c46e727121a8/openjdk-ecj/jdk/make' make[1]: *** [jdk-build] Error 2 make[1]: Leaving directory `/home/dj/icedtea6-c46e727121a8/openjdk-ecj/control/make' make: *** [stamps/icedtea-ecj.stamp] Error 2 [dj at name25 icedtea6-c46e727121a8]# -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From mark at klomp.org Mon Sep 15 02:45:40 2008 From: mark at klomp.org (Mark Wielaard) Date: Mon, 15 Sep 2008 11:45:40 +0200 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> Message-ID: <1221471940.3280.1.camel@dijkstra.wildebeest.org> Hi Martin, On Sun, 2008-09-14 at 19:21 -0700, Martin Buchholz wrote: > I would prefer if the tag for a release was > consistent with the naming convention in OpenJDK7, > i.e. something like "jdk6-b12" Good point. It is unlikely that the bxx numbers for 7 and 6 will overlap soon, but better to be clear about it. Please pull for the renamed tags. Cheers, Mark From langel at redhat.com Mon Sep 15 08:20:58 2008 From: langel at redhat.com (Lillian Angel) Date: Mon, 15 Sep 2008 15:20:58 +0000 Subject: changeset in /hg/icedtea6: 2008-09-15 Lillian Angel changeset 02fc4b7ada3d in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=02fc4b7ada3d description: 2008-09-15 Lillian Angel * patches/icedtea-lc_ctype.patch: Fixed array size and changed to use malloc/free. diffstat: 2 files changed, 21 insertions(+), 4 deletions(-) ChangeLog | 5 +++++ patches/icedtea-lc_ctype.patch | 20 ++++++++++++++++---- diffs (43 lines): diff -r c46e727121a8 -r 02fc4b7ada3d ChangeLog --- a/ChangeLog Sat Sep 13 09:32:12 2008 +0200 +++ b/ChangeLog Mon Sep 15 11:20:54 2008 -0400 @@ -1,3 +1,8 @@ 2008-09-12 Matthias Klose + + * patches/icedtea-lc_ctype.patch: Fixed array size and + changed to use malloc/free. + 2008-09-12 Matthias Klose * Makefile.am, HACKING: Update for b12 zero patch. diff -r c46e727121a8 -r 02fc4b7ada3d patches/icedtea-lc_ctype.patch --- a/patches/icedtea-lc_ctype.patch Sat Sep 13 09:32:12 2008 +0200 +++ b/patches/icedtea-lc_ctype.patch Mon Sep 15 11:20:54 2008 -0400 @@ -1,11 +1,23 @@ ---- java_props_md.c 2008-09-10 12:36:05.000000000 -0400 -+++ openjdk/jdk/src/solaris/native/java/lang/java_props_md.c 2008-09-10 12:36:13.000000000 -0400 -@@ -211,7 +211,7 @@ +--- oldopenjdk6/jdk/src/solaris/native/java/lang/java_props_md.c 2008-08-28 04:15:51.000000000 -0400 ++++ openjdk/jdk/src/solaris/native/java/lang/java_props_md.c 2008-09-15 10:37:26.000000000 -0400 +@@ -211,7 +211,9 @@ * _.@ * , , and are optional. */ - char temp[64]; -+ char temp[strlen(lc)]; ++ char * temp; ++ temp = (char*) malloc(strlen(lc)+1); ++ char *language = NULL, *country = NULL, *variant = NULL, *encoding = NULL; char *std_language = NULL, *std_country = NULL, *std_variant = NULL, +@@ -323,6 +325,9 @@ + /* return same result nl_langinfo would return for en_UK, + * in order to use optimizations. */ + std_encoding = (*p != '\0') ? p : "ISO8859-1"; ++ ++ /* Free temp */ ++ free(temp); + + + #ifdef __linux__ From omajid at redhat.com Mon Sep 15 13:52:59 2008 From: omajid at redhat.com (Omair Majid) Date: Mon, 15 Sep 2008 20:52:59 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-15 Omair Majid changeset 7ad349ee575d in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=7ad349ee575d description: 2008-09-15 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (connectLine): May throw LineUnavailableException now. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java (open): Now rethrows exceptions from connectLine. (connectLine): Throws LineUnavailableException. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java (connectLine): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java (connectLine): Likewise. * src/java/org/classpath/icedtea/pulseaudio/Stream.java (connectForPlayback): Throws an exception if pa_stream_connect_playback fails. (connectForRecording): Throws an exception if pa_stream_connect_record fails. * src/native/org_classpath_icedtea_pulseaudio_Stream.c (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1playback): Dont assert out and die if call to pa_stream_connect_playback fails. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1record): Dont assert out and die if the call to pa_stream_connect_record fails. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java (setUp): Close the mixer if it was open before. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java (testStartNotificationOnCork): Added a note explaining that this test is broken. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java (testDrainTwice): New function. This test drains a mixer twice. (testFlushTwice): New function. This test flushes a mixer twice. diffstat: 9 files changed, 60 insertions(+), 12 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 2 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 14 ++++- src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 2 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 2 src/java/org/classpath/icedtea/pulseaudio/Stream.java | 21 +++++++- src/native/org_classpath_icedtea_pulseaudio_Stream.c | 3 - unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java | 3 + unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java | 1 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java | 24 ++++++++++ diffs (204 lines): diff -r cd7041f7a655 -r 7ad349ee575d src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Sep 12 16:28:22 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Mon Sep 15 16:52:31 2008 -0400 @@ -173,7 +173,7 @@ public class PulseAudioClip extends Puls } - protected void connectLine(int bufferSize) { + protected void connectLine(int bufferSize) throws LineUnavailableException { StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( bufferSize, bufferSize / 2, bufferSize / 2, bufferSize / 2, 0); diff -r cd7041f7a655 -r 7ad349ee575d src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Sep 12 16:28:22 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Mon Sep 15 16:52:31 2008 -0400 @@ -153,8 +153,15 @@ public abstract class PulseAudioDataLine stream.addPlaybackStartedListener(startedListener); - synchronized (eventLoop.threadLock) { - connectLine(bufferSize); + try { + synchronized (eventLoop.threadLock) { + connectLine(bufferSize); + } + + } catch (LineUnavailableException e) { + // error connecting to the server! + // FIXME clean up + throw e; } this.bufferSize = bufferSize; try { @@ -231,7 +238,8 @@ public abstract class PulseAudioDataLine return isEngagedInIo; } - protected abstract void connectLine(int bufferSize); + protected abstract void connectLine(int bufferSize) + throws LineUnavailableException; public abstract void drain(); diff -r cd7041f7a655 -r 7ad349ee575d src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 12 16:28:22 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Mon Sep 15 16:52:31 2008 -0400 @@ -103,7 +103,7 @@ public class PulseAudioSourceDataLine ex } - protected void connectLine(int bufferSize) { + protected void connectLine(int bufferSize) throws LineUnavailableException { StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( bufferSize, bufferSize / 4, bufferSize / 4, bufferSize / 10, 0); diff -r cd7041f7a655 -r 7ad349ee575d src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Fri Sep 12 16:28:22 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Mon Sep 15 16:52:31 2008 -0400 @@ -74,7 +74,7 @@ public class PulseAudioTargetDataLine ex parentMixer.addTargetLine(this); } - protected void connectLine(int bufferSize) { + protected void connectLine(int bufferSize) throws LineUnavailableException { StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( bufferSize, 0, 0, 0, bufferSize / 10); synchronized (eventLoop.threadLock) { diff -r cd7041f7a655 -r 7ad349ee575d src/java/org/classpath/icedtea/pulseaudio/Stream.java --- a/src/java/org/classpath/icedtea/pulseaudio/Stream.java Fri Sep 12 16:28:22 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Stream.java Mon Sep 15 16:52:31 2008 -0400 @@ -40,6 +40,8 @@ import java.io.IOException; import java.io.IOException; import java.util.LinkedList; import java.util.List; + +import javax.sound.sampled.LineUnavailableException; /** * @@ -421,31 +423,42 @@ public class Stream { * @param deviceName * the device to connect to. use * null= 0); + if (dev != NULL) { (*env)->ReleaseStringUTFChars(env, device, dev); dev = NULL; @@ -456,7 +456,6 @@ JNIEXPORT jint JNICALL Java_org_classpat } int value = pa_stream_connect_record(stream, dev, &buffer_attr, flags); - assert(value >= 0); if (dev != NULL) { (*env)->ReleaseStringUTFChars(env, device, dev); diff -r cd7041f7a655 -r 7ad349ee575d unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java Fri Sep 12 16:28:22 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerRawTest.java Mon Sep 15 16:52:31 2008 -0400 @@ -52,6 +52,9 @@ public class PulseAudioMixerRawTest { @Before public void setUp() { mixer = PulseAudioMixer.getInstance(); + if (mixer.isOpen()) { + mixer.close(); + } } @Test diff -r cd7041f7a655 -r 7ad349ee575d unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java Fri Sep 12 16:28:22 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java Mon Sep 15 16:52:31 2008 -0400 @@ -84,6 +84,7 @@ public class PulseAudioSourceDataLineRaw } + // FIXME this test is BROKEN! @Test public void testStartNotificationOnCork() throws UnsupportedAudioFileException, IOException, diff -r cd7041f7a655 -r 7ad349ee575d unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Fri Sep 12 16:28:22 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Mon Sep 15 16:52:31 2008 -0400 @@ -548,6 +548,30 @@ public class PulseAudioSourceDataLineTes } @Test + public void testDrainTwice() throws LineUnavailableException { + SourceDataLine line = (SourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, aSupportedFormat, 1000)); + + line.open(); + line.drain(); + line.drain(); + line.close(); + + } + + @Test + public void testFlushTwice() throws LineUnavailableException { + SourceDataLine line = (SourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, aSupportedFormat, 1000)); + + line.open(); + line.flush(); + line.flush(); + line.close(); + + } + + @Test public void testMixerKnowsAboutOpenLines() throws LineUnavailableException { SourceDataLine sourceDataLine = (SourceDataLine) mixer .getLine(new Line.Info(SourceDataLine.class)); From dbhole at redhat.com Mon Sep 15 14:11:24 2008 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 15 Sep 2008 21:11:24 +0000 Subject: changeset in /hg/icedtea6: - Allow access to applet classloader ... Message-ID: changeset adaf3f0d6262 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=adaf3f0d6262 description: - Allow access to applet classloader from JS on that site (http://czateria.interia.pl/czat,room,70,Warszawa). - Fix right-click lag by temporarily disabling status messages (any page with an applet...). - Fix it so that applets with no height/width specifications can load. - Fix hangs caused when Java->JS calls happened rapidly (http://www.rgagnon.com/examples/testcookie.html) diffstat: 3 files changed, 590 insertions(+), 355 deletions(-) ChangeLog | 8 IcedTeaPlugin.cc | 163 +++++-- patches/icedtea-liveconnect.patch | 774 ++++++++++++++++++++++--------------- diffs (truncated from 1730 to 500 lines): diff -r 02fc4b7ada3d -r adaf3f0d6262 ChangeLog --- a/ChangeLog Mon Sep 15 11:20:54 2008 -0400 +++ b/ChangeLog Mon Sep 15 17:11:17 2008 -0400 @@ -1,3 +1,11 @@ 2008-09-15 Lillian Angel + + * IcedTeaPlugin.cc: Allow access to applet classloader from JS on that + site. Fix right-click lag by temporarily disabling status messages. + * patches/icedtea-liveconnect.patch: Allow access to applet classloader + from JS on that site. Fix it so that applets with no height/width + specifications can load. + 2008-09-15 Lillian Angel * patches/icedtea-lc_ctype.patch: Fixed array size and diff -r 02fc4b7ada3d -r adaf3f0d6262 IcedTeaPlugin.cc --- a/IcedTeaPlugin.cc Mon Sep 15 11:20:54 2008 -0400 +++ b/IcedTeaPlugin.cc Mon Sep 15 17:11:17 2008 -0400 @@ -308,20 +308,30 @@ char const* TYPES[10] = { "Object", "double", "void" }; +#include + // FIXME: create index from security context. #define MESSAGE_CREATE(reference) \ + const char* addr; \ + GetCurrentPageAddress(&addr); \ +\ nsCString message ("context "); \ message.AppendInt (0); \ message += " reference "; \ message.AppendInt (reference); \ + if (factory->codebase_map.find(nsCString(addr)) != factory->codebase_map.end()) \ + { \ + message += " src "; \ + message += factory->codebase_map[nsCString(addr)];\ + } \ message += " "; \ message += __func__; \ - if (factory->resultMap[reference] == NULL) { \ - factory->resultMap[reference] = new ResultContainer(); \ - printf("ResultMap created -- %p %d\n", factory->resultMap[reference], factory->resultMap[reference]->returnIdentifier); \ + if (factory->result_map[reference] == NULL) { \ + factory->result_map[reference] = new ResultContainer(); \ + printf("ResultMap created -- %p %d\n", factory->result_map[reference], factory->result_map[reference]->returnIdentifier); \ } \ else \ - factory->resultMap[reference]->Clear(); + factory->result_map[reference]->Clear(); #define MESSAGE_ADD_STRING(name) \ @@ -387,7 +397,7 @@ char const* TYPES[10] = { "Object", #define PROCESS_PENDING_EVENTS_REF(reference) \ if (factory->shutting_down == PR_TRUE && \ - factory->resultMap[reference]->errorOccured == PR_TRUE) \ + factory->result_map[reference]->errorOccured == PR_TRUE) \ { \ printf("Error occured. Exiting function\n"); \ return NS_ERROR_FAILURE; \ @@ -414,46 +424,46 @@ char const* TYPES[10] = { "Object", #define MESSAGE_RECEIVE_REFERENCE(reference, cast, name) \ nsresult res = NS_OK; \ printf ("RECEIVE 1\n"); \ - while (factory->resultMap[reference]->returnIdentifier == -1) \ + while (factory->result_map[reference]->returnIdentifier == -1) \ { \ PROCESS_PENDING_EVENTS_REF (reference); \ } \ printf ("RECEIVE 3\n"); \ - if (factory->resultMap[reference]->returnIdentifier == 0) \ + if (factory->result_map[reference]->returnIdentifier == 0) \ { \ *name = NULL; \ } else { \ *name = \ reinterpret_cast \ - (factory->references.ReferenceObject (factory->resultMap[reference]->returnIdentifier)); \ + (factory->references.ReferenceObject (factory->result_map[reference]->returnIdentifier)); \ } \ printf ("RECEIVE_REFERENCE: %s result: %x = %d\n", \ - __func__, *name, factory->resultMap[reference]->returnIdentifier); + __func__, *name, factory->result_map[reference]->returnIdentifier); // FIXME: track and free JNIIDs. #define MESSAGE_RECEIVE_ID(reference, cast, id, signature) \ PRBool processed = PR_FALSE; \ nsresult res = NS_OK; \ printf("RECEIVE ID 1\n"); \ - while (factory->resultMap[reference]->returnIdentifier == -1) \ + while (factory->result_map[reference]->returnIdentifier == -1) \ { \ PROCESS_PENDING_EVENTS_REF (reference); \ } \ \ *id = reinterpret_cast \ - (new JNIID (factory->resultMap[reference]->returnIdentifier, signature)); \ + (new JNIID (factory->result_map[reference]->returnIdentifier, signature)); \ printf ("RECEIVE_ID: %s result: %x = %d, %s\n", \ - __func__, *id, factory->resultMap[reference]->returnIdentifier, \ + __func__, *id, factory->result_map[reference]->returnIdentifier, \ signature); #define MESSAGE_RECEIVE_VALUE(reference, ctype, result) \ nsresult res = NS_OK; \ printf("RECEIVE VALUE 1\n"); \ - while (factory->resultMap[reference]->returnValue == "") \ + while (factory->result_map[reference]->returnValue == "") \ { \ PROCESS_PENDING_EVENTS_REF (reference); \ } \ - *result = ParseValue (type, factory->resultMap[reference]->returnValue); + *result = ParseValue (type, factory->result_map[reference]->returnValue); // \ // char* valueString = ValueString (type, *result); \ // printf ("RECEIVE_VALUE: %s result: %x = %s\n", \ @@ -465,12 +475,12 @@ char const* TYPES[10] = { "Object", PRBool processed = PR_FALSE; \ nsresult res = NS_OK; \ printf("RECEIVE SIZE 1\n"); \ - while (factory->resultMap[reference]->returnValue == "") \ + while (factory->result_map[reference]->returnValue == "") \ { \ PROCESS_PENDING_EVENTS_REF (reference); \ } \ nsresult conversionResult; \ - *result = factory->resultMap[reference]->returnValue.ToInteger (&conversionResult); \ + *result = factory->result_map[reference]->returnValue.ToInteger (&conversionResult); \ PLUGIN_CHECK ("parse integer", conversionResult); // \ // printf ("RECEIVE_SIZE: %s result: %x = %d\n", \ @@ -481,13 +491,13 @@ char const* TYPES[10] = { "Object", PRBool processed = PR_FALSE; \ nsresult res = NS_OK; \ printf("RECEIVE STRING 1\n"); \ - while (factory->resultMap[reference]->returnValue == "") \ + while (factory->result_map[reference]->returnValue == "") \ { \ PROCESS_PENDING_EVENTS_REF (reference); \ } \ - printf("Setting result to: %s\n", strdup (factory->resultMap[reference]->returnValue.get ())); \ + printf("Setting result to: %s\n", strdup (factory->result_map[reference]->returnValue.get ())); \ *result = reinterpret_cast \ - (strdup (factory->resultMap[reference]->returnValue.get ())); + (strdup (factory->result_map[reference]->returnValue.get ())); // \ // printf ("RECEIVE_STRING: %s result: %x = %s\n", \ // __func__, result, *result); @@ -497,15 +507,15 @@ char const* TYPES[10] = { "Object", PRBool processed = PR_FALSE; \ nsresult res = NS_OK; \ printf("RECEIVE STRING UCS 1\n"); \ - while (factory->resultMap[reference]->returnValueUCS.IsEmpty()) \ + while (factory->result_map[reference]->returnValueUCS.IsEmpty()) \ { \ PROCESS_PENDING_EVENTS_REF (reference); \ } \ - int length = factory->resultMap[reference]->returnValueUCS.Length (); \ + int length = factory->result_map[reference]->returnValueUCS.Length (); \ jchar* newstring = static_cast (PR_Malloc (length)); \ memset (newstring, 0, length); \ - memcpy (newstring, factory->resultMap[reference]->returnValueUCS.get (), length); \ - std::cout << "Setting result to: " << factory->resultMap[reference]->returnValueUCS.get() << std::endl; \ + memcpy (newstring, factory->result_map[reference]->returnValueUCS.get (), length); \ + std::cout << "Setting result to: " << factory->result_map[reference]->returnValueUCS.get() << std::endl; \ *result = static_cast (newstring); // \ @@ -516,11 +526,11 @@ char const* TYPES[10] = { "Object", PRBool processed = PR_FALSE; \ nsresult res = NS_OK; \ printf("RECEIVE BOOLEAN 1\n"); \ - while (factory->resultMap[reference]->returnIdentifier == -1) \ + while (factory->result_map[reference]->returnIdentifier == -1) \ { \ PROCESS_PENDING_EVENTS_REF (reference); \ } \ - *result = factory->resultMap[reference]->returnIdentifier; + *result = factory->result_map[reference]->returnIdentifier; // res = factory->current->ProcessNextEvent (PR_TRUE, \ // &processed); \ // PLUGIN_CHECK_RETURN (__func__, res); \ @@ -767,7 +777,7 @@ public: // FIXME: make private? JNIEnv* proxyEnv; nsISecureEnv* secureEnv; - std::map resultMap; + std::map result_map; void GetMember (); void SetMember (); void GetSlot (); @@ -778,6 +788,7 @@ public: void Finalize (); void ToString (); nsCOMPtr liveconnect; + std::map codebase_map; private: ~IcedTeaPluginFactory(); @@ -828,7 +839,6 @@ private: class IcedTeaEventSink; - class IcedTeaPluginInstance : public nsIPluginInstance, public nsIJVMPluginInstance { @@ -1139,6 +1149,7 @@ private: int IncrementContextCounter(); void DecrementContextCounter(); + void GetCurrentPageAddress(const char **addr); int contextCounter; }; @@ -2068,6 +2079,29 @@ IcedTeaPluginInstance::Initialize (nsIPl NS_ADDREF (aPeer); printf ("DONE SETTING PEER!!!: %p\n", aPeer); +// if (factory->codebase_map[nsCString(documentbase)] != NULL) +// { +// printf("Found %s in map and it is %s\n", nsCString(documentbase), factory->codebase_map[nsCString(documentbase)].get()); +// +// } + + nsCString dbase(documentbase); + if (factory->codebase_map.find(dbase) != factory->codebase_map.end()) + { + factory->codebase_map[dbase] += ","; + factory->codebase_map[dbase].AppendInt(instance_identifier); + + printf("Appended: %s to %s\n", factory->codebase_map[dbase].get(), documentbase); + + } else + { + nsCString str; + str.AppendInt(instance_identifier); + factory->codebase_map[dbase] = str; + + printf("Creating and adding %s to %s and we now have: %s\n", str.get(), documentbase, factory->codebase_map.find(dbase)->second.get()); + } + return NS_OK; } @@ -2138,9 +2172,8 @@ IcedTeaPluginInstance::SetWindow (nsPlug printf("IcedTeaPluginInstance::SetWindow: Instance %p waiting for initialization...\n", this); - while (initialized == PR_FALSE) { + while (initialized == PR_FALSE) { PROCESS_PENDING_EVENTS; -// printf("waiting for java object\n"); } printf("Instance %p initialization complete...\n", this); @@ -2308,7 +2341,7 @@ IcedTeaPluginFactory::GetJavaObject (PRU objectMessage.AppendInt (reference); objectMessage += " GetJavaObject"; printf ("Sending object message: %s\n", objectMessage.get()); - resultMap[reference] = new ResultContainer(); + result_map[reference] = new ResultContainer(); SendMessageToAppletViewer (objectMessage); PRBool processed = PR_FALSE; @@ -2439,8 +2472,8 @@ IcedTeaPluginFactory::HandleMessage (nsC { IcedTeaPluginInstance* instance = NULL; instances.Get (identifier, &instance); - if (instance != 0) - instance->peer->ShowStatus (nsCString (rest).get ()); +// if (instance != 0) +// instance->peer->ShowStatus (nsCString (rest).get ()); } else if (command == "initialized") { @@ -2658,7 +2691,7 @@ IcedTeaPluginFactory::HandleMessage (nsC else if (command == "Error") { printf("Error occured. Setting error flag for container @ %d to true\n", reference); - resultMap[reference]->errorOccured = PR_TRUE; + result_map[reference]->errorOccured = PR_TRUE; } } else if (prefix == "context") @@ -2694,9 +2727,9 @@ IcedTeaPluginFactory::HandleMessage (nsC || command == "NewGlobalRef" || command == "NewArray") { - resultMap[reference]->returnIdentifier = rest.ToInteger (&conversionResult); + result_map[reference]->returnIdentifier = rest.ToInteger (&conversionResult); PLUGIN_CHECK ("parse integer", conversionResult); - printf ("GOT RETURN IDENTIFIER %d\n", resultMap[reference]->returnIdentifier); + printf ("GOT RETURN IDENTIFIER %d\n", result_map[reference]->returnIdentifier); } else if (command == "GetField" @@ -2710,8 +2743,8 @@ IcedTeaPluginFactory::HandleMessage (nsC // if (returnValue != "") // PLUGIN_ERROR ("Return value already defined."); - resultMap[reference]->returnValue = rest; - printf ("PLUGIN GOT RETURN VALUE: %s\n", resultMap[reference]->returnValue.get()); + result_map[reference]->returnValue = rest; + printf ("PLUGIN GOT RETURN VALUE: %s\n", result_map[reference]->returnValue.get()); } else if (command == "GetStringUTFChars") { @@ -2739,8 +2772,8 @@ IcedTeaPluginFactory::HandleMessage (nsC offset - previousOffset).ToInteger (&conversionResult, 16)); PLUGIN_CHECK ("parse integer", conversionResult); } - resultMap[reference]->returnValue = returnValue; - printf ("PLUGIN GOT RETURN UTF-8 STRING: %s\n", resultMap[reference]->returnValue.get ()); + result_map[reference]->returnValue = returnValue; + printf ("PLUGIN GOT RETURN UTF-8 STRING: %s\n", result_map[reference]->returnValue.get ()); } else if (command == "GetStringChars") { @@ -2792,7 +2825,7 @@ IcedTeaPluginFactory::HandleMessage (nsC printf ("?"); } printf ("\n"); - resultMap[reference]->returnValueUCS = returnValueUCS; + result_map[reference]->returnValueUCS = returnValueUCS; } // Do nothing for: SetStaticField, SetField, ExceptionClear, @@ -3726,6 +3759,10 @@ NS_IMPL_ISUPPORTS1 (IcedTeaJNIEnv, nsISe #include #include #include +#include +#include +#include +#include IcedTeaJNIEnv::IcedTeaJNIEnv (IcedTeaPluginFactory* factory) : factory (factory) @@ -3762,6 +3799,29 @@ IcedTeaJNIEnv::DecrementContextCounter ( PR_EnterMonitor(contextCounterPRMonitor); contextCounter--; PR_ExitMonitor(contextCounterPRMonitor); +} + +void +IcedTeaJNIEnv::GetCurrentPageAddress(const char **addr) +{ + nsIPrincipal *prin; + nsCOMPtr sec_man(do_GetService("@mozilla.org/scriptsecuritymanager;1")); + + sec_man->GetSubjectPrincipal(&prin); + + if (prin) + { + + nsIURI *uri; + prin->GetURI(&uri); + + if (uri) + { + nsCAutoString str; + uri->GetSpec(str); + NS_CStringGetData(str, addr); + } + } } NS_IMETHODIMP @@ -3781,6 +3841,7 @@ IcedTeaJNIEnv::NewObject (jclass clazz, printf("MSG SEND COMPLETE. NOW RECEIVING...\n"); MESSAGE_RECEIVE_REFERENCE (reference, jobject, result); DecrementContextCounter (); + return NS_OK; } @@ -3803,6 +3864,7 @@ IcedTeaJNIEnv::CallMethod (jni_type type printf("MSG SEND COMPLETE. NOW RECEIVING...\n"); MESSAGE_RECEIVE_VALUE (reference, type, result); DecrementContextCounter (); + return NS_OK; } @@ -3816,6 +3878,7 @@ IcedTeaJNIEnv::CallNonvirtualMethod (jni jvalue* result, nsISecurityContext* ctx) { + NOT_IMPLEMENTED (); return NS_ERROR_NOT_IMPLEMENTED; } @@ -3975,7 +4038,7 @@ IcedTeaJNIEnv::ExpandArgs (JNIID* id, jv i = 1; stopchar = ')'; } - + // Method. int arg = 0; char* fl; @@ -3999,9 +4062,11 @@ IcedTeaJNIEnv::ExpandArgs (JNIID* id, jv retstr.AppendInt (args[arg].s); break; case 'I': + printf("Appending (I @ %d) %d\n", arg, args[arg].i); retstr.AppendInt (args[arg].i); break; case 'J': + printf("Appending (J @ %d) %d\n", arg, args[arg].i); retstr.AppendInt (args[arg].j); break; case 'F': @@ -4011,6 +4076,7 @@ IcedTeaJNIEnv::ExpandArgs (JNIID* id, jv retstr += IcedTeaPrintfCString ("%g", args[arg].d); break; case 'L': + std::cout << "Appending for L: arg=" << arg << " args[arg].l=" << args[arg].l << std::endl; retstr.AppendInt (ID (args[arg].l)); i++; while (id->signature[i] != ';') @@ -4044,7 +4110,10 @@ IcedTeaJNIEnv::ExpandArgs (JNIID* id, jv printf ("FAILED ID: %d\n", id->identifier); break; } + + retstr += " "; i++; + arg++; } // Freed by calling function. @@ -4067,6 +4136,7 @@ IcedTeaJNIEnv::GetField (jni_type type, printf("MSG SEND COMPLETE. NOW RECEIVING...\n"); MESSAGE_RECEIVE_VALUE (reference, type, result); DecrementContextCounter (); + return NS_OK; } @@ -4084,7 +4154,7 @@ IcedTeaJNIEnv::SetField (jni_type type, MESSAGE_ADD_ID (fieldID); MESSAGE_ADD_VALUE (fieldID, val); MESSAGE_SEND (); - printf("MSG SEND COMPLETE. NOW RECEIVING...\n"); + return NS_OK; } @@ -4106,6 +4176,7 @@ IcedTeaJNIEnv::CallStaticMethod (jni_typ printf("MSG SEND COMPLETE. NOW RECEIVING...\n"); MESSAGE_RECEIVE_VALUE (reference, type, result); DecrementContextCounter (); + return NS_OK; } @@ -4125,6 +4196,7 @@ IcedTeaJNIEnv::GetStaticField (jni_type printf("MSG SEND COMPLETE. NOW RECEIVING...\n"); MESSAGE_RECEIVE_VALUE (reference, type, result); DecrementContextCounter (); + return NS_OK; } @@ -4142,7 +4214,7 @@ IcedTeaJNIEnv::SetStaticField (jni_type MESSAGE_ADD_ID (fieldID); MESSAGE_ADD_VALUE (fieldID, val); MESSAGE_SEND (); - printf("MSG SEND COMPLETE. NOW RECEIVING...\n"); + return NS_OK; } @@ -4799,12 +4871,15 @@ NSGetFactory (nsISupports* aServMgr, nsC PLUGIN_DEBUG("Waiting for factory to be created..."); } + + PLUGIN_DEBUG("NSGetFactory: Returning existing factory"); + *aFactory = factory; NS_ADDREF (factory); } else { factory_created = PR_TRUE; - PLUGIN_DEBUG("Creating factory"); + PLUGIN_DEBUG("NSGetFactory: Creating factory"); factory = new IcedTeaPluginFactory (); if (!factory) return NS_ERROR_OUT_OF_MEMORY; diff -r 02fc4b7ada3d -r adaf3f0d6262 patches/icedtea-liveconnect.patch --- a/patches/icedtea-liveconnect.patch Mon Sep 15 11:20:54 2008 -0400 +++ b/patches/icedtea-liveconnect.patch Mon Sep 15 17:11:17 2008 -0400 @@ -1,6 +1,6 @@ diff -urN openjdk.orig/jdk/make/sun/Make diff -urN openjdk.orig/jdk/make/sun/Makefile openjdk/jdk/make/sun/Makefile --- openjdk.orig/jdk/make/sun/Makefile 2008-07-10 15:54:44.000000000 -0400 From dbhole at redhat.com Mon Sep 15 14:21:19 2008 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 15 Sep 2008 21:21:19 +0000 Subject: changeset in /hg/icedtea6: Fix bad changelog entry Message-ID: changeset 1c7da2861925 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=1c7da2861925 description: Fix bad changelog entry diffstat: 1 file changed, 1 insertion(+), 1 deletion(-) ChangeLog | 2 +- diffs (12 lines): diff -r adaf3f0d6262 -r 1c7da2861925 ChangeLog --- a/ChangeLog Mon Sep 15 17:11:17 2008 -0400 +++ b/ChangeLog Mon Sep 15 17:21:14 2008 -0400 @@ -2,7 +2,7 @@ 2008-08-26 Deepak Bhole http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 ------- Comment #2 from dj at linuxfromscratch.org 2008-09-15 23:17 ------- Could totally side step the problem. Something like this should work: jar c0mf ... `head -n1 $tmplist` && for item in `cat $tmplist` do jar u0mf ... $item done I'll send a patch when I get back to it tonight. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Mon Sep 15 16:21:14 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 15 Sep 2008 23:21:14 +0000 Subject: [Bug 183] Build error: Argument list too long Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 ------- Comment #3 from doko at ubuntu.com 2008-09-15 23:21 ------- be careful, not every jar has a good enough u (update) option -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Mon Sep 15 16:44:01 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 15 Sep 2008 23:44:01 +0000 Subject: [Bug 183] Build error: Argument list too long Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 ------- Comment #4 from dj at linuxfromscratch.org 2008-09-15 23:44 ------- Jar in question is gjar 4.3.2, which I've honestly never used before now. Besides, I completely ignored the previous thread and the -@ suggestion. My question now is which jar do not support -@? -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Tue Sep 16 05:13:06 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 16 Sep 2008 12:13:06 +0000 Subject: [Bug 183] Build error: Argument list too long Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 ------- Comment #5 from dj at linuxfromscratch.org 2008-09-16 12:13 ------- Created an attachment (id=94) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=94&action=view) Add check for gjar's version of @ (stdin) Adds a check for gjar's stdin @ switch. This is not used in the Makefiles yet. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Tue Sep 16 05:14:05 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 16 Sep 2008 12:14:05 +0000 Subject: [Bug 183] Build error: Argument list too long Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 ------- Comment #6 from dj at linuxfromscratch.org 2008-09-16 12:14 ------- OK, got time to look at it again and I think I figured it out. GCC's gjar uses the @ argument to read filenames from stdin (cat file | gjar cf@ file.jar) Sun's jar uses @ for command completion (jar cf file.jar @file) The JAR_KNOWS_ATFILE test defined in acinclude.m4 is checking for the Sun usage, however, only gjar method is used in jdk/make/common/Release.gmk. I'm too tired to dig any further than that tonight..hopefully I'm just looking at the wrong makefile. Anyway, that test should probably stay like it is and add another before removing the test files (lets call the variable JAR_ACCEPTS_STDIN_LIST or something to that effect), and both methods provided in any use of jar, + the fallback (which apparently does not work on Debian and on my LFSish host, but that is another issue). Here is a quick patch for the autotools, so you can see what I mean, but I still haven't figured out the Makefile layout. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From mark at klomp.org Tue Sep 16 07:41:22 2008 From: mark at klomp.org (Mark Wielaard) Date: Tue, 16 Sep 2008 16:41:22 +0200 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> Message-ID: <1221576082.3889.10.camel@dijkstra.wildebeest.org> Hi, On Sun, 2008-09-14 at 19:21 -0700, Martin Buchholz wrote: > Joe, as I mentioned to you offline, > I think having some history for the mercurial repos > at creation time would be valuable. > > I bet the community would do the conversion down to the > changeset if Sun provided the history in Teamware form. Yes, we were just discussing that again on irc. And Martin is completely right. We would be happy to help in any way getting the individual patches and changesets into a public mercurial repository if made available (at least the back to the future parts, clearly anything from before jdk7 will be a bit too hard). It would greatly help with reviewing the code and any changes in the future. Cheers, Mark From Joe.Darcy at Sun.COM Tue Sep 16 09:37:28 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Tue, 16 Sep 2008 09:37:28 -0700 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <1221576082.3889.10.camel@dijkstra.wildebeest.org> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> Message-ID: <48CFE0C8.6090809@sun.com> Mark Wielaard wrote: > Hi, > > On Sun, 2008-09-14 at 19:21 -0700, Martin Buchholz wrote: > >> Joe, as I mentioned to you offline, >> I think having some history for the mercurial repos >> at creation time would be valuable. >> >> I bet the community would do the conversion down to the >> changeset if Sun provided the history in Teamware form. >> > > Yes, we were just discussing that again on irc. And Martin is completely > right. We would be happy to help in any way getting the individual > patches and changesets into a public mercurial repository if made > available (at least the back to the future parts, clearly anything from > before jdk7 will be a bit too hard). > > It would greatly help with reviewing the code and any changes in the > future. > > Cheers, > > Mark > Hello. While I'm sympathetic to the request and appreciate the offer of help, it is unlikely I'll be able to publish the initial Mercurial repositories with any history. The most history that could be published dates back to when OpenJDK 6 branched off from the already open sourced JDK 7. The total amount of bugs fixed from then until now is on the order of 400-500, with somewhat fewer logical changesets. This number of changesets is quite small compared to the amount of pre-Mercurial history that is not being published externally at all. However, the number is large enough that is would be troublesome for me to reliably synthesize changesets. I don't have Martin's process for scripting and SCM hackery and one of the limitation of the teamware SCM is that the changes are only really tracked on a per-file basis. Published truncated teamware histories outside of Sun's firewall for people to help cons up changesets might be technically possible, but much of the prep work and reviews would have to be done internally and the costs/benefits on that portion don't look attractive to me. I'd rather see the Mercurial repository up and running sooner so all future changes can be tracked well. -Joe From omajid at redhat.com Tue Sep 16 11:05:54 2008 From: omajid at redhat.com (Omair Majid) Date: Tue, 16 Sep 2008 18:05:54 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-16 Omair Majid changeset 3c5c586cf5f3 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=3c5c586cf5f3 description: 2008-09-16 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java (getLine): Throw the exception with a more meaningful description. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java (drain): Implemented drain. Blocks while the TargetDataLine remains started. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java (testIsActiveAndIsOpen): Fixed thinko. Now tests a TargetDataLine instead of a SourceDataLine. (testDrain): New function. Tests if drain() blocks between calls to start() and stop(). (testStartedStopped): Removed call to drain. Instead wait a bit. (tearDown): Clean up a bit more if possible. diffstat: 3 files changed, 60 insertions(+), 8 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 2 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 9 + unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 57 ++++++++-- diffs (133 lines): diff -r 7ad349ee575d -r 3c5c586cf5f3 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Mon Sep 15 16:52:31 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Tue Sep 16 14:05:45 2008 -0400 @@ -255,7 +255,7 @@ public class PulseAudioMixer implements throws LineUnavailableException { if (!isOpen) { - throw new LineUnavailableException(); + throw new LineUnavailableException("The mixer isnt open"); } if (!isLineSupported(info)) { diff -r 7ad349ee575d -r 3c5c586cf5f3 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Mon Sep 15 16:52:31 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Tue Sep 16 14:05:45 2008 -0400 @@ -141,7 +141,14 @@ public class PulseAudioTargetDataLine ex @Override public void drain() { - // FIXME how do we drain a target data line? + // blocks when there is data on the line + // http://www.jsresources.org/faq_audio.html#stop_drain_tdl + while (isStarted) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { } + } + } @Override diff -r 7ad349ee575d -r 3c5c586cf5f3 unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Mon Sep 15 16:52:31 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Tue Sep 16 14:05:45 2008 -0400 @@ -49,7 +49,6 @@ import javax.sound.sampled.LineListener; import javax.sound.sampled.LineListener; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.Mixer; -import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.TargetDataLine; import javax.sound.sampled.UnsupportedAudioFileException; @@ -101,8 +100,8 @@ public class PulseAudioTargetDataLineTes @Test public void testIsActiveAndIsOpen() throws LineUnavailableException { - SourceDataLine line = (SourceDataLine) mixer.getLine(new DataLine.Info( - SourceDataLine.class, aSupportedFormat, 1000)); + TargetDataLine line = (TargetDataLine) mixer.getLine(new DataLine.Info( + TargetDataLine.class, aSupportedFormat, 1000)); Assert.assertFalse(line.isActive()); Assert.assertFalse(line.isOpen()); @@ -147,6 +146,40 @@ public class PulseAudioTargetDataLineTes } @Test + public void testDrain() throws LineUnavailableException, + InterruptedException { + System.out + .println("This test checks that drain() on a start()ed TargetDataLine hangs"); + + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + + targetDataLine.open(); + targetDataLine.start(); + + Thread th = new Thread(new Runnable() { + + @Override + public void run() { + targetDataLine.drain(); + } + + }); + + th.start(); + + th.join(5000); + + if (!th.isAlive()) { + targetDataLine.stop(); + th.join(); + targetDataLine.close(); + Assert.fail("drain() on a opened TargetDataLine should hang"); + } + } + + @Test public void testCloseEvents() throws LineUnavailableException { targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( TargetDataLine.class)); @@ -176,7 +209,7 @@ public class PulseAudioTargetDataLineTes @Test public void testStartedStopped() throws LineUnavailableException, - UnsupportedAudioFileException, IOException { + UnsupportedAudioFileException, IOException, InterruptedException { File soundFile = new File("testsounds/startup.wav"); AudioInputStream audioInputStream = AudioSystem @@ -215,7 +248,7 @@ public class PulseAudioTargetDataLineTes line.start(); - line.drain(); + Thread.sleep(100); line.stop(); line.close(); @@ -261,7 +294,19 @@ public class PulseAudioTargetDataLineTes @After public void tearDown() { - mixer.close(); + if (targetDataLine != null) { + if (targetDataLine.isActive()) { + targetDataLine.stop(); + } + + if (targetDataLine.isOpen()) { + targetDataLine.close(); + } + } + + if (mixer.isOpen()) { + mixer.close(); + } } } From bugzilla-daemon at icedtea.classpath.org Tue Sep 16 19:11:46 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 17 Sep 2008 02:11:46 +0000 Subject: [Bug 183] Build error: Argument list too long Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 dj at linuxfromscratch.org changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #94 is|0 |1 obsolete| | ------- Comment #7 from dj at linuxfromscratch.org 2008-09-17 02:11 ------- Created an attachment (id=95) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=95&action=view) Correct use of @ and add stdin jar @ test and buildfix Oops. Previous patch had a thinko (missing backslash). This one contains both the autotools patch (corrected previous patch), and modifies icedtea-ecj.patch to complete the buildfix. Not tested fully, however it gets through the first jdk build (openjdk-ecj). Posted for testing I will report back with results tomorrow evening. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From cky944 at gmail.com Wed Sep 17 01:41:36 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Wed, 17 Sep 2008 20:41:36 +1200 Subject: On ecj and @Override annotations for interface methods Message-ID: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> Hi there, After a discussion with Alan Bateman (NIO2 lead maintainer) about the unwieldliness of having to remove @Override annotations for interface methods, he suggested that I look into the possibility of making ecj support such uses; more and more code in jdk7 are using it, not just in NIO2. There is, in fact, a way to do this, at least for the version of ecj distributed with Ubuntu 8.04. It just requires supplying the "-1.6" command-line option in javac.in. I'm very keen to see how many of the ecj versions, that IcedTea needs to support, would allow that option to be successfully used. If it works generally (I've attached a trivial file people can test with, if they wish to), I'd propose editing javac.in to use -1.6 instead of -1.5 as it currently does (if there aren't other objects to the idea, of course). Otherwise, I'm happy to make the -1.6 option apply only to NIO2 builds, and have configure test for -1.6 support when --with-project=nio2. Comments welcome, ---Chris K. -------------- next part -------------- A non-text attachment was scrubbed... Name: OverrideTest.java Type: text/x-java Size: 94 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080917/bb6c6df6/OverrideTest.java From aph at redhat.com Wed Sep 17 02:02:23 2008 From: aph at redhat.com (Andrew Haley) Date: Wed, 17 Sep 2008 10:02:23 +0100 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> Message-ID: <48D0C79F.1080909@redhat.com> C. K. Jester-Young wrote: > There is, in fact, a way to do this, at least for the version of ecj > distributed with Ubuntu 8.04. It just requires supplying the "-1.6" > command-line option in javac.in. Seems reasonable. > Otherwise, I'm happy to make the -1.6 option apply only to NIO2 builds, > and have configure test for -1.6 support when --with-project=nio2. Why not simply add a configure test for "-1.6" and if it succeeds use "-1.6" everywhere? Andrew. From cky944 at gmail.com Wed Sep 17 02:21:32 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Wed, 17 Sep 2008 21:21:32 +1200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <48D0C79F.1080909@redhat.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> Message-ID: <20080917092132.GB10250@bamboo.destinee.acro.gen.nz> On Wed, Sep 17, 2008 at 10:02:23AM +0100, Andrew Haley wrote: > Why not simply add a configure test for "-1.6" and if it succeeds use > "-1.6" everywhere? That's actually a good idea. :-) In that case, if the 1.6 test succeeds, then Makefile should specify running with "-source 1.6" too (again, if there are no objections---yes, I noticed that I mistyped that word in my last message ---to the idea). Which makes me think, there should be a new variable, maybe SOURCE_VERSION, which is used both in javac.in and Makefile.am. I've come to discover that this doesn't solve all cases of ecj choking on @Override (specifically, interfaces are not considered to subclass java.lang.Object, and thus any interfaces that override the equals and hashCode methods, say, cannot have @Override annotations for them). But it seems to correct enough cases to significantly diminish any @Override removal patches that I have to come up with. :-) Thanks, ---Chris K. From mark at klomp.org Wed Sep 17 02:30:27 2008 From: mark at klomp.org (Mark Wielaard) Date: Wed, 17 Sep 2008 11:30:27 +0200 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <48CFE0C8.6090809@sun.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> Message-ID: <1221643827.3246.64.camel@dijkstra.wildebeest.org> Hi Joe, On Tue, 2008-09-16 at 09:37 -0700, Joseph D. Darcy wrote: > While I'm sympathetic to the request and appreciate the offer of help, > it is unlikely I'll be able to publish the initial Mercurial > repositories with any history. The most history that could be published > dates back to when OpenJDK 6 branched off from the already open sourced > JDK 7. The total amount of bugs fixed from then until now is on the > order of 400-500, with somewhat fewer logical changesets. This number > of changesets is quite small compared to the amount of pre-Mercurial > history that is not being published externally at all. That is actually about half of what jdk7 or icedtea (disregarding openjdk import changes) have been seeing. So I do think it is a significant amount of changes. It would certain help with getting a better view of how changes relate to each other. > However, the > number is large enough that is would be troublesome for me to reliably > synthesize changesets. I don't have Martin's process for scripting and > SCM hackery and one of the limitation of the teamware SCM is that the > changes are only really tracked on a per-file basis. Published > truncated teamware histories outside of Sun's firewall for people to > help cons up changesets might be technically possible, but much of the > prep work and reviews would have to be done internally and the > costs/benefits on that portion don't look attractive to me. Ah, that is a bummer. I had assumed that the teamware history only included stuff starting with the public release of openjdk7. Isn't there any way to "replay" the patches starting at that point and post those? rcs and cvs also maintain history on a per-file basis, but with some scripting tricks it is still possible to reconstruct cross-file changesets from them mostly. If that is impossible, could you start posting patches to the jdk6-dev when you apply them to your repository? So the chunks are smaller and can be commented on more timely than when you do full bxx code drops? Thanks, Mark From cky944 at gmail.com Wed Sep 17 04:05:06 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Wed, 17 Sep 2008 23:05:06 +1200 Subject: New and (hopefully) improved javac.in Message-ID: <20080917110506.GC10250@bamboo.destinee.acro.gen.nz> Hi there, A while ago, in a thread with Mark, I mentioned that I found it odd that when using ecj to compile, this message kept coming up: incorrect classpath: hotspot-tools/com/sun/codemodel/internal/ClassType.java I figured at the time that it was because ecj was treating the "-bootclasspath '' @hotspot-tools-source-files.txt" as simply "-bootclasspath @hotspot-tools-source-files.txt", losing the empty argument. It turns out that the javac wrapper shell script lost the empty argument in its argument handling. I have thus written a new javac wrapper script. It uses Perl, rather than shell, because I figured this to be more portable than relying on a shell with proper array support (read: different versions of bash differed on how arrays are supported). And without arrays, keeping empty arguments intact would be very difficult. I have endeavoured to keep to the spirit of the original javac.in; any comments would be welcome. Cheers, ---Chris K. -------------- next part -------------- A non-text attachment was scrubbed... Name: javac.in Type: text/x-perl Size: 962 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080917/d6f3cc28/javac.in From Kelly.Ohair at Sun.COM Wed Sep 17 10:26:06 2008 From: Kelly.Ohair at Sun.COM (Kelly O'Hair) Date: Wed, 17 Sep 2008 10:26:06 -0700 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <1221643827.3246.64.camel@dijkstra.wildebeest.org> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> Message-ID: <48D13DAE.9030009@sun.com> Speaking from experience, any attempts at cleanly creating changesets from TeamWare data alone is a waste of time. Just doesn't work well. Granted we have pretty complete OpenJDK6 changeset data (data beyond the TeamWare data) and could potentially do this, it's quite a bit of grunt work to accomplish. Before we go off on this kind of adventure we need to make sure the time spent is worth it. A different approach would be to create changesets per build/promotion, but those kind of large changesets can have limited usefulness. I'll try and talk to Joe about this tomorrow. Also, don't forget that the OpenJDK7 sources are a Mercurial forest, not just one repository. I assume that we want to mimic the same forest layout, keeping the langtools, corba, jaxp, jaxws, and hotspot sources in their own repositories, separate from the core 'jdk' repository. That allows us to do some plug and play with these repositories between OpenJDK6 and OpenJDK7. -kto Mark Wielaard wrote: > Hi Joe, > > On Tue, 2008-09-16 at 09:37 -0700, Joseph D. Darcy wrote: >> While I'm sympathetic to the request and appreciate the offer of help, >> it is unlikely I'll be able to publish the initial Mercurial >> repositories with any history. The most history that could be published >> dates back to when OpenJDK 6 branched off from the already open sourced >> JDK 7. The total amount of bugs fixed from then until now is on the >> order of 400-500, with somewhat fewer logical changesets. This number >> of changesets is quite small compared to the amount of pre-Mercurial >> history that is not being published externally at all. > > That is actually about half of what jdk7 or icedtea (disregarding > openjdk import changes) have been seeing. So I do think it is a > significant amount of changes. It would certain help with getting a > better view of how changes relate to each other. > >> However, the >> number is large enough that is would be troublesome for me to reliably >> synthesize changesets. I don't have Martin's process for scripting and >> SCM hackery and one of the limitation of the teamware SCM is that the >> changes are only really tracked on a per-file basis. Published >> truncated teamware histories outside of Sun's firewall for people to >> help cons up changesets might be technically possible, but much of the >> prep work and reviews would have to be done internally and the >> costs/benefits on that portion don't look attractive to me. > > Ah, that is a bummer. I had assumed that the teamware history only > included stuff starting with the public release of openjdk7. Isn't there > any way to "replay" the patches starting at that point and post those? > rcs and cvs also maintain history on a per-file basis, but with some > scripting tricks it is still possible to reconstruct cross-file > changesets from them mostly. If that is impossible, could you start > posting patches to the jdk6-dev when you apply them to your repository? > So the chunks are smaller and can be commented on more timely than when > you do full bxx code drops? > > Thanks, > > Mark > From mschoene at redhat.com Wed Sep 17 10:29:03 2008 From: mschoene at redhat.com (Marc Schoenefeld) Date: Wed, 17 Sep 2008 19:29:03 +0200 Subject: Patch that fixes JVM crash in sun.misc JNI code Message-ID: <48D13E5F.8030006@redhat.com> Hi, the attached patch fixes two JVM crash cases, when calling on sun.misc.MessageUtils.toStderr(null) and sun.misc.MessageUtils.toStdout(null) . It now prompts the string "null" to the console. Cheers Marc -- Marc Schoenefeld / Red Hat Security Response Team -------------- next part -------------- A non-text attachment was scrubbed... Name: java-1.6.0-openjdk-msgutiljninp.patch Type: text/x-patch Size: 522 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080917/be0be991/java-1.6.0-openjdk-msgutiljninp.patch From gnu_andrew at member.fsf.org Wed Sep 17 15:04:19 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Wed, 17 Sep 2008 23:04:19 +0100 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <1221643827.3246.64.camel@dijkstra.wildebeest.org> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> Message-ID: <17c6771e0809171504s5caf3613lc38c51b48c3bd87d@mail.gmail.com> 2008/9/17 Mark Wielaard : > Hi Joe, > > On Tue, 2008-09-16 at 09:37 -0700, Joseph D. Darcy wrote: >> While I'm sympathetic to the request and appreciate the offer of help, >> it is unlikely I'll be able to publish the initial Mercurial >> repositories with any history. The most history that could be published >> dates back to when OpenJDK 6 branched off from the already open sourced >> JDK 7. The total amount of bugs fixed from then until now is on the >> order of 400-500, with somewhat fewer logical changesets. This number >> of changesets is quite small compared to the amount of pre-Mercurial >> history that is not being published externally at all. > > That is actually about half of what jdk7 or icedtea (disregarding > openjdk import changes) have been seeing. So I do think it is a > significant amount of changes. It would certain help with getting a > better view of how changes relate to each other. > >> However, the >> number is large enough that is would be troublesome for me to reliably >> synthesize changesets. I don't have Martin's process for scripting and >> SCM hackery and one of the limitation of the teamware SCM is that the >> changes are only really tracked on a per-file basis. Published >> truncated teamware histories outside of Sun's firewall for people to >> help cons up changesets might be technically possible, but much of the >> prep work and reviews would have to be done internally and the >> costs/benefits on that portion don't look attractive to me. > > Ah, that is a bummer. I had assumed that the teamware history only > included stuff starting with the public release of openjdk7. Isn't there > any way to "replay" the patches starting at that point and post those? > rcs and cvs also maintain history on a per-file basis, but with some > scripting tricks it is still possible to reconstruct cross-file > changesets from them mostly. If that is impossible, could you start > posting patches to the jdk6-dev when you apply them to your repository? > So the chunks are smaller and can be commented on more timely than when > you do full bxx code drops? > > Thanks, > > Mark > > Seconded. If you posted patchsets as things are developed, we could maintain them in our Mercurial repository until such time as a Sun OpenJDK6 one is launched. -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From gnu_andrew at member.fsf.org Wed Sep 17 16:51:55 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Thu, 18 Sep 2008 00:51:55 +0100 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <48D0C79F.1080909@redhat.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> Message-ID: <20080917235155.GA10355@rivendell.middle-earth.co.uk> On 10:02 Wed 17 Sep , Andrew Haley wrote: > C. K. Jester-Young wrote: > > > There is, in fact, a way to do this, at least for the version of ecj > > distributed with Ubuntu 8.04. It just requires supplying the "-1.6" > > command-line option in javac.in. > > Seems reasonable. > > > Otherwise, I'm happy to make the -1.6 option apply only to NIO2 builds, > > and have configure test for -1.6 support when --with-project=nio2. > > Why not simply add a configure test for "-1.6" and if it succeeds use > "-1.6" everywhere? > I was about to suggest the same thing. However, I don't see the immediate advantage as we'd still have to patch the @Override instances for non-1.6 ecjs. Override is a source-level annotation so it doesn't survive to bytecode anyway. > Andrew. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From cky944 at gmail.com Wed Sep 17 18:08:21 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Thu, 18 Sep 2008 13:08:21 +1200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <20080917235155.GA10355@rivendell.middle-earth.co.uk> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> Message-ID: <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> On Thu, Sep 18, 2008 at 12:51:55AM +0100, Andrew John Hughes wrote: > I was about to suggest the same thing. However, I don't see the immediate > advantage as we'd still have to patch the @Override instances for non-1.6 > ecjs. Override is a source-level annotation so it doesn't survive to bytecode > anyway. I guess my question is, how long do we expect to continue supporting pre-1.6 ecjs, given more and more usage of @Override in jdk7? i.e., is the @Override-stripping a stopgap measure, or is this a long-term thing? In the latter case, I'm keen to edit javac.in to do some preprocessing on the source files that are then fed to ecj...then we don't have to write @Override-stripping patches any longer (because making them is a lot of work, especialy if you want to keep @Override annotations that even 1.5 ecjs can work with). With this preprocessing solution, I feel less funny about stripping @Override willy-nilly for files that ecj is about to touch. i.e., in a non-ecj build, the files don't get touched at all. Comments welcome, ---Chris K. From mlists at juma.me.uk Wed Sep 17 19:24:43 2008 From: mlists at juma.me.uk (Ismael Juma) Date: Thu, 18 Sep 2008 02:24:43 +0000 (UTC) Subject: On ecj and @Override annotations for interface methods References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> Message-ID: C. K. Jester-Young writes: > I guess my question is, how long do we expect to continue supporting > pre-1.6 ecjs, given more and more usage of @Override in jdk7? i.e., is > the @Override-stripping a stopgap measure, or is this a long-term thing? To help along, in case people are not aware of the versions involved, here is some information. The bug regarding the change for while using 1.6 target is: https://bugs.eclipse.org/bugs/show_bug.cgi?id=141931 It was part of the 3.2.2 release (3.2.0 was released in June 2006 and the maintenance update 3.2.2 around March 2007). They also recently changed the behaviour for the 1.5 target: https://bugs.eclipse.org/bugs/show_bug.cgi?id=167262 That change was backported to the 3.3 branch, but it seems like it just missed the 3.3.2 release. In other words, it's only available in 3.4.0 in eclipse.org releases. 3.4.0 was released in June 2008. Hope this helps, Ismael From bugzilla-daemon at icedtea.classpath.org Wed Sep 17 23:46:22 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 18 Sep 2008 06:46:22 +0000 Subject: [Bug 183] Build error: Argument list too long Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 ------- Comment #8 from dj at linuxfromscratch.org 2008-09-18 06:46 ------- Full build checks OK. Attempting to build OOo from source, should be a pretty thorough testing of the overall product. :-) OP or other users who have seen this problem please confirm. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From aph at redhat.com Thu Sep 18 02:32:36 2008 From: aph at redhat.com (Andrew Haley) Date: Thu, 18 Sep 2008 10:32:36 +0100 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <20080917235155.GA10355@rivendell.middle-earth.co.uk> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> Message-ID: <48D22034.3030302@redhat.com> Andrew John Hughes wrote: > On 10:02 Wed 17 Sep , Andrew Haley wrote: >> C. K. Jester-Young wrote: >> >>> There is, in fact, a way to do this, at least for the version of ecj >>> distributed with Ubuntu 8.04. It just requires supplying the "-1.6" >>> command-line option in javac.in. >> Seems reasonable. >> >>> Otherwise, I'm happy to make the -1.6 option apply only to NIO2 builds, >>> and have configure test for -1.6 support when --with-project=nio2. >> Why not simply add a configure test for "-1.6" and if it succeeds use >> "-1.6" everywhere? > > I was about to suggest the same thing. However, I don't see the immediate > advantage as we'd still have to patch the @Override instances for non-1.6 > ecjs. Override is a source-level annotation so it doesn't survive to bytecode > anyway. That makes good sense to me. However, how common are these ecjs that don't do Java 1.6? I don't have the information. Andrew. From gnu_andrew at member.fsf.org Thu Sep 18 03:28:27 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Thu, 18 Sep 2008 11:28:27 +0100 Subject: On ecj and @Override annotations for interface methods In-Reply-To: References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> Message-ID: <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> 2008/9/18 Ismael Juma : > C. K. Jester-Young writes: >> I guess my question is, how long do we expect to continue supporting >> pre-1.6 ecjs, given more and more usage of @Override in jdk7? i.e., is >> the @Override-stripping a stopgap measure, or is this a long-term thing? > > To help along, in case people are not aware of the versions involved, here is > some information. > > The bug regarding the change for while using 1.6 target is: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=141931 > > It was part of the 3.2.2 release (3.2.0 was released in June 2006 and the > maintenance update 3.2.2 around March 2007). > > They also recently changed the behaviour for the 1.5 target: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=167262 > > That change was backported to the 3.3 branch, but it seems like it just missed > the 3.3.2 release. In other words, it's only available in 3.4.0 in eclipse.org > releases. 3.4.0 was released in June 2008. > > Hope this helps, > Ismael > > Yes, it does help. I was aware of the history of the change as you list it for 1.5 (and thus the conclusion that it being in 3.4 was far too late). I didn't realise support was there for the 1.6 target as early as 3.2.2. This might make it acceptable to just switch. Does anyone recall why we stopped using 1.6, other than, as a target, it gives little benefits? Lillian made this commit: 2008-05-20 Lillian Angel * Makefile.am: Updated JAVAC calls so ecj wrapper script is used. * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. * javac.in: Updated to use source 1.6 instead of 1.5. which I don't know the reasoning behind (it also changed the behaviour so that javac.in was always used in ecj builds, slowing things down if the system ecj was native). mjw then reverted us back to 1.5: 2008-05-25 Mark Wielaard * Makefile.am: Use -source 1.5 whenever possible. * Makefile.in: Regenerated. * javac.in: Use -1.5. Debian stable's version would be too old (3.2.1) but we don't support this fully anyway, and stable will soon change to lenny, which I presume will have a newer version. -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From mark at klomp.org Thu Sep 18 03:54:03 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 18 Sep 2008 12:54:03 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> Message-ID: <1221735243.3256.14.camel@dijkstra.wildebeest.org> Hi Andrew, On Thu, 2008-09-18 at 11:28 +0100, Andrew John Hughes wrote: > Does anyone recall why we stopped using 1.6, other than, as a target, it gives > little benefits? Lillian made this commit: > > 2008-05-20 Lillian Angel > > * Makefile.am: Updated JAVAC calls so ecj wrapper script is used. > * Makefile.in: Regenerated. > * aclocal.m4: Likewise. > * configure: Likewise. > * javac.in: Updated to use source 1.6 instead of 1.5. > > which I don't know the reasoning behind (it also changed the behaviour so > that javac.in was always used in ecj builds, slowing things down if the > system ecj was native). mjw then reverted us back to 1.5: > > 2008-05-25 Mark Wielaard > > * Makefile.am: Use -source 1.5 whenever possible. > * Makefile.in: Regenerated. > * javac.in: Use -1.5. > > Debian stable's version would be too old (3.2.1) but we don't support this > fully anyway, and stable will soon change to lenny, which I presume > will have a newer version. See: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2008-May/001990.html Change was indeed made to keep bootstrapping on "older" platforms working. Another issue is that although -target 1.6 looks like it is supported by the free VMs, because they just ignore the bigger major number, there is no public documentation about the class file format changes. So the compiler might actually generate 1.6 class files that aren't supported, but we cannot know since the changes aren't publicly documented (we now of course have the sources, so we could inspect what is being generated, but as far as I know nobody did that yet). Cheers, Mark From gnu_andrew at member.fsf.org Thu Sep 18 04:26:18 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Thu, 18 Sep 2008 12:26:18 +0100 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <1221735243.3256.14.camel@dijkstra.wildebeest.org> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> Message-ID: <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> 2008/9/18 Mark Wielaard : > Hi Andrew, > > On Thu, 2008-09-18 at 11:28 +0100, Andrew John Hughes wrote: >> Does anyone recall why we stopped using 1.6, other than, as a target, it gives >> little benefits? Lillian made this commit: >> >> 2008-05-20 Lillian Angel >> >> * Makefile.am: Updated JAVAC calls so ecj wrapper script is used. >> * Makefile.in: Regenerated. >> * aclocal.m4: Likewise. >> * configure: Likewise. >> * javac.in: Updated to use source 1.6 instead of 1.5. >> >> which I don't know the reasoning behind (it also changed the behaviour so >> that javac.in was always used in ecj builds, slowing things down if the >> system ecj was native). mjw then reverted us back to 1.5: >> >> 2008-05-25 Mark Wielaard >> >> * Makefile.am: Use -source 1.5 whenever possible. >> * Makefile.in: Regenerated. >> * javac.in: Use -1.5. >> >> Debian stable's version would be too old (3.2.1) but we don't support this >> fully anyway, and stable will soon change to lenny, which I presume >> will have a newer version. > > See: > http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2008-May/001990.html > > Change was indeed made to keep bootstrapping on "older" platforms > working. > > Another issue is that although -target 1.6 looks like it is supported by > the free VMs, because they just ignore the bigger major number, there is > no public documentation about the class file format changes. So the > compiler might actually generate 1.6 class files that aren't supported, > but we cannot know since the changes aren't publicly documented (we now > of course have the sources, so we could inspect what is being generated, > but as far as I know nobody did that yet). > > Cheers, > > Mark > > Would -source 1.6 -target 1.5 solve both issues? -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From cky944 at gmail.com Thu Sep 18 04:33:16 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Thu, 18 Sep 2008 23:33:16 +1200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> Message-ID: <20080918113316.GE10250@bamboo.destinee.acro.gen.nz> On Thu, Sep 18, 2008 at 12:26:18PM +0100, Andrew John Hughes wrote: > Would -source 1.6 -target 1.5 solve both issues? That is not allowed by ecj. In fact, some of the ant build scripts use -target 5. (As an aside: for my own testing purposes, I have a specially hacked javac.in (based on the Perl version I posted---I'll send a bugfix for it soon) that can override -target 6 and -source 1.6 no matter what the build scripts say. :-P) Cheers, ---Chris K. From mark at klomp.org Thu Sep 18 04:33:27 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 18 Sep 2008 13:33:27 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> Message-ID: <1221737607.3256.22.camel@dijkstra.wildebeest.org> Hi Andrew, On Thu, 2008-09-18 at 12:26 +0100, Andrew John Hughes wrote: > Would -source 1.6 -target 1.5 solve both issues? There is no -source 1.6 option, there were no language changes between 1.5 and 1.6, only target changes. (Although -source 1.5 will trigger -target 1.5, which is why it makes a difference compared to not giving any -source option.) Cheers, Mark From cky944 at gmail.com Thu Sep 18 04:34:58 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Thu, 18 Sep 2008 23:34:58 +1200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <20080918113316.GE10250@bamboo.destinee.acro.gen.nz> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <20080918113316.GE10250@bamboo.destinee.acro.gen.nz> Message-ID: <20080918113458.GF10250@bamboo.destinee.acro.gen.nz> On Thu, Sep 18, 2008 at 11:33:16PM +1200, C. K. Jester-Young wrote: > That is not allowed by ecj. In fact, some of the ant build scripts > use -target 5. And when that is coupled with -source 1.6, then the build breaks, is what I meant to add. (And hence the need for my custom hacked-up javac.in.) (Sorry I didn't explain myself very well in the last message. :-P) Cheers, ---Chris K. From cky944 at gmail.com Thu Sep 18 04:37:22 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Thu, 18 Sep 2008 23:37:22 +1200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <1221737607.3256.22.camel@dijkstra.wildebeest.org> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> Message-ID: <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> On Thu, Sep 18, 2008 at 01:33:27PM +0200, Mark Wielaard wrote: > There is no -source 1.6 option, there were no language changes between > 1.5 and 1.6, only target changes. (Although -source 1.5 will trigger > -target 1.5, which is why it makes a difference compared to not giving > any -source option.) There is, for the ecj that comes with Ubuntu 8.04 ("Eclipse Java Compiler v_774_R33x, 3.3.1"). It makes a difference between whether @Override annotations are accepted for interface methods; in fact, that's why I started this thread in the first place. :-) Cheers, ---Chris K. From gnu_andrew at member.fsf.org Thu Sep 18 04:39:14 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Thu, 18 Sep 2008 12:39:14 +0100 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> Message-ID: <17c6771e0809180439g7c6d2d10k270d2a1a5408ea4@mail.gmail.com> 2008/9/18 C. K. Jester-Young : > On Thu, Sep 18, 2008 at 01:33:27PM +0200, Mark Wielaard wrote: >> There is no -source 1.6 option, there were no language changes between >> 1.5 and 1.6, only target changes. (Although -source 1.5 will trigger >> -target 1.5, which is why it makes a difference compared to not giving >> any -source option.) > > There is, for the ecj that comes with Ubuntu 8.04 ("Eclipse Java > Compiler v_774_R33x, 3.3.1"). It makes a difference between whether > @Override annotations are accepted for interface methods; in fact, > that's why I started this thread in the first place. :-) > > Cheers, > ---Chris K. > That's what I thought, but if it can't be used with a target of 1.5, then we need to just strip these things in javac.in as you suggested. -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From mark at klomp.org Thu Sep 18 04:41:24 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 18 Sep 2008 13:41:24 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> Message-ID: <1221738084.3256.24.camel@dijkstra.wildebeest.org> On Thu, 2008-09-18 at 23:37 +1200, C. K. Jester-Young wrote: > On Thu, Sep 18, 2008 at 01:33:27PM +0200, Mark Wielaard wrote: > > There is no -source 1.6 option, there were no language changes between > > 1.5 and 1.6, only target changes. (Although -source 1.5 will trigger > > -target 1.5, which is why it makes a difference compared to not giving > > any -source option.) > > There is, for the ecj that comes with Ubuntu 8.04 ("Eclipse Java > Compiler v_774_R33x, 3.3.1"). It makes a difference between whether > @Override annotations are accepted for interface methods; in fact, > that's why I started this thread in the first place. :-) O, that is super confusing, since openjdk javac explicitly says -source 1.6 is not a valid option. hmmm. Cheers, Mark From cky944 at gmail.com Thu Sep 18 04:43:02 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Thu, 18 Sep 2008 23:43:02 +1200 Subject: New and (hopefully) improved javac.in In-Reply-To: <20080917110506.GC10250@bamboo.destinee.acro.gen.nz> References: <20080917110506.GC10250@bamboo.destinee.acro.gen.nz> Message-ID: <20080918114302.GH10250@bamboo.destinee.acro.gen.nz> On Wed, Sep 17, 2008 at 11:05:06PM +1200, C. K. Jester-Young wrote: > I have thus written a new javac wrapper script. It uses Perl, rather > than shell, because I figured this to be more portable than relying on > a shell with proper array support (read: different versions of bash > differed on how arrays are supported). And without arrays, keeping empty > arguments intact would be very difficult. I've since found a bug with my javac.in script. I'm posting a new version here (the -Werror stripping now works correctly, and I've also added a -target dup check); feel free to test it and send feedback. (I will say with honesty that I haven't completed a full build with this script yet, so there may be further issues I haven't yet found.) Cheers, ---Chris K. -------------- next part -------------- A non-text attachment was scrubbed... Name: javac.in Type: text/x-perl Size: 973 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080918/7a8347ae/javac.in From cky944 at gmail.com Thu Sep 18 04:46:16 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Thu, 18 Sep 2008 23:46:16 +1200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <17c6771e0809180439g7c6d2d10k270d2a1a5408ea4@mail.gmail.com> References: <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180439g7c6d2d10k270d2a1a5408ea4@mail.gmail.com> Message-ID: <20080918114616.GI10250@bamboo.destinee.acro.gen.nz> On Thu, Sep 18, 2008 at 12:39:14PM +0100, Andrew John Hughes wrote: > That's what I thought, but if it can't be used with a target of 1.5, then > we need to just strip these things in javac.in as you suggested. Yeah, I'm starting to be convinced that that's the proper course of action. Between not being able to mix-and-match -source and -target, and Mark's message about OpenJDK not accepting -source 1.6, I think it's all too much of a mess. :-P Okay. I'll get cracking on a preprocessor for ecj. Initially it'll just strip @Override, but I'm sure it can be made to handle other ecj quirks that may become apparent, too. :-) Cheers, ---Chris K. From mark at klomp.org Thu Sep 18 05:03:20 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 18 Sep 2008 14:03:20 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <1221738084.3256.24.camel@dijkstra.wildebeest.org> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <1221738084.3256.24.camel@dijkstra.wildebeest.org> Message-ID: <1221739400.3256.34.camel@dijkstra.wildebeest.org> On Thu, 2008-09-18 at 13:41 +0200, Mark Wielaard wrote: > On Thu, 2008-09-18 at 23:37 +1200, C. K. Jester-Young wrote: > > On Thu, Sep 18, 2008 at 01:33:27PM +0200, Mark Wielaard wrote: > > > There is no -source 1.6 option, there were no language changes between > > > 1.5 and 1.6, only target changes. (Although -source 1.5 will trigger > > > -target 1.5, which is why it makes a difference compared to not giving > > > any -source option.) > > > > There is, for the ecj that comes with Ubuntu 8.04 ("Eclipse Java > > Compiler v_774_R33x, 3.3.1"). It makes a difference between whether > > @Override annotations are accepted for interface methods; in fact, > > that's why I started this thread in the first place. :-) > > O, that is super confusing, since openjdk javac explicitly says -source > 1.6 is not a valid option. hmmm. OK, I checked, and it seems openjdk6 javac, actually does accept -source 1.6, this will trigger -target 1.6 though (which I don't think is a good thing for bootstrapping against other free VMs). javac documentation however explicitly says: -source release Specifies the version of source code accepted. The following values for release are allowed: 1.3 The compiler does not support assertions, generics, or other language features introduced after JDK 1.3. 1.4 The compiler accepts code containing assertions, which were introduced in JDK 1.4. 1.5 The compiler accepts code containing generics and other language features introduced in JDK 5. This is the default. 5 Synonym for 1.5 Note: No language changes were introduced in JDK 6, so the values 1.6 and 6 are not valid. Also you cannot combine -source 1.6 and -target 1.5: javac: source release 1.6 requires target release 1.6 I don't know a good way out of this mess. Maybe for icedtea1.7 we should just require a compiler and runtime that supports both -source and -target 1.6, but keep icedtea6 on 1.5 to ease bootstrapping with existing (older) free platforms. This however doesn't help with our problem that there apparently isn't any public documentation on all this (neither the source language changes, not the target byte code changes). Luckily we do now have the sources though. Cheers, Mark From gnu_andrew at member.fsf.org Thu Sep 18 05:05:32 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Thu, 18 Sep 2008 13:05:32 +0100 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <20080918114616.GI10250@bamboo.destinee.acro.gen.nz> References: <48D0C79F.1080909@redhat.com> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180439g7c6d2d10k270d2a1a5408ea4@mail.gmail.com> <20080918114616.GI10250@bamboo.destinee.acro.gen.nz> Message-ID: <17c6771e0809180505m20892a03j851ba8bf17a1b864@mail.gmail.com> 2008/9/18 C. K. Jester-Young : > On Thu, Sep 18, 2008 at 12:39:14PM +0100, Andrew John Hughes wrote: >> That's what I thought, but if it can't be used with a target of 1.5, then >> we need to just strip these things in javac.in as you suggested. > > Yeah, I'm starting to be convinced that that's the proper course of > action. Between not being able to mix-and-match -source and -target, > and Mark's message about OpenJDK not accepting -source 1.6, I think > it's all too much of a mess. :-P > > Okay. I'll get cracking on a preprocessor for ecj. Initially it'll > just strip @Override, but I'm sure it can be made to handle other ecj > quirks that may become apparent, too. :-) > > Cheers, > ---Chris K. > find -name '*.java' -exec sed -i 's#@Override##g' '{}' ';' or something along those lines. -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From aph at redhat.com Thu Sep 18 05:11:08 2008 From: aph at redhat.com (Andrew Haley) Date: Thu, 18 Sep 2008 13:11:08 +0100 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <17c6771e0809180505m20892a03j851ba8bf17a1b864@mail.gmail.com> References: <48D0C79F.1080909@redhat.com> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180439g7c6d2d10k270d2a1a5408ea4@mail.gmail.com> <20080918114616.GI10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180505m20892a03j851ba8bf17a1b864@mail.gmail.com> Message-ID: <48D2455C.9040506@redhat.com> Andrew John Hughes wrote: > find -name '*.java' -exec sed -i 's#@Override##g' '{}' ';' > > or something along those lines. Yes. This is the only route that makes any sense. Andrew. From Joe.Darcy at Sun.COM Thu Sep 18 05:57:14 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Thu, 18 Sep 2008 05:57:14 -0700 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <48D13DAE.9030009@sun.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> <48D13DAE.9030009@sun.com> Message-ID: <48D2502A.7020001@sun.com> Kelly O'Hair wrote: > Speaking from experience, any attempts at cleanly creating changesets > from TeamWare data alone is a waste of time. Just doesn't work well. > Granted we have pretty complete OpenJDK6 changeset data (data beyond > the TeamWare data) and could potentially do this, it's quite a bit of > grunt work to accomplish. Before we go off on this kind of adventure > we need to make sure the time spent is worth it. > A different approach would be to create changesets per build/promotion, > but those kind of large changesets can have limited usefulness. > > I'll try and talk to Joe about this tomorrow. > > Also, don't forget that the OpenJDK7 sources are a Mercurial forest, > not just one repository. I assume that we want to mimic the same > forest layout, keeping the langtools, corba, jaxp, jaxws, and hotspot > sources in their own repositories, separate from the core 'jdk' > repository. > That allows us to do some plug and play with these repositories > between OpenJDK6 and OpenJDK7. > > -kto Yes, my thinking has been to mirror the overall JDK 7 repository forest structure in OpenJDK 6. -Joe From Joe.Darcy at Sun.COM Thu Sep 18 07:03:15 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Thu, 18 Sep 2008 07:03:15 -0700 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <1221735243.3256.14.camel@dijkstra.wildebeest.org> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> Message-ID: <48D25FA3.1010101@sun.com> Mark Wielaard wrote: > Hi Andrew, > > On Thu, 2008-09-18 at 11:28 +0100, Andrew John Hughes wrote: > >> Does anyone recall why we stopped using 1.6, other than, as a target, it gives >> little benefits? Lillian made this commit: >> >> 2008-05-20 Lillian Angel >> >> * Makefile.am: Updated JAVAC calls so ecj wrapper script is used. >> * Makefile.in: Regenerated. >> * aclocal.m4: Likewise. >> * configure: Likewise. >> * javac.in: Updated to use source 1.6 instead of 1.5. >> >> which I don't know the reasoning behind (it also changed the behaviour so >> that javac.in was always used in ecj builds, slowing things down if the >> system ecj was native). mjw then reverted us back to 1.5: >> >> 2008-05-25 Mark Wielaard >> >> * Makefile.am: Use -source 1.5 whenever possible. >> * Makefile.in: Regenerated. >> * javac.in: Use -1.5. >> >> Debian stable's version would be too old (3.2.1) but we don't support this >> fully anyway, and stable will soon change to lenny, which I presume >> will have a newer version. >> > > See: > http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2008-May/001990.html > > Change was indeed made to keep bootstrapping on "older" platforms > working. > > Another issue is that although -target 1.6 looks like it is supported by > the free VMs, because they just ignore the bigger major number, there is > no public documentation about the class file format changes. The class file format changes for JDK 6 are documented in JSR 202, "Java(TM) Class File Specification Update": http://www.jcp.org/en/jsr/detail?id=202 -Joe From Joe.Darcy at Sun.COM Thu Sep 18 07:11:07 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Thu, 18 Sep 2008 07:11:07 -0700 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <20080918114616.GI10250@bamboo.destinee.acro.gen.nz> References: <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180439g7c6d2d10k270d2a1a5408ea4@mail.gmail.com> <20080918114616.GI10250@bamboo.destinee.acro.gen.nz> Message-ID: <48D2617B.1010504@sun.com> C. K. Jester-Young wrote: > On Thu, Sep 18, 2008 at 12:39:14PM +0100, Andrew John Hughes wrote: > >> That's what I thought, but if it can't be used with a target of 1.5, then >> we need to just strip these things in javac.in as you suggested. >> > > Yeah, I'm starting to be convinced that that's the proper course of > action. Between not being able to mix-and-match -source and -target, > and Mark's message about OpenJDK not accepting -source 1.6, I think > it's all too much of a mess. :-P > OpenJDK 6 (and Sun's "ClosedJDK" 6 releases) certainly do accept "-source 1.6" and "-source 6" options: http://java.sun.com/javase/6/docs/technotes/tools/solaris/javac.html (In javac, there is another small behavioral difference with source 1.6 vs 1.5 too; encoding errors in files are treated as errors instead of warnings.) -Joe From Joe.Darcy at Sun.COM Thu Sep 18 07:21:49 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Thu, 18 Sep 2008 07:21:49 -0700 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <1221739400.3256.34.camel@dijkstra.wildebeest.org> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <1221738084.3256.24.camel@dijkstra.wildebeest.org> <1221739400.3256.34.camel@dijkstra.wildebeest.org> Message-ID: <48D263FD.1080702@sun.com> Mark Wielaard wrote: > On Thu, 2008-09-18 at 13:41 +0200, Mark Wielaard wrote: > >> On Thu, 2008-09-18 at 23:37 +1200, C. K. Jester-Young wrote: >> >>> On Thu, Sep 18, 2008 at 01:33:27PM +0200, Mark Wielaard wrote: >>> >>>> There is no -source 1.6 option, there were no language changes between >>>> 1.5 and 1.6, only target changes. (Although -source 1.5 will trigger >>>> -target 1.5, which is why it makes a difference compared to not giving >>>> any -source option.) >>>> >>> There is, for the ecj that comes with Ubuntu 8.04 ("Eclipse Java >>> Compiler v_774_R33x, 3.3.1"). It makes a difference between whether >>> @Override annotations are accepted for interface methods; in fact, >>> that's why I started this thread in the first place. :-) >>> >> O, that is super confusing, since openjdk javac explicitly says -source >> 1.6 is not a valid option. hmmm. >> > > OK, I checked, and it seems openjdk6 javac, actually does accept -source > 1.6, this will trigger -target 1.6 though (which I don't think is a good > thing for bootstrapping against other free VMs). javac documentation > however explicitly says: > > -source release > Specifies the version of source code accepted. The following > values for release are allowed: > > 1.3 > The compiler does not support assertions, generics, or > other language features introduced after JDK 1.3. > > 1.4 > The compiler accepts code containing assertions, which were > introduced in JDK 1.4. > > 1.5 > The compiler accepts code containing generics and other > language features introduced in JDK 5. This is the default. > > 5 Synonym for 1.5 > > Note: No language changes were introduced in JDK 6, so the values > 1.6 and 6 are not valid. > Where are you seeing this documented? The information is not correct and other sources give the correct information: http://java.sun.com/javase/6/docs/technotes/tools/solaris/javac.html > Also you cannot combine -source 1.6 and -target 1.5: > javac: source release 1.6 requires target release 1.6 > > I don't know a good way out of this mess. Maybe for icedtea1.7 we should > just require a compiler and runtime that supports both -source and > -target 1.6, but keep icedtea6 on 1.5 to ease bootstrapping with > existing (older) free platforms. > > This however doesn't help with our problem that there apparently isn't > any public documentation on all this (neither the source language > changes, not the target byte code changes). Luckily we do now have the > sources though. > Compared to 1.5 the only "language change" in 1.6 is to allow @Override on methods from interfaces: http://blogs.sun.com/ahe/entry/override http://blogs.sun.com/ahe/entry/override_snafu In javac, 1.6 triggers rejecting files with encoding errors. -Joe From mark at klomp.org Thu Sep 18 07:27:03 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 18 Sep 2008 16:27:03 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <48D25FA3.1010101@sun.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <48D25FA3.1010101@sun.com> Message-ID: <1221748023.3256.55.camel@dijkstra.wildebeest.org> Hi Joe, On Thu, 2008-09-18 at 07:03 -0700, Joseph D. Darcy wrote: > The class file format changes for JDK 6 are documented in JSR 202, > "Java(TM) Class File Specification Update": > http://www.jcp.org/en/jsr/detail?id=202 Thanks, but those documents don't seem to be public. Are they also publicly available without the non-free license click-through? I am particularly concerned about clauses 2 (a-c) and how they would restrict my ability to distribute alternative implementations. Also clause 5 seems to conflict with using it together with OpenJDK, which seems to be explicitly excluded to be used as base for implementing of this JSR. It seems that accepting the terms for reading this specification takes away my rights of publishing an independent or openjdk based implementation under the GPL, when the implementation is not within the scope of section 2 (a-c). Cheers, Mark From mark at klomp.org Thu Sep 18 07:35:18 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 18 Sep 2008 16:35:18 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <48D263FD.1080702@sun.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <1221738084.3256.24.camel@dijkstra.wildebeest.org> <1221739400.3256.34.camel@dijkstra.wildebeest.org> <48D263FD.1080702@sun.com> Message-ID: <1221748518.3256.59.camel@dijkstra.wildebeest.org> Hi Joe, On Thu, 2008-09-18 at 07:21 -0700, Joseph D. Darcy wrote: > > Note: No language changes were introduced in JDK 6, so the values > > 1.6 and 6 are not valid. > > > > Where are you seeing this documented? The information is not correct > and other sources give the correct information: > http://java.sun.com/javase/6/docs/technotes/tools/solaris/javac.html It is from the javac manual page in: openjdk6/jdk/src/linux/doc/man/javac.1 which seems to be a copy of the one in: openjdk6/jdk/src/solaris/doc/sun/man/man1/javac.1 Cheers, Mark From langel at redhat.com Thu Sep 18 08:23:24 2008 From: langel at redhat.com (Lillian Angel) Date: Thu, 18 Sep 2008 11:23:24 -0400 Subject: Patch that fixes JVM crash in sun.misc JNI code In-Reply-To: <48D13E5F.8030006@redhat.com> References: <48D13E5F.8030006@redhat.com> Message-ID: <48D2726C.6000605@redhat.com> Marc Schoenefeld wrote: > Hi, > > the attached patch fixes two JVM crash cases, when > calling on sun.misc.MessageUtils.toStderr(null) and > sun.misc.MessageUtils.toStdout(null) . It now prompts > the string "null" to the console. Thanks for this. I will commit it. Lillian From langel at redhat.com Thu Sep 18 08:32:05 2008 From: langel at redhat.com (Lillian Angel) Date: Thu, 18 Sep 2008 15:32:05 +0000 Subject: changeset in /hg/icedtea6: 2008-09-18 Lillian Angel changeset 8e3089767a4a in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=8e3089767a4a description: 2008-09-18 Lillian Angel * AUTHORS: Added Marc Schoenefeld. 2008-09-18 Marc Schoenefeld * patches/icedtea-messageutils.patch: New patch fixes JVM crashes when calling on sun.misc.MessageUtils.toStderr(null) and sun.misc.MessageUtils.toStdout(null) . It now prompts the string "null" to the console. * Makefile.am: Added patch above. diffstat: 4 files changed, 28 insertions(+), 2 deletions(-) AUTHORS | 1 + ChangeLog | 14 +++++++++++++- Makefile.am | 3 ++- patches/icedtea-messageutils.patch | 12 ++++++++++++ diffs (61 lines): diff -r 1c7da2861925 -r 8e3089767a4a AUTHORS --- a/AUTHORS Mon Sep 15 17:21:14 2008 -0400 +++ b/AUTHORS Thu Sep 18 11:31:59 2008 -0400 @@ -15,6 +15,7 @@ Dan Munckton Dan Munckton Raif Naffah Bernhard Rosenkr??nzer +Marc Schoenefeld Keith Seitz Joshua Sumali Christian Thalinger diff -r 1c7da2861925 -r 8e3089767a4a ChangeLog --- a/ChangeLog Mon Sep 15 17:21:14 2008 -0400 +++ b/ChangeLog Thu Sep 18 11:31:59 2008 -0400 @@ -1,4 +1,16 @@ 2008-08-26 Deepak Bhole +2008-09-18 Lillian Angel + + * AUTHORS: Added Marc Schoenefeld. + +2008-09-18 Marc Schoenefeld + + * patches/icedtea-messageutils.patch: New patch fixes JVM crashes + when calling on sun.misc.MessageUtils.toStderr(null) and + sun.misc.MessageUtils.toStdout(null) . It now prompts + the string "null" to the console. + * Makefile.am: Added patch above. + +2008-09-16 Deepak Bhole * IcedTeaPlugin.cc: Allow access to applet classloader from JS on that site. Fix right-click lag by temporarily disabling status messages. diff -r 1c7da2861925 -r 8e3089767a4a Makefile.am --- a/Makefile.am Mon Sep 15 17:21:14 2008 -0400 +++ b/Makefile.am Thu Sep 18 11:31:59 2008 -0400 @@ -499,7 +499,8 @@ ICEDTEA_PATCHES = \ $(SHARK_PATCH) \ $(GCC_PATCH) \ patches/icedtea-arch.patch \ - patches/icedtea-lc_ctype.patch + patches/icedtea-lc_ctype.patch \ + patches/icedtea-messageutils.patch if WITH_RHINO ICEDTEA_PATCHES += \ diff -r 1c7da2861925 -r 8e3089767a4a patches/icedtea-messageutils.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/icedtea-messageutils.patch Thu Sep 18 11:31:59 2008 -0400 @@ -0,0 +1,12 @@ +--- openjdk/jdk/src/share/native/sun/misc/MessageUtils.c.orig 2008-09-17 15:17:02.000000000 +0200 ++++ openjdk/jdk/src/share/native/sun/misc/MessageUtils.c 2008-09-17 15:56:07.000000000 +0200 +@@ -39,6 +39,9 @@ printToFile(JNIEnv *env, jstring s, FILE + int i; + const jchar *sAsArray; + ++ if (s == NULL) { ++ s = (*env)->NewStringUTF(env, "null\0"); ++ } + sAsArray = (*env)->GetStringChars(env, s, NULL); + length = (*env)->GetStringLength(env, s); + sConverted = (char *) malloc(length + 1); From omajid at redhat.com Thu Sep 18 08:40:51 2008 From: omajid at redhat.com (Omair Majid) Date: Thu, 18 Sep 2008 15:40:51 +0000 Subject: changeset in /hg/pulseaudio: 2009-09-18 Omair Majid changeset fe9c2599d07d in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=fe9c2599d07d description: 2009-09-18 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/Stream.java (native_pa_stream_is_corked): New function. (isCorked): Likewise. * src/native/org_classpath_icedtea_pulseaudio_Stream.c (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1is_1corked): Likewise. Checks if the stream has been corked. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java (testStartNotificationOnCork): Major fixes. Renamed to testStartAndStopEventsOnCork. (testStartAndStopEventsOnCork): New function. Test START and STOP events on corking/uncorking a stream (ThreadWriter): New class. Writes data to a stream while running in a separate thread. diffstat: 3 files changed, 124 insertions(+), 54 deletions(-) src/java/org/classpath/icedtea/pulseaudio/Stream.java | 11 src/native/org_classpath_icedtea_pulseaudio_Stream.c | 13 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java | 154 ++++++---- diffs (251 lines): diff -r 3c5c586cf5f3 -r fe9c2599d07d src/java/org/classpath/icedtea/pulseaudio/Stream.java --- a/src/java/org/classpath/icedtea/pulseaudio/Stream.java Tue Sep 16 14:05:45 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Stream.java Thu Sep 18 11:37:51 2008 -0400 @@ -176,6 +176,8 @@ public class Stream { * structure update for a stream. */ + private native int native_pa_stream_is_corked(); + private native byte[] native_pa_stream_cork(int b); private native byte[] native_pa_stream_flush(); @@ -629,6 +631,15 @@ public class Stream { } } + + public boolean isCorked() { + int corked = native_pa_stream_is_corked(); + if (corked < 0) { + throw new IllegalStateException("Unable to determine state"); + } + return corked == 0 ? false : true; + } + /** * Pause (or resume) playback of this stream temporarily. * diff -r 3c5c586cf5f3 -r fe9c2599d07d src/native/org_classpath_icedtea_pulseaudio_Stream.c --- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c Tue Sep 16 14:05:45 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c Thu Sep 18 11:37:51 2008 -0400 @@ -603,12 +603,23 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl return convertNativePointerToJava(env, operation); } +/* + * Class: org_classpath_icedtea_pulseaudio_Stream + * Method: native_pa_stream_is_corked + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1is_1corked +(JNIEnv* env, jobject obj) { + pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + assert(stream); + return pa_stream_is_corked(stream); +} + static void cork_callback(pa_stream* stream, int success, void* userdata) { assert(success); JNIEnv* env = pulse_thread_env; assert(env); notifyWaitingOperations(env); - } /* diff -r 3c5c586cf5f3 -r fe9c2599d07d unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java Tue Sep 16 14:05:45 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java Thu Sep 18 11:37:51 2008 -0400 @@ -69,6 +69,56 @@ public class PulseAudioSourceDataLineRaw AudioFormat aSupportedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); + class ThreadWriter extends Thread { + PulseAudioSourceDataLine line; + AudioInputStream stream; + + public ThreadWriter(AudioInputStream stream, + PulseAudioSourceDataLine line) throws LineUnavailableException { + + this.line = line; + this.stream = stream; + + if (line.isOpen()) { + line.close(); + } + + } + + @Override + public void run() { + try { + AudioFormat audioFormat = stream.getFormat(); + + line.open(audioFormat); + + byte[] abData = new byte[1000]; + int bytesRead = 0; + + line.start(); + + while (bytesRead >= 0) { + bytesRead = stream.read(abData, 0, abData.length); + // System.out.println("read data"); + if (bytesRead > 0) { + System.out.println("about to write data"); + line.write(abData, 0, bytesRead); + // System.out.println("wrote data"); + } + } + + line.drain(); + line.close(); + + } catch (LineUnavailableException e) { + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + @Before public void setUp() throws LineUnavailableException { @@ -84,11 +134,13 @@ public class PulseAudioSourceDataLineRaw } - // FIXME this test is BROKEN! - @Test - public void testStartNotificationOnCork() + @Test + public void testStartAndStopEventsOnCork() throws UnsupportedAudioFileException, IOException, - LineUnavailableException { + LineUnavailableException, InterruptedException { + + System.out + .println("This test checks if START and STOP notifications appear on corking"); File soundFile = new File("testsounds/startup.wav"); AudioInputStream audioInputStream = AudioSystem @@ -100,17 +152,17 @@ public class PulseAudioSourceDataLineRaw SourceDataLine.class, audioFormat)); Assert.assertNotNull(line); - line.open(audioFormat); - LineListener startStopListener = new LineListener() { @Override public void update(LineEvent event) { if (event.getType() == LineEvent.Type.START) { + System.out.println("START"); started++; } if (event.getType() == LineEvent.Type.STOP) { + System.out.println("STOP"); stopped++; } } @@ -118,53 +170,49 @@ public class PulseAudioSourceDataLineRaw }; line.addLineListener(startStopListener); - - byte[] abData = new byte[1000]; - int bytesRead = 0; - - line.start(); - int count = 0; - - while (bytesRead >= 0) { - bytesRead = audioInputStream.read(abData, 0, abData.length); - if (bytesRead > 0) { - line.write(abData, 0, bytesRead); - count++; - /* - * keep count high. if it is too low, the line wont even start - * playing so stopping is out of the question - */ - if (count == 100) { - Operation o; - synchronized (EventLoop.getEventLoop().threadLock) { - o = line.getStream().cork(); - } - - o.waitForCompletion(); - o.releaseReference(); - - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - synchronized (EventLoop.getEventLoop().threadLock) { - o = line.getStream().unCork(); - } - - o.waitForCompletion(); - o.releaseReference(); - - } - } - } - - line.drain(); - - line.stop(); - line.close(); + System.out.println("Launching threadWriter"); + ThreadWriter writer = new ThreadWriter(audioInputStream, line); + writer.start(); + // System.out.println("started"); + + Thread.sleep(1000); + + // CORK + Operation o; + synchronized (EventLoop.getEventLoop().threadLock) { + o = line.getStream().cork(); + } + + o.waitForCompletion(); + o.releaseReference(); + synchronized (EventLoop.getEventLoop().threadLock) { + System.out.println("corked? " + line.getStream().isCorked()); + assert (line.getStream().isCorked() == true); + } + + System.out.println("corked"); + + Thread.sleep(1000); + + // UNCORK + synchronized (EventLoop.getEventLoop().threadLock) { + o = line.getStream().unCork(); + } + + o.waitForCompletion(); + o.releaseReference(); + + System.out.println("uncorked"); + + synchronized (EventLoop.getEventLoop().threadLock) { + System.out.println("corked? " + line.getStream().isCorked()); + assert (line.getStream().isCorked() == false); + } + + Thread.sleep(1000); + + // System.out.println("waiting for thread to finish"); + writer.join(); Assert.assertEquals(2, started); Assert.assertEquals(2, stopped); From Joe.Darcy at Sun.COM Thu Sep 18 11:55:44 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Thu, 18 Sep 2008 11:55:44 -0700 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <1221748518.3256.59.camel@dijkstra.wildebeest.org> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <1221738084.3256.24.camel@dijkstra.wildebeest.org> <1221739400.3256.34.camel@dijkstra.wildebeest.org> <48D263FD.1080702@sun.com> <1221748518.3256.59.camel@dijkstra.wildebeest.org> Message-ID: <48D2A430.2070903@sun.com> Mark Wielaard wrote: > Hi Joe, > > On Thu, 2008-09-18 at 07:21 -0700, Joseph D. Darcy wrote: > >>> Note: No language changes were introduced in JDK 6, so the values >>> 1.6 and 6 are not valid. >>> >>> >> Where are you seeing this documented? The information is not correct >> and other sources give the correct information: >> http://java.sun.com/javase/6/docs/technotes/tools/solaris/javac.html >> > > It is from the javac manual page in: > openjdk6/jdk/src/linux/doc/man/javac.1 > which seems to be a copy of the one in: > openjdk6/jdk/src/solaris/doc/sun/man/man1/javac.1 > Well that's a problem! I'll talk to Jon about getting it fixed. -Joe From cky944 at gmail.com Thu Sep 18 16:19:11 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Fri, 19 Sep 2008 11:19:11 +1200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <17c6771e0809180505m20892a03j851ba8bf17a1b864@mail.gmail.com> References: <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180439g7c6d2d10k270d2a1a5408ea4@mail.gmail.com> <20080918114616.GI10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180505m20892a03j851ba8bf17a1b864@mail.gmail.com> Message-ID: <20080918231911.GJ10250@bamboo.destinee.acro.gen.nz> On Thu, Sep 18, 2008 at 01:05:32PM +0100, Andrew John Hughes wrote: > find -name '*.java' -exec sed -i 's#@Override##g' '{}' ';' All occurrences of (problematic) @Override I've seen so far come on its own line. This would reduce the risk of stripping @Override out of string literals and other funny places: find . -name '*.java' -exec perl -pi -e 's/^\s*\@Override\s*$//' {} + Or, for people who don't like Perl: find . -name '*.java' -exec sed -i \ 's/^[[:space:]]*@Override[[:space:]]*$//' {} + Or for non-character-class-supporting seds (assuming that \t does expand to a tab; otherwise use an actual tab instead): find . -name '*.java' -exec sed -i 's/^[ \t]*@Override[ \t]*$//' {} + This does, yes, assume -exec ... + works for find (and not all versions of find support it); but it's specified by the Single Unix Specification and has been supported in GNU find since findutils-4.2.12 (according to ChangeLog---January 2005), and makes things a lot faster. Wow, that's a one-liner turned into a 20-odd liner message. :-P Cheers, ---Chris K. From cky944 at gmail.com Thu Sep 18 16:26:32 2008 From: cky944 at gmail.com (C. K. Jester-Young) Date: Fri, 19 Sep 2008 11:26:32 +1200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <20080918231911.GJ10250@bamboo.destinee.acro.gen.nz> References: <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180439g7c6d2d10k270d2a1a5408ea4@mail.gmail.com> <20080918114616.GI10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180505m20892a03j851ba8bf17a1b864@mail.gmail.com> <20080918231911.GJ10250@bamboo.destinee.acro.gen.nz> Message-ID: <20080918232632.GK10250@bamboo.destinee.acro.gen.nz> On Fri, Sep 19, 2008 at 11:19:11AM +1200, C. K. Jester-Young wrote: > All occurrences of (problematic) @Override I've seen so far come on > its own line. This would reduce the risk of stripping @Override out of > string literals and other funny places: On second thoughts, that's not a correct statement. I've seen one-line function definitions that contain @Override at the start of that line too. find . -name '*.java' -exec sed -i 's/^[[:space:]]*@Override//' {} + works if we assume there are no other annotations that start with Override (otherwise stripping out just the @Override will cause syntax error). Regarding the possibility of other such annotations, here's a Perl version: find . -name '*.java' -exec perl -pi -e 's/^\s*\@Override(\s|$)//' {} + Comments welcome, ---Chris K. From Dalibor.Topic at Sun.COM Fri Sep 19 02:57:48 2008 From: Dalibor.Topic at Sun.COM (Dalibor Topic) Date: Fri, 19 Sep 2008 11:57:48 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <1221748023.3256.55.camel@dijkstra.wildebeest.org> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <48D25FA3.1010101@sun.com> <1221748023.3256.55.camel@dijkstra.wildebeest.org> Message-ID: <48D3779C.4090503@sun.com> Mark Wielaard wrote: > Hi Joe, > > On Thu, 2008-09-18 at 07:03 -0700, Joseph D. Darcy wrote: > >> The class file format changes for JDK 6 are documented in JSR 202, >> "Java(TM) Class File Specification Update": >> http://www.jcp.org/en/jsr/detail?id=202 >> > > Thanks, but those documents don't seem to be public. Are they also > publicly available without the non-free license click-through? No, as far as I can tell. cheers, dalibor topic -- ******************************************************************* Dalibor Topic Tel: (+49 40) 23 646 738 Java F/OSS Ambassador AIM: robiladonaim Sun Microsystems GmbH Mobile: (+49 177) 2664 192 Nagelsweg 55 http://openjdk.java.net D-20097 Hamburg mailto:Dalibor.Topic at sun.com Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten Amtsgericht M?nchen: HRB 161028 Gesch?ftsf?hrer: Thomas Schr?der, Wolfgang Engels, Dr. Roland B?mer Vorsitzender des Aufsichtsrates: Martin H?ring From mark at klomp.org Fri Sep 19 03:17:07 2008 From: mark at klomp.org (Mark Wielaard) Date: Fri, 19 Sep 2008 12:17:07 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <48D3779C.4090503@sun.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <48D25FA3.1010101@sun.com> <1221748023.3256.55.camel@dijkstra.wildebeest.org> <48D3779C.4090503@sun.com> Message-ID: <1221819427.3288.2.camel@dijkstra.wildebeest.org> Hi Dalibor, On Fri, 2008-09-19 at 11:57 +0200, Dalibor Topic wrote: > Mark Wielaard wrote: > > On Thu, 2008-09-18 at 07:03 -0700, Joseph D. Darcy wrote: > > > >> The class file format changes for JDK 6 are documented in JSR 202, > >> "Java(TM) Class File Specification Update": > >> http://www.jcp.org/en/jsr/detail?id=202 > >> > > > > Thanks, but those documents don't seem to be public. Are they also > > publicly available without the non-free license click-through? > No, as far as I can tell. Hmmm, that puts us in a somewhat awkward position then. Are there any plans on a resolution to this issue of not having free specification terms? We could reverse engineer the spec from the GPLed code. But that seems not very productive. Thanks, Mark From Dalibor.Topic at Sun.COM Fri Sep 19 03:42:11 2008 From: Dalibor.Topic at Sun.COM (Dalibor Topic) Date: Fri, 19 Sep 2008 12:42:11 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <1221819427.3288.2.camel@dijkstra.wildebeest.org> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <48D25FA3.1010101@sun.com> <1221748023.3256.55.camel@dijkstra.wildebeest.org> <48D3779C.4090503@sun.com> <1221819427.3288.2.camel@dijkstra.wildebeest.org> Message-ID: <48D38203.8040609@sun.com> Mark Wielaard wrote: > Hmmm, that puts us in a somewhat awkward position then. Are there any > plans on a resolution to this issue of not having free specification > terms? > I don't know whether the JCP has a way to retroactively change license terms of published specifications, assuming that's what you are wondering about. cheers, dalibor topic -- ******************************************************************* Dalibor Topic Tel: (+49 40) 23 646 738 Java F/OSS Ambassador AIM: robiladonaim Sun Microsystems GmbH Mobile: (+49 177) 2664 192 Nagelsweg 55 http://openjdk.java.net D-20097 Hamburg mailto:Dalibor.Topic at sun.com Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten Amtsgericht M?nchen: HRB 161028 Gesch?ftsf?hrer: Thomas Schr?der, Wolfgang Engels, Dr. Roland B?mer Vorsitzender des Aufsichtsrates: Martin H?ring From mark at klomp.org Fri Sep 19 03:53:25 2008 From: mark at klomp.org (Mark Wielaard) Date: Fri, 19 Sep 2008 12:53:25 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <48D38203.8040609@sun.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <48D25FA3.1010101@sun.com> <1221748023.3256.55.camel@dijkstra.wildebeest.org> <48D3779C.4090503@sun.com> <1221819427.3288.2.camel@dijkstra.wildebeest.org> <48D38203.8040609@sun.com> Message-ID: <1221821605.3288.10.camel@dijkstra.wildebeest.org> Hi Dalibor, On Fri, 2008-09-19 at 12:42 +0200, Dalibor Topic wrote: > Mark Wielaard wrote: > > Hmmm, that puts us in a somewhat awkward position then. Are there any > > plans on a resolution to this issue of not having free specification > > terms? > > > I don't know whether the JCP has a way to retroactively change license > terms of > published specifications, assuming that's what you are wondering about. What I wondering about is if whether Sun can publish this document under terms that are acceptable to the community, so that getting access to the document doesn't take away any rights of publishing an independent or openjdk based implementation under the GPL without the restrictions on scope that the current terms 2 (a - c) inflict upon us hackers. Thanks, Mark From Dalibor.Topic at Sun.COM Fri Sep 19 04:16:27 2008 From: Dalibor.Topic at Sun.COM (Dalibor Topic) Date: Fri, 19 Sep 2008 13:16:27 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <1221821605.3288.10.camel@dijkstra.wildebeest.org> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <48D25FA3.1010101@sun.com> <1221748023.3256.55.camel@dijkstra.wildebeest.org> <48D3779C.4090503@sun.com> <1221819427.3288.2.camel@dijkstra.wildebeest.org> <48D38203.8040609@sun.com> <1221821605.3288.10.camel@dijkstra.wildebeest.org> Message-ID: <48D38A0B.8070305@sun.com> Mark Wielaard wrote: > What I wondering about is if whether Sun can publish this document under > terms that are acceptable to the community, so that getting access to > the document doesn't take away any rights of publishing an independent > or openjdk based implementation under the GPL without the restrictions > on scope that the current terms 2 (a - c) inflict upon us hackers. I'll do some asking around, thanks for the friendly nudge. cheers, dalibor topic -- ******************************************************************* Dalibor Topic Tel: (+49 40) 23 646 738 Java F/OSS Ambassador AIM: robiladonaim Sun Microsystems GmbH Mobile: (+49 177) 2664 192 Nagelsweg 55 http://openjdk.java.net D-20097 Hamburg mailto:Dalibor.Topic at sun.com Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten Amtsgericht M?nchen: HRB 161028 Gesch?ftsf?hrer: Thomas Schr?der, Wolfgang Engels, Dr. Roland B?mer Vorsitzender des Aufsichtsrates: Martin H?ring From omajid at redhat.com Fri Sep 19 09:57:02 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 19 Sep 2008 16:57:02 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-19 Omair Majid changeset da120992e52b in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=da120992e52b description: 2008-09-19 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (close): Check that the line is open. (drain): Likewise. (flush): Likewise. (getFrameLength): Likewise. (getFramePosition): Likewise. (getLongFramePosition): Likewise. (getMicrosecondPosition): Likewise. (loop): Likewise. (setFramePosition): Likewise. (setLoopPoints): Likewise. (setMicrosecondPosition): Likewise. (start): Likewise. (stop): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java (close): Likewise. (start): Likewise. (stop): Likewise. (getStream): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java (write): Removed the check for isStarted. This function should block if the line hasnt been started. (drain): Check that the line is open. (flush): Likewise. (close): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java (close): Likewise. (open): Check that the line isnt already open. (read): Removed check for line being started before a call to read. (drain): Check that the line is open. (flush): Likewise. (available): Likewise. * unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java (suite): Removed function. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java (suite): Likewise. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java (suite): Likewise. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerProviderTest.java (suite): Likewise. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java (suite): Likewise. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java (testStartAndStopEventsOnCork): Ignore this function in running the junit test. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java (suite): Removed function. (testStartOnClosedLine): New function. (testStopOnClosedLine): Likewise. (testDrainWithoutOpen): Likewise. (testFlushWihtoutOpen): Likewise. (testMixerKnowsAboutOpen2Lines): Likewise. (testMixerKnowsAboutOpen3Lines): Likewise. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java (suite): Removed function. (testDrainWithoutOpen): New function. (testFlush): Likewise. (testFlushWithoutOpen): Likewise. diffstat: 12 files changed, 225 insertions(+), 67 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 50 ++++++ src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 19 ++ src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 23 ++- src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 29 +++ unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java | 6 unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java | 6 unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java | 6 unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerProviderTest.java | 20 -- unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java | 6 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java | 2 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java | 76 +++++++++- unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 49 ++++-- diffs (truncated from 711 to 500 lines): diff -r fe9c2599d07d -r da120992e52b src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Thu Sep 18 11:37:51 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Sep 19 12:56:33 2008 -0400 @@ -187,6 +187,10 @@ public class PulseAudioClip extends Puls @Override public void close() { + if (!isOpen) { + throw new IllegalStateException("line already closed"); + } + try { clipThread.join(); } catch (InterruptedException e) { @@ -202,6 +206,10 @@ public class PulseAudioClip extends Puls @Override public void drain() { + if (!isOpen) { + throw new IllegalStateException("line not open"); + } + Operation operation; synchronized (eventLoop.threadLock) { @@ -215,6 +223,10 @@ public class PulseAudioClip extends Puls @Override public void flush() { + if (!isOpen) { + throw new IllegalStateException("line not open"); + } + Operation operation; synchronized (eventLoop.threadLock) { operation = stream.flush(); @@ -226,16 +238,28 @@ public class PulseAudioClip extends Puls @Override public int getFrameLength() { + if (!isOpen) { + return AudioSystem.NOT_SPECIFIED; + } + return frameCount; } @Override public int getFramePosition() { + if (!isOpen) { + throw new IllegalStateException("Line not open"); + } + return (int) framesSinceOpen; } @Override public long getLongFramePosition() { + if (!isOpen) { + throw new IllegalStateException("Line not open"); + } + synchronized (clipLock) { return framesSinceOpen; } @@ -253,6 +277,10 @@ public class PulseAudioClip extends Puls @Override public long getMicrosecondPosition() { + if (!isOpen) { + throw new IllegalStateException("Line not open"); + } + synchronized (clipLock) { return framesSinceOpen / currentFormat.getFrameSize(); } @@ -260,6 +288,9 @@ public class PulseAudioClip extends Puls @Override public void loop(int count) { + if (!isOpen) { + throw new IllegalStateException("Line not open"); + } System.out.println("Loop " + count + " called"); @@ -346,6 +377,9 @@ public class PulseAudioClip extends Puls @Override public void setFramePosition(int frames) { + if (!isOpen) { + throw new IllegalStateException("Line not open"); + } if (frames > frameCount) { throw new IllegalArgumentException("incorreft frame value"); @@ -359,6 +393,10 @@ public class PulseAudioClip extends Puls @Override public void setLoopPoints(int start, int end) { + if (!isOpen) { + throw new IllegalStateException("Line not open"); + } + if (end == -1) { end = frameCount; } @@ -377,6 +415,10 @@ public class PulseAudioClip extends Puls @Override public void setMicrosecondPosition(long microseconds) { + if (!isOpen) { + throw new IllegalStateException("Line not open"); + } + float frameIndex = microseconds * currentFormat.getFrameRate(); synchronized (clipLock) { currentFrame = (int) frameIndex; @@ -386,6 +428,10 @@ public class PulseAudioClip extends Puls @Override public void start() { + if (!isOpen) { + throw new IllegalStateException("Line not open"); + } + if (isStarted) { throw new IllegalStateException("already started"); } @@ -402,6 +448,10 @@ public class PulseAudioClip extends Puls } public void stop() { + if (!isOpen) { + throw new IllegalStateException("Line not open"); + } + if (!isStarted) { throw new IllegalStateException("not started, so cant stop"); } diff -r fe9c2599d07d -r da120992e52b src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Thu Sep 18 11:37:51 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Sep 19 12:56:33 2008 -0400 @@ -160,7 +160,7 @@ public abstract class PulseAudioDataLine } catch (LineUnavailableException e) { // error connecting to the server! - // FIXME clean up + // FIXME clean up throw e; } this.bufferSize = bufferSize; @@ -191,6 +191,10 @@ public abstract class PulseAudioDataLine } public void close() { + if (!isOpen) { + throw new IllegalStateException( + "Line must be open for close() to work"); + } synchronized (eventLoop.threadLock) { drain(); @@ -208,10 +212,19 @@ public abstract class PulseAudioDataLine } public void start() { + if (!isOpen) { + throw new IllegalStateException( + "Line must be open()ed before it can be start()ed"); + } + isStarted = true; } public void stop() { + if (!isOpen) { + throw new IllegalStateException( + "Line must be open()ed before it can be start()ed"); + } isStarted = false; } @@ -244,6 +257,10 @@ public abstract class PulseAudioDataLine public abstract void drain(); public Stream getStream() { + if (!isOpen) { + throw new IllegalStateException("Line must be open"); + } + return stream; } diff -r fe9c2599d07d -r da120992e52b src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Thu Sep 18 11:37:51 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 19 12:56:33 2008 -0400 @@ -67,6 +67,7 @@ public class PulseAudioSourceDataLine ex this.volume = PulseAudioVolumeControl.MAX_VOLUME; } + @Override public void open(AudioFormat format, int bufferSize) throws LineUnavailableException { @@ -114,13 +115,10 @@ public class PulseAudioSourceDataLine ex @Override public int write(byte[] data, int offset, int length) { - + // can't call write() without open()ing first, but can call write() + // without start()ing if (!isOpen) { throw new IllegalStateException("must call open() before write()"); - } - - if (!isStarted) { - throw new IllegalStateException("must call start() before write()"); } int frameSize = currentFormat.getFrameSize(); @@ -224,6 +222,12 @@ public class PulseAudioSourceDataLine ex @Override public void drain() { + if (!isOpen) { + throw new IllegalStateException( + "Line must be open before it can be drain()ed"); + + } + Operation operation; synchronized (eventLoop.threadLock) { @@ -237,6 +241,11 @@ public class PulseAudioSourceDataLine ex @Override public void flush() { + if (!isOpen) { + throw new IllegalStateException( + "Line must be open before it can be flush()ed"); + } + Operation operation; synchronized (eventLoop.threadLock) { operation = stream.flush(); @@ -249,6 +258,10 @@ public class PulseAudioSourceDataLine ex @Override public void close() { + if (!isOpen) { + throw new IllegalStateException("not open so cant close"); + } + PulseAudioMixer parent = PulseAudioMixer.getInstance(); parent.removeSourceLine(this); diff -r fe9c2599d07d -r da120992e52b src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Thu Sep 18 11:37:51 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Fri Sep 19 12:56:33 2008 -0400 @@ -59,6 +59,11 @@ public class PulseAudioTargetDataLine ex @Override public void close() { + if (!isOpen) { + throw new IllegalStateException( + "Line cant be closed if it isnt open"); + } + PulseAudioMixer parentMixer = PulseAudioMixer.getInstance(); parentMixer.removeTargetLine(this); @@ -68,6 +73,10 @@ public class PulseAudioTargetDataLine ex @Override public void open(AudioFormat format, int bufferSize) throws LineUnavailableException { + if (isOpen) { + throw new IllegalStateException("already open"); + } + super.open(format, bufferSize); PulseAudioMixer parentMixer = PulseAudioMixer.getInstance(); @@ -87,10 +96,6 @@ public class PulseAudioTargetDataLine ex if (!isOpen) { throw new IllegalStateException("must call open() before read()"); - } - - if (!isStarted) { - throw new IllegalStateException("must call start() before read()"); } int frameSize = currentFormat.getFrameSize(); @@ -141,22 +146,36 @@ public class PulseAudioTargetDataLine ex @Override public void drain() { + + if (!isOpen) { + throw new IllegalStateException("must call open() before drain()"); + } + // blocks when there is data on the line // http://www.jsresources.org/faq_audio.html#stop_drain_tdl while (isStarted) { try { Thread.sleep(100); - } catch (InterruptedException e) { } + } catch (InterruptedException e) { + } } } @Override public void flush() { + if (!isOpen) { + throw new IllegalStateException("Line must be open"); + } + // FIXME how to flush a target data line } public int available() { + if (!isOpen) { + throw new IllegalStateException("Line must be open"); + } + synchronized (eventLoop.threadLock) { return stream.getReableSize(); } diff -r fe9c2599d07d -r da120992e52b unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java Thu Sep 18 11:37:51 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/OtherSoundProvidersAvailableTest.java Fri Sep 19 12:56:33 2008 -0400 @@ -43,15 +43,9 @@ import javax.sound.sampled.Mixer; import javax.sound.sampled.Mixer; import javax.sound.sampled.SourceDataLine; -import junit.framework.JUnit4TestAdapter; - import org.junit.Test; public class OtherSoundProvidersAvailableTest { - - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(OtherSoundProvidersAvailableTest.class); - } @Test public void testOtherSoundProviders() { diff -r fe9c2599d07d -r da120992e52b unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Thu Sep 18 11:37:51 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Fri Sep 19 12:56:33 2008 -0400 @@ -53,8 +53,6 @@ import javax.sound.sampled.Mixer; import javax.sound.sampled.Mixer; import javax.sound.sampled.UnsupportedAudioFileException; -import junit.framework.JUnit4TestAdapter; - import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -65,10 +63,6 @@ public class PulseAudioClipTest { Mixer mixer; AudioFormat aSupportedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); - - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(PulseAudioClipTest.class); - } @Before public void setUp() throws LineUnavailableException { diff -r fe9c2599d07d -r da120992e52b unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java Thu Sep 18 11:37:51 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioEventLoopOverhead.java Fri Sep 19 12:56:33 2008 -0400 @@ -43,18 +43,12 @@ import javax.sound.sampled.LineUnavailab import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.Mixer; -import junit.framework.JUnit4TestAdapter; - import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; public class PulseAudioEventLoopOverhead { - - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(PulseAudioEventLoopOverhead.class); - } Mixer mixer; diff -r fe9c2599d07d -r da120992e52b unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerProviderTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerProviderTest.java Thu Sep 18 11:37:51 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerProviderTest.java Fri Sep 19 12:56:33 2008 -0400 @@ -46,16 +46,10 @@ import javax.sound.sampled.Mixer; import javax.sound.sampled.Mixer; import javax.sound.sampled.SourceDataLine; -import junit.framework.JUnit4TestAdapter; - import org.junit.Test; public class PulseAudioMixerProviderTest { - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(PulseAudioMixerProviderTest.class); - } - AudioFormat aSupportedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); @@ -79,17 +73,17 @@ public class PulseAudioMixerProviderTest selectedMixerInfo = info; } } - + assertNotNull(selectedMixerInfo); + System.out.println("Getting information from selected mixer:"); + System.out.println("Name: " + selectedMixerInfo.getName()); + System.out.println("Version: " + selectedMixerInfo.getVersion()); - System.out.println("Getting information from selected mixer:"); - System.out.println("Name: "+ selectedMixerInfo.getName()); - System.out.println("Version: " + selectedMixerInfo.getVersion()); - selectedMixer = AudioSystem.getMixer(selectedMixerInfo); assertNotNull(selectedMixer); - System.out.println("Implemented in class: " + selectedMixer.getClass().toString()); + System.out.println("Implemented in class: " + + selectedMixer.getClass().toString()); selectedMixer.open(); // initialize the mixer @@ -116,7 +110,7 @@ public class PulseAudioMixerProviderTest // sourceDataLine.write('a', 0, 2); sourceDataLine.close(); } - + selectedMixer.close(); } diff -r fe9c2599d07d -r da120992e52b unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Thu Sep 18 11:37:51 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioMixerTest.java Fri Sep 19 12:56:33 2008 -0400 @@ -47,8 +47,6 @@ import javax.sound.sampled.Port; import javax.sound.sampled.Port; import javax.sound.sampled.TargetDataLine; -import junit.framework.JUnit4TestAdapter; - import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -61,10 +59,6 @@ public class PulseAudioMixerTest { AudioFormat aSupportedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); - - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(PulseAudioMixerTest.class); - } @Before public void setUp() throws Exception { diff -r fe9c2599d07d -r da120992e52b unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java Thu Sep 18 11:37:51 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java Fri Sep 19 12:56:33 2008 -0400 @@ -57,6 +57,7 @@ import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; public class PulseAudioSourceDataLineRawTest { @@ -134,6 +135,7 @@ public class PulseAudioSourceDataLineRaw } + @Ignore @Test public void testStartAndStopEventsOnCork() throws UnsupportedAudioFileException, IOException, diff -r fe9c2599d07d -r da120992e52b unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Thu Sep 18 11:37:51 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Fri Sep 19 12:56:33 2008 -0400 @@ -57,8 +57,6 @@ import javax.sound.sampled.SourceDataLin import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.UnsupportedAudioFileException; -import junit.framework.JUnit4TestAdapter; - From omajid at redhat.com Fri Sep 19 10:47:11 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 19 Sep 2008 17:47:11 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-19 Omair Majid changeset fda25668e4d1 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=fda25668e4d1 description: 2008-09-19 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java (connectLine): Changed the buffer attributes so that corking/uncorking doesnt hang the program. diffstat: 1 file changed, 2 insertions(+), 1 deletion(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 3 ++- diffs (13 lines): diff -r da120992e52b -r fda25668e4d1 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 19 12:56:33 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 19 13:06:48 2008 -0400 @@ -106,7 +106,8 @@ public class PulseAudioSourceDataLine ex protected void connectLine(int bufferSize) throws LineUnavailableException { StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( - bufferSize, bufferSize / 4, bufferSize / 4, bufferSize / 10, 0); + bufferSize, bufferSize / 4, bufferSize / 8, + ((bufferSize / 10) > 100 ? bufferSize / 10 : 100), 0); synchronized (eventLoop.threadLock) { stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes); From omajid at redhat.com Fri Sep 19 10:47:11 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 19 Sep 2008 17:47:11 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-19 Omair Majid changeset 3a9c7727be22 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=3a9c7727be22 description: 2008-09-19 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (ClipThread.run): Drain the stream when done playing. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java (testOpenEvent): Added a println indicate the event. (testCloseEvent): Added a println to indicate the event. (testStartedStopped): Added println to indicate the events. Removed call to drain(). * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java (ThreadWriter.run): Commented out debug output. (testStartAndStopEventsOnCork): Enabled this test. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java (ThreadWriter): New class. Writes to a SourceDataLine while running in a separate thread. (testStartedStopped): Added clearer debug output. (test2StartAndStopEvents): New function. Checks that two START and two STOP events are caused. (test3StartAndStopEvents): New function. Checks that three START and STOP events are produced. diffstat: 4 files changed, 190 insertions(+), 9 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 8 unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java | 7 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java | 4 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java | 180 +++++++++- diffs (313 lines): diff -r fda25668e4d1 -r 3a9c7727be22 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Sep 19 13:06:48 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Sep 19 13:42:34 2008 -0400 @@ -79,7 +79,7 @@ public class PulseAudioClip extends Puls if (Thread.interrupted()) { // Thread.currentThread().interrupt(); clipThreadStarted = false; - return; + break; } try { @@ -89,7 +89,7 @@ public class PulseAudioClip extends Puls if (loopsLeft == 0) { System.out.println("Reading to the end of the file"); writeFrames(endFrame, getFrameLength()); - return; + break; } else { synchronized (clipLock) { currentFrame = startFrame; @@ -98,8 +98,10 @@ public class PulseAudioClip extends Puls } clipSemaphore.release(); } catch (InterruptedException e) { - return; + break; } + + PulseAudioClip.this.drain(); } } diff -r fda25668e4d1 -r 3a9c7727be22 unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Fri Sep 19 13:06:48 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Fri Sep 19 13:42:34 2008 -0400 @@ -175,6 +175,7 @@ public class PulseAudioClipTest { @Override public void update(LineEvent event) { if (event.getType() == LineEvent.Type.OPEN) { + System.out.println("OPEN"); opened++; } } @@ -210,6 +211,7 @@ public class PulseAudioClipTest { @Override public void update(LineEvent event) { if (event.getType() == LineEvent.Type.CLOSE) { + System.out.println("CLOSE"); closed++; } } @@ -252,12 +254,13 @@ public class PulseAudioClipTest { @Override public void update(LineEvent event) { if (event.getType() == LineEvent.Type.START) { + System.out.println("START"); started++; Assert.assertEquals(1, started); } if (event.getType() == LineEvent.Type.STOP) { - System.out.println("Stopped event"); + System.out.println("STOP"); stopped++; Assert.assertEquals(1, stopped); } @@ -268,7 +271,7 @@ public class PulseAudioClipTest { clip.addLineListener(startStopListener); clip.start(); - clip.drain(); + // clip.drain(); clip.stop(); clip.close(); diff -r fda25668e4d1 -r 3a9c7727be22 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java Fri Sep 19 13:06:48 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java Fri Sep 19 13:42:34 2008 -0400 @@ -57,7 +57,6 @@ import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; public class PulseAudioSourceDataLineRawTest { @@ -102,7 +101,7 @@ public class PulseAudioSourceDataLineRaw bytesRead = stream.read(abData, 0, abData.length); // System.out.println("read data"); if (bytesRead > 0) { - System.out.println("about to write data"); + // System.out.println("about to write data"); line.write(abData, 0, bytesRead); // System.out.println("wrote data"); } @@ -135,7 +134,6 @@ public class PulseAudioSourceDataLineRaw } - @Ignore @Test public void testStartAndStopEventsOnCork() throws UnsupportedAudioFileException, IOException, diff -r fda25668e4d1 -r 3a9c7727be22 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Fri Sep 19 13:06:48 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Fri Sep 19 13:42:34 2008 -0400 @@ -73,6 +73,56 @@ public class PulseAudioSourceDataLineTes AudioFormat aSupportedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 10, true); + class ThreadWriter extends Thread { + SourceDataLine line; + AudioInputStream stream; + + public ThreadWriter(AudioInputStream stream, SourceDataLine line) + throws LineUnavailableException { + + this.line = line; + this.stream = stream; + + if (line.isOpen()) { + line.close(); + } + + } + + @Override + public void run() { + try { + AudioFormat audioFormat = stream.getFormat(); + + line.open(audioFormat); + + byte[] abData = new byte[1000]; + int bytesRead = 0; + + line.start(); + + while (bytesRead >= 0) { + bytesRead = stream.read(abData, 0, abData.length); + // System.out.println("read data"); + if (bytesRead > 0) { + // System.out.println("about to write data"); + line.write(abData, 0, bytesRead); + // System.out.println("wrote data"); + } + } + + line.drain(); + line.close(); + + } catch (LineUnavailableException e) { + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + @Before public void setUp() throws Exception { Mixer.Info mixerInfos[] = AudioSystem.getMixerInfo(); @@ -194,12 +244,13 @@ public class PulseAudioSourceDataLineTes @Override public void update(LineEvent event) { if (event.getType() == LineEvent.Type.START) { + System.out.println("START"); started++; Assert.assertEquals(1, started); } if (event.getType() == LineEvent.Type.STOP) { - System.out.println("Stopped event"); + System.out.println("STOP"); stopped++; Assert.assertEquals(1, stopped); } @@ -226,6 +277,133 @@ public class PulseAudioSourceDataLineTes Assert.assertEquals(1, started); Assert.assertEquals(1, stopped); + + } + + @Test + public void test2StartAndStopEvents() throws UnsupportedAudioFileException, + IOException, LineUnavailableException, InterruptedException { + + System.out + .println("This test checks if START and STOP notifications appear on corking"); + + File soundFile = new File("testsounds/startup.wav"); + AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + AudioFormat audioFormat = audioInputStream.getFormat(); + + SourceDataLine line; + line = (SourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, audioFormat)); + Assert.assertNotNull(line); + + LineListener startStopListener = new LineListener() { + + @Override + public void update(LineEvent event) { + if (event.getType() == LineEvent.Type.START) { + System.out.println("START"); + started++; + } + + if (event.getType() == LineEvent.Type.STOP) { + System.out.println("STOP"); + stopped++; + } + } + + }; + + line.addLineListener(startStopListener); + System.out.println("Launching threadWriter"); + ThreadWriter writer = new ThreadWriter(audioInputStream, line); + writer.start(); + // System.out.println("started"); + + Thread.sleep(1000); + + line.stop(); + + System.out.println("corked"); + + Thread.sleep(1000); + + // UNCORK + line.stop(); + + Thread.sleep(1000); + + // System.out.println("waiting for thread to finish"); + writer.join(); + + Assert.assertEquals(2, started); + Assert.assertEquals(2, stopped); + + } + + @Test + public void test3StartAndStopEvents() throws UnsupportedAudioFileException, + IOException, LineUnavailableException, InterruptedException { + + System.out + .println("This test checks if START and STOP notifications appear on corking"); + + File soundFile = new File("testsounds/startup.wav"); + AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + AudioFormat audioFormat = audioInputStream.getFormat(); + + SourceDataLine line; + line = (SourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, audioFormat)); + Assert.assertNotNull(line); + + LineListener startStopListener = new LineListener() { + + @Override + public void update(LineEvent event) { + if (event.getType() == LineEvent.Type.START) { + System.out.println("START"); + started++; + } + + if (event.getType() == LineEvent.Type.STOP) { + System.out.println("STOP"); + stopped++; + } + } + + }; + + line.addLineListener(startStopListener); + System.out.println("Launching threadWriter"); + ThreadWriter writer = new ThreadWriter(audioInputStream, line); + writer.start(); + // System.out.println("started"); + + Thread.sleep(1000); + + line.stop(); + + Thread.sleep(1000); + + line.start(); + + Thread.sleep(1000); + + line.stop(); + + Thread.sleep(1000); + + line.start(); + + Thread.sleep(1000); + + // System.out.println("waiting for thread to finish"); + writer.join(); + + Assert.assertEquals(3, started); + Assert.assertEquals(3, stopped); } From bugzilla-daemon at icedtea.classpath.org Fri Sep 19 20:48:09 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sat, 20 Sep 2008 03:48:09 +0000 Subject: [Bug 84] jar c0mf@ causes error "Illegal option: @" Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=84 dj at linuxfromscratch.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dj at linuxfromscratch.org BugsThisDependsOn| |183 ------- Comment #7 from dj at linuxfromscratch.org 2008-09-20 03:48 ------- Bug 183 contains a patch that I believe closes this issue properly. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Sep 19 20:48:10 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sat, 20 Sep 2008 03:48:10 +0000 Subject: [Bug 183] Build error: Argument list too long Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 dj at linuxfromscratch.org changed: What |Removed |Added ---------------------------------------------------------------------------- OtherBugsDependingO| |84 nThis| | -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Mon Sep 22 07:35:51 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 22 Sep 2008 14:35:51 +0000 Subject: [Bug 183] Build error: Argument list too long Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 langel at redhat.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #9 from langel at redhat.com 2008-09-22 14:35 ------- Thanks! I will commit this patch -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Mon Sep 22 07:35:52 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 22 Sep 2008 14:35:52 +0000 Subject: [Bug 84] jar c0mf@ causes error "Illegal option: @" Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=84 Bug 84 depends on bug 183, which changed state. Bug 183 Summary: Build error: Argument list too long http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 What |Old Value |New Value ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Mon Sep 22 07:36:15 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 22 Sep 2008 14:36:15 +0000 Subject: [Bug 84] jar c0mf@ causes error "Illegal option: @" Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=84 langel at redhat.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From langel at redhat.com Mon Sep 22 07:39:06 2008 From: langel at redhat.com (Lillian Angel) Date: Mon, 22 Sep 2008 14:39:06 +0000 Subject: changeset in /hg/icedtea6: 2008-09-22 Lillian Angel changeset d2579e023b0e in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=d2579e023b0e description: 2008-09-22 Lillian Angel DJ Lucas * Makefile.am: Added new env var JAR_ACCEPTS_STDIN_LIST. * acinclude.m4: Added check to determine whether jar supports stdin file args. * patches/icedtea-ecj.patch: Updated patch. * AUTHORS: Added DJ Lucas. diffstat: 5 files changed, 38 insertions(+), 11 deletions(-) AUTHORS | 1 + ChangeLog | 9 +++++++++ Makefile.am | 3 ++- acinclude.m4 | 9 +++++++++ patches/icedtea-ecj.patch | 27 +++++++++++++++++---------- diffs (129 lines): diff -r 8e3089767a4a -r d2579e023b0e AUTHORS --- a/AUTHORS Thu Sep 18 11:31:59 2008 -0400 +++ b/AUTHORS Mon Sep 22 10:39:01 2008 -0400 @@ -11,6 +11,7 @@ Andrew John Hughes Matthias Klose Francis Kung +DJ Lucas Casey Marshall Dan Munckton Raif Naffah diff -r 8e3089767a4a -r d2579e023b0e ChangeLog --- a/ChangeLog Thu Sep 18 11:31:59 2008 -0400 +++ b/ChangeLog Mon Sep 22 10:39:01 2008 -0400 @@ -1,3 +1,12 @@ 2008-09-18 Lillian Angel + DJ Lucas + + * Makefile.am: Added new env var JAR_ACCEPTS_STDIN_LIST. + * acinclude.m4: Added check to determine whether jar supports + stdin file args. + * patches/icedtea-ecj.patch: Updated patch. + * AUTHORS: Added DJ Lucas. + 2008-09-18 Lillian Angel * AUTHORS: Added Marc Schoenefeld. diff -r 8e3089767a4a -r d2579e023b0e Makefile.am --- a/Makefile.am Thu Sep 18 11:31:59 2008 -0400 +++ b/Makefile.am Mon Sep 22 10:39:01 2008 -0400 @@ -228,7 +228,8 @@ ICEDTEA_ENV_ECJ = \ "HOTSPOT_BUILD_JOBS=$(PARALLEL_JOBS)" \ "JAVAC=" \ "RHINO_JAR=$(RHINO_JAR)" \ - "JAR_KNOWS_ATFILE=$(JAR_KNOWS_ATFILE)" + "JAR_KNOWS_ATFILE=$(JAR_KNOWS_ATFILE)" \ + "JAR_ACCEPTS_STDIN_LIST=$(JAR_ACCEPTS_STDIN_LIST)" if WITH_CACAO ICEDTEA_ENV_ECJ += \ diff -r 8e3089767a4a -r d2579e023b0e acinclude.m4 --- a/acinclude.m4 Thu Sep 18 11:31:59 2008 -0400 +++ b/acinclude.m4 Mon Sep 22 10:39:01 2008 -0400 @@ -342,9 +342,18 @@ EOF JAR_KNOWS_ATFILE= AC_MSG_RESULT(no) fi + AC_MSG_CHECKING([whether jar supports stdin file arguments]) + if cat _config.list | $JAR cf@ _config.jar 2>/dev/null; then + JAR_ACCEPTS_STDIN_LIST=1 + AC_MSG_RESULT(yes) + else + JAR_ACCEPTS_STDIN_LIST= + AC_MSG_RESULT(no) + fi rm -f _config.txt _config.list _config.jar AC_SUBST(JAR) AC_SUBST(JAR_KNOWS_ATFILE) + AC_SUBST(JAR_ACCEPTS_STDIN_LIST) ]) AC_DEFUN([FIND_RMIC], diff -r 8e3089767a4a -r d2579e023b0e patches/icedtea-ecj.patch --- a/patches/icedtea-ecj.patch Thu Sep 18 11:31:59 2008 -0400 +++ b/patches/icedtea-ecj.patch Mon Sep 22 10:39:01 2008 -0400 @@ -428,32 +428,35 @@ diff -ru openjdk-ecj.orig/langtools/make endif # Override of what javac to use (see deploy workspace) ---- oipenjdk/jdk/make/common/Release.gmk 2007-11-13 16:47:23.000000000 -0500 -+++ openjdk-ecj/jdk/make/common/Release.gmk 2007-11-13 16:48:08.000000000 -0500 -@@ -655,10 +649,19 @@ +--- oipenjdk/jdk/make/common/Release.gmk 2008-08-28 03:10:47.000000000 -0500 ++++ openjdk-ecj/jdk/make/common/Release.gmk 2008-09-16 17:53:16.000000000 -0500 +@@ -655,10 +655,23 @@ $(RES_JAR_ARGLIST): $(RES_JAR_FILELIST) $(prep-target) $(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@ -$(RESOURCES_JAR): $(RES_JAR_ARGLIST) $(JAR_MANIFEST_FILE) -- $(prep-target) +$(RESOURCES_JAR): \ + $(if $(JAR_KNOWS_ATFILE),$(RES_JAR_FILELIST),$(RES_JAR_ARGLIST)) \ + $(JAR_MANIFEST_FILE) -+ $(prep-target) + $(prep-target) +ifneq (,$(JAR_KNOWS_ATFILE)) ++ (cd $(CLASSBINDIR) && \ + $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ +- @$(RES_JAR_ARGLIST) $(JAR_JFLAGS) ++ $(JAR_JFLAGS) @$(RES_JAR_FILELIST)) ++else ifneq (,$(JAR_ACCEPTS_STDIN_LIST)) + (cd $(CLASSBINDIR) && $(CAT) $(RES_JAR_FILELIST) | \ + $(BOOT_JAR_CMD) c0mf@ $(JAR_MANIFEST_FILE) $@ \ + $(JAR_JFLAGS)) +else + (cd $(CLASSBINDIR) && \ - $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ -- @$(RES_JAR_ARGLIST) $(JAR_JFLAGS) ++ $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ + $(JAR_JFLAGS) `cat $(RES_JAR_FILELIST)`) +endif @$(java-vm-cleanup) # Create jsse.jar containing SunJSSE implementation classes -@@ -714,10 +717,18 @@ +@@ -714,10 +727,22 @@ $(RT_JAR_ARGLIST): $(RT_JAR_FILELIST) $(prep-target) $(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@ @@ -462,13 +465,17 @@ diff -ru openjdk-ecj.orig/langtools/make + $(JAR_MANIFEST_FILE) $(prep-target) +ifneq (,$(JAR_KNOWS_ATFILE)) ++ (cd $(CLASSBINDIR) && \ + $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ +- @$(RT_JAR_ARGLIST) $(JAR_JFLAGS) ++ $(JAR_JFLAGS) @$(RT_JAR_FILELIST)) ++else ifneq (,$(JAR_ACCEPTS_STDIN_LIST)) + (cd $(CLASSBINDIR) && $(CAT) $(RT_JAR_FILELIST) | \ + $(BOOT_JAR_CMD) c0mf@ $(JAR_MANIFEST_FILE) $@ \ + $(JAR_JFLAGS)) +else + (cd $(CLASSBINDIR) && \ - $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ -- @$(RT_JAR_ARGLIST) $(JAR_JFLAGS) ++ $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ + $(JAR_JFLAGS) `$(CAT) $(RT_JAR_FILELIST)`) +endif @$(java-vm-cleanup) From omajid at redhat.com Mon Sep 22 11:44:45 2008 From: omajid at redhat.com (Omair Majid) Date: Mon, 22 Sep 2008 18:44:45 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-22 Omair Majid changeset 11a52266951f in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=11a52266951f description: 2008-09-22 Omair Majid * src/native/org_classpath_icedtea_pulseaudio_Stream.c (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1unref): Use the constant STREAM_POINTER instead of the string "streamPointer". (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1state): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1context): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1index): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1device_1index): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1device_1name): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1is_1suspended): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1playback): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1record): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1disconnect): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1write): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1read): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1peek): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drop): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1writable_1size): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1readable_1size): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drain): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1is_1corked): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1cork): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1flush): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1trigger): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1set_1name): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1time): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1latency): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1sample_1spec): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1buffer_1attr): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1set_1buffer_1attr): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1update_1sample_1rate): Likewise. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1setVolume): Likewise. diffstat: 1 file changed, 31 insertions(+), 29 deletions(-) src/native/org_classpath_icedtea_pulseaudio_Stream.c | 60 +++++++++--------- diffs (267 lines): diff -r 3fc512ee667f -r 11a52266951f src/native/org_classpath_icedtea_pulseaudio_Stream.c --- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c Fri Sep 19 17:13:44 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c Mon Sep 22 14:10:35 2008 -0400 @@ -306,8 +306,10 @@ JNIEXPORT void JNICALL Java_org_classpat */ JNIEXPORT void JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1unref (JNIEnv* env, jobject obj) { - pa_stream* stream = getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = getJavaPointer(env, obj, STREAM_POINTER); + assert(stream); pa_stream_unref(stream); + setJavaPointer(env, obj, "streamPointer", NULL); } /* @@ -317,7 +319,7 @@ JNIEXPORT void JNICALL Java_org_classpat */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1state (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER); assert(stream); return pa_stream_get_state(stream); } @@ -330,7 +332,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1context (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER); assert(stream); pa_context* context = pa_stream_get_context(stream); assert(context); @@ -344,7 +346,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1index (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER); assert(stream); return pa_stream_get_index(stream); } @@ -356,7 +358,7 @@ JNIEXPORT jint JNICALL Java_org_classpat */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1device_1index (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER); assert(stream); return pa_stream_get_device_index(stream); } @@ -368,7 +370,7 @@ JNIEXPORT jint JNICALL Java_org_classpat */ JNIEXPORT jstring JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1device_1name (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); const char* name = pa_stream_get_device_name(stream); assert(name); @@ -382,7 +384,7 @@ JNIEXPORT jstring JNICALL Java_org_class */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1is_1suspended (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER); assert(stream); return pa_stream_is_suspended(stream); } @@ -398,7 +400,7 @@ JNIEXPORT jint JNICALL Java_org_classpat jint bufferMinimumRequest, jint bufferFragmentSize, jint flags, jbyteArray volumePointer, jbyteArray sync_streamPointer) { - pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER); pa_buffer_attr buffer_attr; @@ -444,7 +446,7 @@ JNIEXPORT jint JNICALL Java_org_classpat jint bufferMinimumRequest, jint bufferFragmentSize, jint flags, jbyteArray volumePointer, jbyteArray sync_streamPointer) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); pa_buffer_attr buffer_attr; @@ -485,7 +487,7 @@ JNIEXPORT jint JNICALL Java_org_classpat */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1disconnect (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER); assert(stream); int return_value = pa_stream_disconnect(stream); @@ -499,7 +501,7 @@ JNIEXPORT jint JNICALL Java_org_classpat */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1write (JNIEnv* env, jobject obj, jbyteArray data, jint offset, jint data_length) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); jbyte* data_buffer = (*env)->GetByteArrayElements(env, data, NULL); if (data_buffer == NULL) { @@ -513,7 +515,7 @@ JNIEXPORT jint JNICALL Java_org_classpat JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1read (JNIEnv *env, jobject obj, jbyteArray array, jint length, jint offset) { - pa_stream *stream = getJavaPointer(env, obj, "streamPointer"); + pa_stream *stream = getJavaPointer(env, obj, STREAM_POINTER); assert(stream); const void *read_data = NULL; size_t read_length = 0; @@ -535,7 +537,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1peek (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); const void* startLocation; size_t count; @@ -562,7 +564,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drop (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER); assert(stream); return pa_stream_drop(stream); } @@ -574,7 +576,7 @@ JNIEXPORT jint JNICALL Java_org_classpat */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1writable_1size (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); size_t size = pa_stream_writable_size(stream); return size; @@ -588,7 +590,7 @@ JNIEXPORT jint JNICALL Java_org_classpat */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1readable_1size (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); return pa_stream_readable_size(stream); } @@ -609,7 +611,7 @@ static void drain_callback(pa_stream* st */ JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drain (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); pa_operation* operation = pa_stream_drain(stream, drain_callback, NULL); assert(operation); @@ -623,7 +625,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl */ JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1is_1corked (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER); assert(stream); return pa_stream_is_corked(stream); } @@ -642,7 +644,7 @@ static void cork_callback(pa_stream* str */ JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1cork (JNIEnv* env, jobject obj, jint yes) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); pa_operation* operation = pa_stream_cork(stream, yes, cork_callback, NULL); assert(operation); @@ -664,7 +666,7 @@ static void flush_callback(pa_stream* st */ JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1flush (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER); assert(stream); pa_operation* operation = pa_stream_flush(stream, flush_callback, NULL); assert(operation); @@ -686,7 +688,7 @@ static void trigger_callback(pa_stream* */ JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1trigger (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); pa_operation* operation = pa_stream_trigger(stream, trigger_callback, NULL); assert(operation); @@ -707,7 +709,7 @@ static void set_name_callback(pa_stream* */ JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1set_1name (JNIEnv* env, jobject obj, jstring newName) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); const char* name; @@ -730,7 +732,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl */ JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1time (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); pa_usec_t time = 0; @@ -748,7 +750,7 @@ JNIEXPORT jlong JNICALL Java_org_classpa */ JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1latency (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); pa_usec_t returnValue = 0; int negative = 0; @@ -765,7 +767,7 @@ JNIEXPORT jlong JNICALL Java_org_classpa */ JNIEXPORT jobject JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1sample_1spec (JNIEnv* env, jobject obj) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); const pa_sample_spec* sample_spec = pa_stream_get_sample_spec(stream); @@ -801,7 +803,7 @@ JNIEXPORT jobject JNICALL Java_org_class // printf("in native_pa_stream_get_buffer_attributes"); - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); const pa_buffer_attr* buffer = pa_stream_get_buffer_attr(stream); assert(buffer); @@ -844,7 +846,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1set_1buffer_1attr (JNIEnv* env, jobject obj, jobject bufferAttributeObject) { - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); jclass cls = (*env)->GetObjectClass(env, bufferAttributeObject); @@ -904,7 +906,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl uint32_t rate = (uint32_t) newRate; - pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer"); + pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER); assert(stream); pa_operation* operation = pa_stream_update_sample_rate(stream,rate, update_sample_rate_callback, NULL); assert(operation); @@ -919,7 +921,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl */ JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1setVolume (JNIEnv *env, jobject obj, jfloat new_volume) { - pa_stream *stream = getJavaPointer(env, obj, "streamPointer"); + pa_stream *stream = getJavaPointer(env, obj, STREAM_POINTER); assert(stream); pa_context *context = pa_stream_get_context(stream); From omajid at redhat.com Mon Sep 22 11:44:45 2008 From: omajid at redhat.com (Omair Majid) Date: Mon, 22 Sep 2008 18:44:45 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-19 Omair Majid changeset 3fc512ee667f in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=3fc512ee667f description: 2008-09-19 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java (close): Free the stream only after we are done with it. * src/java/org/classpath/icedtea/pulseaudio/Stream.java (native_pa_stream_unref): New function. (free): New function. Frees the memory used by the stream. * src/native/org_classpath_icedtea_pulseaudio_Stream.c (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1unref): New function. Free the stream. (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1disconnect): Doesnt deallocate the stream anymore. * src/native/jni-common.c (getJavaPointer): Allow returning NULL values. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java (write): Only wait for a little bit. diffstat: 5 files changed, 31 insertions(+), 11 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 6 ++-- src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 2 - src/java/org/classpath/icedtea/pulseaudio/Stream.java | 11 +++++-- src/native/jni-common.c | 8 ++--- src/native/org_classpath_icedtea_pulseaudio_Stream.c | 15 +++++++++- diffs (172 lines): diff -r 3a9c7727be22 -r 3fc512ee667f src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Sep 19 13:42:34 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Sep 19 17:13:44 2008 -0400 @@ -176,7 +176,6 @@ public abstract class PulseAudioDataLine } catch (InterruptedException e) { throw new LineUnavailableException("unable to prepare stream"); } - } public void open(AudioFormat format) throws LineUnavailableException { @@ -197,7 +196,6 @@ public abstract class PulseAudioDataLine } synchronized (eventLoop.threadLock) { - drain(); stream.disconnect(); } @@ -205,6 +203,10 @@ public abstract class PulseAudioDataLine semaphore.acquire(); } catch (InterruptedException e) { throw new RuntimeException("unable to prepare stream"); + } + + synchronized (eventLoop.threadLock) { + stream.free(); } super.close(); diff -r 3a9c7727be22 -r 3fc512ee667f src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 19 13:42:34 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 19 17:13:44 2008 -0400 @@ -162,7 +162,7 @@ public class PulseAudioSourceDataLine ex if (availableSize == 0) { try { - eventLoop.threadLock.wait(); + eventLoop.threadLock.wait(100); } catch (InterruptedException e) { // FIXME assert (false); diff -r 3a9c7727be22 -r 3fc512ee667f src/java/org/classpath/icedtea/pulseaudio/Stream.java --- a/src/java/org/classpath/icedtea/pulseaudio/Stream.java Fri Sep 19 13:42:34 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Stream.java Fri Sep 19 17:13:44 2008 -0400 @@ -128,6 +128,8 @@ public class Stream { private native void native_pa_stream_new(byte[] contextPointer, String name, String format, int sampleRate, int channels); + private native void native_pa_stream_unref(); + private native int native_pa_stream_get_state(); private native byte[] native_pa_stream_get_context(); @@ -177,7 +179,7 @@ public class Stream { */ private native int native_pa_stream_is_corked(); - + private native byte[] native_pa_stream_cork(int b); private native byte[] native_pa_stream_flush(); @@ -631,7 +633,6 @@ public class Stream { } } - public boolean isCorked() { int corked = native_pa_stream_is_corked(); if (corked < 0) { @@ -639,7 +640,7 @@ public class Stream { } return corked == 0 ? false : true; } - + /** * Pause (or resume) playback of this stream temporarily. * @@ -745,4 +746,8 @@ public class Stream { return streamPointer; } + public void free() { + native_pa_stream_unref(); + } + } diff -r 3a9c7727be22 -r 3fc512ee667f src/native/jni-common.c --- a/src/native/jni-common.c Fri Sep 19 13:42:34 2008 -0400 +++ b/src/native/jni-common.c Fri Sep 19 17:13:44 2008 -0400 @@ -177,12 +177,13 @@ void* getJavaPointer(JNIEnv* env, jobjec jbyteArray array = getJavaByteArrayField(env, obj, name); assert(array); void* value = convertJavaPointerToNative(env, array); - assert(value); + // allow returning NULL values return value; } void setJavaPointer(JNIEnv* env, jobject obj, char* name, void* value) { + // allow NULL for value jbyteArray array = convertNativePointerToJava(env, value); assert(array); setJavaByteArrayField(env, obj, name, array); @@ -194,6 +195,7 @@ void* convertJavaPointerToNative(JNIEnv* void* returnPointer = NULL; + // this is not the pointer, but the container of the pointer assert(pointer); jsize len = (*env)->GetArrayLength(env, pointer); @@ -214,8 +216,6 @@ jbyteArray convertNativePointerToJava(JN jbyteArray convertNativePointerToJava(JNIEnv* env, void* pointer) { // printf("convertNativePointerToJava(): entering method\n"); - // assert(pointer); - jbyteArray array = (*env)->NewByteArray(env, sizeof(pointer)); if (array == NULL) { return 0; // oome? @@ -223,7 +223,7 @@ jbyteArray convertNativePointerToJava(JN jbyte* data = (*env)->GetByteArrayElements(env, array, NULL); if (data == NULL) { - return 0; + return 0; // oome } memcpy(data, &pointer, sizeof(pointer)); diff -r 3a9c7727be22 -r 3fc512ee667f src/native/org_classpath_icedtea_pulseaudio_Stream.c --- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c Fri Sep 19 13:42:34 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c Fri Sep 19 17:13:44 2008 -0400 @@ -3,6 +3,8 @@ #include "jni-common.h" #include #include + +#define STREAM_POINTER "streamPointer" typedef struct java_context { JNIEnv* env; @@ -299,6 +301,17 @@ JNIEXPORT void JNICALL Java_org_classpat /* * Class: org_classpath_icedtea_pulseaudio_Stream + * Method: native_pa_stream_unref + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1unref +(JNIEnv* env, jobject obj) { + pa_stream* stream = getJavaPointer(env, obj, "streamPointer"); + pa_stream_unref(stream); +} + +/* + * Class: org_classpath_icedtea_pulseaudio_Stream * Method: native_pa_stream_get_state * Signature: ()I */ @@ -475,7 +488,7 @@ JNIEXPORT jint JNICALL Java_org_classpat pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer"); assert(stream); int return_value = pa_stream_disconnect(stream); - pa_stream_unref(stream); + return return_value; } From omajid at redhat.com Mon Sep 22 11:44:45 2008 From: omajid at redhat.com (Omair Majid) Date: Mon, 22 Sep 2008 18:44:45 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-22 Omair Majid changeset b7a5a39b31ab in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=b7a5a39b31ab description: 2008-09-22 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (ClipThread.run): Drain when done playing. (close): Interrupt the clipThread to stop it immediately. (drain): Interrupt and drain the buffer, dont block. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java (testStartedStopped): Calls drain to wait for the line to finish playing. (testDrainWithoutStart): New test. diffstat: 2 files changed, 46 insertions(+), 18 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 18 +++ unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java | 46 ++++++---- diffs (176 lines): diff -r 11a52266951f -r b7a5a39b31ab src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Mon Sep 22 14:10:35 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Mon Sep 22 14:44:23 2008 -0400 @@ -73,6 +73,7 @@ public class PulseAudioClip extends Puls private class ClipThread extends Thread { @Override public void run() { + clipThreadStarted = true; while (loopsLeft >= 0) { writeFrames(currentFrame, endFrame + 1); @@ -101,9 +102,9 @@ public class PulseAudioClip extends Puls break; } - PulseAudioClip.this.drain(); - - } + } + + PulseAudioClip.this.drain(); } } @@ -193,6 +194,8 @@ public class PulseAudioClip extends Puls throw new IllegalStateException("line already closed"); } + clipThread.interrupt(); + try { clipThread.join(); } catch (InterruptedException e) { @@ -212,6 +215,13 @@ public class PulseAudioClip extends Puls throw new IllegalStateException("line not open"); } + if (clipThread != null) { + clipThread.interrupt(); + try { + clipThread.join(); + } catch (InterruptedException e) { + } + } Operation operation; synchronized (eventLoop.threadLock) { @@ -447,6 +457,7 @@ public class PulseAudioClip extends Puls clipThread = new ClipThread(); clipThread.start(); } + } public void stop() { @@ -472,6 +483,7 @@ public class PulseAudioClip extends Puls } super.stop(); + } } diff -r 11a52266951f -r b7a5a39b31ab unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Mon Sep 22 14:10:35 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Mon Sep 22 14:44:23 2008 -0400 @@ -64,6 +64,11 @@ public class PulseAudioClipTest { AudioFormat aSupportedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); + int started = 0; + int stopped = 0; + int opened = 0; + int closed = 0; + @Before public void setUp() throws LineUnavailableException { Mixer.Info wantedMixerInfo = null; @@ -77,6 +82,11 @@ public class PulseAudioClipTest { assert (wantedMixerInfo != null); mixer = AudioSystem.getMixer(wantedMixerInfo); mixer.open(); + + started = 0; + stopped = 0; + opened = 0; + closed = 0; } @Test @@ -158,8 +168,6 @@ public class PulseAudioClipTest { } - int opened = 0; - @Test public void testOpenEvent() throws LineUnavailableException, UnsupportedAudioFileException, IOException { @@ -191,8 +199,6 @@ public class PulseAudioClipTest { } - int closed = 0; - @Test public void testCloseEvent() throws LineUnavailableException, UnsupportedAudioFileException, IOException { @@ -228,12 +234,9 @@ public class PulseAudioClipTest { } - int started = 0; - int stopped = 0; - @Test public void testStartedStopped() throws LineUnavailableException, - UnsupportedAudioFileException, IOException { + UnsupportedAudioFileException, IOException, InterruptedException { File soundFile = new File("testsounds/startup.wav"); AudioInputStream audioInputStream = AudioSystem @@ -243,9 +246,6 @@ public class PulseAudioClipTest { Clip clip; clip = (Clip) mixer.getLine(new DataLine.Info(Clip.class, audioFormat)); Assert.assertNotNull(clip); - - started = 0; - stopped = 0; clip.open(audioInputStream); @@ -271,16 +271,31 @@ public class PulseAudioClipTest { clip.addLineListener(startStopListener); clip.start(); - // clip.drain(); - + clip.drain(); clip.stop(); clip.close(); Assert.assertEquals(1, started); Assert.assertEquals(1, stopped); - started = 0; - stopped = 0; + } + + @Test + public void testDrainWithoutStart() throws UnsupportedAudioFileException, + IOException, LineUnavailableException { + + File soundFile = new File("testsounds/startup.wav"); + AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + AudioFormat audioFormat = audioInputStream.getFormat(); + + Clip clip; + clip = (Clip) mixer.getLine(new DataLine.Info(Clip.class, audioFormat)); + Assert.assertNotNull(clip); + + clip.open(audioInputStream); + clip.drain(); + clip.close(); } @@ -387,6 +402,7 @@ public class PulseAudioClipTest { @After public void tearDown() { mixer.close(); + } } From Joe.Darcy at Sun.COM Mon Sep 22 12:54:54 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Mon, 22 Sep 2008 12:54:54 -0700 Subject: OpenJDK 6 build 12 source posted (directaudio/alsa backend) In-Reply-To: <1221402124.3542.40.camel@dijkstra.wildebeest.org> References: <48CAB08F.6010407@sun.com> <1221402124.3542.40.camel@dijkstra.wildebeest.org> Message-ID: <48D7F80E.6060802@sun.com> Hi Mark. Mark Wielaard wrote: > Hi Joe, > > Although not in your changelogs, I saw you also included two of my fixes > for the ALSA directaudio backend which I posted back in May on > sound-dev, and which are included in icedtea already. > - The sloppy open/close patch: > http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000053.html > - The ALSA native lock patch: > http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000054.html > > Although it makes some applets that use some primitive sound output work > better I never got a real response. Did you get someone from the sound > team to look at these patches? They do seem to work for me and the few > test users of those applets, but a full review by one of the sound > engineers would be appreciated. They don't seem to be in the JDK7 tree. > No; the patches were not explicitly reviewed; Alex, please take a look at them. Neither Gervill nor your patches have yet been incorporated into JDK 7. > Karl did correctly pointed out back then that we just need a better/new > sound backend. I do hope in time the pulseaudio backend that Ioana and > Omair are working on will be that backend. > I don't have any technical background to speak of in sound, so I'll let others weigh in on evaluating any new backends. Regards, -Joe From Joe.Darcy at Sun.COM Mon Sep 22 13:40:02 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Mon, 22 Sep 2008 13:40:02 -0700 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <48D2502A.7020001@sun.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> <48D13DAE.9030009@sun.com> <48D2502A.7020001@sun.com> Message-ID: <48D802A2.6080509@sun.com> Joseph D. Darcy wrote: > Kelly O'Hair wrote: >> Speaking from experience, any attempts at cleanly creating changesets >> from TeamWare data alone is a waste of time. Just doesn't work well. >> Granted we have pretty complete OpenJDK6 changeset data (data beyond >> the TeamWare data) and could potentially do this, it's quite a bit of >> grunt work to accomplish. Before we go off on this kind of adventure >> we need to make sure the time spent is worth it. >> A different approach would be to create changesets per build/promotion, >> but those kind of large changesets can have limited usefulness. >> >> I'll try and talk to Joe about this tomorrow. >> >> Also, don't forget that the OpenJDK7 sources are a Mercurial forest, >> not just one repository. I assume that we want to mimic the same >> forest layout, keeping the langtools, corba, jaxp, jaxws, and hotspot >> sources in their own repositories, separate from the core 'jdk' >> repository. >> That allows us to do some plug and play with these repositories >> between OpenJDK6 and OpenJDK7. >> >> -kto > Yes, my thinking has been to mirror the overall JDK 7 repository > forest structure in OpenJDK 6. Quick follow-up, I've been traveling recently and haven't had a chance to chat with Kelly yet. Given that there is currently the per-build external Mercurial repository and that it is easy to get the list of bugs fixed in a build, retroactively synthesizing the (approximate) patches associated with a set of bugs *might* be workable since figuring out the bug <-> file mapping shouldn't be that bad. If those interested in seeing the past history synthesized these patches, I could focus on finishing getting the OpenJDK build 12++ code ready for Mercurial and then reverse apply the set of patches to get back to the earlier public source drops. However, this might be more work than I think and I'll want to talk to Kelly about the detailed logistics of what would be necessary for this to happen. My priority is on getting the "official" Mercurial repository up and running so we can collaborate there going forward as opposed to spending lots of time on retrofitting the existing build history into the new repository. Also, in the future I'd like to consider an infrastructure where areas like corba, jaxp, and jaxws for OpenJDK 6 could be managed as patches to an imported code base rather than having a fully populated copy of the code under revision management for the release. Cheers, -Joe From bugzilla-daemon at icedtea.classpath.org Mon Sep 22 15:35:21 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 22 Sep 2008 22:35:21 +0000 Subject: [Bug 194] New: ClassNotFoundException loading applet Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=194 Summary: ClassNotFoundException loading applet Product: IcedTea Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: agajania at cs.newpaltz.edu My platform is CentOS 5.2 with OpenJDK b11 from EPEL. When loading an applet, the following messages are output: netx: Initialization Error: Could not initialize applet. (java.lang.ClassNotFoundException osp.OSP) netx: Initialization Error: Could not initialize applet. (java.lang.ClassNotFoundException osp.OSP) Help in resolving this would be sincerely appreciated. The following is a more verbose listing of the output gcjwebplugin GCJ PLUGIN: thread 0x1b579230: NP_Initialize GCJ PLUGIN: thread 0x1b579230: plugin_test_appletviewer GCJ PLUGIN: thread 0x1b579230: plugin_test_appletviewer return GCJ PLUGIN: thread 0x1b579230: NP_Initialize: using /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/../../bin/pluginappletviewer GCJ PLUGIN: thread 0x1b579230: NP_Initialize return GCJ PLUGIN: thread 0x1b579230: GCJ_New GCJ PLUGIN: thread 0x1b579230: plugin_data_new GCJ PLUGIN: thread 0x1b579230: plugin_data_new return GCJ PLUGIN: thread 0x1b579230: plugin_get_documentbase GCJ PLUGIN: thread 0x1b579230: plugin_get_documentbase return GCJ PLUGIN: thread 0x1b579230: GCJ_New: creating input fifo: /home/agajania/.gcjwebplugin/gcj-instance-9035-0-appletviewer-to-plugin GCJ PLUGIN: thread 0x1b579230: GCJ_New: created input fifo: /home/agajania/.gcjwebplugin/gcj-instance-9035-0-appletviewer-to-plugin GCJ PLUGIN: thread 0x1b579230: GCJ_New: creating output fifo: /home/agajania/.gcjwebplugin/gcj-instance-9035-0-plugin-to-appletviewer GCJ PLUGIN: thread 0x1b579230: GCJ_New: created output fifo: /home/agajania/.gcjwebplugin/gcj-instance-9035-0-plugin-to-appletviewer GCJ PLUGIN: thread 0x1b579230: plugin_start_appletviewer GCJ PLUGIN: thread 0x1b579230: plugin_start_appletviewer return GCJ PLUGIN: thread 0x1b579230: GCJ_New: got confirmation that appletviewer is running. GCJ PLUGIN: thread 0x1b579230: plugin_create_applet_tag GCJ PLUGIN: thread 0x1b579230: plugin_create_applet_tag return GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer PIPE: plugin wrote: instance-9035-0 GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer return GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer PIPE: plugin wrote: tag http://cs.newpaltz.edu:8080/ospBase/servlet/osp.Submit.SubmitWork GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer return GCJ PLUGIN: thread 0x1b579230: GCJ_New return PIPE: appletviewer wrote: running GCJ PLUGIN: thread 0x1b579230: NP_GetValue GCJ PLUGIN: thread 0x1b579230: NP_GetValue: returning plugin description. GCJ PLUGIN: thread 0x1b579230: NP_GetValue return GCJ PLUGIN: thread 0x1b579230: GCJ_GetValue GCJ PLUGIN: thread 0x1b579230: GCJ_GetValue: returning TRUE for NeedsXEmbed. GCJ PLUGIN: thread 0x1b579230: GCJ_GetValue return GCJ PLUGIN: thread 0x1b579230: GCJ_SetWindow GCJ PLUGIN: thread 0x1b579230: GCJ_SetWindow: setting window. GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer PIPE: plugin wrote: instance-9035-0 GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer return GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer PIPE: plugin wrote: handle 41999103 width 600 height 350 GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer return GCJ PLUGIN: thread 0x1b579230: GCJ_SetWindow return GCJ PLUGIN: thread 0x1b579230: GCJ_SetWindow GCJ PLUGIN: thread 0x1b579230: GCJ_SetWindow: window already exists. GCJ PLUGIN: thread 0x1b579230: GCJ_SetWindow: window width changed. GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer PIPE: plugin wrote: instance-9035-0 GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer return GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer PIPE: plugin wrote: width 600 GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer return GCJ PLUGIN: thread 0x1b579230: GCJ_SetWindow: window height changed. GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer PIPE: plugin wrote: instance-9035-0 GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer return GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer PIPE: plugin wrote: height 350 GCJ PLUGIN: thread 0x1b579230: plugin_send_message_to_appletviewer return GCJ PLUGIN: thread 0x1b579230: GCJ_SetWindow return PIPE: appletviewer read: instance-9035-0 PIPE: appletviewer read: tag http://cs.newpaltz.edu:8080/ospBase/servlet/osp.Submit.SubmitWork PIPE: appletviewer read: instance-9035-0 PIPE: appletviewer read: handle 41999103 width 600 height 350 GCJ PLUGIN: thread 0x1b579230: plugin_in_pipe_callback PIPE: appletviewer wrote: status starting applet... GCJ PLUGIN: thread 0x1b579230: plugin_in_pipe_callback: setting status starting applet... PIPE: plugin read: status starting applet... GCJ PLUGIN: thread 0x1b579230: plugin_in_pipe_callback return PIPE: appletviewer read: instance-9035-0 PIPE: appletviewer read: width 600 PIPE: appletviewer read: instance-9035-0 PIPE: appletviewer read: height 350 initializing JNLPRuntime... netx: Initialization Error: Could not initialize applet. (java.lang.ClassNotFoundException osp.OSP) netx: Initialization Error: Could not initialize applet. (java.lang.ClassNotFoundException osp.OSP) GCJ PLUGIN: thread 0x1b579230: plugin_out_pipe_callback GCJ PLUGIN: thread 0x1b579230: plugin_out_pipe_callback: appletviewer has stopped. GCJ PLUGIN: thread 0x1b579230: plugin_out_pipe_callback return GCJ PLUGIN: thread 0x1b579230: plugin_in_pipe_callback GCJ PLUGIN: thread 0x1b579230: appletviewer has stopped. GCJ PLUGIN: thread 0x1b579230: plugin_in_pipe_callback return The following is a section of the HTML from the web page that calls the applet: alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason." Your browser is completely ignoring the &lt;APPLET&gt; tag! -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From mark at klomp.org Tue Sep 23 02:59:35 2008 From: mark at klomp.org (Mark Wielaard) Date: Tue, 23 Sep 2008 11:59:35 +0200 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <48D13DAE.9030009@sun.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> <48D13DAE.9030009@sun.com> Message-ID: <1222163975.3178.38.camel@dijkstra.wildebeest.org> Hi Kelly, On Wed, 2008-09-17 at 10:26 -0700, Kelly O'Hair wrote: > Speaking from experience, any attempts at cleanly creating changesets > from TeamWare data alone is a waste of time. Just doesn't work well. > Granted we have pretty complete OpenJDK6 changeset data (data beyond > the TeamWare data) and could potentially do this, it's quite a bit of > grunt work to accomplish. Before we go off on this kind of adventure > we need to make sure the time spent is worth it. It depends on what your goal is. To be useful having any changeset data that is more fine grained grained than the big source code drop changes we have now is already enough. While it would be great to have an all singing and dancing mercurial repo that exactly matches the teamware changesets going back to the birth of openjdk6 and that then is essentially a tree that can be easily merged with openjdk7 would be super great. But to be useful just having the changes as they are going in (even if it is just patches posted to the list at the time they are applied to the internal teamware tree) would be of great value imho. > A different approach would be to create changesets per build/promotion, > but those kind of large changesets can have limited usefulness. That is what we have in http://icedtea.classpath.org/hg/openjdk6 now. It is indeed of limited usefulness. But already very useful to actually see what really went into the tree. Being able to just hg diff between source code drops really helps getting a better feeling for the changes in the code in my experience. So in order of preference I would like to see: - Patches posted to the mailinglist going forward whenever they are applied to the internal teamware tree until we have a real public mercurial repository. - Getting individual changesets as they were applied from openjdk6 build b05 so we can build up at least some real history of the tree. - Getting the baseline openjdk7 tree from which the original openjdk6 was derived, so it will be easier to track essential changes from the openjdk7 tree since then. - Getting the changesets from that version of the openjdk7 tree to the first openjdk7 tree that is in mercurial (we already have early source drop changes from the early svn days converted to mercurial in http://icedtea.classpath.org/openjdk) - Nirvana - aka, combine all the above to construct a mercurial tree with all the above changesets that covers both openjdk6 and openjdk7 for really easy merging between the tree. > Also, don't forget that the OpenJDK7 sources are a Mercurial forest, > not just one repository. I assume that we want to mimic the same > forest layout, keeping the langtools, corba, jaxp, jaxws, and hotspot > sources in their own repositories, separate from the core 'jdk' repository. > That allows us to do some plug and play with these repositories > between OpenJDK6 and OpenJDK7. How likely is it that we will actually plug and play these sub-repositories between openjdk6 and openjdk7? If we can easily do that, and it is likely that we will not just share individual patches between trees but whole repository merges then that would be interesting. But if openjdk6 will essentially be a separate, mainly maintenance, tree then I think just having one tree instead of a forest of repositories makes sense. Since forests do complicate things a bit. So it must be clear that there is a real gain from having them. Cheers, Mark From mark at klomp.org Tue Sep 23 03:03:08 2008 From: mark at klomp.org (Mark Wielaard) Date: Tue, 23 Sep 2008 12:03:08 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <48D2A430.2070903@sun.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <1221738084.3256.24.camel@dijkstra.wildebeest.org> <1221739400.3256.34.camel@dijkstra.wildebeest.org> <48D263FD.1080702@sun.com> <1221748518.3256.59.camel@dijkstra.wildebeest.org> <48D2A430.2070903@sun.com> Message-ID: <1222164188.3178.42.camel@dijkstra.wildebeest.org> Hi Joe, On Thu, 2008-09-18 at 11:55 -0700, Joseph D. Darcy wrote: > Mark Wielaard wrote: > > On Thu, 2008-09-18 at 07:21 -0700, Joseph D. Darcy wrote: > > > >>> Note: No language changes were introduced in JDK 6, so the values > >>> 1.6 and 6 are not valid. > >>> > >> Where are you seeing this documented? The information is not correct > >> and other sources give the correct information: > >> http://java.sun.com/javase/6/docs/technotes/tools/solaris/javac.html > > > > It is from the javac manual page in: > > openjdk6/jdk/src/linux/doc/man/javac.1 > > which seems to be a copy of the one in: > > openjdk6/jdk/src/solaris/doc/sun/man/man1/javac.1 > > > > Well that's a problem! I'll talk to Jon about getting it fixed. Note that the version(s) in the openjdk7 tree are also stale and have the above (wrong) information in them. Are these manpages written by hand these days? It has a comment that says: "Generated by html2man", but it doesn't say what the original html file is that it was generated from. Cheers, Mark From mark at klomp.org Tue Sep 23 03:08:45 2008 From: mark at klomp.org (Mark Wielaard) Date: Tue, 23 Sep 2008 12:08:45 +0200 Subject: OpenJDK 6 build 12 source posted (directaudio/alsa backend) In-Reply-To: <48D7F80E.6060802@sun.com> References: <48CAB08F.6010407@sun.com> <1221402124.3542.40.camel@dijkstra.wildebeest.org> <48D7F80E.6060802@sun.com> Message-ID: <1222164525.3178.48.camel@dijkstra.wildebeest.org> Hi Joe, On Mon, 2008-09-22 at 12:54 -0700, Joseph D. Darcy wrote: > Mark Wielaard wrote: > > Although not in your changelogs, I saw you also included two of my fixes > > for the ALSA directaudio backend which I posted back in May on > > sound-dev, and which are included in icedtea already. > > - The sloppy open/close patch: > > http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000053.html > > - The ALSA native lock patch: > > http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000054.html > > > > Although it makes some applets that use some primitive sound output work > > better I never got a real response. Did you get someone from the sound > > team to look at these patches? They do seem to work for me and the few > > test users of those applets, but a full review by one of the sound > > engineers would be appreciated. They don't seem to be in the JDK7 tree. > > > No; the patches were not explicitly reviewed; Alex, please take a look > at them. Thanks. > Neither Gervill nor your patches have yet been incorporated into JDK 7. What is the reason for having them in JDK6, but not in JDK7? > > Karl did correctly pointed out back then that we just need a better/new > > sound backend. I do hope in time the pulseaudio backend that Ioana and > > Omair are working on will be that backend. > > > I don't have any technical background to speak of in sound, so I'll let > others weigh in on evaluating any new backends. The problem with the current backend is that hacks like the above seem to be necessary. And I found these deadlocks and "single channel" restrictions by just running some simple applets that used sound. Which did actually surprise me because either I am missing something, or the current backend is just not at all production ready. You can find the pulseaudio backend at http://icedtea.classpath.org/hg/pulseaudio and discussion and patches go to the icedtea mailinglist distro-pkg-dev at openjdk.java.net Cheers, Mark From mark at klomp.org Tue Sep 23 03:11:48 2008 From: mark at klomp.org (Mark Wielaard) Date: Tue, 23 Sep 2008 12:11:48 +0200 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <48D802A2.6080509@sun.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> <48D13DAE.9030009@sun.com> <48D2502A.7020001@sun.com> <48D802A2.6080509@sun.com> Message-ID: <1222164708.3178.51.camel@dijkstra.wildebeest.org> Hi Joe, On Mon, 2008-09-22 at 13:40 -0700, Joseph D. Darcy wrote: > Given that there is currently the per-build external Mercurial > repository and that it is easy to get the list of bugs fixed in a build, > retroactively synthesizing the (approximate) patches associated with a > set of bugs *might* be workable since figuring out the bug <-> file > mapping shouldn't be that bad. How do you get a list of these bugs? Your emails announcing the source drops do have some listed, but when I go over the actual diffs there are also changes that don't seem to relate to any bugs you mentioned. Thanks, Mark From mark at klomp.org Tue Sep 23 03:42:47 2008 From: mark at klomp.org (Mark Wielaard) Date: Tue, 23 Sep 2008 12:42:47 +0200 Subject: FW: Porting OpenJDK 6 to Stratus OpenVOS on IA32 -- cross development?? In-Reply-To: References: Message-ID: <1222166567.3178.72.camel@dijkstra.wildebeest.org> Hi Richard, On Mon, 2008-09-22 at 16:41 -0400, Barnes, Richard wrote: > Since Java obviously does not exist on OpenVOS yet, and since there > are *.java files in HotSpot, we have been considering doing cross > development from a Linux/IA32 machine that already has a native Java > installed. Since what we desire as a result of this project is an > OpenJDK6 running on OpenVOS, we believe we have run into a problem in > the makefiles and *.gmk files we have encountered to do not seem to > distinguish between host environments and target environments, which > would be helpful in order to make cross development less difficult. > This is in contrast to what we have seen in porting GNU software such > as gcc and gdb. Does anybody have any hints in how to deal with this > situation in order to produce a JVM and JIT compiler for a platform > different from the original host platform? If you do already have a GCC plus recent GCJ port for OpenVOS you could use the approach that IcedTea took and bootstrap OpenJDK using the existing libre-java toolchain based on GCC, GCJ, GNU Classpath and ECJ. See http://icedtea.classpath.org/ and the people on distro-pkg-dev at openjdk.java.net will most likely be happy to help out. Cheers, Mark From Joe.Darcy at Sun.COM Tue Sep 23 05:03:11 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Tue, 23 Sep 2008 05:03:11 -0700 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <1222164708.3178.51.camel@dijkstra.wildebeest.org> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> <48D13DAE.9030009@sun.com> <48D2502A.7020001@sun.com> <48D802A2.6080509@sun.com> <1222164708.3178.51.camel@dijkstra.wildebeest.org> Message-ID: <48D8DAFF.7090003@sun.com> Mark Wielaard wrote: > Hi Joe, > > On Mon, 2008-09-22 at 13:40 -0700, Joseph D. Darcy wrote: > >> Given that there is currently the per-build external Mercurial >> repository and that it is easy to get the list of bugs fixed in a build, >> retroactively synthesizing the (approximate) patches associated with a >> set of bugs *might* be workable since figuring out the bug <-> file >> mapping shouldn't be that bad. >> > > How do you get a list of these bugs? Your emails announcing the source > drops do have some listed, but when I go over the actual diffs there are > also changes that don't seem to relate to any bugs you mentioned. > I can generate queries against the Sun-internal bug database to get the full bug list per build. -Joe From Joe.Darcy at Sun.COM Tue Sep 23 06:12:17 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Tue, 23 Sep 2008 06:12:17 -0700 Subject: OpenJDK 6 build 12 source posted (directaudio/alsa backend) In-Reply-To: <1222164525.3178.48.camel@dijkstra.wildebeest.org> References: <48CAB08F.6010407@sun.com> <1221402124.3542.40.camel@dijkstra.wildebeest.org> <48D7F80E.6060802@sun.com> <1222164525.3178.48.camel@dijkstra.wildebeest.org> Message-ID: <48D8EB31.60004@sun.com> Mark Wielaard wrote: > Hi Joe, > > On Mon, 2008-09-22 at 12:54 -0700, Joseph D. Darcy wrote: > >> Mark Wielaard wrote: >> >>> Although not in your changelogs, I saw you also included two of my fixes >>> for the ALSA directaudio backend which I posted back in May on >>> sound-dev, and which are included in icedtea already. >>> - The sloppy open/close patch: >>> http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000053.html >>> - The ALSA native lock patch: >>> http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000054.html >>> >>> Although it makes some applets that use some primitive sound output work >>> better I never got a real response. Did you get someone from the sound >>> team to look at these patches? They do seem to work for me and the few >>> test users of those applets, but a full review by one of the sound >>> engineers would be appreciated. They don't seem to be in the JDK7 tree. >>> >>> >> No; the patches were not explicitly reviewed; Alex, please take a look >> at them. >> > > Thanks. > > >> Neither Gervill nor your patches have yet been incorporated into JDK 7. >> > > What is the reason for having them in JDK6, but not in JDK7? > Just no one at Sun has gotten around to doing it yet for JDK 7. -Joe From Joe.Darcy at Sun.COM Tue Sep 23 07:12:16 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Tue, 23 Sep 2008 07:12:16 -0700 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <1222164188.3178.42.camel@dijkstra.wildebeest.org> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <1221738084.3256.24.camel@dijkstra.wildebeest.org> <1221739400.3256.34.camel@dijkstra.wildebeest.org> <48D263FD.1080702@sun.com> <1221748518.3256.59.camel@dijkstra.wildebeest.org> <48D2A430.2070903@sun.com> <1222164188.3178.42.camel@dijkstra.wildebeest.org> Message-ID: <48D8F940.40600@sun.com> Mark Wielaard wrote: > Hi Joe, > > On Thu, 2008-09-18 at 11:55 -0700, Joseph D. Darcy wrote: > >> Mark Wielaard wrote: >> >>> On Thu, 2008-09-18 at 07:21 -0700, Joseph D. Darcy wrote: >>> >>> >>>>> Note: No language changes were introduced in JDK 6, so the values >>>>> 1.6 and 6 are not valid. >>>>> >>>>> >>>> Where are you seeing this documented? The information is not correct >>>> and other sources give the correct information: >>>> http://java.sun.com/javase/6/docs/technotes/tools/solaris/javac.html >>>> >>> It is from the javac manual page in: >>> openjdk6/jdk/src/linux/doc/man/javac.1 >>> which seems to be a copy of the one in: >>> openjdk6/jdk/src/solaris/doc/sun/man/man1/javac.1 >>> >>> >> Well that's a problem! I'll talk to Jon about getting it fixed. >> > > Note that the version(s) in the openjdk7 tree are also stale and have > the above (wrong) information in them. > > Are these manpages written by hand these days? It has a comment that > says: "Generated by html2man", but it doesn't say what the original html > file is that it was generated from. > The process used in the past for man pages was that the docs team works with us developers to write the HTML man pages, which are in turn converted to SGML and *roff for Solaris and Linux, respectively. It looks like the last update to the HTML page, 6392810 "javac manpage needs to be updated to include JSR 269 and other Mustang options," did not get converted to the other formats. If the actual *nix man pages, regardless of format, are supposed to be generated in this fashion, it would admittedly be a better architecture to have them as generated files during the build and not track all three versions of the man page under version control. The -help output from a command should also be in-sync with the tool's capabilities. -Joe From omajid at redhat.com Tue Sep 23 08:38:41 2008 From: omajid at redhat.com (Omair Majid) Date: Tue, 23 Sep 2008 15:38:41 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-23 Omair Majid changeset 381f212496eb in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=381f212496eb description: 2008-09-23 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/Operation.java (waitForComplete): Handles interrupts now. Maybe not the best way of handling them, but it works. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (ClipThread.run): Drain the stream by using the stream functions, not by a call to drain. (drain): Fixed to work the way reported in the bug report. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java (testLoopStartStopClip): Renamed to testLoop4Times. Now uses drain to wait for the loop to complete playing. (testDrainWithoutStart): Added a timeout. (testDrainBlocksWhilePlaying): New function. Tests that drain() blocks while playing. (testLoop0Clip): Renamed to testLoop0InterruptsPlayback. (testFramePosition): New function. Checks the value of getLongFrames() from clip. (testFramePositionAfterLooping): Checks that Looping the clip still returns the correct number of frames played (not just the current frame position in the audio stream). diffstat: 3 files changed, 132 insertions(+), 21 deletions(-) src/java/org/classpath/icedtea/pulseaudio/Operation.java | 9 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 28 +- unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java | 116 ++++++++-- diffs (238 lines): diff -r 4a1c8f3d1f62 -r 381f212496eb src/java/org/classpath/icedtea/pulseaudio/Operation.java --- a/src/java/org/classpath/icedtea/pulseaudio/Operation.java Tue Sep 23 10:29:27 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Operation.java Tue Sep 23 11:38:18 2008 -0400 @@ -133,6 +133,8 @@ public class Operation { public void waitForCompletion() { assert (operationPointer != null); + + boolean interrupted = false; do { synchronized (eventLoop.threadLock) { if (getState() == Operation.State.Done) { @@ -141,10 +143,15 @@ public class Operation { try { eventLoop.threadLock.wait(); } catch (InterruptedException e) { - e.printStackTrace(); + // ingore the interrupt for now + interrupted = true; } } } while (getState() != State.Done); + // let the caller know about the interrupt + if (interrupted) { + Thread.currentThread().interrupt(); + } } } diff -r 4a1c8f3d1f62 -r 381f212496eb src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 23 10:29:27 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 23 11:38:18 2008 -0400 @@ -104,7 +104,15 @@ public class PulseAudioClip extends Puls } - PulseAudioClip.this.drain(); + Operation operation; + + synchronized (eventLoop.threadLock) { + operation = stream.drain(); + } + + operation.waitForCompletion(); + operation.releaseReference(); + } } @@ -209,19 +217,29 @@ public class PulseAudioClip extends Puls } + /* + * + * drain() on a Clip should block until the entire clip has finished playing + * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4732218 + * + * + * @see org.classpath.icedtea.pulseaudio.PulseAudioDataLine#drain() + */ @Override public void drain() { if (!isOpen) { throw new IllegalStateException("line not open"); } - if (clipThread != null) { - clipThread.interrupt(); + while (clipThread != null && clipThread.isAlive()) { try { clipThread.join(); } catch (InterruptedException e) { - } - } + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + Operation operation; synchronized (eventLoop.threadLock) { diff -r 4a1c8f3d1f62 -r 381f212496eb unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Tue Sep 23 10:29:27 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Tue Sep 23 11:38:18 2008 -0400 @@ -116,8 +116,12 @@ public class PulseAudioClipTest { } @Test - public void testLoopStopStartClip() throws LineUnavailableException, - IOException, UnsupportedAudioFileException { + public void testLoop4Times() throws LineUnavailableException, IOException, + UnsupportedAudioFileException { + System.out + .println("This tests loop(4) on the Clip. " + + "You should hear a certain part of the clip play back 5 time"); + Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); File soundFile = new File("testsounds/startup.wav"); AudioInputStream audioInputStream = AudioSystem @@ -127,18 +131,11 @@ public class PulseAudioClipTest { clip.setLoopPoints((int) (clip.getFrameLength() / 4), (int) (clip .getFrameLength() / 2)); clip.loop(4); - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - e.printStackTrace(); - } + + clip.drain(); + clip.stop(); - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - clip.start(); + clip.close(); } @@ -280,7 +277,7 @@ public class PulseAudioClipTest { } - @Test + @Test(timeout = 1000) public void testDrainWithoutStart() throws UnsupportedAudioFileException, IOException, LineUnavailableException { @@ -300,7 +297,37 @@ public class PulseAudioClipTest { } @Test - public void testLoop0Clip() throws LineUnavailableException, IOException, + public void testDrainBlocksWhilePlaying() + throws UnsupportedAudioFileException, IOException, + LineUnavailableException { + + String fileName = "testsounds/startup.wav"; + File soundFile = new File(fileName); + AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + AudioFormat audioFormat = audioInputStream.getFormat(); + + Clip clip; + clip = (Clip) mixer.getLine(new DataLine.Info(Clip.class, audioFormat)); + Assert.assertNotNull(clip); + + long startTime = System.currentTimeMillis(); + + clip.open(audioInputStream); + clip.start(); + clip.drain(); + clip.stop(); + clip.close(); + + long endTime = System.currentTimeMillis(); + + Assert.assertTrue(endTime - startTime > 3000); + System.out.println("Playback of " + fileName + " completed in " + + (endTime - startTime) + " milliseconds"); + } + + @Test + public void testLoop0InterruptsPlayback() throws LineUnavailableException, IOException, UnsupportedAudioFileException { Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); File soundFile = new File("testsounds/startup.wav"); @@ -383,6 +410,65 @@ public class PulseAudioClipTest { } @Test + public void testFramePosition() throws LineUnavailableException, + UnsupportedAudioFileException, IOException { + System.out + .println("This tests if the Clip provides the correct frame position"); + Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); + String fileName = "testsounds/logout.wav"; + File soundFile1 = new File(fileName); + AudioInputStream audioInputStream1 = AudioSystem + .getAudioInputStream(soundFile1); + clip.open(audioInputStream1); + + clip.start(); + + clip.drain(); + + long pos = clip.getFramePosition(); + + clip.close(); + + long expected = 136703; + long granularity = 100; + System.out.println("Frames in " + fileName + ": " + expected); + System.out.println("Frame position in clip :" + pos); + Assert.assertTrue("Expected: " + expected + " got " + pos, Math + .abs(expected - pos) < granularity); + + } + + @Test + public void testFramePositionAfterLooping() + throws LineUnavailableException, UnsupportedAudioFileException, + IOException { + System.out + .println("This tests if the Clip provides the correct frame position"); + Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); + String fileName = "testsounds/logout.wav"; + File soundFile1 = new File(fileName); + AudioInputStream audioInputStream1 = AudioSystem + .getAudioInputStream(soundFile1); + clip.open(audioInputStream1); + + clip.loop(1); + + clip.drain(); + + long pos = clip.getFramePosition(); + + clip.close(); + + long expected = 136703 * 2; + long granularity = 100; + System.out.println("Frames in " + fileName + ": " + expected); + System.out.println("Frame position in clip :" + pos); + Assert.assertTrue("Expected: " + expected + " got " + pos, Math + .abs(expected - pos) < granularity); + + } + + @Test public void testMixerKnowsAboutOpenClips() throws LineUnavailableException, UnsupportedAudioFileException, IOException { Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); From omajid at redhat.com Tue Sep 23 08:38:41 2008 From: omajid at redhat.com (Omair Majid) Date: Tue, 23 Sep 2008 15:38:41 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-23 Omair Majid changeset 4a1c8f3d1f62 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=4a1c8f3d1f62 description: 2008-09-23 Omair Majid * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java sourceDataLine is a memeber variable to allow tearDown to close it if some test accidentallly leaves it open. (testOpenAndClose): Fixed to use sourceDataLine. (testIsActiveAndIsOpen): Likewise. (testPlay): Likewise. (testStartedStopped): Likewise. (test2StartAndStopEvents): Likewise. (test3StartAndStopEvents): Likewise. (testStartOnClosedLine): Likewise. (testStopOnClosedLine): Likewise. (testPlayLessThanFrameSize): Likewise. (testOpenFormat): Likewise. (testFindLineWithFormat): Likewise. (testFindLineWithWrongFormat): Likewise. (testFindControl): Likewise. (testSupportedControls): Likewise. (testVolumeAndMute): Likewise. (testVolumeChanging): Likewise. (testOpenEvent): Likewise. (testCloseEvent): Likewise. (testCloseEventWrongListener): Likewise. (testFramePosition): Likewise. (testFramePositionAfterPlayingTwice): New function. Checks the length of getFramePositionAfterPlaying a file twice. (testMicroseconPosition): New function. Tests getMicrosecondPosition. (testBufferSizes): Fixed to use sourceDataLine. (testHasADefaultFormat): Likewise. (testDefaultFormatWithGetLine): Likewise. (testDrainTwice): Likewise. (testDrainWithoutStart): New function. Tests that for a SourceDataLine, writing some data, not starting it and trying to drain it causes the drain to hang. (testDrainWithoutOpen): Likewise. (testFlushTwice): Likewise. (testFlushWithoutOpen): Likewise. (testMixerKnowsAboutOpenLines): Likewise. (testMixerKnowsAboutOpen2Lines): Likewise (testMixerKnowsAboutOpen3Lines): Likewise. (tearDown): Close sourceDataLine if possible. diffstat: 1 file changed, 349 insertions(+), 196 deletions(-) unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java | 545 ++++++---- diffs (truncated from 907 to 500 lines): diff -r b7a5a39b31ab -r 4a1c8f3d1f62 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Mon Sep 22 14:44:23 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Tue Sep 23 10:29:27 2008 -0400 @@ -64,11 +64,13 @@ import org.junit.Test; public class PulseAudioSourceDataLineTest { Mixer mixer; - + SourceDataLine sourceDataLine; private int listenerCalled = 0; int started = 0; int stopped = 0; + int opened = 0; + int closed = 0; AudioFormat aSupportedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 10, true); @@ -144,44 +146,48 @@ public class PulseAudioSourceDataLineTes mixer.open(); + sourceDataLine = null; + started = 0; stopped = 0; + opened = 0; + closed = 0; } @Test public void testOpenAndClose() throws LineUnavailableException { - SourceDataLine line = (SourceDataLine) mixer.getLine(new Line.Info( - SourceDataLine.class)); - - line.open(); - Assert.assertTrue(line.isOpen()); - - line.close(); - Assert.assertFalse(line.isOpen()); + sourceDataLine = (SourceDataLine) mixer.getLine(new Line.Info( + SourceDataLine.class)); + + sourceDataLine.open(); + Assert.assertTrue(sourceDataLine.isOpen()); + + sourceDataLine.close(); + Assert.assertFalse(sourceDataLine.isOpen()); } @Test public void testIsActiveAndIsOpen() throws LineUnavailableException { - SourceDataLine line = (SourceDataLine) mixer.getLine(new DataLine.Info( + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( SourceDataLine.class, aSupportedFormat, 1000)); - Assert.assertFalse(line.isActive()); - Assert.assertFalse(line.isOpen()); - line.open(); - Assert.assertTrue(line.isOpen()); - Assert.assertFalse(line.isActive()); - line.start(); - Assert.assertTrue(line.isOpen()); - Assert.assertTrue(line.isActive()); - line.stop(); - Assert.assertTrue(line.isOpen()); - Assert.assertFalse(line.isActive()); - line.close(); - Assert.assertFalse(line.isOpen()); - Assert.assertFalse(line.isActive()); + Assert.assertFalse(sourceDataLine.isActive()); + Assert.assertFalse(sourceDataLine.isOpen()); + sourceDataLine.open(); + Assert.assertTrue(sourceDataLine.isOpen()); + Assert.assertFalse(sourceDataLine.isActive()); + sourceDataLine.start(); + Assert.assertTrue(sourceDataLine.isOpen()); + Assert.assertTrue(sourceDataLine.isActive()); + sourceDataLine.stop(); + Assert.assertTrue(sourceDataLine.isOpen()); + Assert.assertFalse(sourceDataLine.isActive()); + sourceDataLine.close(); + Assert.assertFalse(sourceDataLine.isOpen()); + Assert.assertFalse(sourceDataLine.isActive()); } @@ -195,14 +201,13 @@ public class PulseAudioSourceDataLineTes .getAudioInputStream(soundFile); AudioFormat audioFormat = audioInputStream.getFormat(); - SourceDataLine line; - line = (SourceDataLine) mixer.getLine(new DataLine.Info( + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( SourceDataLine.class, audioFormat)); - Assert.assertNotNull(line); - - line.open(audioFormat); + Assert.assertNotNull(sourceDataLine); + + sourceDataLine.open(audioFormat); System.out.println("opened"); - line.start(); + sourceDataLine.start(); System.out.println("started"); byte[] abData = new byte[1000]; int bytesRead = 0; @@ -210,15 +215,15 @@ public class PulseAudioSourceDataLineTes while (bytesRead >= 0) { bytesRead = audioInputStream.read(abData, 0, abData.length); if (bytesRead > 0) { - line.write(abData, 0, bytesRead); + sourceDataLine.write(abData, 0, bytesRead); } } System.out.println("done"); - line.drain(); + sourceDataLine.drain(); System.out.println("drained"); - line.stop(); - line.close(); + sourceDataLine.stop(); + sourceDataLine.close(); System.out.println("closed"); } @@ -232,12 +237,11 @@ public class PulseAudioSourceDataLineTes .getAudioInputStream(soundFile); AudioFormat audioFormat = audioInputStream.getFormat(); - SourceDataLine line; - line = (SourceDataLine) mixer.getLine(new DataLine.Info( + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( SourceDataLine.class, audioFormat)); - Assert.assertNotNull(line); - - line.open(audioFormat); + Assert.assertNotNull(sourceDataLine); + + sourceDataLine.open(audioFormat); LineListener startStopListener = new LineListener() { @@ -258,22 +262,22 @@ public class PulseAudioSourceDataLineTes }; - line.addLineListener(startStopListener); + sourceDataLine.addLineListener(startStopListener); byte[] abData = new byte[1000]; int bytesRead = 0; - line.start(); + sourceDataLine.start(); while (bytesRead >= 0) { bytesRead = audioInputStream.read(abData, 0, abData.length); if (bytesRead > 0) { - line.write(abData, 0, bytesRead); - } - } - line.drain(); - - line.stop(); - line.close(); + sourceDataLine.write(abData, 0, bytesRead); + } + } + sourceDataLine.drain(); + + sourceDataLine.stop(); + sourceDataLine.close(); Assert.assertEquals(1, started); Assert.assertEquals(1, stopped); @@ -292,10 +296,9 @@ public class PulseAudioSourceDataLineTes .getAudioInputStream(soundFile); AudioFormat audioFormat = audioInputStream.getFormat(); - SourceDataLine line; - line = (SourceDataLine) mixer.getLine(new DataLine.Info( + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( SourceDataLine.class, audioFormat)); - Assert.assertNotNull(line); + Assert.assertNotNull(sourceDataLine); LineListener startStopListener = new LineListener() { @@ -314,22 +317,22 @@ public class PulseAudioSourceDataLineTes }; - line.addLineListener(startStopListener); + sourceDataLine.addLineListener(startStopListener); System.out.println("Launching threadWriter"); - ThreadWriter writer = new ThreadWriter(audioInputStream, line); + ThreadWriter writer = new ThreadWriter(audioInputStream, sourceDataLine); writer.start(); // System.out.println("started"); Thread.sleep(1000); - line.stop(); + sourceDataLine.stop(); System.out.println("corked"); Thread.sleep(1000); // UNCORK - line.stop(); + sourceDataLine.start(); Thread.sleep(1000); @@ -353,10 +356,9 @@ public class PulseAudioSourceDataLineTes .getAudioInputStream(soundFile); AudioFormat audioFormat = audioInputStream.getFormat(); - SourceDataLine line; - line = (SourceDataLine) mixer.getLine(new DataLine.Info( + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( SourceDataLine.class, audioFormat)); - Assert.assertNotNull(line); + Assert.assertNotNull(sourceDataLine); LineListener startStopListener = new LineListener() { @@ -375,27 +377,27 @@ public class PulseAudioSourceDataLineTes }; - line.addLineListener(startStopListener); + sourceDataLine.addLineListener(startStopListener); System.out.println("Launching threadWriter"); - ThreadWriter writer = new ThreadWriter(audioInputStream, line); + ThreadWriter writer = new ThreadWriter(audioInputStream, sourceDataLine); writer.start(); // System.out.println("started"); Thread.sleep(1000); - line.stop(); + sourceDataLine.stop(); Thread.sleep(1000); - line.start(); + sourceDataLine.start(); Thread.sleep(1000); - line.stop(); + sourceDataLine.stop(); Thread.sleep(1000); - line.start(); + sourceDataLine.start(); Thread.sleep(1000); @@ -409,23 +411,21 @@ public class PulseAudioSourceDataLineTes @Test(expected = IllegalStateException.class) public void testStartOnClosedLine() throws LineUnavailableException { - SourceDataLine line; - line = (SourceDataLine) mixer.getLine(new Line.Info( - SourceDataLine.class)); - Assert.assertNotNull(line); - - line.start(); + sourceDataLine = (SourceDataLine) mixer.getLine(new Line.Info( + SourceDataLine.class)); + Assert.assertNotNull(sourceDataLine); + + sourceDataLine.start(); } @Test(expected = IllegalStateException.class) public void testStopOnClosedLine() throws LineUnavailableException { - SourceDataLine line; - line = (SourceDataLine) mixer.getLine(new Line.Info( - SourceDataLine.class)); - Assert.assertNotNull(line); - - line.stop(); + sourceDataLine = (SourceDataLine) mixer.getLine(new Line.Info( + SourceDataLine.class)); + Assert.assertNotNull(sourceDataLine); + + sourceDataLine.stop(); } @Test(expected = IllegalArgumentException.class) @@ -437,21 +437,20 @@ public class PulseAudioSourceDataLineTes AudioFormat audioFormat = audioInputStream.getFormat(); // the audio file must have an even number of channels Assert.assertTrue(audioFormat.getChannels() % 2 == 0); - SourceDataLine line; - line = (SourceDataLine) mixer.getLine(new DataLine.Info( + + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( SourceDataLine.class, audioFormat)); byte[] data = new byte[1]; data[0] = (byte) 'a'; - line.open(); - line.start(); + sourceDataLine.open(); + sourceDataLine.start(); try { - line.write(data, 0, 1); + sourceDataLine.write(data, 0, 1); } finally { - line.drain(); - line.stop(); - line.close(); + sourceDataLine.stop(); + sourceDataLine.close(); } } @@ -469,13 +468,12 @@ public class PulseAudioSourceDataLineTes .getAudioInputStream(soundFile); AudioFormat audioFormat = audioInputStream.getFormat(); - SourceDataLine line; - line = (SourceDataLine) mixer.getLine(new DataLine.Info( + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( SourceDataLine.class, audioFormat)); - Assert.assertNotNull(line); - line.open(); - Assert.assertTrue(line.getFormat().matches(audioFormat)); - line.close(); + Assert.assertNotNull(sourceDataLine); + sourceDataLine.open(); + Assert.assertTrue(sourceDataLine.getFormat().matches(audioFormat)); + sourceDataLine.close(); } @Test @@ -485,11 +483,12 @@ public class PulseAudioSourceDataLineTes AudioFormat wantedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 10, true); System.out.println(wantedFormat); - SourceDataLine line = (SourceDataLine) mixer.getLine(new DataLine.Info( + + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( SourceDataLine.class, wantedFormat)); - line.open(); - System.out.println(line.getFormat()); - line.close(); + sourceDataLine.open(); + System.out.println(sourceDataLine.getFormat()); + sourceDataLine.close(); } @@ -497,46 +496,46 @@ public class PulseAudioSourceDataLineTes public void testFindLineWithWrongFormat() throws LineUnavailableException { System.out .println("This test tries to acquire a line with incorrect format spec"); - SourceDataLine line = (SourceDataLine) mixer.getLine(new DataLine.Info( + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( SourceDataLine.class, new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100, 10000, 1, 13, 10, true))); - line.open(); - line.close(); + sourceDataLine.open(); + sourceDataLine.close(); } @Test public void testFindControl() throws LineUnavailableException { - SourceDataLine sourceLine = (SourceDataLine) mixer - .getLine(new Line.Info(SourceDataLine.class)); - sourceLine.open(); - Control[] controls = sourceLine.getControls(); + sourceDataLine = (SourceDataLine) mixer.getLine(new Line.Info( + SourceDataLine.class)); + sourceDataLine.open(); + Control[] controls = sourceDataLine.getControls(); Assert.assertNotNull(controls); - Assert.assertTrue(sourceLine.getControls().length > 0); + Assert.assertTrue(sourceDataLine.getControls().length > 0); for (Control control : controls) { Assert.assertNotNull(control); } - sourceLine.close(); + sourceDataLine.close(); } @Test public void testSupportedControls() throws LineUnavailableException { - SourceDataLine sourceLine = (SourceDataLine) mixer - .getLine(new Line.Info(SourceDataLine.class)); - sourceLine.open(); - Assert.assertTrue(sourceLine + sourceDataLine = (SourceDataLine) mixer.getLine(new Line.Info( + SourceDataLine.class)); + sourceDataLine.open(); + Assert.assertTrue(sourceDataLine .isControlSupported(FloatControl.Type.VOLUME)); - Assert.assertTrue(sourceLine + Assert.assertTrue(sourceDataLine .isControlSupported(BooleanControl.Type.MUTE)); - sourceLine.close(); + sourceDataLine.close(); } @Test public void testVolumeAndMute() throws Exception { Mixer selectedMixer = mixer; - SourceDataLine line = (SourceDataLine) selectedMixer - .getLine(new Line.Info(SourceDataLine.class)); + sourceDataLine = (SourceDataLine) selectedMixer.getLine(new Line.Info( + SourceDataLine.class)); File soundFile = new File(new java.io.File(".").getCanonicalPath() + "/testsounds/logout.wav"); @@ -544,11 +543,11 @@ public class PulseAudioSourceDataLineTes .getAudioInputStream(soundFile); AudioFormat audioFormat = audioInputStream.getFormat(); - line.open(audioFormat); - line.start(); - FloatControl volume = (FloatControl) line + sourceDataLine.open(audioFormat); + sourceDataLine.start(); + FloatControl volume = (FloatControl) sourceDataLine .getControl(FloatControl.Type.VOLUME); - BooleanControl mute = (BooleanControl) line + BooleanControl mute = (BooleanControl) sourceDataLine .getControl(BooleanControl.Type.MUTE); mute.setValue(true); @@ -562,12 +561,12 @@ public class PulseAudioSourceDataLineTes while (bytesRead >= 0) { bytesRead = audioInputStream.read(abData, 0, abData.length); if (bytesRead > 0) { - line.write(abData, 0, bytesRead); - } - } - - line.drain(); - line.close(); + sourceDataLine.write(abData, 0, bytesRead); + } + } + + sourceDataLine.drain(); + sourceDataLine.close(); selectedMixer.close(); } @@ -578,8 +577,8 @@ public class PulseAudioSourceDataLineTes Mixer selectedMixer = mixer; - SourceDataLine line = (SourceDataLine) selectedMixer - .getLine(new Line.Info(SourceDataLine.class)); + sourceDataLine = (SourceDataLine) selectedMixer.getLine(new Line.Info( + SourceDataLine.class)); File soundFile = new File(new java.io.File(".").getCanonicalPath() + "/testsounds/logout.wav"); @@ -587,9 +586,9 @@ public class PulseAudioSourceDataLineTes .getAudioInputStream(soundFile); AudioFormat audioFormat = audioInputStream.getFormat(); - line.open(audioFormat); - line.start(); - FloatControl volume = (FloatControl) line + sourceDataLine.open(audioFormat); + sourceDataLine.start(); + FloatControl volume = (FloatControl) sourceDataLine .getControl(FloatControl.Type.VOLUME); volume.setValue(volume.getMinimum()); @@ -600,13 +599,13 @@ public class PulseAudioSourceDataLineTes while (bytesRead >= 0) { bytesRead = audioInputStream.read(abData, 0, abData.length); if (bytesRead > 0) { - line.write(abData, 0, bytesRead); + sourceDataLine.write(abData, 0, bytesRead); volume.setValue(volume.getValue() + 100); } } - line.drain(); - line.close(); From omajid at redhat.com Tue Sep 23 12:08:59 2008 From: omajid at redhat.com (Omair Majid) Date: Tue, 23 Sep 2008 19:08:59 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-23 Omair Majid changeset c46f6e0e7959 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=c46f6e0e7959 description: 2008-09-23 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Removed clipThreadStarted. Use clipThread.isAlive() etc. Removed unused clipSemaphore (ClipThread.run): Fixed to run without clipSemaphore. (close): Reset currentFrame and framesSinceOpen on close. (getFramePosition): Synchronized on framesSinceOpen. (loop): Replaced use of clipThreadStarted with clipThread.isAlive. (open): Initialize currentFrame, framesSinceOpen and endFrame. (stop): Remember which frame we stopped at. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java (open): Clean up properly on error. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java (write): On interrupt, return asap and mark the thread as being interrupted. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java (testFramePosition): Renamed to testFramePositionBeforeClose. (testFramePositionWithStartStop): New function. Checks that starting and stopping doesnt change the frame counts. (testFramePositionWithLoop): Checks that looping doesnt interfere with the frame position. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java (ThreadWriter.run): Removed useless TODO comment. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java (ThreadWriter.run): Removed useless TODO. (setUp): Initialize listeners. diffstat: 6 files changed, 168 insertions(+), 48 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 86 +++++--- src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 13 - src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 10 unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java | 103 +++++++++- unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java | 1 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java | 3 diffs (482 lines): diff -r 381f212496eb -r c46f6e0e7959 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 23 11:38:18 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 23 15:02:55 2008 -0400 @@ -38,7 +38,6 @@ package org.classpath.icedtea.pulseaudio package org.classpath.icedtea.pulseaudio; import java.io.IOException; -import java.util.concurrent.Semaphore; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; @@ -57,53 +56,57 @@ public class PulseAudioClip extends Puls private float volume; // these are frame indices. so counted from 0 + // the current frame index private int currentFrame = 0; + + // total number of frames in this clip private int frameCount = 0; + + // the starting frame of the loop private int startFrame = 0; + // the ending frame of the loop private int endFrame = 0; + + // the total number of frames played since this line was opened private int framesSinceOpen = 0; public static final String DEFAULT_CLIP_NAME = "Clip"; private Object clipLock = new Object(); - private boolean clipThreadStarted; private int loopsLeft; - private Semaphore clipSemaphore = new Semaphore(1); + + // private Semaphore clipSemaphore = new Semaphore(1); private class ClipThread extends Thread { @Override public void run() { - clipThreadStarted = true; while (loopsLeft >= 0) { writeFrames(currentFrame, endFrame + 1); if (Thread.interrupted()) { // Thread.currentThread().interrupt(); - clipThreadStarted = false; + // System.out.println("returned from interrupted + // writeFrames"); break; } - try { - // if loop(0) has been called from the mainThread, - // wait until loopsLeft has been set - clipSemaphore.acquire(); - if (loopsLeft == 0) { - System.out.println("Reading to the end of the file"); - writeFrames(endFrame, getFrameLength()); - break; - } else { - synchronized (clipLock) { - currentFrame = startFrame; - loopsLeft--; - } + // if loop(0) has been called from the mainThread, + // wait until loopsLeft has been set + if (loopsLeft == 0) { + // System.out.println("Reading to the end of the file"); + // System.out.println("endFrame: " + endFrame); + writeFrames(endFrame, getFrameLength()); + break; + } else { + synchronized (clipLock) { + currentFrame = startFrame; + loopsLeft--; } - clipSemaphore.release(); - } catch (InterruptedException e) { - break; } } + // drain Operation operation; synchronized (eventLoop.threadLock) { @@ -145,6 +148,9 @@ public class PulseAudioClip extends Puls try { eventLoop.threadLock.wait(); } catch (InterruptedException e) { + // System.out + // .println("interrupted while waiting for + // getWritableSize"); // clean up and return Thread.currentThread().interrupt(); stream.removeWriteListener(writeListener); @@ -160,16 +166,18 @@ public class PulseAudioClip extends Puls framesToWrite * getFormat().getFrameSize()); remainingFrames -= framesToWrite; currentFrame += framesToWrite; + framesSinceOpen += framesToWrite; if (Thread.interrupted()) { Thread.currentThread().interrupt(); break; } // System.out.println("remaining frames" + remainingFrames); + // System.out.println("currentFrame: " + currentFrame); + // System.out.println("framesSinceOpen: " + framesSinceOpen); } } stream.removeWriteListener(writeListener); - } public PulseAudioClip(EventLoop eventLoop, AudioFormat[] formats, @@ -210,6 +218,9 @@ public class PulseAudioClip extends Puls e.printStackTrace(); } + currentFrame = 0; + framesSinceOpen = 0; + PulseAudioMixer mixer = PulseAudioMixer.getInstance(); mixer.removeSourceLine(this); @@ -235,8 +246,7 @@ public class PulseAudioClip extends Puls try { clipThread.join(); } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + // ignore } } @@ -280,8 +290,9 @@ public class PulseAudioClip extends Puls if (!isOpen) { throw new IllegalStateException("Line not open"); } - - return (int) framesSinceOpen; + synchronized (clipLock) { + return (int) framesSinceOpen; + } } @Override @@ -324,7 +335,7 @@ public class PulseAudioClip extends Puls System.out.println("Loop " + count + " called"); - if (clipThreadStarted && count != 0) { + if (clipThread.isAlive() && count != 0) { // Do nothing; behavior not specified by the Java API return; } @@ -358,7 +369,9 @@ public class PulseAudioClip extends Puls this.data = new byte[bufferSize]; System.arraycopy(data, offset, this.data, 0, bufferSize); frameCount = bufferSize / format.getFrameSize(); - + currentFrame = 0; + framesSinceOpen = 0; + endFrame = frameCount - 1; PulseAudioVolumeControl volumeControl = new PulseAudioVolumeControl( this, eventLoop); PulseAudioMuteControl muteControl = new PulseAudioMuteControl(this, @@ -373,6 +386,20 @@ public class PulseAudioClip extends Puls } + // FIXME This is not exposed by the Clip interface, but becomes available if + // using PulseAudioClip + // @Override + // public void open(AudioFormat format, int bufferSize) + // throws LineUnavailableException { + // throw new IllegalArgumentException("open(AudioFormat, int) on a Clip is + // not allowed"); + // } + + @Override + // public void open(AudioFormat format) throws LineUnavailableException { + // throw new IllegalArgumentException("open(AudioFormat) on a Clip is not + // allowed"); + // } public byte[] native_setVolume(float value) { return stream.native_setVolume(value); } @@ -428,7 +455,7 @@ public class PulseAudioClip extends Puls } if (end == -1) { - end = frameCount; + end = frameCount - 1; } if (end < start) { @@ -496,7 +523,6 @@ public class PulseAudioClip extends Puls e.printStackTrace(); } synchronized (clipLock) { - currentFrame = 0; loopsLeft = 0; } diff -r 381f212496eb -r c46f6e0e7959 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Tue Sep 23 11:38:18 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Tue Sep 23 15:02:55 2008 -0400 @@ -160,7 +160,11 @@ public abstract class PulseAudioDataLine } catch (LineUnavailableException e) { // error connecting to the server! - // FIXME clean up + stream.removePlaybackStartedListener(startedListener); + stream.removeUnderflowListener(stoppedListener); + stream.removeStateListener(openCloseListener); + stream.free(); + stream = null; throw e; } this.bufferSize = bufferSize; @@ -169,6 +173,7 @@ public abstract class PulseAudioDataLine synchronized (eventLoop.threadLock) { if (stream.getState() != Stream.State.READY) { stream.disconnect(); + stream.free(); throw new LineUnavailableException( "unable to obtain a line"); } @@ -230,9 +235,9 @@ public abstract class PulseAudioDataLine isStarted = false; } - // A BIG FIXME ! - /* + * TODO + * * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4791152 : * * a line is active in between calls to start() and stop(). In that sense, @@ -242,6 +247,8 @@ public abstract class PulseAudioDataLine * running. This also means that a line should become not running on buffer * underrun/overflow. * + * + * HOWEVER, the javadocs say the opposite thing! * */ diff -r 381f212496eb -r c46f6e0e7959 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Tue Sep 23 11:38:18 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Tue Sep 23 15:02:55 2008 -0400 @@ -151,6 +151,8 @@ public class PulseAudioSourceDataLine ex }; stream.addWriteListener(writeNotifier); + boolean interrupted = false; + while (remainingLength != 0) { synchronized (eventLoop.threadLock) { @@ -164,8 +166,8 @@ public class PulseAudioSourceDataLine ex try { eventLoop.threadLock.wait(100); } catch (InterruptedException e) { - // FIXME - assert (false); + // ignore for now + interrupted = true; } } @@ -195,7 +197,9 @@ public class PulseAudioSourceDataLine ex */ stream.removeWriteListener(writeNotifier); - + if (interrupted) { + Thread.currentThread().interrupt(); + } return sizeWritten; } diff -r 381f212496eb -r c46f6e0e7959 unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Tue Sep 23 11:38:18 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Tue Sep 23 15:02:55 2008 -0400 @@ -168,6 +168,8 @@ public class PulseAudioClipTest { @Test public void testOpenEvent() throws LineUnavailableException, UnsupportedAudioFileException, IOException { + System.out + .println("This tests the OPEN event. You should see an OPEN on the next line"); Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); File soundFile = new File("testsounds/startup.wav"); AudioInputStream audioInputStream = AudioSystem @@ -327,8 +329,8 @@ public class PulseAudioClipTest { } @Test - public void testLoop0InterruptsPlayback() throws LineUnavailableException, IOException, - UnsupportedAudioFileException { + public void testLoop0InterruptsPlayback() throws LineUnavailableException, + IOException, UnsupportedAudioFileException { Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); File soundFile = new File("testsounds/startup.wav"); AudioInputStream audioInputStream = AudioSystem @@ -410,7 +412,7 @@ public class PulseAudioClipTest { } @Test - public void testFramePosition() throws LineUnavailableException, + public void testFramePositionBeforeClose() throws LineUnavailableException, UnsupportedAudioFileException, IOException { System.out .println("This tests if the Clip provides the correct frame position"); @@ -430,7 +432,7 @@ public class PulseAudioClipTest { clip.close(); long expected = 136703; - long granularity = 100; + long granularity = 5; System.out.println("Frames in " + fileName + ": " + expected); System.out.println("Frame position in clip :" + pos); Assert.assertTrue("Expected: " + expected + " got " + pos, Math @@ -439,9 +441,10 @@ public class PulseAudioClipTest { } @Test - public void testFramePositionAfterLooping() + public void testFramePositionWithStartStop() throws LineUnavailableException, UnsupportedAudioFileException, - IOException { + IOException, InterruptedException { + System.out .println("This tests if the Clip provides the correct frame position"); Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); @@ -451,7 +454,12 @@ public class PulseAudioClipTest { .getAudioInputStream(soundFile1); clip.open(audioInputStream1); - clip.loop(1); + clip.start(); + + Thread.sleep(500); + clip.stop(); + Thread.sleep(5000); + clip.start(); clip.drain(); @@ -459,8 +467,8 @@ public class PulseAudioClipTest { clip.close(); - long expected = 136703 * 2; - long granularity = 100; + long expected = 136703; + long granularity = 5; System.out.println("Frames in " + fileName + ": " + expected); System.out.println("Frame position in clip :" + pos); Assert.assertTrue("Expected: " + expected + " got " + pos, Math @@ -469,6 +477,83 @@ public class PulseAudioClipTest { } @Test + public void testFramePositionWithLoop() throws LineUnavailableException, + UnsupportedAudioFileException, IOException, InterruptedException { + System.out.println("This tests if the Clip provides the correct frame " + + "position with a bit of looping in the clip"); + Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); + String fileName = "testsounds/logout.wav"; + File soundFile1 = new File(fileName); + AudioInputStream audioInputStream1 = AudioSystem + .getAudioInputStream(soundFile1); + clip.open(audioInputStream1); + + clip.setLoopPoints(0, -1); + clip.loop(1); + Thread.sleep(500); + clip.stop(); + Thread.sleep(2000); + clip.start(); + Thread.sleep(100); + clip.stop(); + Thread.sleep(4000); + clip.start(); + Thread.sleep(100); + clip.stop(); + Thread.sleep(2000); + clip.start(); + Thread.sleep(100); + clip.stop(); + Thread.sleep(3000); + clip.start(); + + clip.drain(); + + long pos = clip.getFramePosition(); + + clip.close(); + + long expected = 136703 * 1; + long granularity = 5; + System.out.println("Frames in " + fileName + ": " + expected); + System.out.println("Frame position in clip :" + pos); + Assert.assertTrue("Expected: " + expected + " got " + pos, Math + .abs(expected - pos) < granularity); + + } + + @Test + public void testFramePositionAfterLooping() + throws LineUnavailableException, UnsupportedAudioFileException, + IOException { + System.out + .println("This tests if the Clip provides the correct frame position"); + Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); + String fileName = "testsounds/logout.wav"; + File soundFile1 = new File(fileName); + AudioInputStream audioInputStream1 = AudioSystem + .getAudioInputStream(soundFile1); + clip.open(audioInputStream1); + + clip.setLoopPoints(0, -1); + clip.loop(1); + + clip.drain(); + + long pos = clip.getFramePosition(); + + clip.close(); + + long expected = 136703 * 2; + long granularity = 5; + System.out.println("Frames in " + fileName + ": " + expected); + System.out.println("Frame position in clip :" + pos); + Assert.assertTrue("Expected: " + expected + " got " + pos, Math + .abs(expected - pos) < granularity); + + } + + @Test public void testMixerKnowsAboutOpenClips() throws LineUnavailableException, UnsupportedAudioFileException, IOException { Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); diff -r 381f212496eb -r c46f6e0e7959 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java Tue Sep 23 11:38:18 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java Tue Sep 23 15:02:55 2008 -0400 @@ -113,7 +113,6 @@ public class PulseAudioSourceDataLineRaw } catch (LineUnavailableException e) { e.printStackTrace(); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); } } diff -r 381f212496eb -r c46f6e0e7959 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Tue Sep 23 11:38:18 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Tue Sep 23 15:02:55 2008 -0400 @@ -119,7 +119,6 @@ public class PulseAudioSourceDataLineTes } catch (LineUnavailableException e) { e.printStackTrace(); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); } } @@ -152,7 +151,7 @@ public class PulseAudioSourceDataLineTes stopped = 0; opened = 0; closed = 0; - + listenerCalled = 0; } @Test From iivan at redhat.com Tue Sep 23 14:09:50 2008 From: iivan at redhat.com (Ioana Ivan) Date: Tue, 23 Sep 2008 21:09:50 +0000 Subject: changeset in /hg/pulseaudio: Ioana Ivan Message-ID: changeset 2d384ad19c3e in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=2d384ad19c3e description: Ioana Ivan * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java: -split open() into createStream(), addStreamListeners() and connect(), which can be reused when reconnecting the line for synchronization -added recconectForSynchronization() -made some changes to stop()/start() in order to send START/STOP events both when corking and in case of underflow * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java: -changes to synchronize() * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java: -changed connectLine to take the masterStream as a parameter in case we want to synchronize the Line * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java: -changed connectLine to take the masterStream as a parameter in case we want to synchronize the Line diffstat: 11 files changed, 407 insertions(+), 111 deletions(-) ChangeLog | 20 + src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 12 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 190 ++++++++-- src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java | 4 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 141 ++++++- src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 55 +- src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 2 src/java/org/classpath/icedtea/pulseaudio/Stream.java | 32 + src/native/org_classpath_icedtea_pulseaudio_Stream.c | 24 + unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineRawTest.java | 28 - unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java | 10 diffs (truncated from 914 to 500 lines): diff -r c46f6e0e7959 -r 2d384ad19c3e ChangeLog --- a/ChangeLog Tue Sep 23 15:02:55 2008 -0400 +++ b/ChangeLog Tue Sep 23 17:01:26 2008 -0400 @@ -1,3 +1,23 @@ 2008-08-13 Ioana Ivan + * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java: + -split open() into createStream(), addStreamListeners() and + connect(), which can be reused when reconnecting the line for + synchronization + -added recconectForSynchronization() + -made some changes to stop()/start() in order to send + START/STOP events both when corking and in case of underflow + * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java: + -changes to synchronize() + * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java: + -changed connectLine to take the masterStream as a + parameter in case we want to synchronize the Line + * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java: + -changed connectLine to take the masterStream as a + parameter in case we want to synchronize the Line + + + + 2008-08-13 Ioana Ivan * src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java: superclass for TargetPort and SourcePort diff -r c46f6e0e7959 -r 2d384ad19c3e src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 23 15:02:55 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 23 17:01:26 2008 -0400 @@ -192,11 +192,19 @@ public class PulseAudioClip extends Puls } - protected void connectLine(int bufferSize) throws LineUnavailableException { + protected void connectLine(int bufferSize, Stream masterStream) throws LineUnavailableException{ StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( bufferSize, bufferSize / 2, bufferSize / 2, bufferSize / 2, 0); - stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes); + if(masterStream != null) { + synchronized (eventLoop.threadLock) { + stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, masterStream.getStreamPointer()); + } + } else { + synchronized (eventLoop.threadLock) { + stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, null); + } + } } @Override diff -r c46f6e0e7959 -r 2d384ad19c3e src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Tue Sep 23 15:02:55 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Tue Sep 23 17:01:26 2008 -0400 @@ -37,6 +37,7 @@ exception statement from your version. package org.classpath.icedtea.pulseaudio; +import java.util.ArrayList; import java.util.concurrent.Semaphore; import javax.sound.sampled.AudioFormat; @@ -45,6 +46,8 @@ import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineUnavailableException; +import org.classpath.icedtea.pulseaudio.Stream.WriteListener; + public abstract class PulseAudioDataLine extends PulseAudioLine implements DataLine { @@ -56,7 +59,8 @@ public abstract class PulseAudioDataLine // true between start() and stop() protected boolean isStarted = false; - protected boolean isEngagedInIo = false; + protected boolean dataWritten = false; + protected boolean corked = true; // true if a stream has been paused // protected boolean isPaused = false; @@ -64,12 +68,14 @@ public abstract class PulseAudioDataLine protected AudioFormat[] supportedFormats = null; protected AudioFormat currentFormat = null; protected AudioFormat defaultFormat = null; + protected boolean sendEvents = true; protected int bufferSize = 0; protected EventLoop eventLoop = null; protected Semaphore semaphore = new Semaphore(0); protected Stream stream; + private ArrayList synchronizedLines; public void open(AudioFormat format, int bufferSize) throws LineUnavailableException { @@ -77,6 +83,16 @@ public abstract class PulseAudioDataLine if (isOpen) { throw new IllegalStateException("DataLine is already open"); } + + createStream(format); + + addStreamListeners(); + connect(null, bufferSize); + + } + + public void createStream(AudioFormat format) + throws LineUnavailableException { for (AudioFormat myFormat : supportedFormats) { if (format.matches(myFormat)) { @@ -91,11 +107,16 @@ public abstract class PulseAudioDataLine super.open(); } } - // no matches found + if (!isOpen) { throw new IllegalArgumentException("Invalid format"); } + System.out.println("Stream " + stream + " created"); + + } + + public void addStreamListeners() { Stream.StateListener openCloseListener = new Stream.StateListener() { @Override @@ -116,14 +137,24 @@ public abstract class PulseAudioDataLine */ if (stream.getState() == Stream.State.READY) { - fireLineEvent(new LineEvent(PulseAudioDataLine.this, - LineEvent.Type.OPEN, AudioSystem.NOT_SPECIFIED)); + if (sendEvents) { + fireLineEvent(new LineEvent( + PulseAudioDataLine.this, + LineEvent.Type.OPEN, + AudioSystem.NOT_SPECIFIED)); + } semaphore.release(); + } else if (stream.getState() == Stream.State.TERMINATED || stream.getState() == Stream.State.FAILED) { - fireLineEvent((new LineEvent(PulseAudioDataLine.this, - LineEvent.Type.CLOSE, AudioSystem.NOT_SPECIFIED))); + if (sendEvents) { + fireLineEvent((new LineEvent( + PulseAudioDataLine.this, + LineEvent.Type.CLOSE, + AudioSystem.NOT_SPECIFIED))); + } semaphore.release(); + } } } @@ -134,9 +165,13 @@ public abstract class PulseAudioDataLine Stream.UnderflowListener stoppedListener = new Stream.UnderflowListener() { @Override public void update() { - isEngagedInIo = false; - fireLineEvent(new LineEvent(PulseAudioDataLine.this, - LineEvent.Type.STOP, AudioSystem.NOT_SPECIFIED)); + dataWritten = false; + + if (!corked) { + fireLineEvent(new LineEvent(PulseAudioDataLine.this, + LineEvent.Type.STOP, AudioSystem.NOT_SPECIFIED)); + } + } }; stream.addUnderflowListener(stoppedListener); @@ -144,34 +179,64 @@ public abstract class PulseAudioDataLine Stream.PlaybackStartedListener startedListener = new Stream.PlaybackStartedListener() { @Override public void update() { - isEngagedInIo = true; - fireLineEvent(new LineEvent(PulseAudioDataLine.this, - LineEvent.Type.START, AudioSystem.NOT_SPECIFIED)); - } - + + dataWritten = true; + if (!corked) { + fireLineEvent(new LineEvent(PulseAudioDataLine.this, + LineEvent.Type.START, AudioSystem.NOT_SPECIFIED)); + } + + } }; stream.addPlaybackStartedListener(startedListener); + WriteListener writeNotifier = new WriteListener() { + + @Override + public void update() { + // System.out.println("can write"); + eventLoop.threadLock.notifyAll(); + } + + }; + stream.addWriteListener(writeNotifier); + + Stream.CorkListener corkListener = new Stream.CorkListener() { + + @Override + public void update() { + + eventLoop.threadLock.notifyAll(); + } + + }; + stream.addCorkListener(corkListener); + } + + public void connect(Stream masterStream, int bufferSize) + throws LineUnavailableException { + try { synchronized (eventLoop.threadLock) { - connectLine(bufferSize); - } - + connectLine(bufferSize, masterStream); + } } catch (LineUnavailableException e) { // error connecting to the server! - stream.removePlaybackStartedListener(startedListener); - stream.removeUnderflowListener(stoppedListener); - stream.removeStateListener(openCloseListener); + //stream.removePlaybackStartedListener(startedListener); + //stream.removeUnderflowListener(stoppedListener); + //stream.removeStateListener(openCloseListener); stream.free(); stream = null; throw e; + } this.bufferSize = bufferSize; try { semaphore.acquire(); synchronized (eventLoop.threadLock) { if (stream.getState() != Stream.State.READY) { + System.out.println(stream.getState()); stream.disconnect(); stream.free(); throw new LineUnavailableException( @@ -200,6 +265,8 @@ public abstract class PulseAudioDataLine "Line must be open for close() to work"); } + drain(); + synchronized (eventLoop.threadLock) { stream.disconnect(); } @@ -218,21 +285,88 @@ public abstract class PulseAudioDataLine } + public void reconnectforSynchronization(Stream masterStream) { + sendEvents = false; + drain(); + + synchronized (eventLoop.threadLock) { + stream.disconnect(); + } + try { + semaphore.acquire(); + } catch (InterruptedException e) { + throw new RuntimeException("unable to prepare stream"); + } + try { + createStream(getFormat()); + } catch (LineUnavailableException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + addStreamListeners(); + try { + connect(masterStream, getBufferSize()); + } catch (LineUnavailableException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + sendEvents = true; + } + public void start() { if (!isOpen) { throw new IllegalStateException( "Line must be open()ed before it can be start()ed"); } + if (!corked) { + System.out.println("Already started, returning"); + return; + } + + corked = false; + Operation op; + synchronized (eventLoop.threadLock) { + op = stream.unCork(); + } + + op.waitForCompletion(); + op.releaseReference(); isStarted = true; - } - - public void stop() { + + /*if (dataWritten) { + fireLineEvent(new LineEvent(PulseAudioDataLine.this, + LineEvent.Type.START, AudioSystem.NOT_SPECIFIED)); + }*/ + + } + + public synchronized void stop() { if (!isOpen) { throw new IllegalStateException( "Line must be open()ed before it can be start()ed"); - } + + } + if (corked) { + return; + } + corked = true; + Operation op; + synchronized (eventLoop.threadLock) { + op = stream.cork(); + } + + op.waitForCompletion(); + op.releaseReference(); + isStarted = false; + if (dataWritten) { + fireLineEvent(new LineEvent(PulseAudioDataLine.this, + LineEvent.Type.STOP, AudioSystem.NOT_SPECIFIED)); + } + + isStarted = false; + } /* @@ -257,10 +391,10 @@ public abstract class PulseAudioDataLine } public boolean isRunning() { - return isEngagedInIo; - } - - protected abstract void connectLine(int bufferSize) + return !corked && dataWritten; + } + + protected abstract void connectLine(int bufferSize, Stream masterStream) throws LineUnavailableException; public abstract void drain(); diff -r c46f6e0e7959 -r 2d384ad19c3e src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Tue Sep 23 15:02:55 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Tue Sep 23 17:01:26 2008 -0400 @@ -114,9 +114,9 @@ abstract class PulseAudioLine implements @Override public void open() throws LineUnavailableException { - if (isOpen) { + /*if (isOpen) { throw new IllegalStateException("Line is already open"); - } + }*/ isOpen = true; } diff -r c46f6e0e7959 -r 2d384ad19c3e src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Tue Sep 23 15:02:55 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Tue Sep 23 17:01:26 2008 -0400 @@ -38,6 +38,7 @@ package org.classpath.icedtea.pulseaudio package org.classpath.icedtea.pulseaudio; import java.io.File; +import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; @@ -61,6 +62,7 @@ import javax.sound.sampled.Port; import javax.sound.sampled.Port; import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.TargetDataLine; +import javax.sound.sampled.UnsupportedAudioFileException; import javax.sound.sampled.AudioFormat.Encoding; import javax.sound.sampled.Control.Type; @@ -393,13 +395,32 @@ public class PulseAudioMixer implements @Override public boolean isSynchronizationSupported(Line[] lines, boolean maintainSync) { // FIXME - return false; + return true; } @Override public void synchronize(Line[] lines, boolean maintainSync) { - // FIXME pulse audio supports this - throw new IllegalArgumentException(); + Line masterStream = null; + for (Line line : lines) { + if (line.isOpen()) { + masterStream = line; + break; + } + } + if(masterStream == null) { + //for now, can't synchronize lines if none of them is open (no stream pointer to pass) + //will see what to do about this later + throw new IllegalArgumentException(); + } + + for(Line line : lines) { + if(line != masterStream) { + + ((PulseAudioDataLine) line).reconnectforSynchronization(((PulseAudioDataLine) masterStream).getStream()); + + } + } + } @Override @@ -631,6 +652,10 @@ public class PulseAudioMixer implements } } + public static void debug(String string) { + System.out.println("DEBUG: " + string); + } + public static void main(String[] args) throws Exception { Mixer.Info mixerInfos[] = AudioSystem.getMixerInfo(); Mixer.Info selectedMixerInfo = null; @@ -648,27 +673,97 @@ public class PulseAudioMixer implements .getMixer(selectedMixerInfo); mixer.open(); - File soundFile = new File("testsounds/startup.wav"); - AudioInputStream audioInputStream = AudioSystem - .getAudioInputStream(soundFile); - AudioFormat audioFormat = audioInputStream.getFormat(); - - SourceDataLine line; - line = (SourceDataLine) mixer.getLine(new DataLine.Info( - SourceDataLine.class, audioFormat)); - - line.open(); - Port.Info info = new Port.Info(Port.class, - "alsa_output.pci_8086_24d5_sound_card_0_alsa_playback_0", false); - Port port = (Port) mixer.getLine(info); - FloatControl control = (FloatControl) port - .getControl(FloatControl.Type.VOLUME); - control.getValue(); - control.setValue(0); - control.getValue(); - System.out.println(control.getValue()); + + String fileName1 = "testsounds/startup.wav"; + PulseAudioSourceDataLine line1; + line1 = (PulseAudioSourceDataLine) mixer.getLine(new Line.Info( + SourceDataLine.class)); + line1.setName("Line 1"); + + String fileName2 = "testsounds/logout.wav"; + PulseAudioSourceDataLine line2; + line2 = (PulseAudioSourceDataLine) mixer.getLine(new Line.Info( + SourceDataLine.class)); + line2.setName("Line 2"); + + + ThreadWriter writer1 = mixer.new ThreadWriter(line1, fileName1); + ThreadWriter writer2 = mixer.new ThreadWriter(line2, fileName2); + //line2.start(); + // line1.start(); + + Line[] lines = { line1, line2 }; + mixer.synchronize(lines, true); + + // line2.stop(); + + debug("PulseAudioMixer: " + line1.getName() + " and " + line2.getName() From omajid at redhat.com Tue Sep 23 14:23:38 2008 From: omajid at redhat.com (Omair Majid) Date: Tue, 23 Sep 2008 21:23:38 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-23 Omair Majid changeset 09bfaae2203b in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=09bfaae2203b description: 2008-09-23 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (ClipThread.run): The while loop doesnt end now if loop is less 0. Makes it work with LOOP_CONTINUOUSLY (-1). * unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java (testLoopContinuously): New function. Tests that loop(LOOP_CONTINUOUSLY) works. diffstat: 2 files changed, 45 insertions(+), 1 deletion(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 2 unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java | 44 ++++++++++ diffs (66 lines): diff -r c46f6e0e7959 -r 09bfaae2203b src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 23 15:02:55 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 23 17:07:56 2008 -0400 @@ -81,7 +81,7 @@ public class PulseAudioClip extends Puls @Override public void run() { - while (loopsLeft >= 0) { + while (true) { writeFrames(currentFrame, endFrame + 1); if (Thread.interrupted()) { // Thread.currentThread().interrupt(); diff -r c46f6e0e7959 -r 09bfaae2203b unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Tue Sep 23 15:02:55 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Tue Sep 23 17:07:56 2008 -0400 @@ -138,6 +138,50 @@ public class PulseAudioClipTest { clip.close(); } + + + @Test + public void testLoopContinuously() throws LineUnavailableException, + IOException, UnsupportedAudioFileException, InterruptedException { + System.out + .println("This tests loop(LOOP_CONTINUOUSLY) on the Clip"); + final Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); + File soundFile = new File("testsounds/error.wav"); + AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + clip.open(audioInputStream); + + clip.setLoopPoints((int) (clip.getFrameLength() / 4), (int) (clip + .getFrameLength() / 2)); + clip.loop(Clip.LOOP_CONTINUOUSLY); + + Runnable blocker = new Runnable() { + + @Override + public void run() { + clip.drain(); + } + + }; + + Thread th = new Thread(blocker); + th.start(); + th.join(10000); + + if (!th.isAlive()) { + clip.close(); + Assert.fail("LOOP_CONTINUOUSLY doesnt seem to work"); + } + + clip.stop(); + th.join(500); + if ( th.isAlive()) { + clip.close(); + Assert.fail("stopping LOOP_CONTINUOSLY failed"); + } + + clip.close(); + } @Test public void testIsActiveAndIsOpen() throws LineUnavailableException, From omajid at redhat.com Tue Sep 23 14:23:38 2008 From: omajid at redhat.com (Omair Majid) Date: Tue, 23 Sep 2008 21:23:38 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-23 Omair Majid changeset 6409aaedc201 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=6409aaedc201 description: 2008-09-23 Omair Majid * README: Added a note explaining a new sound file. * testsounds/error.wav: New sound file to play around with. It has a very short duration, so multiple loops in a short duration are possible. diffstat: 1 file changed, 5 insertions(+), 1 deletion(-) README | 6 +++++- diffs (17 lines): diff -r 09bfaae2203b -r 6409aaedc201 README --- a/README Tue Sep 23 17:07:56 2008 -0400 +++ b/README Tue Sep 23 17:20:45 2008 -0400 @@ -19,6 +19,10 @@ Where does it come from? Where does it come from? All of the code was written by the authors -The sound files (new.wav and logout.wav) were taken from +The sound files new.wav and logout.wav were taken from http://websvn.kde.org/branches/KDE/4.0/kdeartwork/sounds/ (and renamed). They are licensed by the copyright holders as GPLv2. + +The sound file error.wav is part of gnome-audio +http://ftp.gnome.org/pub/gnome/sources/gnome-audio/2.22/gnome-audio-2.22.2.tar.bz2 +It is licensed under the LGPL by the copyright holders. diff -r 09bfaae2203b -r 6409aaedc201 testsounds/error.wav Binary file testsounds/error.wav has changed From omajid at redhat.com Tue Sep 23 14:23:38 2008 From: omajid at redhat.com (Omair Majid) Date: Tue, 23 Sep 2008 21:23:38 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-23 Omair Majid changeset 438aa072a80d in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=438aa072a80d description: 2008-09-23 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Merged changes. diffstat: 3 files changed, 50 insertions(+), 2 deletions(-) README | 6 + src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 2 unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java | 44 ++++++++++ diffs (83 lines): diff -r 2d384ad19c3e -r 438aa072a80d README --- a/README Tue Sep 23 17:01:26 2008 -0400 +++ b/README Tue Sep 23 17:23:27 2008 -0400 @@ -19,6 +19,10 @@ Where does it come from? Where does it come from? All of the code was written by the authors -The sound files (new.wav and logout.wav) were taken from +The sound files new.wav and logout.wav were taken from http://websvn.kde.org/branches/KDE/4.0/kdeartwork/sounds/ (and renamed). They are licensed by the copyright holders as GPLv2. + +The sound file error.wav is part of gnome-audio +http://ftp.gnome.org/pub/gnome/sources/gnome-audio/2.22/gnome-audio-2.22.2.tar.bz2 +It is licensed under the LGPL by the copyright holders. diff -r 2d384ad19c3e -r 438aa072a80d src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 23 17:01:26 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 23 17:23:27 2008 -0400 @@ -81,7 +81,7 @@ public class PulseAudioClip extends Puls @Override public void run() { - while (loopsLeft >= 0) { + while (true) { writeFrames(currentFrame, endFrame + 1); if (Thread.interrupted()) { // Thread.currentThread().interrupt(); diff -r 2d384ad19c3e -r 438aa072a80d testsounds/error.wav Binary file testsounds/error.wav has changed diff -r 2d384ad19c3e -r 438aa072a80d unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Tue Sep 23 17:01:26 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java Tue Sep 23 17:23:27 2008 -0400 @@ -138,6 +138,50 @@ public class PulseAudioClipTest { clip.close(); } + + + @Test + public void testLoopContinuously() throws LineUnavailableException, + IOException, UnsupportedAudioFileException, InterruptedException { + System.out + .println("This tests loop(LOOP_CONTINUOUSLY) on the Clip"); + final Clip clip = (Clip) mixer.getLine(new Line.Info(Clip.class)); + File soundFile = new File("testsounds/error.wav"); + AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + clip.open(audioInputStream); + + clip.setLoopPoints((int) (clip.getFrameLength() / 4), (int) (clip + .getFrameLength() / 2)); + clip.loop(Clip.LOOP_CONTINUOUSLY); + + Runnable blocker = new Runnable() { + + @Override + public void run() { + clip.drain(); + } + + }; + + Thread th = new Thread(blocker); + th.start(); + th.join(10000); + + if (!th.isAlive()) { + clip.close(); + Assert.fail("LOOP_CONTINUOUSLY doesnt seem to work"); + } + + clip.stop(); + th.join(500); + if ( th.isAlive()) { + clip.close(); + Assert.fail("stopping LOOP_CONTINUOSLY failed"); + } + + clip.close(); + } @Test public void testIsActiveAndIsOpen() throws LineUnavailableException, From bugzilla-daemon at icedtea.classpath.org Tue Sep 23 16:27:28 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 23 Sep 2008 23:27:28 +0000 Subject: [Bug 195] New: Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 Summary: Webex dies with NullPointerException Product: IcedTea Version: unspecified Platform: PC URL: https://linbit- en.webex.com/ec0600l/eventcenter/enroll/register.do?site url=linbit- en&formId=5267537&confId=5267537&formType=1&loadFlag=1&e ventType=1&accessType=viewRecording OS/Version: Linux Status: NEW Severity: critical Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: joej at edwyse.com I'm running java-1.6.0-openjdk-plugin-1.6.0.0-0.18.b09.fc9.x86_64.rpm (fedora 9 install). I'm trying to open the webinar at: https://linbit-en.webex.com/ec0600l/eventcenter/enroll/register.do?siteurl=linbit-en&formId=5267537&confId=5267537&formType=1&loadFlag=1&eventType=1&accessType=viewRecording I enter a name and email address, click submit. The screen displays the html portion, then loads the applet. The applet loads and throws: exception: java.lang.NullPointerException ---- Java downloader 2.5 Os Name: Linux java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:342) at java.security.AccessController.checkPermission(AccessController.java:553) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302) at java.lang.System.getProperty(System.java:669) at npatjava.getNetscapeDir(npatjava.java:265) at npatjava.init(npatjava.java:83) at sun.applet.AppletPanel.run(AppletPanel.java:436) at java.lang.Thread.run(Thread.java:636) Netscape installation path11: null checkDirExist SecurityException PIPE: appletviewer wrote: status Applet initialized.GCJ PLUGIN: thread 0x20a3c30: plugin_in_pipe_callback GCJ PLUGIN: thread 0x20a3c30: plugin_in_pipe_callback: setting status Applet initialized. PIPE: plugin read: status Applet initialized. GCJ PLUGIN: thread 0x20a3c30: plugin_in_pipe_callback return PIPE: appletviewer wrote: status exception: java.lang.NullPointerException. java.lang.NullPointerException at java.lang.StringBuffer.(StringBuffer.java:120)GCJ PLUGIN: thread 0x20a3c30: plugin_in_pipe_callback GCJ PLUGIN: thread 0x20a3c30: plugin_in_pipe_callback: setting status exception: java.lang.NullPointerException. at npatjava.download(npatjava.java:170) at npatjava.start(npatjava.java:107) at sun.applet.AppletPanel.run(AppletPanel.java:476) PIPE: plugin read: status exception: java.lang.NullPointerException. GCJ PLUGIN: thread 0x20a3c30: plugin_in_pipe_callback return at java.lang.Thread.run(Thread.java:636) -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Tue Sep 23 16:37:01 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 23 Sep 2008 23:37:01 +0000 Subject: [Bug 196] New: Corba: ioser.c not passed $(MOZILLA_CFLAGS) but includes jni.h Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=196 Summary: Corba: ioser.c not passed $(MOZILLA_CFLAGS) but includes jni.h Product: IcedTea Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: dj at linuxfromscratch.org Interesting that I've made this build happen to completion a couple of times now. I've reviewed host system changes several times and am unable to figure out why I was able to build it properly against changeset 1040 with the patch for changeset 1045. I am now unable to do even that. Seems likely there was a change on the host system, however, I am unable to find any thing out of the ordinary. I am now downloading FC9 for a comparison, but it'll take some time. I am only bugging this to rule out any breakage in the autotools or patches. Can somebody please look at a recent successful build tree (preferably 1045) and confirm that corba does include the MOZILLA flags? Or is this a host system problem in that jni.h is in /usr/include on supported platforms? If that is the case, then would a patch be welcome for other targets, if it is not just something silly that I am overlooking? I am also not against a healthy beating with the cluebat. FYI: [dj at name25 icedtea6-d2579e023b0e]# find /usr/include/ -name jni.h /usr/include/firefox-2.0.0.11/java/jni.h /usr/include/firefox-2.0.0.11/jni.h /usr/include/thunderbird-2.0.0.9/java/jni.h /usr/include/thunderbird-2.0.0.9/jni.h [dj at name25 icedtea6-d2579e023b0e]# grep "^MOZILLA" Makefile MOZILLA_CFLAGS = -I/usr/include/firefox-2.0.0.11/java -I/usr/include/firefox-2.0.0.11/plugin -I/usr/include/nspr -I/usr/include/firefox-2.0.0.11 -I/usr/include/firefox-2.0.0.11/xpcom -I/usr/include/firefox-2.0.0.11/string MOZILLA_LIBS = -L/usr/lib/firefox-2.0.0.11 -lxpcom -lplds4 -lplc4 -lnspr4 -lpthread -ldl Here is the build error: /usr/bin/gcc -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -fno-omit-frame-pointer -D_LITTLE_ENDIAN -D_i586_ -Di586 -DARCH='"i586"' -DLINUX -DRELEASE='"1.6.0_0-internal"' -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -I. -I/home/dj/icedtea6-d2579e023b0e/openjdk-ecj/control/build/linux-i586/corba/tmp/sun/com.sun.corba.se.internal.io/ioser12/CClassHeaders -I../../../../src/solaris/javavm/export -I../../../../src/share/javavm/export -I../../../../src/share/javavm/include -I../../../../src/solaris/javavm/include -ICClassHeaders -I/home/dj/icedtea6-d2579e023b0e/bootstrap/jdk1.6.0/include -I/home/dj/icedtea6-d2579e023b0e/bootstrap/jdk1.6.0/include/linux -I../../../../src/share/native/common -I../../../../src/solaris/native/common -I../../../../src/share/native/com/sun/corba/se/internal/io -I../../../../src/solaris/native/com/sun/corba/se/internal/io -c -o /home/dj/icedtea6-d2579e023b0e/openjdk-ecj/control/build/linux-i586/corba/tmp/sun/com.sun.corba.se.internal.io/ioser12/obj/ioser.o ../../../../src/share/native/com/sun/corba/se/internal/io/ioser.c ../../../../src/share/native/com/sun/corba/se/internal/io/ioser.c:26:17: error: jni.h: No such file or directory In file included from ../../../../src/share/native/com/sun/corba/se/internal/io/ioser.c:28: /home/dj/icedtea6-d2579e023b0e/openjdk-ecj/control/build/linux-i586/corba/tmp/sun/com.sun.corba.se.internal.io/ioser12/CClassHeaders/com_sun_corba_se_internal_io_IIOPInputStream.h:3:17: error: jni.h: No such file or directory In file included from ../../../../src/share/native/com/sun/corba/se/internal/io/ioser.c:28: /home/dj/icedtea6-d2579e023b0e/openjdk-ecj/control/build/linux-i586/corba/tmp/sun/com.sun.corba.se.internal.io/ioser12/CClassHeaders/com_sun_corba_se_internal_io_IIOPInputStream.h:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'jobject' make[6]: *** [/home/dj/icedtea6-d2579e023b0e/openjdk-ecj/control/build/linux-i586/corba/tmp/sun/com.sun.corba.se.internal.io/ioser12/obj/ioser.o] Error 1 make[6]: Leaving directory `/home/dj/icedtea6-d2579e023b0e/openjdk-ecj/corba/make/sun/corba/core' make[5]: *** [library_parallel_compile] Error 2 make[5]: Leaving directory `/home/dj/icedtea6-d2579e023b0e/openjdk-ecj/corba/make/sun/corba/core' make[4]: *** [build] Error 1 make[4]: Leaving directory `/home/dj/icedtea6-d2579e023b0e/openjdk-ecj/corba/make/sun/corba' make[3]: *** [build] Error 1 make[3]: Leaving directory `/home/dj/icedtea6-d2579e023b0e/openjdk-ecj/corba/make/sun' make[2]: *** [build] Error 1 make[2]: Leaving directory `/home/dj/icedtea6-d2579e023b0e/openjdk-ecj/corba/make' make[1]: *** [corba-build] Error 2 make[1]: Leaving directory `/home/dj/icedtea6-d2579e023b0e/openjdk-ecj/control/make' make: *** [stamps/icedtea-ecj.stamp] Error 2 If I do something stupid like: OTHER_CFLAGS=`grep "^MOZILLA_CFLAGS" Makefile | sed 's at MOZILLA_CFLAGS = @@'` make The build now fails at a much later point (which I don't have handy ATM). -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Tue Sep 23 16:45:39 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 23 Sep 2008 23:45:39 +0000 Subject: [Bug 196] Corba: ioser.c not passed $(MOZILLA_CFLAGS) but includes jni.h Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=196 dj at linuxfromscratch.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID ------- Comment #1 from dj at linuxfromscratch.org 2008-09-23 23:45 ------- UGH! I knew I should have checked this out one more time. Please ignore and sorry for the broken report. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From Joe.Darcy at Sun.COM Tue Sep 23 21:52:13 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Tue, 23 Sep 2008 21:52:13 -0700 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <48D802A2.6080509@sun.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> <48D13DAE.9030009@sun.com> <48D2502A.7020001@sun.com> <48D802A2.6080509@sun.com> Message-ID: <48D9C77D.5030506@sun.com> Joseph D. Darcy wrote: > Joseph D. Darcy wrote: >> Kelly O'Hair wrote: >>> Speaking from experience, any attempts at cleanly creating changesets >>> from TeamWare data alone is a waste of time. Just doesn't work well. >>> Granted we have pretty complete OpenJDK6 changeset data (data beyond >>> the TeamWare data) and could potentially do this, it's quite a bit of >>> grunt work to accomplish. Before we go off on this kind of adventure >>> we need to make sure the time spent is worth it. >>> A different approach would be to create changesets per build/promotion, >>> but those kind of large changesets can have limited usefulness. >>> >>> I'll try and talk to Joe about this tomorrow. >>> >>> Also, don't forget that the OpenJDK7 sources are a Mercurial forest, >>> not just one repository. I assume that we want to mimic the same >>> forest layout, keeping the langtools, corba, jaxp, jaxws, and hotspot >>> sources in their own repositories, separate from the core 'jdk' >>> repository. >>> That allows us to do some plug and play with these repositories >>> between OpenJDK6 and OpenJDK7. >>> >>> -kto >> Yes, my thinking has been to mirror the overall JDK 7 repository >> forest structure in OpenJDK 6. > > Quick follow-up, I've been traveling recently and haven't had a chance > to chat with Kelly yet. > > Given that there is currently the per-build external Mercurial > repository and that it is easy to get the list of bugs fixed in a > build, retroactively synthesizing the (approximate) patches associated > with a set of bugs *might* be workable since figuring out the bug <-> > file mapping shouldn't be that bad. If those interested in seeing the > past history synthesized these patches, I could focus on finishing > getting the OpenJDK build 12++ code ready for Mercurial and then > reverse apply the set of patches to get back to the earlier public > source drops. However, this might be more work than I think and I'll > want to talk to Kelly about the detailed logistics of what would be > necessary for this to happen. > > My priority is on getting the "official" Mercurial repository up and > running so we can collaborate there going forward as opposed to > spending lots of time on retrofitting the existing build history into > the new repository. > > Also, in the future I'd like to consider an infrastructure where areas > like corba, jaxp, and jaxws for OpenJDK 6 could be managed as patches > to an imported code base rather than having a fully populated copy of > the code under revision management for the release. > > Cheers, Kelly and I chatted on Tuesday. We'll be working on getting the official OpenJDK 6 Mercurial repositories up and open for business. We agreed to publish the future repositories with at least as much version information as the one Mark Wielaard setup, that is, at least one changeset per build going back to the first published OpenJDK6 build, b05. If people would like to see more fine grained changesets with more detailed changeset -> bugid grouping, Martin, Mark W., and others could help carve up the big build-to-build patches and sent us the decomposition before the official Mercurial transitional. Alternatively, if that decomposition isn't finished before we want to go live with the repositories, Kelly though that adding supplementary changsets with this information might be able to be added later. Kelly, please fill in any details here. In the near term, we will probably have a forest of repositories as in JDK 7. However, longer term I would be happy if only hotspot, jdk, and langtools were full repositories and jaxp, jaxws, and corba repos were just vestiges that applied a few patches to upstream sources. We'll have to work out some logistical details with the HotSpot team to mesh with their "HotSpot Express" release model. -Joe The per-build bug lists below are raw lists from the bug database with a small amount of filtering to remove a handful of bugs whose changes only touch closed JDK code; I might have missed one or two of these bugs fixes that aren't present in the open code. Fixed in b06 - http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-February/000016.html 6601458: Move java.math tests from closed to open 6499487: [zh_CN] README_zh_CN in jdk is out of sync with the english README 6566218: l10n of 6476932 6536195: flaw in DatatypeConverter 6536209: flaw in SAAJMetaFactory 6588002: XSLTProcessorApplet still allows reading from forbidden URLs 6587132: Code changes behavior when compiled 6635776: Regression in jaxb tests with JDk6 U4 6559283: Duplicate GPL notices in src/share/classes/com/sun/xml/internal 6590857: Drag & Drop arbitrary file copy 6662775: Move Imaging and color classes from closed to open 6606396: Notepad demo doesn't run in Japanese locale. 6646197: (tz) Support tzdata2007k 6509039: Swedish localization has incorrect am/pm markers in FormatData_sv 6573250: Java.util.Currency.getSymbol(Locale) returns wrong value when locale is not US. 6610748: Dateformat - AM-PM indicator in Finnish appears to be from English 6645268: Country/language names with locale fi_FI are incorrect for FRANCE/FRENCH 6645405: Errors in Hungarian local-specific formatting. (L10N part of 6609703) 6650730: Lithuanian locale date and number formats mismatch. 4225362: localized DateFormatSymbols for fr_FR is wrong 6450945: The week day for Saturday and the first week day in Romania locale are incorrect 6609737: DateFormat incorrect for German locale 6647063: java/text/Format/NumberFormat/CurrencyFormat.java fails 6652200: test/java/util/TimeZone/Bug6329116.java fails 6598520: (tz) Windows time zone mapping table needs to be updated for KB933360 6605798: JAX-WS RI 2.1.1 should be integrated in OpenJDK6 6661448: Make the SNMP agent optional when OPENJDK=true and IMPORT_BINARY_PLUGS=false 6662581: jdk/make/common/internal/Defs-corba.gmk doesnot list all files to be imported: some classes missing 6667532: Update OpenJDK 6 make/README 6676375: Make sure MOTIF_REQUIRED=false when OPENJDK=true Fixed in b07 - http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-March/000026.html 6586752: Window decorations do not appear 6642034: System.getProperty("os.name") returns Windows Vista on Windows Server 2008 (longhorn) 6671051: (process) Runtime.exec() hangs if signalled during fork/exec 6636951: javax.swing.plaf SigTest Failures in OpenJDK 6 6662830: OpenJDK build testing results 6668781: Openjdk windows cygwin build failure: no rule to make linker_md.obj target 6669175: Add OpenJDK(TM) notification 6672710: Allow for openjdk sound to be built without the binary plugs (IMPORT_BINARY_PLUGS=false) 6672777: Broken deploy build from jdk fix 6668781 for cygwin windows 6674015: Update trademark notification to version 1.1 6674314: Setting MOTIF_REQUIRED to 'false' doesn't work Fixed in b08 - http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-March/000033.html 6613927: Compilation of splashscreen png library failed on Ubuntu 7.04 (64bit) 6578538: com.sun.crypto.provider.SunJCE instance leak using KRB5 and LoginContext 6679296: sec-lib.zip and friends inadvertantly added to the 6-open and jdk7 b19 directories 6679994: Undocumented .jar files in JDK 6 Open: hotspot/agent/src/share/lib 6680088: SSLEngineDeadlock workaround for 6519515 needed by OpenJDK builds Fixed b09 - http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-April/000039.html 6602007: Transition to Mercurial: Remove SCCS keywords from files in the test/ directory 6633656: Cross platform print dialog doesn't check for orientation being unsupported. 6672868: Package javax.xml.ws.wsaddressing not included in make/docs/CORE_PKGS.gmk 6650748: (tz) Java runtime doesn't detect VET time zone correctly on Windows 6679340: (tz) Support tzdata2008b 6678161: Printing to remote non-Postscript printer does not work in Linux Fixed in b10 - http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-May/000058.html 6683078: Update JCE framework and provider builds to work on read-only filesystems 6604044: java crashes talking to second X screen 6684582: Launcher needs improved error reporting 6644659: Error in default target of make/javax/crypto in OpenJDK build 6691185: (coll) TreeMap.navigableKeySet's descendingIterator method starts at first instead of last entry 6691215: (coll) IdentityHashMap.containsValue(null) returns true when null value not present 6523403: OSS CMM: Need to provide lcms library with PYCC and LINEAR_RGB OS ICC profiles 6682167: Add cygwin faq to README-builds.html 6695553: Cleanup GPLv2+SPL legal notices in hat sources 6563616: Clarify instructions for unpacking openjdk binary "plug" 6611685: Incorrect link to CA certs info from build README 6597857: JDK build instructions need to be updated (BUILD_JDK_IMPORT_PATH, BUILD_BINARY_PLUGS_PATH) 6636469: Java Fullscreen Exclusive Mode not working with Xorg server 1.3.0 and above 6602426: TEST_BUG: test/sun/misc/Version/VersionCheck.java fails 6479286: LTP: XMLEncoder does not persist LineBorder properly 6673853: LegacyIntrospectorTest is testing an old deprecated com.sun API not present in OpenJDK. 6707643: (tz) Support tzdata2008c 6702956: OpenJDK: replace encumbered code (software synthesizer) 6703931: Remove jaxws doc-files from the jdk 6704655: Test test/java/lang/reflect/Generics/Probe.java fails under OpenJDK 6705893: javax.script tests should not require a js engine on OpenJDK Fixed in b11 - http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-July/000067.html 6542088: JAX-WS server allows XXE attacks 6332953: JMX agent should bind to loopback address when starting the local connector server 6665028: native code of method j*.text.Bidi.nativeBidiChars is using the contents of a primitive array direct 6661918: Array reference changes behavior when compiled 6624717: Corrupted combo box, GTK L&F, Ubuntu 7.10 6621691: (dc) test/java/nio/channels/DatagramChannel/NotBound.java missing public modifier 6691328: DragSourceContext returns unexpected cursor 6685178: REGRESSION: NPE in ConnectorBootstrap when Agent.getManagementProperties() returns null. 6607339: IncrementalSAXSource_Filter still allows reading of local files 6601377: hotspot/src/share/vm/prims/jvmtiLib.xsl generates files with incorrect legal notices 6589868: transition to Mercurial: need to eliminate dependencies on SCCS keywords 6681796: hotspot build failure on gcc 4.2.x (ubuntu 8.04) w/ openjdk6 6695776: corba jscheme jar files in repository could be built from source 6695777: Queens.class should be built from source, not put in source repo 6565364: update legal notices in corba 6695765: Remove winver.exe completely from jdk sources 6705945: com.sun.tools.javac.zip files do not have valid copyright 6596323: (fc) ClosedByInterruptException not thrown by the interrupt method (lnx) 6710579: (ch) test/java/nio/channels/AsyncCloseAndInterrupt fails (lnx) 6623167: C2 crashed in StoreCMNode::Value 6497639: Profiling Swing application caused JVM crash 6599425: OopMapCache::lookup() can cause later crash or assert() failure 6659207: access violation in CompilerThread0 6614100: EXCEPTION_ACCESS_VIOLATION while running Eclipse with 1.6.0_05-ea 6608764: test/closed/java/awt/Focus/TemporaryLostComponentDeadlock fails 6620632: DTD event is missing entity and notation information 6601384: hotspot/src/share/vm/adlc/archDesc.cpp generates files with incorrect legal notices 6710791: Remove files or build them from source: maf-1_0.jar, jlfgr-1_0.jar 6713083: hotspot copy.cpp and vmStructs_parNew.hpp source files contains proprietary sun notice 6717575: Make sanity prints duplicated BUILD_JDK messages 6717694: Normalize src/share/classes/com/sun/media/sound Fixed in b12 - http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-September/000150.html 6590549: Cygwin build of OpenJDK has problems and not very well documented 6635663: make/tools/AutoMulti/{AutoMulti,TestALFGenerator}.java still generate files with wrong legal notices 6719182: update legal notice in src/share/classes/java/lang/instrument/package.html 6714428: 'os.name' system property shows wrong value on 64-bit Windows XP 6720240: IOB exception when getting font metrics of hershey font 6548261: Use of SE in make/common/Defs-windows.gmk 6681798: (build) CharsetEncoder.java fails to compile in openjdk6 on ubuntu 8.04 6372405: Server thread hangs when fragments don't complete because of connection abort 5104239: Java: thread deadlock 6191561: JCK15: api/org_omg/PortableInterceptor/ClientRequestInfo/index.html#RIMethods sometime hang 6486322: org.omg.CORBA.ORB.init() thread safety issue 6465377: NullPointerException for RMI ORB in 1.5.0_08 6438259: Wrong repository ID generated by IDLJ 6509042: javac rejects class literals in enum constructors 6627362: javac generates code that uses array.clone, which is not available on JavaCard 6627364: javac needs Float and Double on the bootclasspath even when not directly used 6627366: javac needs Cloneable and Serializable on the classpath even when not directly used 6665223: Static import of inherited protected method causes compiler exception 6538484: JAF fails in Turkish locale 6699090: Avoid NPE if parse fails in isMimeTypeEqual, do a string comparison instead 6176978: current Javadoc's invocation and extension (Doclet) mechanisms are problematic 6681889: JSN security test headline/noWarningApp failed with NPE exception 6732815: CORBA_2_3 java sources not explicitly compiled 6734545: Corrections to missing explicit corba sources on javac compile lines 6573268: Four JCK-devtools-6a tests report OOM: Java Heap space since JDK7 b14 6720349: (ch) Channels tests depending on hosts inside Sun 6739302: Check that deserialization preserves EnumSet integrity 6730743: (tz) Support tzdata2008e 6741642: bad enum definition in ciTypeFlow.hpp 6717691: Update Gervill with post 1.0 fixes 6733501: Apply IcedTea little cms patches 6735154: Apply IcedTea Color.createContext patch 6738894: Merge jaxp fixes from 6 update train into OpenJDK 6 6740210: Update Gervill with more post 1.0 fixes 6748247: Further update Gervill with still more post 1.0 fixes From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 07:31:44 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 14:31:44 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #1 from langel at redhat.com 2008-09-24 14:31 ------- Created an attachment (id=96) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=96&action=view) Output from firefox with liveconnect plugin enabled -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 07:32:03 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 14:32:03 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #2 from langel at redhat.com 2008-09-24 14:32 ------- Created an attachment (id=97) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=97&action=view) output from firefox with liveconnect disabled -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From dbhole at redhat.com Wed Sep 24 10:01:41 2008 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 24 Sep 2008 17:01:41 +0000 Subject: changeset in /hg/icedtea6: More updates to Makefile.am to suppor... Message-ID: changeset 30b1dbd707d5 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=30b1dbd707d5 description: More updates to Makefile.am to support proper separation of plugin packages/classes diffstat: 1 file changed, 24 insertions(+), 10 deletions(-) Makefile.am | 34 ++++++++++++++++++++++++---------- diffs (101 lines): diff -r 3e5d21f2b7a4 -r 30b1dbd707d5 Makefile.am --- a/Makefile.am Thu Sep 18 15:49:10 2008 -0400 +++ b/Makefile.am Sun Sep 21 15:58:46 2008 -0400 @@ -8,21 +8,19 @@ NETBEANS_PLATFORM_MD5SUM = 77c79b3a7d3db NETBEANS_PLATFORM_MD5SUM = 77c79b3a7d3dbe6a8858639f8d564a38 NETBEANS_PROFILER_MD5SUM = ff8e8abc42df6c6749e6b02bcf7bb0a5 VISUALVM_MD5SUM = 4b55bc623418818793392bb233da2927 + +EXCLUDE_LIVECONNECT = | grep -vE "netscape/javascript|org/classpath/icedtea/plugin" if ENABLE_LIVECONNECT ICEDTEAPLUGIN_CLEAN = clean-IcedTeaPlugin ICEDTEAPLUGIN_TARGET = IcedTeaPlugin.so ICEDTEAPLUGIN_JAR = IcedTeaPlugin.jar PLUGIN_PATCH = patches/icedtea-liveconnect.patch -EXCLUDE_LIVECONNECT = -LIVECONNECT_DIR = -C lib/rt netscape else ICEDTEAPLUGIN_CLEAN = ICEDTEAPLUGIN_TARGET = ICEDTEAPLUGIN_JAR = PLUGIN_PATCH = patches/icedtea-plugin.patch -EXCLUDE_LIVECONNECT = | grep -v 'netscape/javascript' -LIVECONNECT_DIR = if ENABLE_PLUGIN GCJWEBPLUGIN_CLEAN = clean-gcjwebplugin GCJWEBPLUGIN_TARGET = gcjwebplugin.so @@ -580,7 +578,7 @@ stamps/patch.stamp: stamps/patch-fsg.sta else \ test x$${all_patches_ok} = "xyes" && all_patches_ok=$$p ; \ fi ; \ - done ; \ + done ; mv stamps/patch.stamp.tmp stamps/patch.stamp ; \ if ! test x$${all_patches_ok} = "xyes"; then \ echo ERROR patch $${all_patches_ok} FAILED! ; \ @@ -911,6 +909,12 @@ if ENABLE_LIVECONNECT $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ cp -pPRf IcedTeaPlugin.jar \ $(BUILD_OUTPUT_DIR)/j2re-image/lib/ + + $(JAR) uf $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/rt.jar \ + -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes sun + + $(JAR) uf $(BUILD_OUTPUT_DIR)/j2re-image/lib/rt.jar \ + -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes sun else if ENABLE_PLUGIN cp -pPRf gcjwebplugin.so \ @@ -966,6 +970,12 @@ if ENABLE_LIVECONNECT $(BUILD_OUTPUT_DIR)-debug/j2sdk-image/jre/lib/ cp -pPRf IcedTeaPlugin.jar \ $(BUILD_OUTPUT_DIR)-debug/j2re-image/lib/ + + $(JAR) uf $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/rt.jar \ + -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes sun + + $(JAR) uf $(BUILD_OUTPUT_DIR)/j2re-image/lib/rt.jar \ + -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes sun else if ENABLE_PLUGIN cp -pPRf gcjwebplugin.so \ @@ -1233,10 +1243,10 @@ bootstrap/jdk1.7.0/jre/lib/rt-closed.jar if ! test -d $(ICEDTEA_BOOT_DIR) ; \ then \ $(JAR) cf $@ -C lib/rt com -C lib/rt java \ - -C lib/rt javax -C lib/rt net $(LIVECONNECT_DIR) -C lib/rt sun ; \ + -C lib/rt javax -C lib/rt net -C lib/rt sun ; \ else \ $(ICEDTEA_BOOT_DIR)/bin/jar cf $@ -C lib/rt com -C lib/rt java \ - -C lib/rt javax -C lib/rt net $(LIVECONNECT_DIR) -C lib/rt sun ; \ + -C lib/rt javax -C lib/rt net -C lib/rt sun ; \ fi if test -d bootstrap/ecj/jre/lib ; \ then \ @@ -1312,6 +1322,7 @@ IcedTeaPlugin.o: IcedTeaPlugin.cc $(GTK_CFLAGS) \ $(XULRUNNER_CFLAGS) \ -fPIC -c -o $@ $< + IcedTeaPlugin.so: IcedTeaPlugin.o $(CXX) $(CXXFLAGS) \ $< \ @@ -1324,11 +1335,14 @@ IcedTeaPlugin.jar: mkdir -p $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes (cd plugin/icedtea/java/src/main/; \ $(ICEDTEA_BOOT_DIR)/bin/javac -g \ - -d $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes \ + -d ../../../../../$(BUILD_OUTPUT_DIR)/plugin/icedtea/classes \ -bootclasspath $(ICEDTEA_BOOT_DIR)/jre/lib/rt.jar \ - sun/applet/*.java \ + sun/applet/*.java netscape/javascript/*.java org/classpath/icedtea/plugin/*.java \ ) - $(JAR) cf $@ -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes sun + + $(JAR) cf $@ \ + -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes org/classpath/icedtea/plugin \ + -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes netscape/javascript clean-IcedTeaPlugin: rm -f IcedTeaPlugin.o From dbhole at redhat.com Wed Sep 24 10:01:41 2008 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 24 Sep 2008 17:01:41 +0000 Subject: changeset in /hg/icedtea6: - Refactor java-side of icedtea code ... Message-ID: changeset 5cf4df1bc010 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=5cf4df1bc010 description: - Refactor java-side of icedtea code for proper security management - Remove most new files from iced tea plugin patch, and move it to a directory diffstat: 62 files changed, 7629 insertions(+), 2758 deletions(-) Makefile.am | 22 plugin/icedtea/java/src/main/netscape/javascript/JSException.java | 140 + plugin/icedtea/java/src/main/netscape/javascript/JSObject.java | 258 + plugin/icedtea/java/src/main/netscape/javascript/JSProxy.java | 58 plugin/icedtea/java/src/main/netscape/javascript/JSRunnable.java | 70 plugin/icedtea/java/src/main/netscape/javascript/JSUtil.java | 59 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/GetMemberPluginCallRequest.java | 78 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/GetWindowPluginCallRequest.java | 76 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginAppletSecurityContext.java | 855 ++++++ plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginCallRequestFactoryImpl.java | 22 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginMain.java | 193 + plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginMessageConsumer.java | 76 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginMessageHandlerWorker.java | 79 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginObjectStore.java | 119 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginStreamHandlerImpl.java | 362 ++ plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/RequestQueue.java | 40 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/TestEnv.java | 172 + plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/VoidPluginCallRequest.java | 69 plugin/icedtea/java/src/main/sun/applet/AppletAudioClip.java | 151 + plugin/icedtea/java/src/main/sun/applet/AppletClassLoader.java | 861 ++++++ plugin/icedtea/java/src/main/sun/applet/AppletEvent.java | 65 plugin/icedtea/java/src/main/sun/applet/AppletEventMulticaster.java | 127 plugin/icedtea/java/src/main/sun/applet/AppletIOException.java | 59 plugin/icedtea/java/src/main/sun/applet/AppletIllegalArgumentException.java | 48 plugin/icedtea/java/src/main/sun/applet/AppletImageRef.java | 54 plugin/icedtea/java/src/main/sun/applet/AppletListener.java | 39 plugin/icedtea/java/src/main/sun/applet/AppletMessageHandler.java | 113 plugin/icedtea/java/src/main/sun/applet/AppletObjectInputStream.java | 106 plugin/icedtea/java/src/main/sun/applet/AppletPanel.java | 1334 ++++++++++ plugin/icedtea/java/src/main/sun/applet/AppletProps.java | 221 + plugin/icedtea/java/src/main/sun/applet/AppletResourceLoader.java | 48 plugin/icedtea/java/src/main/sun/applet/AppletSecurity.java | 371 ++ plugin/icedtea/java/src/main/sun/applet/AppletSecurityContext.java | 25 plugin/icedtea/java/src/main/sun/applet/AppletSecurityContextManager.java | 27 plugin/icedtea/java/src/main/sun/applet/AppletSecurityException.java | 65 plugin/icedtea/java/src/main/sun/applet/AppletThreadGroup.java | 64 plugin/icedtea/java/src/main/sun/applet/AppletViewerFactory.java | 41 plugin/icedtea/java/src/main/sun/applet/AppletViewerPanel.java | 254 + plugin/icedtea/java/src/main/sun/applet/GetMemberPluginCallRequest.java | 72 plugin/icedtea/java/src/main/sun/applet/GetWindowPluginCallRequest.java | 66 plugin/icedtea/java/src/main/sun/applet/Main.java | 533 +++ plugin/icedtea/java/src/main/sun/applet/PluginAppletSecurityContext.java | 847 ------ plugin/icedtea/java/src/main/sun/applet/PluginAppletViewer.java | 384 +- plugin/icedtea/java/src/main/sun/applet/PluginCallRequest.java | 31 plugin/icedtea/java/src/main/sun/applet/PluginCallRequestFactory.java | 7 plugin/icedtea/java/src/main/sun/applet/PluginClassLoader.java | 13 plugin/icedtea/java/src/main/sun/applet/PluginDebug.java | 2 plugin/icedtea/java/src/main/sun/applet/PluginException.java | 7 plugin/icedtea/java/src/main/sun/applet/PluginMain.java | 533 --- plugin/icedtea/java/src/main/sun/applet/PluginMessageConsumer.java | 49 plugin/icedtea/java/src/main/sun/applet/PluginMessageHandlerWorker.java | 59 plugin/icedtea/java/src/main/sun/applet/PluginObjectStore.java | 119 plugin/icedtea/java/src/main/sun/applet/PluginStreamHandler.java | 20 plugin/icedtea/java/src/main/sun/applet/TestEnv.java | 172 - plugin/icedtea/java/src/main/sun/applet/VoidPluginCallRequest.java | 62 rt/net/sourceforge/jnlp/Launcher.java | 1 rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 4 rt/netscape/javascript/JSException.java | 140 - rt/netscape/javascript/JSObject.java | 258 - rt/netscape/javascript/JSProxy.java | 58 rt/netscape/javascript/JSRunnable.java | 70 rt/netscape/javascript/JSUtil.java | 59 diffs (truncated from 11003 to 500 lines): diff -r 30b1dbd707d5 -r 5cf4df1bc010 Makefile.am --- a/Makefile.am Sun Sep 21 15:58:46 2008 -0400 +++ b/Makefile.am Tue Sep 23 16:33:17 2008 -0400 @@ -16,11 +16,13 @@ ICEDTEAPLUGIN_TARGET = IcedTeaPlugin.so ICEDTEAPLUGIN_TARGET = IcedTeaPlugin.so ICEDTEAPLUGIN_JAR = IcedTeaPlugin.jar PLUGIN_PATCH = patches/icedtea-liveconnect.patch +LIVECONNECT = $(abs_top_srcdir)/plugin/icedtea/java/src/main else ICEDTEAPLUGIN_CLEAN = ICEDTEAPLUGIN_TARGET = ICEDTEAPLUGIN_JAR = PLUGIN_PATCH = patches/icedtea-plugin.patch +LIVECONNECT = if ENABLE_PLUGIN GCJWEBPLUGIN_CLEAN = clean-gcjwebplugin GCJWEBPLUGIN_TARGET = gcjwebplugin.so @@ -578,7 +580,7 @@ stamps/patch.stamp: stamps/patch-fsg.sta else \ test x$${all_patches_ok} = "xyes" && all_patches_ok=$$p ; \ fi ; \ - done ; + done ; \ mv stamps/patch.stamp.tmp stamps/patch.stamp ; \ if ! test x$${all_patches_ok} = "xyes"; then \ echo ERROR patch $${all_patches_ok} FAILED! ; \ @@ -909,12 +911,6 @@ if ENABLE_LIVECONNECT $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ cp -pPRf IcedTeaPlugin.jar \ $(BUILD_OUTPUT_DIR)/j2re-image/lib/ - - $(JAR) uf $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/rt.jar \ - -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes sun - - $(JAR) uf $(BUILD_OUTPUT_DIR)/j2re-image/lib/rt.jar \ - -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes sun else if ENABLE_PLUGIN cp -pPRf gcjwebplugin.so \ @@ -970,12 +966,6 @@ if ENABLE_LIVECONNECT $(BUILD_OUTPUT_DIR)-debug/j2sdk-image/jre/lib/ cp -pPRf IcedTeaPlugin.jar \ $(BUILD_OUTPUT_DIR)-debug/j2re-image/lib/ - - $(JAR) uf $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/rt.jar \ - -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes sun - - $(JAR) uf $(BUILD_OUTPUT_DIR)/j2re-image/lib/rt.jar \ - -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes sun else if ENABLE_PLUGIN cp -pPRf gcjwebplugin.so \ @@ -1207,8 +1197,8 @@ bootstrap/jdk1.7.0/jre/lib/tools.jar: st # rt-closed.jar class files. rt-source-files.txt: stamps/extract.stamp stamps/copy-source-files.stamp - find $(abs_top_srcdir)/rt $(abs_top_builddir)/rt -name '*.java' \ - $(EXCLUDE_LIVECONNECT) \ + find $(abs_top_srcdir)/rt $(abs_top_builddir)/rt $(LIVECONNECT) -name '*.java' \ + $(EXCLUDE_LIVECONNECT) \ | sort -u > $@ stamps/rt-class-files.stamp: rt-source-files.txt @@ -1337,7 +1327,7 @@ IcedTeaPlugin.jar: $(ICEDTEA_BOOT_DIR)/bin/javac -g \ -d ../../../../../$(BUILD_OUTPUT_DIR)/plugin/icedtea/classes \ -bootclasspath $(ICEDTEA_BOOT_DIR)/jre/lib/rt.jar \ - sun/applet/*.java netscape/javascript/*.java org/classpath/icedtea/plugin/*.java \ + netscape/javascript/*.java org/classpath/icedtea/plugin/*.java \ ) $(JAR) cf $@ \ diff -r 30b1dbd707d5 -r 5cf4df1bc010 plugin/icedtea/java/src/main/netscape/javascript/JSException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugin/icedtea/java/src/main/netscape/javascript/JSException.java Tue Sep 23 16:33:17 2008 -0400 @@ -0,0 +1,140 @@ +/* -*- Mode: Java; tab-width: 8; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Communicator client code, released + * March 31, 1998. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +package netscape.javascript; + +/** + * JSException is an exception which is thrown when JavaScript code + * returns an error. + */ + +public +class JSException extends RuntimeException { + public static final int EXCEPTION_TYPE_EMPTY = -1; + public static final int EXCEPTION_TYPE_VOID = 0; + public static final int EXCEPTION_TYPE_OBJECT = 1; + public static final int EXCEPTION_TYPE_FUNCTION = 2; + public static final int EXCEPTION_TYPE_STRING = 3; + public static final int EXCEPTION_TYPE_NUMBER = 4; + public static final int EXCEPTION_TYPE_BOOLEAN = 5; + public static final int EXCEPTION_TYPE_ERROR = 6; + + public String filename; + public int lineno; + public String source; + public int tokenIndex; + public int wrappedExceptionType; + public Object wrappedException; + + /** + * Constructs a JSException without a detail message. + * A detail message is a String that describes this particular exception. + * + * @deprecated Not for public use in future versions. + */ + public JSException() { + super(); + filename = "unknown"; + lineno = 0; + source = ""; + tokenIndex = 0; + wrappedExceptionType = EXCEPTION_TYPE_EMPTY; + } + + /** + * Constructs a JSException with a detail message. + * A detail message is a String that describes this particular exception. + * @param s the detail message + * + * @deprecated Not for public use in future versions. + */ + public JSException(String s) { + super(s); + filename = "unknown"; + lineno = 0; + source = ""; + tokenIndex = 0; + wrappedExceptionType = EXCEPTION_TYPE_EMPTY; + } + + /** + * Constructs a JSException with a wrapped JavaScript exception object. + * This constructor needs to be public so that Java users can throw + * exceptions to JS cleanly. + */ + public JSException(int wrappedExceptionType, Object wrappedException) { + super(); + this.wrappedExceptionType = wrappedExceptionType; + this.wrappedException = wrappedException; + } + + /** + * Constructs a JSException with a detail message and all the + * other info that usually comes with a JavaScript error. + * @param s the detail message + * + * @deprecated Not for public use in future versions. + */ + public JSException(String s, String filename, int lineno, + String source, int tokenIndex) { + super(s); + this.filename = filename; + this.lineno = lineno; + this.source = source; + this.tokenIndex = tokenIndex; + wrappedExceptionType = EXCEPTION_TYPE_EMPTY; + } + + /** + * Instance method getWrappedExceptionType returns the int mapping of the + * type of the wrappedException Object. + */ + public int getWrappedExceptionType() { + return wrappedExceptionType; + } + + /** + * Instance method getWrappedException. + */ + public Object getWrappedException() { + return wrappedException; + } + +} + diff -r 30b1dbd707d5 -r 5cf4df1bc010 plugin/icedtea/java/src/main/netscape/javascript/JSObject.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugin/icedtea/java/src/main/netscape/javascript/JSObject.java Tue Sep 23 16:33:17 2008 -0400 @@ -0,0 +1,258 @@ +/* -*- Mode: Java; tab-width: 8; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Communicator client code, released + * March 31, 1998. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* more doc todo: + * threads + * gc + * + * + */ + +package netscape.javascript; + +import java.applet.Applet; +import java.io.IOException; +import sun.applet.PluginAppletViewer; + +/** + * JSObject allows Java to manipulate objects that are + * defined in JavaScript. + * Values passed from Java to JavaScript are converted as + * follows:
    + *
  • JSObject is converted to the original JavaScript object + *
  • Any other Java object is converted to a JavaScript wrapper, + * which can be used to access methods and fields of the java object. + * Converting this wrapper to a string will call the toString method + * on the original object, converting to a number will call the + * doubleValue method if possible and fail otherwise. Converting + * to a boolean will try to call the booleanValue method in the + * same way. + *
  • Java arrays are wrapped with a JavaScript object that understands + * array.length and array[index] + *
  • A Java boolean is converted to a JavaScript boolean + *
  • Java byte, char, short, int, long, float, and double are converted + * to JavaScript numbers + *
+ * Values passed from JavaScript to Java are converted as follows:
    + *
  • objects which are wrappers around java objects are unwrapped + *
  • other objects are wrapped with a JSObject + *
  • strings, numbers and booleans are converted to String, Double, + * and Boolean objects respectively + *
+ * This means that all JavaScript values show up as some kind + * of java.lang.Object in Java. In order to make much use of them, + * you will have to cast them to the appropriate subclass of Object, + * e.g. (String) window.getMember("name"); or + * (JSObject) window.getMember("document");. + */ +public final class JSObject { + /* the internal object data */ + private int internal; + private long long_internal; + + /** + * initialize + */ + private static void initClass() { + System.err.println ("JSObject.initClass"); + } + + static { + System.err.println ("JSObject INITIALIZER"); + } + + /** + * it is illegal to construct a JSObject manually + */ + // FIXME: make private! + public JSObject(int jsobj_addr) { + System.err.println ("JSObject int CONSTRUCTOR"); + internal = jsobj_addr; + } + + private JSObject(long jsobj_addr) { + System.err.println ("JSObject long CONSTRUCTOR"); + long_internal = jsobj_addr; + } + + /** + * Retrieves a named member of a JavaScript object. + * Equivalent to "this.name" in JavaScript. + */ + public Object getMember(String name) + { + System.err.println ("JSObject.getMember " + name); + + Object o = PluginAppletViewer.getMember(internal, name); + System.out.println ("JSObject.getMember GOT " + o); + return o; + } + + + /** + * Retrieves an indexed member of a JavaScript object. + * Equivalent to "this[index]" in JavaScript. + */ + // public Object getMember(int index) { return getSlot(index); } + public Object getSlot(int index) + { + System.err.println ("JSObject.getSlot " + index); + + return PluginAppletViewer.getSlot(internal, index); + } + + + /** + * Sets a named member of a JavaScript object. + * Equivalent to "this.name = value" in JavaScript. + */ + public void setMember(String name, Object value) + { + System.err.println ("JSObject.setMember " + name + " " + value); + + PluginAppletViewer.setMember(internal, name, value); + } + + /** + * Sets an indexed member of a JavaScript object. + * Equivalent to "this[index] = value" in JavaScript. + */ + // public void setMember(int index, Object value) { + // setSlot(index, value); + // } + public void setSlot(int index, Object value) + { + System.err.println ("JSObject.setSlot " + index + " " + value); + + PluginAppletViewer.setSlot(internal, index, value); + } + + + // TODO: toString, finalize. + + /** + * Removes a named member of a JavaScript object. + */ + public void removeMember(String name) + { + System.err.println ("JSObject.removeMember " + name); + + PluginAppletViewer.removeMember(internal, name); + } + + + /** + * Calls a JavaScript method. + * Equivalent to "this.methodName(args[0], args[1], ...)" in JavaScript. + */ + public Object call(String methodName, Object args[]) + { + System.err.print ("JSObject.call " + methodName); + for (int i = 0; i < args.length; i++) + System.err.print (" " + args[i]); + System.err.println(""); + return PluginAppletViewer.call(internal, methodName, args); + } + + + /** + * Evaluates a JavaScript expression. The expression is a string + * of JavaScript source code which will be evaluated in the context + * given by "this". + */ + public Object eval(String s) + { + System.err.println("JSObject.eval " + s); + return PluginAppletViewer.eval(internal, s); + } + + + /** + * Converts a JSObject to a String. + */ + public String toString() + { + System.err.println("JSObject.toString"); + return PluginAppletViewer.javascriptToString(internal); + } + + + // should use some sort of identifier rather than String + // is "property" the right word? + // native String[] listProperties(); + + + /** + * get a JSObject for the window containing the given applet + */ + public static JSObject getWindow(Applet applet) + { + System.err.println("JSObject.getWindow"); + // FIXME: handle long case as well. + int internal = 0; + internal = ((PluginAppletViewer) + applet.getAppletContext()).getWindow(); + System.out.println ("GOT IT: " + internal); + return new JSObject(internal); + } + + + /** + * Finalization decrements the reference count on the corresponding + * JavaScript object. + */ + protected void finalize() + { + System.err.println("JSObject.finalize "); + PluginAppletViewer.JavaScriptFinalize(internal); + } + + + /** + * Override java.lang.Object.equals() because identity is not preserved + * with instances of JSObject. + */ + public boolean equals(Object obj) + { + System.err.println("JSObject.equals " + obj); + + return false; + } + +} diff -r 30b1dbd707d5 -r 5cf4df1bc010 plugin/icedtea/java/src/main/netscape/javascript/JSProxy.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugin/icedtea/java/src/main/netscape/javascript/JSProxy.java Tue Sep 23 16:33:17 2008 -0400 @@ -0,0 +1,58 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Communicator client code, released + * March 31, 1998. + * From dbhole at redhat.com Wed Sep 24 10:01:41 2008 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 24 Sep 2008 17:01:41 +0000 Subject: changeset in /hg/icedtea6: Moved IcedTeaPlugin related classes i... Message-ID: changeset 3e5d21f2b7a4 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=3e5d21f2b7a4 description: Moved IcedTeaPlugin related classes into a separate jar, so that it can be run in a sandbox. Removed new files out of the IcedTeaPlugin patch, and moved them into a directory, so that history can be tracked properly. diffstat: 18 files changed, 4811 insertions(+), 4850 deletions(-) Makefile.am | 25 patches/icedtea-liveconnect.patch | 3559 ---------- patches/icedtea-plugin.patch | 1294 --- plugin/gcj/java/src/main/sun/applet/PluginAppletViewer.java | 1008 ++ plugin/gcj/java/src/main/sun/applet/PluginMain.java | 274 plugin/icedtea/java/src/main/sun/applet/GetMemberPluginCallRequest.java | 72 plugin/icedtea/java/src/main/sun/applet/GetWindowPluginCallRequest.java | 66 plugin/icedtea/java/src/main/sun/applet/PluginAppletSecurityContext.java | 847 ++ plugin/icedtea/java/src/main/sun/applet/PluginAppletViewer.java | 1439 ++++ plugin/icedtea/java/src/main/sun/applet/PluginCallRequest.java | 56 plugin/icedtea/java/src/main/sun/applet/PluginDebug.java | 13 plugin/icedtea/java/src/main/sun/applet/PluginException.java | 14 plugin/icedtea/java/src/main/sun/applet/PluginMain.java | 533 + plugin/icedtea/java/src/main/sun/applet/PluginMessageConsumer.java | 49 plugin/icedtea/java/src/main/sun/applet/PluginMessageHandlerWorker.java | 59 plugin/icedtea/java/src/main/sun/applet/PluginObjectStore.java | 119 plugin/icedtea/java/src/main/sun/applet/TestEnv.java | 172 plugin/icedtea/java/src/main/sun/applet/VoidPluginCallRequest.java | 62 diffs (truncated from 9811 to 500 lines): diff -r 8e3089767a4a -r 3e5d21f2b7a4 Makefile.am --- a/Makefile.am Thu Sep 18 11:31:59 2008 -0400 +++ b/Makefile.am Thu Sep 18 15:49:10 2008 -0400 @@ -12,12 +12,14 @@ if ENABLE_LIVECONNECT if ENABLE_LIVECONNECT ICEDTEAPLUGIN_CLEAN = clean-IcedTeaPlugin ICEDTEAPLUGIN_TARGET = IcedTeaPlugin.so +ICEDTEAPLUGIN_JAR = IcedTeaPlugin.jar PLUGIN_PATCH = patches/icedtea-liveconnect.patch EXCLUDE_LIVECONNECT = LIVECONNECT_DIR = -C lib/rt netscape else ICEDTEAPLUGIN_CLEAN = ICEDTEAPLUGIN_TARGET = +ICEDTEAPLUGIN_JAR = PLUGIN_PATCH = patches/icedtea-plugin.patch EXCLUDE_LIVECONNECT = | grep -v 'netscape/javascript' LIVECONNECT_DIR = @@ -894,7 +896,7 @@ stamps/icedtea.stamp: stamps/bootstrap-d stamps/icedtea.stamp: stamps/bootstrap-directory-symlink.stamp \ stamps/hotspot-tools.stamp stamps/plugs.stamp \ stamps/ports.stamp stamps/patch.stamp stamps/overlay.stamp \ - $(GCJWEBPLUGIN_TARGET) $(ICEDTEAPLUGIN_TARGET) \ + $(GCJWEBPLUGIN_TARGET) $(ICEDTEAPLUGIN_TARGET) $(ICEDTEAPLUGIN_JAR) \ extra-lib/about.jar stamps/cacao.stamp stamps/visualvm.stamp $(MAKE) \ $(ICEDTEA_ENV) \ @@ -905,6 +907,10 @@ if ENABLE_LIVECONNECT $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) cp -pPRf IcedTeaPlugin.so \ $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + cp -pPRf IcedTeaPlugin.jar \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ + cp -pPRf IcedTeaPlugin.jar \ + $(BUILD_OUTPUT_DIR)/j2re-image/lib/ else if ENABLE_PLUGIN cp -pPRf gcjwebplugin.so \ @@ -945,7 +951,7 @@ stamps/icedtea-debug.stamp: stamps/boots stamps/icedtea-debug.stamp: stamps/bootstrap-directory-symlink.stamp \ stamps/hotspot-tools.stamp stamps/plugs.stamp \ stamps/ports.stamp stamps/patch.stamp stamps/overlay.stamp \ - $(GCJWEBPLUGIN_TARGET) $(ICEDTEAPLUGIN_TARGET) \ + $(GCJWEBPLUGIN_TARGET) $(ICEDTEAPLUGIN_TARGET) $(ICEDTEAPLUGIN_JAR) \ extra-lib/about.jar stamps/cacao.stamp $(MAKE) \ $(ICEDTEA_ENV) \ @@ -956,6 +962,10 @@ if ENABLE_LIVECONNECT $(BUILD_OUTPUT_DIR)-debug/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) cp -pPRf IcedTeaPlugin.so \ $(BUILD_OUTPUT_DIR)-debug/j2re-image/lib/$(INSTALL_ARCH_DIR) + cp -pPRf IcedTeaPlugin.jar \ + $(BUILD_OUTPUT_DIR)-debug/j2sdk-image/jre/lib/ + cp -pPRf IcedTeaPlugin.jar \ + $(BUILD_OUTPUT_DIR)-debug/j2re-image/lib/ else if ENABLE_PLUGIN cp -pPRf gcjwebplugin.so \ @@ -1308,6 +1318,17 @@ IcedTeaPlugin.so: IcedTeaPlugin.o $(GTK_LIBS) \ $(XULRUNNER_LIBS) \ -shared -o $@ + +# icedtea plugin jar for java-side classes +IcedTeaPlugin.jar: + mkdir -p $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes + (cd plugin/icedtea/java/src/main/; \ + $(ICEDTEA_BOOT_DIR)/bin/javac -g \ + -d $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes \ + -bootclasspath $(ICEDTEA_BOOT_DIR)/jre/lib/rt.jar \ + sun/applet/*.java \ + ) + $(JAR) cf $@ -C $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes sun clean-IcedTeaPlugin: rm -f IcedTeaPlugin.o diff -r 8e3089767a4a -r 3e5d21f2b7a4 patches/icedtea-liveconnect.patch --- a/patches/icedtea-liveconnect.patch Thu Sep 18 11:31:59 2008 -0400 +++ b/patches/icedtea-liveconnect.patch Thu Sep 18 15:49:10 2008 -0400 @@ -1,6 +1,6 @@ diff -urN openjdk.orig/jdk/make/sun/Make diff -urN openjdk.orig/jdk/make/sun/Makefile openjdk/jdk/make/sun/Makefile --- openjdk.orig/jdk/make/sun/Makefile 2008-07-10 15:54:44.000000000 -0400 -+++ openjdk/jdk/make/sun/Makefile 2008-09-15 16:21:47.000000000 -0400 ++++ openjdk/jdk/make/sun/Makefile 2008-09-18 14:28:41.000000000 -0400 @@ -66,6 +66,7 @@ $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \ font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \ @@ -11,7 +11,7 @@ diff -urN openjdk.orig/jdk/make/sun/Make all build clean clobber:: diff -urN openjdk.orig/jdk/make/sun/Makefile.orig openjdk/jdk/make/sun/Makefile.orig --- openjdk.orig/jdk/make/sun/Makefile.orig 1969-12-31 19:00:00.000000000 -0500 -+++ openjdk/jdk/make/sun/Makefile.orig 2008-09-15 16:21:47.000000000 -0400 ++++ openjdk/jdk/make/sun/Makefile.orig 2008-09-18 14:28:41.000000000 -0400 @@ -0,0 +1,73 @@ +# +# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. @@ -88,7 +88,7 @@ diff -urN openjdk.orig/jdk/make/sun/Make + diff -urN openjdk.orig/jdk/make/sun/plugin/Makefile openjdk/jdk/make/sun/plugin/Makefile --- openjdk.orig/jdk/make/sun/plugin/Makefile 1969-12-31 19:00:00.000000000 -0500 -+++ openjdk/jdk/make/sun/plugin/Makefile 2008-09-15 16:21:47.000000000 -0400 ++++ openjdk/jdk/make/sun/plugin/Makefile 2008-09-18 14:28:41.000000000 -0400 @@ -0,0 +1,53 @@ +# +# Copyright 1995-2005 Sun Microsystems, Inc. All Rights Reserved. @@ -143,3556 +143,3 @@ diff -urN openjdk.orig/jdk/make/sun/plug +JAVA_ARGS = "{ \"sun.applet.PluginMain\" }" +include $(BUILDDIR)/common/Program.gmk + -diff -urN openjdk.orig/jdk/src/share/classes/sun/applet/GetMemberPluginCallRequest.java openjdk/jdk/src/share/classes/sun/applet/GetMemberPluginCallRequest.java ---- openjdk.orig/jdk/src/share/classes/sun/applet/GetMemberPluginCallRequest.java 1969-12-31 19:00:00.000000000 -0500 -+++ openjdk/jdk/src/share/classes/sun/applet/GetMemberPluginCallRequest.java 2008-09-15 16:22:06.000000000 -0400 -@@ -0,0 +1,72 @@ -+/* GetMemberPluginCallRequest -- represent Java-to-JavaScript requests -+ Copyright (C) 2008 Red Hat -+ -+This file is part of IcedTea. -+ -+IcedTea is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+IcedTea is distributed in the hope that it will be useful, but -+WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with IcedTea; see the file COPYING. If not, write to the -+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -+02110-1301 USA. -+ -+Linking this library statically or dynamically with other modules is -+making a combined work based on this library. Thus, the terms and -+conditions of the GNU General Public License cover the whole -+combination. -+ -+As a special exception, the copyright holders of this library give you -+permission to link this library with independent modules to produce an -+executable, regardless of the license terms of these independent -+modules, and to copy and distribute the resulting executable under -+terms of your choice, provided that you also meet, for each linked -+independent module, the terms and conditions of the license of that -+module. An independent module is a module which is not derived from -+or based on this library. If you modify this library, you may extend -+this exception to your version of the library, but you are not -+obligated to do so. If you do not wish to do so, delete this -+exception statement from your version. */ -+ -+package sun.applet; -+ -+class GetMemberPluginCallRequest extends PluginCallRequest { -+ Object object = null; -+ -+ public GetMemberPluginCallRequest(String message, String returnString) { -+ super(message, returnString); -+ System.out.println ("GetMEMBerPLUGINCAlL " + message + " " + returnString); -+ } -+ -+ public void parseReturn(String message) { -+ System.out.println ("GetMEMBerparseReturn GOT: " + message); -+ String[] args = message.split(" "); -+ // FIXME: add thread ID to messages to support multiple -+ // threads using the netscape.javascript package. -+ object = PluginAppletSecurityContext.contexts.get( -+ 0).store.getObject(Integer.parseInt(args[1])); -+ done = true; -+ } -+ -+ /** -+ * Returns whether the given message is serviceable by this object -+ * -+ * @param message The message to service -+ * @return boolean indicating if message is serviceable -+ */ -+ public boolean serviceable(String message) { -+ return message.contains("JavaScriptCall") || -+ message.contains("JavaScriptEval") || -+ message.contains("JavaScriptGetMember") || -+ message.contains("JavaScriptGetSlot") || -+ message.contains("JavaScriptToString"); -+ } -+} -+ -diff -urN openjdk.orig/jdk/src/share/classes/sun/applet/GetWindowPluginCallRequest.java openjdk/jdk/src/share/classes/sun/applet/GetWindowPluginCallRequest.java ---- openjdk.orig/jdk/src/share/classes/sun/applet/GetWindowPluginCallRequest.java 1969-12-31 19:00:00.000000000 -0500 -+++ openjdk/jdk/src/share/classes/sun/applet/GetWindowPluginCallRequest.java 2008-09-15 16:22:06.000000000 -0400 -@@ -0,0 +1,66 @@ -+/* GetWindowPluginCallRequest -- represent Java-to-JavaScript requests -+ Copyright (C) 2008 Red Hat -+ -+This file is part of IcedTea. -+ -+IcedTea is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+IcedTea is distributed in the hope that it will be useful, but -+WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with IcedTea; see the file COPYING. If not, write to the -+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -+02110-1301 USA. -+ -+Linking this library statically or dynamically with other modules is -+making a combined work based on this library. Thus, the terms and -+conditions of the GNU General Public License cover the whole -+combination. -+ -+As a special exception, the copyright holders of this library give you -+permission to link this library with independent modules to produce an -+executable, regardless of the license terms of these independent -+modules, and to copy and distribute the resulting executable under -+terms of your choice, provided that you also meet, for each linked -+independent module, the terms and conditions of the license of that -+module. An independent module is a module which is not derived from -+or based on this library. If you modify this library, you may extend -+this exception to your version of the library, but you are not -+obligated to do so. If you do not wish to do so, delete this -+exception statement from your version. */ -+ -+package sun.applet; -+ -+class GetWindowPluginCallRequest extends PluginCallRequest { -+ // FIXME: look into int vs long JavaScript internal values. -+ int internal; -+ -+ public GetWindowPluginCallRequest(String message, String returnString) { -+ super(message, returnString); -+ } -+ -+ public void parseReturn(String message) { -+ System.out.println ("GetWINDOWparseReturn GOT: " + message); -+ String[] args = message.split(" "); -+ // FIXME: add thread ID to messages to support multiple -+ // threads using the netscape.javascript package. -+ internal = Integer.parseInt(args[1]); -+ done = true; -+ } -+ -+ /** -+ * Returns whether the given message is serviceable by this object -+ * -+ * @param message The message to service -+ * @return boolean indicating if message is serviceable -+ */ -+ public boolean serviceable(String message) { -+ return message.contains("JavaScriptGetWindow"); -+ } -+} -diff -urN openjdk.orig/jdk/src/share/classes/sun/applet/PluginAppletSecurityContext.java openjdk/jdk/src/share/classes/sun/applet/PluginAppletSecurityContext.java ---- openjdk.orig/jdk/src/share/classes/sun/applet/PluginAppletSecurityContext.java 1969-12-31 19:00:00.000000000 -0500 -+++ openjdk/jdk/src/share/classes/sun/applet/PluginAppletSecurityContext.java 2008-09-15 16:22:07.000000000 -0400 -@@ -0,0 +1,847 @@ -+/* PluginAppletSecurityContext -- execute plugin JNI messages -+ Copyright (C) 2008 Red Hat -+ -+This file is part of IcedTea. -+ -+IcedTea is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+IcedTea is distributed in the hope that it will be useful, but -+WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with IcedTea; see the file COPYING. If not, write to the -+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -+02110-1301 USA. -+ -+Linking this library statically or dynamically with other modules is -+making a combined work based on this library. Thus, the terms and -+conditions of the GNU General Public License cover the whole -+combination. -+ -+As a special exception, the copyright holders of this library give you -+permission to link this library with independent modules to produce an -+executable, regardless of the license terms of these independent -+modules, and to copy and distribute the resulting executable under -+terms of your choice, provided that you also meet, for each linked -+independent module, the terms and conditions of the license of that -+module. An independent module is a module which is not derived from -+or based on this library. If you modify this library, you may extend -+this exception to your version of the library, but you are not -+obligated to do so. If you do not wish to do so, delete this -+exception statement from your version. */ -+ -+package sun.applet; -+ -+import java.lang.reflect.Array; -+import java.lang.reflect.Constructor; -+import java.lang.reflect.Field; -+import java.lang.reflect.Method; -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.List; -+import java.util.StringTokenizer; -+ -+class Signature { -+ private String signature; -+ private int currentIndex; -+ private List typeList; -+ private static final char ARRAY = '['; -+ private static final char OBJECT = 'L'; -+ private static final char SIGNATURE_ENDCLASS = ';'; -+ private static final char SIGNATURE_FUNC = '('; -+ private static final char SIGNATURE_ENDFUNC = ')'; -+ private static final char VOID = 'V'; -+ private static final char BOOLEAN = 'Z'; -+ private static final char BYTE = 'B'; -+ private static final char CHARACTER = 'C'; -+ private static final char SHORT = 'S'; -+ private static final char INTEGER = 'I'; -+ private static final char LONG = 'J'; -+ private static final char FLOAT = 'F'; -+ private static final char DOUBLE = 'D'; -+ -+ private String nextTypeName() { -+ char key = signature.charAt(currentIndex++); -+ -+ switch (key) { -+ case ARRAY: -+ return nextTypeName() + "[]"; -+ -+ case OBJECT: -+ int endClass = signature.indexOf(SIGNATURE_ENDCLASS, currentIndex); -+ String retVal = signature.substring(currentIndex, endClass); -+ retVal = retVal.replace('/', '.'); -+ currentIndex = endClass + 1; -+ return retVal; -+ -+ // FIXME: generated bytecode with classes named after -+ // primitives will not work in this scheme -- those -+ // classes will be incorrectly treated as primitive -+ // types. -+ case VOID: -+ return "void"; -+ case BOOLEAN: -+ return "boolean"; -+ case BYTE: -+ return "byte"; -+ case CHARACTER: -+ return "char"; -+ case SHORT: -+ return "short"; -+ case INTEGER: -+ return "int"; -+ case LONG: -+ return "long"; -+ case FLOAT: -+ return "float"; -+ case DOUBLE: -+ return "double"; -+ -+ case SIGNATURE_ENDFUNC: -+ case SIGNATURE_FUNC: -+ return nextTypeName(); -+ -+ default: -+ throw new IllegalArgumentException( -+ "Invalid JNI signature character '" + key + "'"); -+ } -+ } -+ -+ public Signature(String signature, String src) { -+ this.signature = signature; -+ currentIndex = 0; -+ typeList = new ArrayList(10); -+ -+ String elem; -+ while (currentIndex < signature.length()) { -+ elem = nextTypeName(); -+ // System.out.println ("NEXT TYPE: " + elem); -+ Class primitive = primitiveNameToType(elem); -+ if (primitive != null) -+ typeList.add(primitive); -+ else { -+ // System.out.println ("HERE1"); -+ int dimsize = 0; -+ int n = elem.indexOf('['); -+ if (n != -1) { -+ // System.out.println ("HERE2"); -+ String arrayType = elem.substring(0, n); -+ dimsize++; -+ n = elem.indexOf('[', n + 1); -+ // System.out.println ("HERE2.5"); -+ while (n != -1) { -+ dimsize++; -+ n = elem.indexOf('[', n + 1); -+ // System.out.println ("HERE2.8"); -+ } -+ int[] dims = new int[dimsize]; -+ primitive = primitiveNameToType(arrayType); -+ // System.out.println ("HERE3"); -+ if (primitive != null) { -+ typeList.add(Array.newInstance(primitive, dims) -+ .getClass()); -+ // System.out.println ("HERE4"); -+ } else -+ typeList.add(Array.newInstance( -+ getClass(arrayType, src), dims).getClass()); -+ } else { -+ typeList.add(getClass(elem, src)); -+ } -+ } -+ } -+ if (typeList.size() == 0) { -+ throw new IllegalArgumentException("Invalid JNI signature '" -+ + signature + "'"); -+ } -+ } -+ -+ public static Class getClass(String name, String src) { -+ -+ Class c = null; -+ -+ try { -+ c = Class.forName(name); -+ } catch (ClassNotFoundException cnfe) { -+ -+ StringTokenizer st = new StringTokenizer(src, ","); -+ -+ while (st.hasMoreTokens()) { -+ -+ String tok = st.nextToken(); -+ System.err.println("Searching for " + name + " at key " + tok); -+ -+ try { -+ c = PluginAppletSecurityContext.classLoaders.get(tok).loadClass(name); -+ } catch (ClassNotFoundException e) { -+ // do nothing .. thrown below -+ } -+ -+ if (c != null) -+ break; -+ } -+ } -+ -+ if (c == null) { -+ throw (new RuntimeException(new ClassNotFoundException("Unable to find class " + name))); -+ } -+ -+ return c; -+ } -+ -+ public static Class primitiveNameToType(String name) { -+ if (name.equals("void")) -+ return Void.TYPE; -+ else if (name.equals("boolean")) -+ return Boolean.TYPE; -+ else if (name.equals("byte")) -+ return Byte.TYPE; -+ else if (name.equals("char")) -+ return Character.TYPE; -+ else if (name.equals("short")) -+ return Short.TYPE; -+ else if (name.equals("int")) -+ return Integer.TYPE; -+ else if (name.equals("long")) -+ return Long.TYPE; -+ else if (name.equals("float")) -+ return Float.TYPE; -+ else if (name.equals("double")) -+ return Double.TYPE; -+ else -+ return null; -+ } -+ -+ public Class[] getClassArray() { -+ return typeList.subList(0, typeList.size() - 1).toArray(new Class[] {}); -+ } -+} -+ -+public class PluginAppletSecurityContext { -+ // Context identifier -> PluginAppletSecurityContext object. -+ // FIXME: make private -+ public static HashMap contexts = new HashMap(); -+ -+ public static HashMap classLoaders = new HashMap(); -+ -+ // FIXME: make private -+ public PluginObjectStore store = new PluginObjectStore(); -+ private Throwable throwable = null; -+ private ClassLoader liveconnectLoader = ClassLoader.getSystemClassLoader(); -+ int identifier = 0; -+ -+ static { -+ // FIXME: when should we add each new security context? but how would -+ // we be able to know which context applies to which request from nspr? -+ // the nspr jni functions do not know what applet they are being called -+ // in reference to From dbhole at redhat.com Wed Sep 24 10:01:42 2008 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 24 Sep 2008 17:01:42 +0000 Subject: changeset in /hg/icedtea6: More refactoring. Moved classes to a ... Message-ID: changeset abdb5c94757d in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=abdb5c94757d description: More refactoring. Moved classes to a shorter path, removed classes provided by the JDK tarball (they were there by mistake). diffstat: 76 files changed, 5756 insertions(+), 10252 deletions(-) ChangeLog | 50 Makefile.am | 4 patches/icedtea-plugin.patch | 1294 ++++++++ plugin/gcj/java/src/main/sun/applet/PluginAppletViewer.java | 1008 ------ plugin/gcj/java/src/main/sun/applet/PluginMain.java | 274 - plugin/icedtea/java/src/main/netscape/javascript/JSException.java | 140 plugin/icedtea/java/src/main/netscape/javascript/JSObject.java | 258 - plugin/icedtea/java/src/main/netscape/javascript/JSProxy.java | 58 plugin/icedtea/java/src/main/netscape/javascript/JSRunnable.java | 70 plugin/icedtea/java/src/main/netscape/javascript/JSUtil.java | 59 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/GetMemberPluginCallRequest.java | 78 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/GetWindowPluginCallRequest.java | 76 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginAppletSecurityContext.java | 855 ----- plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginCallRequestFactoryImpl.java | 22 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginMain.java | 193 - plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginMessageConsumer.java | 76 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginMessageHandlerWorker.java | 79 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginObjectStore.java | 119 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/PluginStreamHandlerImpl.java | 362 -- plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/RequestQueue.java | 40 plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/TestEnv.java | 172 - plugin/icedtea/java/src/main/org/classpath/icedtea/plugin/VoidPluginCallRequest.java | 69 plugin/icedtea/java/src/main/sun/applet/AppletAudioClip.java | 151 - plugin/icedtea/java/src/main/sun/applet/AppletClassLoader.java | 861 ----- plugin/icedtea/java/src/main/sun/applet/AppletEvent.java | 65 plugin/icedtea/java/src/main/sun/applet/AppletEventMulticaster.java | 127 plugin/icedtea/java/src/main/sun/applet/AppletIOException.java | 59 plugin/icedtea/java/src/main/sun/applet/AppletIllegalArgumentException.java | 48 plugin/icedtea/java/src/main/sun/applet/AppletImageRef.java | 54 plugin/icedtea/java/src/main/sun/applet/AppletListener.java | 39 plugin/icedtea/java/src/main/sun/applet/AppletMessageHandler.java | 113 plugin/icedtea/java/src/main/sun/applet/AppletObjectInputStream.java | 106 plugin/icedtea/java/src/main/sun/applet/AppletPanel.java | 1334 --------- plugin/icedtea/java/src/main/sun/applet/AppletProps.java | 221 - plugin/icedtea/java/src/main/sun/applet/AppletResourceLoader.java | 48 plugin/icedtea/java/src/main/sun/applet/AppletSecurity.java | 371 -- plugin/icedtea/java/src/main/sun/applet/AppletSecurityContext.java | 25 plugin/icedtea/java/src/main/sun/applet/AppletSecurityContextManager.java | 27 plugin/icedtea/java/src/main/sun/applet/AppletSecurityException.java | 65 plugin/icedtea/java/src/main/sun/applet/AppletThreadGroup.java | 64 plugin/icedtea/java/src/main/sun/applet/AppletViewerFactory.java | 41 plugin/icedtea/java/src/main/sun/applet/AppletViewerPanel.java | 254 - plugin/icedtea/java/src/main/sun/applet/Main.java | 533 --- plugin/icedtea/java/src/main/sun/applet/PluginAppletViewer.java | 1481 ---------- plugin/icedtea/java/src/main/sun/applet/PluginCallRequest.java | 85 plugin/icedtea/java/src/main/sun/applet/PluginCallRequestFactory.java | 7 plugin/icedtea/java/src/main/sun/applet/PluginClassLoader.java | 13 plugin/icedtea/java/src/main/sun/applet/PluginDebug.java | 13 plugin/icedtea/java/src/main/sun/applet/PluginException.java | 15 plugin/icedtea/java/src/main/sun/applet/PluginStreamHandler.java | 20 plugin/icedtea/netscape/javascript/JSException.java | 140 plugin/icedtea/netscape/javascript/JSObject.java | 258 + plugin/icedtea/netscape/javascript/JSProxy.java | 58 plugin/icedtea/netscape/javascript/JSRunnable.java | 70 plugin/icedtea/netscape/javascript/JSUtil.java | 59 plugin/icedtea/org/classpath/icedtea/plugin/GetMemberPluginCallRequest.java | 78 plugin/icedtea/org/classpath/icedtea/plugin/GetWindowPluginCallRequest.java | 76 plugin/icedtea/org/classpath/icedtea/plugin/PluginAppletSecurityContext.java | 855 +++++ plugin/icedtea/org/classpath/icedtea/plugin/PluginCallRequestFactoryImpl.java | 22 plugin/icedtea/org/classpath/icedtea/plugin/PluginMain.java | 193 + plugin/icedtea/org/classpath/icedtea/plugin/PluginMessageConsumer.java | 76 plugin/icedtea/org/classpath/icedtea/plugin/PluginMessageHandlerWorker.java | 79 plugin/icedtea/org/classpath/icedtea/plugin/PluginObjectStore.java | 119 plugin/icedtea/org/classpath/icedtea/plugin/PluginStreamHandlerImpl.java | 362 ++ plugin/icedtea/org/classpath/icedtea/plugin/RequestQueue.java | 40 plugin/icedtea/org/classpath/icedtea/plugin/TestEnv.java | 172 + plugin/icedtea/org/classpath/icedtea/plugin/VoidPluginCallRequest.java | 69 plugin/icedtea/sun/applet/AppletSecurityContext.java | 25 plugin/icedtea/sun/applet/AppletSecurityContextManager.java | 27 plugin/icedtea/sun/applet/PluginAppletViewer.java | 1481 ++++++++++ plugin/icedtea/sun/applet/PluginCallRequest.java | 85 plugin/icedtea/sun/applet/PluginCallRequestFactory.java | 7 plugin/icedtea/sun/applet/PluginClassLoader.java | 13 plugin/icedtea/sun/applet/PluginDebug.java | 13 plugin/icedtea/sun/applet/PluginException.java | 15 plugin/icedtea/sun/applet/PluginStreamHandler.java | 20 diffs (truncated from 16340 to 500 lines): diff -r 5cf4df1bc010 -r abdb5c94757d ChangeLog --- a/ChangeLog Tue Sep 23 16:33:17 2008 -0400 +++ b/ChangeLog Tue Sep 23 16:52:24 2008 -0400 @@ -1,3 +1,53 @@ 2008-09-18 Lillian Angel + * Makefile.am: Update to create new IcedTeaPlugin.jar + * patches/icedtea-liveconnect.patch: Update patch and remove all new .java + files + * plugin/icedtea/java/src/main/netscape/javascript/JSException.java: Moved + out of rt/ overlay. + * plugin/icedtea/java/src/main/netscape/javascript/JSObject.java: Same. + * plugin/icedtea/java/src/main/netscape/javascript/JSProxy.java: Same. + * plugin/icedtea/java/src/main/netscape/javascript/JSRunnable.java: Same. + * plugin/icedtea/java/src/main/netscape/javascript/JSUtil.java: Same. + * plugin/icedtea/org/classpath/icedtea/plugin/GetMemberPluginCallRequest.java: + Moved out of icedtea-liveconnect.patch and refactored. + * plugin/icedtea/org/classpath/icedtea/plugin/GetWindowPluginCallRequest.java: + Same. + * plugin/icedtea/org/classpath/icedtea/plugin/PluginAppletSecurityContext.java: + Same. + * plugin/icedtea/org/classpath/icedtea/plugin/PluginCallRequestFactoryImpl.java: + Same. + * plugin/icedtea/org/classpath/icedtea/plugin/PluginMain.java: Same. + * plugin/icedtea/org/classpath/icedtea/plugin/PluginMessageConsumer.java: + Same. + * plugin/icedtea/org/classpath/icedtea/plugin/PluginMessageHandlerWorker.java: + Same. + * plugin/icedtea/org/classpath/icedtea/plugin/PluginObjectStore.java: + Same. + * plugin/icedtea/org/classpath/icedtea/plugin/PluginStreamHandlerImpl.java: + Same. + * plugin/icedtea/org/classpath/icedtea/plugin/RequestQueue.java: Same. + * plugin/icedtea/org/classpath/icedtea/plugin/TestEnv.java: Same. + * plugin/icedtea/org/classpath/icedtea/plugin/VoidPluginCallRequest.java: + Same. + * plugin/icedtea/sun/applet/AppletSecurityContext.java: Same. + * plugin/icedtea/sun/applet/AppletSecurityContextManager.java: Same. + * plugin/icedtea/sun/applet/PluginAppletViewer.java: Same. + * plugin/icedtea/sun/applet/PluginCallRequest.java: Same. + * plugin/icedtea/sun/applet/PluginCallRequestFactory.java: Same. + * plugin/icedtea/sun/applet/PluginClassLoader.java: Same. + * plugin/icedtea/sun/applet/PluginDebug.java: Same. + * plugin/icedtea/sun/applet/PluginException.java: Same. + * plugin/icedtea/sun/applet/PluginStreamHandler.java: Same. + * rt/net/sourceforge/jnlp/Launcher.java: Print exception trace if launch + fails. + * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Set ServiceManagerStub + before SecurityManager is set. + * rt/netscape/javascript/JSException.java: Move to plugin/icedtea dir. + * rt/netscape/javascript/JSObject.java: Same. + * rt/netscape/javascript/JSProxy.java: Same. + * rt/netscape/javascript/JSRunnable.java: Same. + * rt/netscape/javascript/JSUtil.java: Same. + 2008-09-18 Lillian Angel * AUTHORS: Added Marc Schoenefeld. diff -r 5cf4df1bc010 -r abdb5c94757d Makefile.am --- a/Makefile.am Tue Sep 23 16:33:17 2008 -0400 +++ b/Makefile.am Tue Sep 23 16:52:24 2008 -0400 @@ -16,7 +16,7 @@ ICEDTEAPLUGIN_TARGET = IcedTeaPlugin.so ICEDTEAPLUGIN_TARGET = IcedTeaPlugin.so ICEDTEAPLUGIN_JAR = IcedTeaPlugin.jar PLUGIN_PATCH = patches/icedtea-liveconnect.patch -LIVECONNECT = $(abs_top_srcdir)/plugin/icedtea/java/src/main +LIVECONNECT = $(abs_top_srcdir)/plugin/icedtea/ else ICEDTEAPLUGIN_CLEAN = ICEDTEAPLUGIN_TARGET = @@ -1323,7 +1323,7 @@ IcedTeaPlugin.so: IcedTeaPlugin.o # icedtea plugin jar for java-side classes IcedTeaPlugin.jar: mkdir -p $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes - (cd plugin/icedtea/java/src/main/; \ + (cd plugin/icedtea/; \ $(ICEDTEA_BOOT_DIR)/bin/javac -g \ -d ../../../../../$(BUILD_OUTPUT_DIR)/plugin/icedtea/classes \ -bootclasspath $(ICEDTEA_BOOT_DIR)/jre/lib/rt.jar \ diff -r 5cf4df1bc010 -r abdb5c94757d patches/icedtea-plugin.patch --- a/patches/icedtea-plugin.patch Tue Sep 23 16:33:17 2008 -0400 +++ b/patches/icedtea-plugin.patch Tue Sep 23 16:52:24 2008 -0400 @@ -1,6 +1,6 @@ diff -urN openjdk.orig/jdk/make/launcher diff -urN openjdk.orig/jdk/make/launchers/Makefile openjdk/jdk/make/launchers/Makefile ---- openjdk.orig/jdk/make/launchers/Makefile 2008-07-10 15:54:41.000000000 -0400 -+++ openjdk/jdk/make/launchers/Makefile 2008-09-18 14:21:46.000000000 -0400 +--- openjdk.orig/jdk/make/launchers/Makefile 2008-06-29 09:40:07.000000000 -0400 ++++ openjdk/jdk/make/launchers/Makefile 2008-06-29 09:40:16.000000000 -0400 @@ -92,6 +92,7 @@ -J-Dcom.sun.CORBA.activation.Port=1049 \ -J-Dcom.sun.CORBA.POA.ORBServerId=1, ) @@ -9,3 +9,1293 @@ diff -urN openjdk.orig/jdk/make/launcher $(call make-launcher, policytool, sun.security.tools.PolicyTool, , ) $(call make-launcher, rmic, sun.rmi.rmic.Main, , ) $(call make-launcher, rmid, sun.rmi.server.Activation, , ) +diff -urN openjdk.orig/jdk/src/share/classes/sun/applet/PluginMain.java openjdk/jdk/src/share/classes/sun/applet/PluginMain.java +--- openjdk.orig/jdk/src/share/classes/sun/applet/PluginMain.java 1969-12-31 19:00:00.000000000 -0500 ++++ openjdk/jdk/src/share/classes/sun/applet/PluginMain.java 2008-01-14 14:18:53.000000000 -0500 +@@ -0,0 +1,274 @@ ++/* ++ * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. Sun designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Sun in the LICENSE file that accompanied this code. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, ++ * CA 95054 USA or visit www.sun.com if you need additional information or ++ * have any questions. ++ */ ++ ++package sun.applet; ++ ++import java.io.*; ++import java.lang.reflect.Method; ++import java.lang.reflect.InvocationTargetException; ++import java.net.*; ++import java.nio.charset.Charset; ++import java.util.*; ++import sun.net.www.ParseUtil; ++ ++class PluginParseRequest ++{ ++ long handle; ++ String tag; ++ String documentbase; ++ boolean alreadySent; ++} ++ ++/** ++ * The main entry point into PluginAppletViewer. ++ */ ++public class PluginMain ++{ ++ // A mapping of instance IDs to PluginAppletViewers. ++ private static HashMap appletWindows = new HashMap(); ++ private static HashMap parseRequests = new HashMap(); ++ private static String currentKey; ++ private static PluginAppletViewer currentWindow; ++ private static PluginParseRequest currentRequest; ++ private static BufferedReader pluginInputStream; ++ private static BufferedWriter pluginOutputStream; ++ // This is used in init(). Getting rid of this is desirable but depends ++ // on whether the property that uses it is necessary/standard. ++ public static final String theVersion = System.getProperty("java.version"); ++ ++ /** ++ * The main entry point into AppletViewer. ++ */ ++ public static void main(String args[]) ++ throws IOException ++ { ++ if(args.length != 2) { ++ // Indicate to plugin that appletviewer is installed correctly. ++ System.exit(0); ++ } ++ // INSTALL THE SECURITY MANAGER ++ init(); ++ start(new FileInputStream(args[0]), new FileOutputStream(args[1])); ++ System.exit(0); ++ } ++ ++ private static void init() { ++ Properties avProps = new Properties(); ++ ++ // ADD OTHER RANDOM PROPERTIES ++ // XXX 5/18 need to revisit why these are here, is there some ++ // standard for what is available? ++ ++ // Standard browser properties ++ avProps.put("browser", "sun.applet.AppletViewer"); ++ avProps.put("browser.version", "1.06"); ++ avProps.put("browser.vendor", "Sun Microsystems Inc."); ++ avProps.put("http.agent", "Java(tm) 2 SDK, Standard Edition v" + theVersion); ++ ++ // Define which packages can be extended by applets ++ // XXX 5/19 probably not needed, not checked in AppletSecurity ++ avProps.put("package.restrict.definition.java", "true"); ++ avProps.put("package.restrict.definition.sun", "true"); ++ ++ // Define which properties can be read by applets. ++ // A property named by "key" can be read only when its twin ++ // property "key.applet" is true. The following ten properties ++ // are open by default. Any other property can be explicitly ++ // opened up by the browser user by calling appletviewer with ++ // -J-Dkey.applet=true ++ avProps.put("java.version.applet", "true"); ++ avProps.put("java.vendor.applet", "true"); ++ avProps.put("java.vendor.url.applet", "true"); ++ avProps.put("java.class.version.applet", "true"); ++ avProps.put("os.name.applet", "true"); ++ avProps.put("os.version.applet", "true"); ++ avProps.put("os.arch.applet", "true"); ++ avProps.put("file.separator.applet", "true"); ++ avProps.put("path.separator.applet", "true"); ++ avProps.put("line.separator.applet", "true"); ++ ++ // Read in the System properties. If something is going to be ++ // over-written, warn about it. ++ Properties sysProps = System.getProperties(); ++ for (Enumeration e = sysProps.propertyNames(); e.hasMoreElements(); ) { ++ String key = (String) e.nextElement(); ++ String val = (String) sysProps.getProperty(key); ++ avProps.setProperty(key, val); ++ } ++ ++ // INSTALL THE PROPERTY LIST ++ System.setProperties(avProps); ++ ++ // Create and install the security manager ++ System.setSecurityManager(new AppletSecurity()); ++ ++ // REMIND: Create and install a socket factory! ++ } ++ ++ static void registerWindow(PluginAppletViewer pluginappletviewer) ++ { ++ appletWindows.put(currentKey, pluginappletviewer); ++ currentWindow = (PluginAppletViewer)appletWindows.get(currentKey); ++ } ++ ++ private static void deregisterWindow(PluginAppletViewer pluginappletviewer) ++ { ++ appletWindows.remove(currentWindow); ++ currentWindow.dispose(); ++ currentWindow = null; ++ } ++ ++ static void start(InputStream inputstream, OutputStream outputstream) ++ throws MalformedURLException, IOException ++ { ++ // Set up input and output pipes. Use UTF-8 encoding. ++ pluginInputStream = ++ new BufferedReader(new InputStreamReader(inputstream, ++ Charset.forName("UTF-8"))); ++ pluginOutputStream = ++ new BufferedWriter(new OutputStreamWriter ++ (outputstream, Charset.forName("UTF-8"))); ++ ++ write("running"); ++ ++ // Read first message. ++ String message = read(); ++ ++ while(true) { ++ if (message.startsWith("instance")) { ++ // Read applet instance identifier. ++ currentKey = message.substring("instance".length() + 1); ++ currentWindow = ++ (PluginAppletViewer)appletWindows.get(currentKey); ++ currentRequest = null; ++ if (currentWindow == null) { ++ if (!parseRequests.containsKey(currentKey)) ++ parseRequests.put(currentKey, new PluginParseRequest()); ++ currentRequest = ++ (PluginParseRequest)parseRequests.get(currentKey); ++ } ++ } else if (message.startsWith("tag")) { ++ if (currentRequest != null) { ++ int index = message.indexOf(' ', "tag".length() + 1); ++ currentRequest.documentbase = ++ message.substring("tag".length() + 1, index); ++ currentRequest.tag = message.substring(index + 1); ++ if (currentRequest.handle != 0 ++ && !currentRequest.alreadySent) { ++ PluginAppletViewer.parse ++ (currentRequest.handle, 1, 1, ++ new StringReader(currentRequest.tag), ++ new URL(currentRequest.documentbase)); ++ parseRequests.remove(currentKey); ++ } ++ } ++ } else if (message.startsWith("handle")) { ++ if (currentRequest != null) { ++ currentRequest.handle = Long.parseLong ++ (message.substring("handle".length() + 1, ++ message.indexOf("width") - 1)); ++ int width = Integer.parseInt(message.substring ++ (message.indexOf("width") + ++ "width".length() + 1, ++ message.indexOf("height") - 1)); ++ int height = Integer.parseInt(message.substring( ++ message.indexOf("height") + ++ "height".length() + 1)); ++ if (currentRequest.tag != null ++ && !currentRequest.alreadySent) { ++ PluginAppletViewer.parse ++ (currentRequest.handle, width, height, ++ new StringReader(currentRequest.tag), ++ new URL(currentRequest.documentbase)); ++ parseRequests.remove(currentKey); ++ } ++ } ++ } else if (message.startsWith("width")) { ++ int width = ++ Integer.parseInt(message.substring("width".length() + 1)); ++ int height = currentWindow.getHeight(); ++ currentWindow.updateAtts(width, height); ++ currentWindow.setSize(width, height); ++ } else if (message.startsWith("height")) { ++ int height = ++ Integer.parseInt(message.substring("height".length() + 1)); ++ int width = currentWindow.getWidth(); ++ currentWindow.updateAtts(width, height); ++ currentWindow.setSize(width, height); ++ } else if (message.startsWith("destroy") ++ && currentWindow != null) { ++ deregisterWindow(currentWindow); ++ } ++ ++ // Read next message. ++ message = read(); ++ } ++ } ++ ++ /** ++ * Write string to plugin. ++ * ++ * @param message the message to write ++ * ++ * @exception IOException if an error occurs ++ */ ++ static void write(String message) ++ throws IOException ++ { ++ pluginOutputStream.write(message, 0, message.length()); ++ pluginOutputStream.newLine(); ++ pluginOutputStream.flush(); ++ ++ System.err.println(" PIPE: appletviewer wrote: " + message); ++ } ++ ++ /** ++ * Read string from plugin. ++ * ++ * @return the read string ++ * ++ * @exception IOException if an error occurs ++ */ ++ static String read() ++ throws IOException ++ { ++ String message = pluginInputStream.readLine(); ++ System.err.println(" PIPE: appletviewer read: " + message); ++ if (message == null || message.equals("shutdown")) { ++ try { ++ // Close input/output channels to plugin. ++ pluginInputStream.close(); ++ pluginOutputStream.close(); ++ } catch (IOException exception) { ++ // Deliberately ignore IOException caused by broken ++ // pipe since plugin may have already detached. ++ } ++ ++ System.err.println("APPLETVIEWER: exiting appletviewer"); ++ System.exit(0); ++ } ++ return message; ++ } ++} +diff -urN openjdk.orig/jdk/src/share/classes/sun/applet/PluginAppletViewer.java openjdk/jdk/src/share/classes/sun/applet/PluginAppletViewer.java +--- openjdk.orig/jdk/src/share/classes/sun/applet/PluginAppletViewer.java 2008-06-24 22:55:57.286013713 -0400 ++++ openjdk/jdk/src/share/classes/sun/applet/PluginAppletViewer.java 2008-06-29 10:34:07.000000000 -0400 +@@ -0,0 +1,1008 @@ ++/* ++ * Copyright 1995-2004 Sun Microsystems, Inc. All Rights Reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. Sun designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Sun in the LICENSE file that accompanied this code. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, ++ * CA 95054 USA or visit www.sun.com if you need additional information or ++ * have any questions. ++ */ ++ ++package sun.applet; ++ ++import java.util.*; ++import java.io.*; ++import java.awt.*; ++import java.awt.event.*; ++import java.awt.print.*; ++import javax.print.attribute.*; ++import java.applet.*; ++import java.net.URL; ++import java.net.MalformedURLException; ++import java.net.SocketPermission; ++import sun.misc.Ref; ++import java.security.AccessController; ++import java.security.PrivilegedAction; ++import java.lang.reflect.InvocationTargetException; ++import java.lang.reflect.Method; ++import sun.awt.SunToolkit; ++import sun.awt.AppContext; ++import sun.awt.X11.*; ++import java.lang.ref.WeakReference; ++import net.sourceforge.jnlp.NetxPanel; ++ ++/** ++ * Lets us construct one using unix-style one shot behaviors ++ */ ++ ++class PluginAppletViewerFactory ++{ ++ public PluginAppletViewer createAppletViewer(long handle, int x, int y, ++ URL doc, Hashtable atts) { ++ PluginAppletViewer pluginappletviewer = new PluginAppletViewer(handle, x, y, doc, atts, System.out, this); ++ PluginMain.registerWindow(pluginappletviewer); ++ return pluginappletviewer; ++ } ++ ++ public boolean isStandalone() ++ { ++ return false; ++ } ++} ++ ++/* ++ */ ++public class PluginAppletViewer extends XEmbeddedFrame ++ implements AppletContext, Printable { ++ /** ++ * Some constants... ++ */ ++ private static String defaultSaveFile = "Applet.ser"; ++ ++ /** ++ * The panel in which the applet is being displayed. ++ */ ++ AppletViewerPanel panel; ++ ++ /** ++ * The status line. ++ */ ++ Label label; ++ ++ /** ++ * output status messages to this stream ++ */ ++ ++ PrintStream statusMsgStream; ++ ++ /** ++ * For cloning ++ */ ++ PluginAppletViewerFactory factory; ++ ++ /** ++ * Create the applet viewer ++ */ ++ public PluginAppletViewer(long handle, int x, int y, final URL doc, ++ final Hashtable atts, PrintStream statusMsgStream, ++ PluginAppletViewerFactory factory) { ++ super(handle, true); ++ this.factory = factory; ++ this.statusMsgStream = statusMsgStream; ++ ++ try { ++ panel = new NetxPanel(doc, atts); ++ AppletViewerPanel.debug("Using NetX panel"); ++ } catch (Exception ex) { ++ AppletViewerPanel.debug("Unable to start NetX applet - defaulting to Sun applet", ex); ++ panel = new AppletViewerPanel(doc, atts); ++ } ++ add("Center", panel); ++ panel.init(); ++ appletPanels.addElement(panel); ++ ++ pack(); ++ setVisible(true); ++ ++ WindowListener windowEventListener = new WindowAdapter() { ++ ++ public void windowClosing(WindowEvent evt) { From dbhole at redhat.com Wed Sep 24 10:01:42 2008 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 24 Sep 2008 17:01:42 +0000 Subject: changeset in /hg/icedtea6: - Update makefile to properly include... Message-ID: changeset 30567fe7d579 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=30567fe7d579 description: - Update makefile to properly include plugin's sun.applet classes in rt.jar - Update .cc file to call new plugin main call (different hierarchy) - Added a couple of functions to the .cc file to properly recognize context diffstat: 3 files changed, 100 insertions(+), 10 deletions(-) ChangeLog | 2 + IcedTeaPlugin.cc | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++---- Makefile.am | 12 ++++-- diffs (240 lines): diff -r abdb5c94757d -r 30567fe7d579 ChangeLog --- a/ChangeLog Tue Sep 23 16:52:24 2008 -0400 +++ b/ChangeLog Wed Sep 24 11:35:01 2008 -0400 @@ -1,4 +1,6 @@ 2008-09-23 Deepak Bhole + * IcedTeaPlugin.cc: Updated to call new plugin main class. Add function to + correctly recognize JS context. * Makefile.am: Update to create new IcedTeaPlugin.jar * patches/icedtea-liveconnect.patch: Update patch and remove all new .java files diff -r abdb5c94757d -r 30567fe7d579 IcedTeaPlugin.cc --- a/IcedTeaPlugin.cc Tue Sep 23 16:52:24 2008 -0400 +++ b/IcedTeaPlugin.cc Wed Sep 24 11:35:01 2008 -0400 @@ -244,6 +244,7 @@ static GError* channel_error = NULL; static GError* channel_error = NULL; // Fully-qualified appletviewer executable. static char* appletviewer_executable = NULL; +static char* extra_jars = NULL; static char* libjvm_so = NULL; class IcedTeaPluginFactory; @@ -313,7 +314,10 @@ char const* TYPES[10] = { "Object", // FIXME: create index from security context. #define MESSAGE_CREATE(reference) \ const char* addr; \ + char context[16]; \ GetCurrentPageAddress(&addr); \ + GetCurrentContextAddr(context); \ + printf("Addr: %s , Context: %s\n", addr, context);\ \ nsCString message ("context "); \ message.AppendInt (0); \ @@ -1149,7 +1153,8 @@ private: int IncrementContextCounter(); void DecrementContextCounter(); - void GetCurrentPageAddress(const char **addr); + nsresult GetCurrentContextAddr(char *addr); + nsresult GetCurrentPageAddress(const char **addr); int contextCounter; }; @@ -3184,9 +3189,9 @@ IcedTeaPluginFactory::StartAppletviewer PLUGIN_CHECK_RETURN ("init process", result); // FIXME: hard-coded port number. - char const* args[5] = { "-Xdebug", "-Xnoagent", "-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n", "sun.applet.PluginMain", "50007" }; + char const* args[8] = { "-classpath", extra_jars, "-Xdebug", "-Xnoagent", "-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n", "org.classpath.icedtea.plugin.PluginMain", "50007" }; // char const* args[2] = { "sun.applet.PluginMain", "50007" }; - result = applet_viewer_process->Run (PR_FALSE, args, 5, nsnull); + result = applet_viewer_process->Run (PR_FALSE, args, 8, nsnull); PLUGIN_CHECK_RETURN ("run process", result); // start processing thread @@ -3763,6 +3768,7 @@ NS_IMPL_ISUPPORTS1 (IcedTeaJNIEnv, nsISe #include #include #include +#include IcedTeaJNIEnv::IcedTeaJNIEnv (IcedTeaPluginFactory* factory) : factory (factory) @@ -3801,17 +3807,69 @@ IcedTeaJNIEnv::DecrementContextCounter ( PR_ExitMonitor(contextCounterPRMonitor); } -void +#include + +nsresult +IcedTeaJNIEnv::GetCurrentContextAddr(char *addr) +{ + PLUGIN_TRACE_JNIENV (); + + // Get JSContext from stack. + nsCOMPtr mJSContextStack(do_GetService("@mozilla.org/js/xpc/ContextStack;1")); + if (mJSContextStack) { + JSContext *cx; + if (NS_FAILED(mJSContextStack->Peek(&cx))) + return NS_ERROR_FAILURE; + + printf("Context1: %p\n", cx); + + // address cannot be more than 8 bytes (8 bytes = 64 bits) + sprintf(addr, "%p", cx); + + printf("Context2: %s\n", addr); + } + + return NS_OK; +} + +nsresult IcedTeaJNIEnv::GetCurrentPageAddress(const char **addr) { + + PLUGIN_TRACE_JNIENV (); + nsIPrincipal *prin; nsCOMPtr sec_man(do_GetService("@mozilla.org/scriptsecuritymanager;1")); - sec_man->GetSubjectPrincipal(&prin); + if (sec_man) { + + PRBool isEnabled = PR_FALSE; + sec_man->IsCapabilityEnabled("UniversalBrowserRead", &isEnabled); + + if (isEnabled == PR_FALSE) { + printf("UniversalBrowserRead is NOT enabled\n"); + } else { + printf("UniversalBrowserRead IS enabled\n"); + } + + sec_man->IsCapabilityEnabled("UniversalBrowserWrite", &isEnabled); + + if (isEnabled == PR_FALSE) { + printf("UniversalBrowserWrite is NOT enabled\n"); + } else { + printf("UniversalBrowserWrite IS enabled\n"); + } + } + + if (sec_man) + { + sec_man->GetSubjectPrincipal(&prin); + } else { + return NS_ERROR_FAILURE; + } if (prin) { - nsIURI *uri; prin->GetURI(&uri); @@ -3820,8 +3878,19 @@ IcedTeaJNIEnv::GetCurrentPageAddress(con nsCAutoString str; uri->GetSpec(str); NS_CStringGetData(str, addr); + } else { + return NS_ERROR_FAILURE; } + } else { + return NS_ERROR_FAILURE; } + + + nsCOMPtr js_id(do_GetService("@mozilla.org/js/xpc/ID;1")); + printf("JS ID is: %s\n", js_id->GetID()->ToString()); + + return NS_OK; + } NS_IMETHODIMP @@ -4846,19 +4915,34 @@ NSGetFactory (nsISupports* aServMgr, nsC return NS_ERROR_OUT_OF_MEMORY; } nsCString executable (dirname (filename)); + nsCString jar(dirname (filename)); + nsCString extrajars(""); free (filename); filename = NULL; //executableString += nsCString ("/../../bin/pluginappletviewer"); executable += nsCString ("/../../bin/java"); + extrajars += jar; + extrajars += nsCString("/IcedTeaPlugin.jar"); + extrajars += ":"; + extrajars += jar; + extrajars += nsCString("/rt.jar"); + //executable += nsCString ("/client/libjvm.so"); // Never freed. appletviewer_executable = strdup (executable.get ()); + extra_jars = strdup (extrajars.get ()); //libjvm_so = strdup (executable.get ()); if (!appletviewer_executable) { PLUGIN_ERROR ("Failed to create java executable name."); + return NS_ERROR_OUT_OF_MEMORY; + } + + if (!extra_jars) + { + PLUGIN_ERROR ("Failed to create plugin jar name."); return NS_ERROR_OUT_OF_MEMORY; } diff -r abdb5c94757d -r 30567fe7d579 Makefile.am --- a/Makefile.am Tue Sep 23 16:52:24 2008 -0400 +++ b/Makefile.am Wed Sep 24 11:35:01 2008 -0400 @@ -8,8 +8,6 @@ NETBEANS_PLATFORM_MD5SUM = 77c79b3a7d3db NETBEANS_PLATFORM_MD5SUM = 77c79b3a7d3dbe6a8858639f8d564a38 NETBEANS_PROFILER_MD5SUM = ff8e8abc42df6c6749e6b02bcf7bb0a5 VISUALVM_MD5SUM = 4b55bc623418818793392bb233da2927 - -EXCLUDE_LIVECONNECT = | grep -vE "netscape/javascript|org/classpath/icedtea/plugin" if ENABLE_LIVECONNECT ICEDTEAPLUGIN_CLEAN = clean-IcedTeaPlugin @@ -587,6 +585,9 @@ stamps/patch.stamp: stamps/patch-fsg.sta echo WARNING make clean-patch before retrying a fix ; \ false; \ fi +if ENABLE_LIVECONNECT + cp -a plugin/icedtea/sun/applet/*java openjdk/jdk/src/share/classes/sun/applet/ +endif clean-patch: rm -f stamps/patch.stamp @@ -605,6 +606,10 @@ clean-patch: if ! test x$${all_patches_ok} = "xyes" ; then \ echo "WARNING Not all patches reverted cleanly" ; \ fi + for file in plugin/icedtea/sun/applet/*java ; \ + do \ + rm -f openjdk/jdk/src/share/classes/sun/applet/`basename $file` ; \ + done ; stamps/patch-fsg.stamp: stamps/extract.stamp mkdir -p stamps ; \ @@ -1198,7 +1203,6 @@ bootstrap/jdk1.7.0/jre/lib/tools.jar: st # rt-closed.jar class files. rt-source-files.txt: stamps/extract.stamp stamps/copy-source-files.stamp find $(abs_top_srcdir)/rt $(abs_top_builddir)/rt $(LIVECONNECT) -name '*.java' \ - $(EXCLUDE_LIVECONNECT) \ | sort -u > $@ stamps/rt-class-files.stamp: rt-source-files.txt @@ -1325,7 +1329,7 @@ IcedTeaPlugin.jar: mkdir -p $(BUILD_OUTPUT_DIR)/plugin/icedtea/classes (cd plugin/icedtea/; \ $(ICEDTEA_BOOT_DIR)/bin/javac -g \ - -d ../../../../../$(BUILD_OUTPUT_DIR)/plugin/icedtea/classes \ + -d ../../$(BUILD_OUTPUT_DIR)/plugin/icedtea/classes \ -bootclasspath $(ICEDTEA_BOOT_DIR)/jre/lib/rt.jar \ netscape/javascript/*.java org/classpath/icedtea/plugin/*.java \ ) From dbhole at redhat.com Wed Sep 24 10:01:43 2008 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 24 Sep 2008 17:01:43 +0000 Subject: changeset in /hg/icedtea6: Merging with latest from main repo Message-ID: changeset f9d81fd1466d in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=f9d81fd1466d description: Merging with latest from main repo diffstat: 5 files changed, 38 insertions(+), 11 deletions(-) AUTHORS | 1 + ChangeLog | 9 +++++++++ Makefile.am | 3 ++- acinclude.m4 | 9 +++++++++ patches/icedtea-ecj.patch | 27 +++++++++++++++++---------- diffs (132 lines): diff -r 30567fe7d579 -r f9d81fd1466d AUTHORS --- a/AUTHORS Wed Sep 24 11:35:01 2008 -0400 +++ b/AUTHORS Wed Sep 24 11:44:16 2008 -0400 @@ -11,6 +11,7 @@ Andrew John Hughes Matthias Klose Francis Kung +DJ Lucas Casey Marshall Dan Munckton Raif Naffah diff -r 30567fe7d579 -r f9d81fd1466d ChangeLog --- a/ChangeLog Wed Sep 24 11:35:01 2008 -0400 +++ b/ChangeLog Wed Sep 24 11:44:16 2008 -0400 @@ -49,6 +49,15 @@ 2008-09-23 Deepak Bhole + DJ Lucas + + * Makefile.am: Added new env var JAR_ACCEPTS_STDIN_LIST. + * acinclude.m4: Added check to determine whether jar supports + stdin file args. + * patches/icedtea-ecj.patch: Updated patch. + * AUTHORS: Added DJ Lucas. 2008-09-18 Lillian Angel diff -r 30567fe7d579 -r f9d81fd1466d Makefile.am --- a/Makefile.am Wed Sep 24 11:35:01 2008 -0400 +++ b/Makefile.am Wed Sep 24 11:44:16 2008 -0400 @@ -228,7 +228,8 @@ ICEDTEA_ENV_ECJ = \ "HOTSPOT_BUILD_JOBS=$(PARALLEL_JOBS)" \ "JAVAC=" \ "RHINO_JAR=$(RHINO_JAR)" \ - "JAR_KNOWS_ATFILE=$(JAR_KNOWS_ATFILE)" + "JAR_KNOWS_ATFILE=$(JAR_KNOWS_ATFILE)" \ + "JAR_ACCEPTS_STDIN_LIST=$(JAR_ACCEPTS_STDIN_LIST)" if WITH_CACAO ICEDTEA_ENV_ECJ += \ diff -r 30567fe7d579 -r f9d81fd1466d acinclude.m4 --- a/acinclude.m4 Wed Sep 24 11:35:01 2008 -0400 +++ b/acinclude.m4 Wed Sep 24 11:44:16 2008 -0400 @@ -342,9 +342,18 @@ EOF JAR_KNOWS_ATFILE= AC_MSG_RESULT(no) fi + AC_MSG_CHECKING([whether jar supports stdin file arguments]) + if cat _config.list | $JAR cf@ _config.jar 2>/dev/null; then + JAR_ACCEPTS_STDIN_LIST=1 + AC_MSG_RESULT(yes) + else + JAR_ACCEPTS_STDIN_LIST= + AC_MSG_RESULT(no) + fi rm -f _config.txt _config.list _config.jar AC_SUBST(JAR) AC_SUBST(JAR_KNOWS_ATFILE) + AC_SUBST(JAR_ACCEPTS_STDIN_LIST) ]) AC_DEFUN([FIND_RMIC], diff -r 30567fe7d579 -r f9d81fd1466d patches/icedtea-ecj.patch --- a/patches/icedtea-ecj.patch Wed Sep 24 11:35:01 2008 -0400 +++ b/patches/icedtea-ecj.patch Wed Sep 24 11:44:16 2008 -0400 @@ -428,32 +428,35 @@ diff -ru openjdk-ecj.orig/langtools/make endif # Override of what javac to use (see deploy workspace) ---- oipenjdk/jdk/make/common/Release.gmk 2007-11-13 16:47:23.000000000 -0500 -+++ openjdk-ecj/jdk/make/common/Release.gmk 2007-11-13 16:48:08.000000000 -0500 -@@ -655,10 +649,19 @@ +--- oipenjdk/jdk/make/common/Release.gmk 2008-08-28 03:10:47.000000000 -0500 ++++ openjdk-ecj/jdk/make/common/Release.gmk 2008-09-16 17:53:16.000000000 -0500 +@@ -655,10 +655,23 @@ $(RES_JAR_ARGLIST): $(RES_JAR_FILELIST) $(prep-target) $(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@ -$(RESOURCES_JAR): $(RES_JAR_ARGLIST) $(JAR_MANIFEST_FILE) -- $(prep-target) +$(RESOURCES_JAR): \ + $(if $(JAR_KNOWS_ATFILE),$(RES_JAR_FILELIST),$(RES_JAR_ARGLIST)) \ + $(JAR_MANIFEST_FILE) -+ $(prep-target) + $(prep-target) +ifneq (,$(JAR_KNOWS_ATFILE)) ++ (cd $(CLASSBINDIR) && \ + $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ +- @$(RES_JAR_ARGLIST) $(JAR_JFLAGS) ++ $(JAR_JFLAGS) @$(RES_JAR_FILELIST)) ++else ifneq (,$(JAR_ACCEPTS_STDIN_LIST)) + (cd $(CLASSBINDIR) && $(CAT) $(RES_JAR_FILELIST) | \ + $(BOOT_JAR_CMD) c0mf@ $(JAR_MANIFEST_FILE) $@ \ + $(JAR_JFLAGS)) +else + (cd $(CLASSBINDIR) && \ - $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ -- @$(RES_JAR_ARGLIST) $(JAR_JFLAGS) ++ $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ + $(JAR_JFLAGS) `cat $(RES_JAR_FILELIST)`) +endif @$(java-vm-cleanup) # Create jsse.jar containing SunJSSE implementation classes -@@ -714,10 +717,18 @@ +@@ -714,10 +727,22 @@ $(RT_JAR_ARGLIST): $(RT_JAR_FILELIST) $(prep-target) $(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@ @@ -462,13 +465,17 @@ diff -ru openjdk-ecj.orig/langtools/make + $(JAR_MANIFEST_FILE) $(prep-target) +ifneq (,$(JAR_KNOWS_ATFILE)) ++ (cd $(CLASSBINDIR) && \ + $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ +- @$(RT_JAR_ARGLIST) $(JAR_JFLAGS) ++ $(JAR_JFLAGS) @$(RT_JAR_FILELIST)) ++else ifneq (,$(JAR_ACCEPTS_STDIN_LIST)) + (cd $(CLASSBINDIR) && $(CAT) $(RT_JAR_FILELIST) | \ + $(BOOT_JAR_CMD) c0mf@ $(JAR_MANIFEST_FILE) $@ \ + $(JAR_JFLAGS)) +else + (cd $(CLASSBINDIR) && \ - $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ -- @$(RT_JAR_ARGLIST) $(JAR_JFLAGS) ++ $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ + $(JAR_JFLAGS) `$(CAT) $(RT_JAR_FILELIST)`) +endif @$(java-vm-cleanup) From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 10:27:38 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 17:27:38 +0000 Subject: [Bug 183] Build error: Argument list too long Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=183 ------- Comment #10 from beuc at beuc.net 2008-09-24 17:27 ------- I confirm that it works :) Complete Etch build today. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From langel at redhat.com Wed Sep 24 10:56:11 2008 From: langel at redhat.com (Lillian Angel) Date: Wed, 24 Sep 2008 17:56:11 +0000 Subject: changeset in /hg/icedtea6: 2008-09-23 Lillian Angel changeset 098f7819fe90 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=098f7819fe90 description: 2008-09-23 Lillian Angel * configure.ac: Fixed help string for enable-visualvm. * rt/net/sourceforge/nanoxml/XMLElement.java: Fixed check for special tags. diffstat: 3 files changed, 10 insertions(+), 3 deletions(-) ChangeLog | 6 ++++++ configure.ac | 3 +-- rt/net/sourceforge/nanoxml/XMLElement.java | 4 +++- diffs (54 lines): diff -r f9d81fd1466d -r 098f7819fe90 ChangeLog --- a/ChangeLog Wed Sep 24 11:44:16 2008 -0400 +++ b/ChangeLog Wed Sep 24 13:56:07 2008 -0400 @@ -1,3 +1,9 @@ 2008-09-23 Deepak Bhole + + * configure.ac: Fixed help string for enable-visualvm. + * rt/net/sourceforge/nanoxml/XMLElement.java: Fixed check for special + tags. + 2008-09-23 Deepak Bhole * IcedTeaPlugin.cc: Updated to call new plugin main class. Add function to correctly recognize JS context. diff -r f9d81fd1466d -r 098f7819fe90 configure.ac --- a/configure.ac Wed Sep 24 11:44:16 2008 -0400 +++ b/configure.ac Wed Sep 24 13:56:07 2008 -0400 @@ -118,8 +118,7 @@ AM_CONDITIONAL([ENABLE_DOCS], [test x$EN AC_ARG_ENABLE([visualvm], [AS_HELP_STRING([--enable-visualvm], - [Enable compilation of visualvm. Requires that \ - --with-netbeans-dir=DIR is specified.])], + [Enable compilation of visualvm.])], [enable_visualvm="yes"], [enable_visualvm="no"]) AM_CONDITIONAL(WITH_VISUALVM, test "x${enable_visualvm}" = "xyes") diff -r f9d81fd1466d -r 098f7819fe90 rt/net/sourceforge/nanoxml/XMLElement.java --- a/rt/net/sourceforge/nanoxml/XMLElement.java Wed Sep 24 11:44:16 2008 -0400 +++ b/rt/net/sourceforge/nanoxml/XMLElement.java Wed Sep 24 13:56:07 2008 -0400 @@ -1255,6 +1255,7 @@ public class XMLElement this.reader = isr; this.parserLineNr = 0; int newline = 2; + char prev = ' '; while(true) { char ch; @@ -1289,7 +1290,7 @@ public class XMLElement // If the next char is a ? or !, then we've hit a special tag, // and should skip it. - if (next == '!' || next == '?') { + if (prev == '<' && (next == '!' || next == '?')) { this.skipSpecialTag(0); this.sanitizeCharReadTooMuch = '\0'; } @@ -1306,6 +1307,7 @@ public class XMLElement } } } + prev = next; } out.close(); From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 11:09:25 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 18:09:25 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #3 from j.sumali at gmail.com 2008-09-24 18:09 ------- Hi, I've been trying to reproduce this with a fresh gcjwebplugin build (no liveconnect), but the application seems to run fine. I get a security dialog to verify signing, and the program does it's thing. The application will *not* complete fully due to some other problem, though, but I think this is unrelated, because Sun's plugin has the same behavior. This behavior is most likely due to the application downloading a .so named "npatgpc.so" to wherever the plugin is stored though (err, why is this application doing this?...). It gets downloaded to my ~/.mozilla/plugins, since that's where I linked my gcjwebplugin.so. I get LoadPlugin: failed to initialize shared library /home/jsumali/.mozilla/plugins/npatgpc.so [libstdc++.so.5: cannot open shared object file: No such file or directory] running this application with both Sun's plugin, and gcjwebplugin. I believe this is output from the actual application. I'll test more and see if I can find anything else... -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 11:11:20 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 18:11:20 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #4 from j.sumali at gmail.com 2008-09-24 18:11 ------- I haven't tested this, but exception: java.lang.NullPointerException. at npatjava.download(npatjava.java:170) at npatjava.start(npatjava.java:107) at sun.applet.AppletPanel.run(AppletPanel.java:476) might be because the application is trying to download that .so to a root-owned /usr/lib/...path to/jre/i386 where gcjwebplugin.so is stored. I probably won't be able to tell without the source to npatjava.download(). -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 11:18:46 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 18:18:46 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #5 from j.sumali at gmail.com 2008-09-24 18:18 ------- (In reply to comment #2) > Created an attachment (id=97) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=97&action=view) [details] > output from firefox with liveconnect disabled > Did you happen to get a security dialog popup regarding signing before the program was run? The only reason I can think of "user.home read" being denied is if the application is unsigned and thus put in a sandbox. The jar is indeed signed though, and I did get a popup before the program ran. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 11:26:20 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 18:26:20 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #6 from langel at redhat.com 2008-09-24 18:26 ------- I did not get a pop-up asking for verification. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 11:31:22 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 18:31:22 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #7 from j.sumali at gmail.com 2008-09-24 18:31 ------- (In reply to comment #6) > I did not get a pop-up asking for verification. > Hrm. Kind of odd. Anyways, the jar that it downloaded should be at /tmp/cache/https/linbit-en.webex.com/client/T26L/linux/nbr/npatsun.jar, and jarsigner -verify -verbose -certs npatsun.jar *should* say it was verified. I'm not sure what else to try other than a new build. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 11:45:52 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 18:45:52 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #8 from langel at redhat.com 2008-09-24 18:45 ------- joe- did you see the popup for this? -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 11:48:37 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 18:48:37 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #9 from langel at redhat.com 2008-09-24 18:48 ------- Ah, I was able to get the popup to show after clearing out /tmp thanks -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 12:14:12 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 19:14:12 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #10 from joej at edwyse.com 2008-09-24 19:14 ------- No, I did not get a verification dialog. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 12:17:33 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 19:17:33 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #11 from joej at edwyse.com 2008-09-24 19:17 ------- (In reply to comment #4) > might be because the application is trying to download that .so to a root-owned > /usr/lib/...path to/jre/i386 where gcjwebplugin.so is stored. I probably won't > be able to tell without the source to npatjava.download(). > I tried running firefox as root with the same results. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Sep 24 12:17:51 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 24 Sep 2008 19:17:51 +0000 Subject: [Bug 195] Webex dies with NullPointerException Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=195 ------- Comment #12 from langel at redhat.com 2008-09-24 19:17 ------- ok clearing out /tmp and ~/.netx should fix that. but this is definitely still a bug -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Wed Sep 24 14:19:12 2008 From: omajid at redhat.com (Omair Majid) Date: Wed, 24 Sep 2008 21:19:12 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-24 Omair Majid changeset e29a9eb84a4e in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=e29a9eb84a4e description: 2008-09-24 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java (open): Reset currentFramePosition to 0. (read): Add to currentFramePosition. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java (testOpenEvents): Print OPEN on an OPEN event. (testCloseEvents): Output CLOSE on a CLOSE event. (testStartedStopped): Output START on a START event and STOP on a STOP event. (testFramePosition): New function. Tests the getFramePosition for a TargetDataLine. (testFramePositionWithStartAndStop): New function. Tests frame position of a TargetDataLine while pausing it for a bit. diffstat: 2 files changed, 73 insertions(+), 2 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 4 unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 71 +++++++++- diffs (128 lines): diff -r 438aa072a80d -r e29a9eb84a4e src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Tue Sep 23 17:23:27 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Wed Sep 24 10:51:53 2008 -0400 @@ -79,6 +79,8 @@ public class PulseAudioTargetDataLine ex super.open(format, bufferSize); + currentFramePosition = 0; + PulseAudioMixer parentMixer = PulseAudioMixer.getInstance(); parentMixer.addTargetLine(this); } @@ -128,7 +130,7 @@ public class PulseAudioTargetDataLine ex sizeRead += bytesRead; position += bytesRead; remainingLength -= bytesRead; - currentFramePosition = bytesRead / currentFormat.getFrameSize(); + currentFramePosition += bytesRead / currentFormat.getFrameSize(); } } diff -r 438aa072a80d -r e29a9eb84a4e unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Tue Sep 23 17:23:27 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Wed Sep 24 10:51:53 2008 -0400 @@ -132,6 +132,7 @@ public class PulseAudioTargetDataLineTes @Override public void update(LineEvent event) { Assert.assertEquals(LineEvent.Type.OPEN, event.getType()); + System.out.println("OPEN"); calledCount++; Assert.assertEquals(1, calledCount); } @@ -222,6 +223,7 @@ public class PulseAudioTargetDataLineTes @Override public void update(LineEvent event) { Assert.assertEquals(LineEvent.Type.CLOSE, event.getType()); + System.out.println("CLOSE"); calledCount++; Assert.assertEquals(1, calledCount); } @@ -259,12 +261,13 @@ public class PulseAudioTargetDataLineTes @Override public void update(LineEvent event) { if (event.getType() == LineEvent.Type.START) { + System.out.println("START"); started++; Assert.assertEquals(1, started); } if (event.getType() == LineEvent.Type.STOP) { - System.out.println("Stopped event"); + System.out.println("STOP"); stopped++; Assert.assertEquals(1, stopped); } @@ -315,6 +318,72 @@ public class PulseAudioTargetDataLineTes Assert.assertEquals(0, targetDataLine.getControls().length); targetDataLine.close(); + } + + @Test + public void testFramePosition() throws LineUnavailableException { + System.out + .println("This test tests frame position for a target data line"); + + final int CHUNCKS = 100; + final int BUFFER_SIZE = 1000; + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + + targetDataLine.open(); + targetDataLine.start(); + byte[] data = new byte[BUFFER_SIZE]; + + for (int i = 0; i < CHUNCKS; i++) { + targetDataLine.read(data, 0, data.length); + } + + targetDataLine.stop(); + long pos = targetDataLine.getLongFramePosition(); + System.out.println("Frames read: " + pos); + long expected = BUFFER_SIZE * CHUNCKS + / targetDataLine.getFormat().getFrameSize(); + System.out.println("Expected: " + expected); + long granularity = 2; + Assert.assertTrue(Math.abs(expected - pos) < granularity); + targetDataLine.close(); + } + + @Test + public void testFramePositionWithStartAndStop() + throws LineUnavailableException, InterruptedException { + System.out + .println("This test tests frame position for a target data line"); + + final int CHUNCKS = 100; + final int BUFFER_SIZE = 1000; + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + + targetDataLine.open(); + targetDataLine.start(); + byte[] data = new byte[BUFFER_SIZE]; + + for (int i = 0; i < CHUNCKS; i++) { + if (i == CHUNCKS / 2) { + targetDataLine.stop(); + Thread.sleep(1000); + targetDataLine.start(); + } + + targetDataLine.read(data, 0, data.length); + } + + targetDataLine.stop(); + long pos = targetDataLine.getLongFramePosition(); + System.out.println("Frames read: " + pos); + long expected = BUFFER_SIZE * CHUNCKS + / targetDataLine.getFormat().getFrameSize(); + System.out.println("Expected: " + expected); + long granularity = 2; + Assert.assertTrue(Math.abs(expected - pos) < granularity); + targetDataLine.close(); + } @After From gnu_andrew at member.fsf.org Wed Sep 24 14:42:50 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Wed, 24 Sep 2008 22:42:50 +0100 Subject: [PATCH] Remove dependency on JScheme for generating CORBA exceptions In-Reply-To: <485A98D0.3090602@sun.com> References: <20080619171625.9A86F5D06@eggemoggin.niobe.net> <485A98D0.3090602@sun.com> Message-ID: <17c6771e0809241442m634bd6ai2140b9b3e63f9286@mail.gmail.com> 2008/6/19 Ken Cavanaugh : > Mark Reinhold wrote: >> >> Andrew: Thanks for the patch! >> >> The CORBA code isn't maintained directly in OpenJDK, but rather in a >> sub-project of GlassFish (https://glassfish-corba.dev.java.net/). >> >> That's why there's no CORBA Group. (The same goes for JAXWS and JAXP.) >> >> Ken Cavanaugh owns the glassfish-corba project ... >> >> Ken: What's the best way to handle this? It'd take longer if OpenJDK >> waits for these patches to be applied to the upstream glassfish-corba. >> Could we apply them directly in OpenJDK for now, and then sync things >> up later? >> > > Yes, you should apply the patch now to the OpenJDK workspaces. > I'll take it as a requirement to remove Jscheme from the CORBA master > before we integrate with JDK 7. I'll take a closer look at the > code from the patch and adapt/replace it as needed. > Some work will be needed because I changed the code > generation for exception wrappers in the later versions of CORBA > > Thanks, > > Ken. > > > Although the patch made it into OpenJDK6 sometime ago (b11), it doesn't seem to have reached the OpenJDK workspaces. Any news on this? Thanks, -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From Kelly.Ohair at Sun.COM Wed Sep 24 16:41:15 2008 From: Kelly.Ohair at Sun.COM (Kelly O'Hair) Date: Wed, 24 Sep 2008 16:41:15 -0700 Subject: [PATCH] Remove dependency on JScheme for generating CORBA exceptions In-Reply-To: <17c6771e0809241442m634bd6ai2140b9b3e63f9286@mail.gmail.com> References: <20080619171625.9A86F5D06@eggemoggin.niobe.net> <485A98D0.3090602@sun.com> <17c6771e0809241442m634bd6ai2140b9b3e63f9286@mail.gmail.com> Message-ID: <48DAD01B.7080006@sun.com> I'll try and sync up the corba/jaxp/jaxws areas in OpenJDK6 and OpenJDK7 very soon... I'm working on the OpenJDK6 Mercurial repositories now... -kto Andrew John Hughes wrote: > 2008/6/19 Ken Cavanaugh : >> Mark Reinhold wrote: >>> Andrew: Thanks for the patch! >>> >>> The CORBA code isn't maintained directly in OpenJDK, but rather in a >>> sub-project of GlassFish (https://glassfish-corba.dev.java.net/). >>> >>> That's why there's no CORBA Group. (The same goes for JAXWS and JAXP.) >>> >>> Ken Cavanaugh owns the glassfish-corba project ... >>> >>> Ken: What's the best way to handle this? It'd take longer if OpenJDK >>> waits for these patches to be applied to the upstream glassfish-corba. >>> Could we apply them directly in OpenJDK for now, and then sync things >>> up later? >>> >> Yes, you should apply the patch now to the OpenJDK workspaces. >> I'll take it as a requirement to remove Jscheme from the CORBA master >> before we integrate with JDK 7. I'll take a closer look at the >> code from the patch and adapt/replace it as needed. >> Some work will be needed because I changed the code >> generation for exception wrappers in the later versions of CORBA >> >> Thanks, >> >> Ken. >> >> >> > > Although the patch made it into OpenJDK6 sometime ago (b11), it > doesn't seem to have reached the OpenJDK workspaces. Any news > on this? > > Thanks, From mark at klomp.org Thu Sep 25 05:45:36 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 25 Sep 2008 14:45:36 +0200 Subject: mercurial notifications In-Reply-To: <17c6771e0808311301x7c7281a5od6ae9a8cbc35084a@mail.gmail.com> References: <17c6771e0808291839y2a26b031pd4cb226c8facb51c@mail.gmail.com> <1220193060.3524.12.camel@hermans.wildebeest.org> <17c6771e0808311301x7c7281a5od6ae9a8cbc35084a@mail.gmail.com> Message-ID: <1222346736.3266.70.camel@dijkstra.wildebeest.org> Hi Andrew, On Sun, 2008-08-31 at 21:01 +0100, Andrew John Hughes wrote: > On 31/08/2008, Mark Wielaard wrote: > > You managed to push this without generating a commit message. I cannot > > figure out why that is. Do you have any idea how you got this commit in > > "under the hgext.notify radar"? > > > Something is broken: > > remote: added 1 changesets with 2 changes to 2 files > remote: error: incoming.notify hook raised an exception: cannot > concatenate 'str' and 'NoneType' objects I tried to track this down, but it seems things are just working fine now. I am slightly concerned that this is intermittent and we might be missing commit emails. Could you let me know if you get this error again? Thanks, Mark From mark at klomp.org Thu Sep 25 05:57:25 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 25 Sep 2008 14:57:25 +0200 Subject: Public open specs In-Reply-To: <48D38A0B.8070305@sun.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <48D25FA3.1010101@sun.com> <1221748023.3256.55.camel@dijkstra.wildebeest.org> <48D3779C.4090503@sun.com> <1221819427.3288.2.camel@dijkstra.wildebeest.org> <48D38203.8040609@sun.com> <1221821605.3288.10.camel@dijkstra.wildebeest.org> <48D38A0B.8070305@sun.com> Message-ID: <1222347445.3266.72.camel@dijkstra.wildebeest.org> Hi Dalibor, On Fri, 2008-09-19 at 13:16 +0200, Dalibor Topic wrote: > Mark Wielaard wrote: > > What I wondering about is if whether Sun can publish this document under > > terms that are acceptable to the community, so that getting access to > > the document doesn't take away any rights of publishing an independent > > or openjdk based implementation under the GPL without the restrictions > > on scope that the current terms 2 (a - c) inflict upon us hackers. > I'll do some asking around, thanks for the friendly nudge. Any progress on getting this specification open and public? Thanks, Mark From Dalibor.Topic at Sun.COM Thu Sep 25 06:32:44 2008 From: Dalibor.Topic at Sun.COM (Dalibor Topic) Date: Thu, 25 Sep 2008 15:32:44 +0200 Subject: Public open specs In-Reply-To: <1222347445.3266.72.camel@dijkstra.wildebeest.org> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <48D25FA3.1010101@sun.com> <1221748023.3256.55.camel@dijkstra.wildebeest.org> <48D3779C.4090503@sun.com> <1221819427.3288.2.camel@dijkstra.wildebeest.org> <48D38203.8040609@sun.com> <1221821605.3288.10.camel@dijkstra.wildebeest.org> <48D38A0B.8070305@sun.com> <1222347445.3266.72.camel@dijkstra.wildebeest.org> Message-ID: <48DB92FC.3060100@sun.com> Mark Wielaard wrote: > Any progress on getting this specification open and public? > Unfortunately, there is no visible progress yet. cheers, dalibor topic -- ******************************************************************* Dalibor Topic Tel: (+49 40) 23 646 738 Java F/OSS Ambassador AIM: robiladonaim Sun Microsystems GmbH Mobile: (+49 177) 2664 192 Nagelsweg 55 http://openjdk.java.net D-20097 Hamburg mailto:Dalibor.Topic at sun.com Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten Amtsgericht M?nchen: HRB 161028 Gesch?ftsf?hrer: Thomas Schr?der, Wolfgang Engels, Dr. Roland B?mer Vorsitzender des Aufsichtsrates: Martin H?ring From bugzilla-daemon at icedtea.classpath.org Thu Sep 25 09:09:54 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 25 Sep 2008 16:09:54 +0000 Subject: [Bug 197] New: Java2D: Dash array does not work in java.awt.BasicStroke Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=197 Summary: Java2D: Dash array does not work in java.awt.BasicStroke Product: IcedTea Version: unspecified Platform: PC URL: https://pivot.dev.java.net/nonav/tutorials/demo.standalo ne.html OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: tvolkert at gmail.com When painting a dashed line using Java2D, you get incorrect results in Iced Tea vs J2SE. See attached screenshots. Here's some sample code to reproduce the error: !{{{ BasicStroke dashStroke = new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f, new float[] {0.0f, 2.0f}, 0.0f); graphics.setStroke(dashStroke); graphics.setColor(Color.BLACK); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics.drawRect(5, 5, 10, 10); }}} -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Thu Sep 25 09:10:51 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 25 Sep 2008 16:10:51 +0000 Subject: [Bug 197] Java2D: Dash array does not work in java.awt.BasicStroke Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=197 ------- Comment #1 from tvolkert at gmail.com 2008-09-25 16:10 ------- Created an attachment (id=98) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=98&action=view) First example: Correct painting in J2SE -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Thu Sep 25 09:11:22 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 25 Sep 2008 16:11:22 +0000 Subject: [Bug 197] Java2D: Dash array does not work in java.awt.BasicStroke Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=197 ------- Comment #2 from tvolkert at gmail.com 2008-09-25 16:11 ------- Created an attachment (id=99) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=99&action=view) First example: Incorrect painting in J2SE -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Thu Sep 25 09:11:41 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 25 Sep 2008 16:11:41 +0000 Subject: [Bug 197] Java2D: Dash array does not work in java.awt.BasicStroke Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=197 ------- Comment #3 from tvolkert at gmail.com 2008-09-25 16:11 ------- Created an attachment (id=100) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=100&action=view) Second example: Correct painting in J2SE -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Thu Sep 25 09:11:57 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 25 Sep 2008 16:11:57 +0000 Subject: [Bug 197] Java2D: Dash array does not work in java.awt.BasicStroke Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=197 ------- Comment #4 from tvolkert at gmail.com 2008-09-25 16:11 ------- Created an attachment (id=101) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=101&action=view) Second example: Incorrect painting in J2SE -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From iivan at redhat.com Thu Sep 25 11:34:38 2008 From: iivan at redhat.com (Ioana Ivan) Date: Thu, 25 Sep 2008 18:34:38 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-25 Ioana Ivan changeset 6201d96f7b94 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=6201d96f7b94 description: 2008-09-25 Ioana Ivan * src/native/org_classpath_icedtea_Stream.c (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1playback): pass 0 as a flag to pa_stream_connect_playback * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java: formating changes diffstat: 3 files changed, 37 insertions(+), 32 deletions(-) ChangeLog | 9 + src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 55 ++++------ src/native/org_classpath_icedtea_pulseaudio_Stream.c | 5 diffs (142 lines): diff -r e29a9eb84a4e -r 6201d96f7b94 ChangeLog --- a/ChangeLog Wed Sep 24 10:51:53 2008 -0400 +++ b/ChangeLog Thu Sep 25 14:33:45 2008 -0400 @@ -1,3 +1,12 @@ 2008-09-23 Ioana Ivan +2008-09-25 Ioana Ivan + + * src/native/org_classpath_icedtea_Stream.c + (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1playback): + pass 0 as a flag to pa_stream_connect_playback + + * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java: + formating changes + 2008-09-23 Ioana Ivan * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java: -split open() into createStream(), addStreamListeners() and diff -r e29a9eb84a4e -r 6201d96f7b94 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Wed Sep 24 10:51:53 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Thu Sep 25 14:33:45 2008 -0400 @@ -105,25 +105,25 @@ public class PulseAudioSourceDataLine ex } - protected void connectLine(int bufferSize, Stream masterStream) throws LineUnavailableException { + protected void connectLine(int bufferSize, Stream masterStream) + throws LineUnavailableException { StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( - bufferSize, bufferSize / 4, bufferSize / 8, + bufferSize, bufferSize / 4, bufferSize / 8, ((bufferSize / 10) > 100 ? bufferSize / 10 : 100), 0); - - if(masterStream != null) { - synchronized (eventLoop.threadLock) { - stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, masterStream.getStreamPointer()); + if (masterStream != null) { + synchronized (eventLoop.threadLock) { + stream.connectForPlayback(Stream.DEFAULT_DEVICE, + bufferAttributes, masterStream.getStreamPointer()); } } else { synchronized (eventLoop.threadLock) { - stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, null); - } - } - } - - + stream.connectForPlayback(Stream.DEFAULT_DEVICE, + bufferAttributes, null); + } + } + } @Override public int write(byte[] data, int offset, int length) { @@ -133,11 +133,10 @@ public class PulseAudioSourceDataLine ex throw new IllegalStateException("must call open() before write()"); } - - /*if (!isStarted) { - throw new IllegalStateException("must call start() before write()"); - }*/ - + /* + * if (!isStarted) { throw new IllegalStateException("must call start() + * before write()"); } + */ int frameSize = currentFormat.getFrameSize(); if (length % frameSize != 0) { @@ -158,15 +157,13 @@ public class PulseAudioSourceDataLine ex int sizeWritten = 0; - - boolean interrupted = false; while (remainingLength != 0) { synchronized (eventLoop.threadLock) { availableSize = stream.getWritableSize(); - + do { if (availableSize < 0) { return sizeWritten; @@ -181,29 +178,25 @@ public class PulseAudioSourceDataLine ex } } - + availableSize = stream.getWritableSize(); - //System.out.println(availableSize); - + // System.out.println(availableSize); } while (availableSize == 0); - if (availableSize > remainingLength) { availableSize = remainingLength; } /* write a little bit of the buffer */ - - stream.write(data, position, availableSize); - //System.out.println("written " + availableSize); - + + stream.write(data, position, availableSize); + // System.out.println("written " + availableSize); sizeWritten += availableSize; position += availableSize; remainingLength -= availableSize; - } - } - + } + } // all the data should have been played by now assert (sizeWritten == length); diff -r e29a9eb84a4e -r 6201d96f7b94 src/native/org_classpath_icedtea_pulseaudio_Stream.c --- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c Wed Sep 24 10:51:53 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c Thu Sep 25 14:33:45 2008 -0400 @@ -435,7 +435,10 @@ JNIEXPORT jint JNICALL Java_org_classpat return -1; // oome thrown } } - int value = pa_stream_connect_playback(stream, dev, &buffer_attr, PA_STREAM_START_CORKED, NULL, sync_stream); + /* Set flags to 0 to fix problem with draining before calling start, might need to + be changed back to PA_STREAM_START_CORKED in the future, if we'll be able to implement + synchronization*/ + int value = pa_stream_connect_playback(stream, dev, &buffer_attr, 0, NULL, sync_stream); if (dev != NULL) { (*env)->ReleaseStringUTFChars(env, device, dev); From mark at klomp.org Thu Sep 25 11:42:51 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 25 Sep 2008 18:42:51 +0000 Subject: changeset in /hg/icedtea6: * patches/icedtea-clean-crypto.patch:... Message-ID: changeset 09fccdb9f333 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=09fccdb9f333 description: * patches/icedtea-clean-crypto.patch: Cleaned up. Remove unneeded classes JarVeridier and JceSecurityManager and remove unneeded methods in JceSecurity class. diffstat: 2 files changed, 553 insertions(+), 59 deletions(-) ChangeLog | 6 patches/icedtea-clean-crypto.patch | 606 ++++++++++++++++++++++++++++++++---- diffs (truncated from 740 to 500 lines): diff -r 098f7819fe90 -r 09fccdb9f333 ChangeLog --- a/ChangeLog Wed Sep 24 13:56:07 2008 -0400 +++ b/ChangeLog Thu Sep 25 20:42:43 2008 +0200 @@ -1,3 +1,9 @@ 2008-09-23 Lillian Angel + + * patches/icedtea-clean-crypto.patch: Cleaned up. + Remove unneeded classes JarVerifier and JceSecurityManager + and remove unneeded methods in JceSecurity class. + 2008-09-23 Lillian Angel * configure.ac: Fixed help string for enable-visualvm. diff -r 098f7819fe90 -r 09fccdb9f333 patches/icedtea-clean-crypto.patch --- a/patches/icedtea-clean-crypto.patch Wed Sep 24 13:56:07 2008 -0400 +++ b/patches/icedtea-clean-crypto.patch Thu Sep 25 20:42:43 2008 +0200 @@ -1,6 +1,6 @@ diff -ur openjdk.orig/jdk/make/javax/cry -diff -ur openjdk.orig/jdk/make/javax/crypto/Makefile openjdk/jdk/make/javax/crypto/Makefile ---- openjdk.orig/jdk/make/javax/crypto/Makefile 2008-08-28 13:10:20.000000000 +0200 -+++ openjdk/jdk/make/javax/crypto/Makefile 2008-08-28 15:17:56.000000000 +0200 +diff -r 4aebfff4f8a2 jdk/make/javax/crypto/Makefile +--- openjdk.orig/jdk/make/javax/crypto/Makefile Mon Sep 15 11:38:34 2008 +0200 ++++ openjdk/jdk/make/javax/crypto/Makefile Thu Sep 25 17:45:37 2008 +0200 @@ -155,7 +155,8 @@ # @@ -11,9 +11,9 @@ diff -ur openjdk.orig/jdk/make/javax/cry else # OPENJDK ifeq ($(strip $(FILES_java)),) all: -diff -ur openjdk.orig/jdk/src/share/classes/javax/crypto/Cipher.java openjdk/jdk/src/share/classes/javax/crypto/Cipher.java ---- openjdk.orig/jdk/src/share/classes/javax/crypto/Cipher.java 2008-08-28 12:06:23.000000000 +0200 -+++ openjdk/jdk/src/share/classes/javax/crypto/Cipher.java 2008-08-28 15:23:41.000000000 +0200 +diff -r 4aebfff4f8a2 jdk/src/share/classes/javax/crypto/Cipher.java +--- openjdk.orig/jdk/src/share/classes/javax/crypto/Cipher.java Mon Sep 15 11:38:34 2008 +0200 ++++ openjdk/jdk/src/share/classes/javax/crypto/Cipher.java Thu Sep 25 17:45:37 2008 +0200 @@ -144,12 +144,6 @@ // The transformation private String transformation; @@ -52,7 +52,44 @@ diff -ur openjdk.orig/jdk/src/share/clas this.lock = null; } -@@ -603,7 +589,6 @@ +@@ -442,9 +428,6 @@ + Exception failure = null; + while (t.hasNext()) { + Service s = (Service)t.next(); +- if (JceSecurity.canUseProvider(s.getProvider()) == false) { +- continue; +- } + Transform tr = getTransform(s, transforms); + if (tr == null) { + // should never happen +@@ -570,26 +553,12 @@ + } + Exception failure = null; + List transforms = getTransforms(transformation); +- boolean providerChecked = false; + String paddingError = null; + for (Iterator t = transforms.iterator(); t.hasNext();) { + Transform tr = (Transform)t.next(); + Service s = provider.getService("Cipher", tr.transform); + if (s == null) { + continue; +- } +- if (providerChecked == false) { +- // for compatibility, first do the lookup and then verify +- // the provider. this makes the difference between a NSAE +- // and a SecurityException if the +- // provider does not support the algorithm. +- Exception ve = JceSecurity.getVerificationResult(provider); +- if (ve != null) { +- String msg = "JCE cannot authenticate the provider " +- + provider.getName(); +- throw new SecurityException(msg, ve); +- } +- providerChecked = true; + } + if (tr.supportsMode(s) == S_NO) { + continue; +@@ -603,7 +572,6 @@ tr.setModePadding(spi); Cipher cipher = new Cipher(spi, transformation); cipher.provider = s.getProvider(); @@ -60,10 +97,12 @@ diff -ur openjdk.orig/jdk/src/share/clas return cipher; } catch (Exception e) { failure = e; -@@ -622,22 +607,6 @@ +@@ -620,22 +588,6 @@ + } + throw new NoSuchAlgorithmException ("No such algorithm: " + transformation, failure); - } - +- } +- - // If the requested crypto service is export-controlled, - // determine the maximum allowable keysize. - private void initCryptoPermission() throws NoSuchAlgorithmException { @@ -78,12 +117,20 @@ diff -ur openjdk.orig/jdk/src/share/clas - if (exmechName != null) { - exmech = ExemptionMechanism.getInstance(exmechName); - } -- } -- + } + // max number of debug warnings to print from chooseFirstProvider() - private static int warnCount = 10; - -@@ -699,7 +668,6 @@ +@@ -679,9 +631,6 @@ + s = (Service)serviceIterator.next(); + thisSpi = null; + } +- if (JceSecurity.canUseProvider(s.getProvider()) == false) { +- continue; +- } + Transform tr = getTransform(s, transforms); + if (tr == null) { + // should never happen +@@ -699,7 +648,6 @@ thisSpi = (CipherSpi)obj; } tr.setModePadding(thisSpi); @@ -91,7 +138,7 @@ diff -ur openjdk.orig/jdk/src/share/clas spi = thisSpi; provider = s.getProvider(); // not needed any more -@@ -731,19 +699,15 @@ +@@ -731,19 +679,15 @@ InvalidAlgorithmParameterException { switch (type) { case I_KEY: @@ -111,7 +158,17 @@ diff -ur openjdk.orig/jdk/src/share/clas thisSpi.engineInit(opmode, key, random); break; default: -@@ -793,7 +757,6 @@ +@@ -777,9 +721,6 @@ + if (s.supportsParameter(key) == false) { + continue; + } +- if (JceSecurity.canUseProvider(s.getProvider()) == false) { +- continue; +- } + Transform tr = getTransform(s, transforms); + if (tr == null) { + // should never happen +@@ -793,7 +734,6 @@ thisSpi = (CipherSpi)s.newInstance(null); } tr.setModePadding(thisSpi); @@ -119,7 +176,7 @@ diff -ur openjdk.orig/jdk/src/share/clas implInit(thisSpi, initType, opmode, key, paramSpec, params, random); provider = s.getProvider(); -@@ -939,107 +902,6 @@ +@@ -939,107 +879,6 @@ return exmech; } @@ -227,7 +284,7 @@ diff -ur openjdk.orig/jdk/src/share/clas // check if opmode is one of the defined constants // throw InvalidParameterExeption if not private static void checkOpmode(int opmode) { -@@ -1144,7 +1006,6 @@ +@@ -1144,7 +983,6 @@ checkOpmode(opmode); if (spi != null) { @@ -235,7 +292,7 @@ diff -ur openjdk.orig/jdk/src/share/clas spi.engineInit(opmode, key, random); } else { try { -@@ -1270,7 +1131,6 @@ +@@ -1270,7 +1108,6 @@ checkOpmode(opmode); if (spi != null) { @@ -243,7 +300,7 @@ diff -ur openjdk.orig/jdk/src/share/clas spi.engineInit(opmode, key, params, random); } else { chooseProvider(I_PARAMSPEC, opmode, key, params, null, random); -@@ -1391,7 +1251,6 @@ +@@ -1391,7 +1228,6 @@ checkOpmode(opmode); if (spi != null) { @@ -251,7 +308,7 @@ diff -ur openjdk.orig/jdk/src/share/clas spi.engineInit(opmode, key, params, random); } else { chooseProvider(I_PARAMS, opmode, key, null, params, random); -@@ -1555,7 +1414,6 @@ +@@ -1555,7 +1391,6 @@ (certificate==null? null:certificate.getPublicKey()); if (spi != null) { @@ -259,21 +316,239 @@ diff -ur openjdk.orig/jdk/src/share/clas spi.engineInit(opmode, publicKey, random); } else { try { -diff -ur openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurity.java openjdk/jdk/src/share/classes/javax/crypto/JceSecurity.java ---- openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurity.java 2008-08-28 12:06:23.000000000 +0200 -+++ openjdk/jdk/src/share/classes/javax/crypto/JceSecurity.java 2008-08-28 15:17:56.000000000 +0200 -@@ -63,8 +63,8 @@ - // Map of the providers currently being verified - private final static Map verifyingProviders = new IdentityHashMap(); - +@@ -2361,12 +2196,15 @@ + return null; + } + ++ // Used by getMaxAllowedKeyLength and getMaxAllowedParameterSpec ++ // always returns CryptoAllPermission. Old stuff from bad old days. + private static CryptoPermission getConfiguredPermission( + String transformation) throws NullPointerException, + NoSuchAlgorithmException { + if (transformation == null) throw new NullPointerException(); +- String[] parts = tokenizeTransformation(transformation); +- return JceSecurityManager.INSTANCE.getCryptoPermission(parts[0]); ++ // Called to make sure it is a valid transformation. ++ tokenizeTransformation(transformation); ++ return CryptoAllPermission.INSTANCE; + } + + /** +diff -r 4aebfff4f8a2 jdk/src/share/classes/javax/crypto/JarVerifier.java +--- openjdk/jdk/src/share/classes/javax/crypto/JarVerifier.java Mon Sep 15 11:38:34 2008 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,170 +0,0 @@ +-/* +- * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +- * +- * This code is free software; you can redistribute it and/or modify it +- * under the terms of the GNU General Public License version 2 only, as +- * published by the Free Software Foundation. Sun designates this +- * particular file as subject to the "Classpath" exception as provided +- * by Sun in the LICENSE file that accompanied this code. +- * +- * This code is distributed in the hope that it will be useful, but WITHOUT +- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +- * version 2 for more details (a copy is included in the LICENSE file that +- * accompanied this code). +- * +- * You should have received a copy of the GNU General Public License version +- * 2 along with this work; if not, write to the Free Software Foundation, +- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +- * +- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +- * CA 95054 USA or visit www.sun.com if you need additional information or +- * have any questions. +- */ +- +-package javax.crypto; +- +-import java.io.*; +-import java.net.*; +-import java.security.*; +-import java.util.*; +-import java.util.jar.*; +-import javax.crypto.CryptoPolicyParser.ParsingException; +- +-/** +- * This class verifies JAR files (and any supporting JAR files), and +- * determines whether they may be used in this implementation. +- * +- * The JCE in OpenJDK has an open cryptographic interface, meaning it +- * does not restrict which providers can be used. Compliance with +- * United States export controls and with local law governing the +- * import/export of products incorporating the JCE in the OpenJDK is +- * the responsibility of the licensee. +- * +- * @since 1.7 +- */ +-final class JarVerifier { +- +- // The URL for the JAR file we want to verify. +- private URL jarURL; +- private boolean savePerms; +- private CryptoPermissions appPerms = null; +- +- /** +- * Creates a JarVerifier object to verify the given URL. +- * +- * @param jarURL the JAR file to be verified. +- * @param savePerms if true, save the permissions allowed by the +- * exemption mechanism +- */ +- JarVerifier(URL jarURL, boolean savePerms) { +- this.jarURL = jarURL; +- this.savePerms = savePerms; +- } +- +- /** +- * Verify the JAR file is signed by an entity which has a certificate +- * issued by a trusted CA. +- * +- * In OpenJDK, we just need to examine the "cryptoperms" file to see +- * if any permissions were bundled together with this jar file. +- */ +- void verify() throws JarException, IOException { +- +- // Short-circuit. If we weren't asked to save any, we're done. +- if (!savePerms) { +- return; +- } +- +- // If the protocol of jarURL isn't "jar", we should +- // construct a JAR URL so we can open a JarURLConnection +- // for verifying this provider. +- final URL url = jarURL.getProtocol().equalsIgnoreCase("jar")? +- jarURL : new URL("jar:" + jarURL.toString() + "!/"); +- +- JarFile jf = null; +- try { +- +- // Get a link to the Jarfile to search. +- try { +- jf = (JarFile) +- AccessController.doPrivileged( +- new PrivilegedExceptionAction() { +- public Object run() throws Exception { +- JarURLConnection conn = +- (JarURLConnection) url.openConnection(); +- // You could do some caching here as +- // an optimization. +- conn.setUseCaches(false); +- return conn.getJarFile(); +- } +- }); +- } catch (java.security.PrivilegedActionException pae) { +- SecurityException se = new SecurityException( +- "Cannot load " + url.toString()); +- se.initCause(pae); +- throw se; +- } +- +- if (jf != null) { +- JarEntry je = jf.getJarEntry("cryptoPerms"); +- if (je == null) { +- throw new JarException( +- "Can not find cryptoPerms"); +- } +- try { +- appPerms = new CryptoPermissions(); +- appPerms.load(jf.getInputStream(je)); +- } catch (Exception ex) { +- JarException jex = +- new JarException("Cannot load/parse" + +- jarURL.toString()); +- jex.initCause(ex); +- throw jex; +- } +- } +- } finally { +- // Only call close() when caching is not enabled. +- // Otherwise, exceptions will be thrown for all +- // subsequent accesses of this cached jar. +- if (jf != null) { +- jf.close(); +- } +- } +- } +- +- /** +- * Verify that the provided JarEntry was indeed signed by the +- * framework signing certificate. +- * +- * @param je the URL of the jar entry to be checked. +- * @throws Exception if the jar entry was not signed by +- * the proper certificate +- */ +- static void verifyFrameworkSigned(URL je) throws Exception { +- } +- +- /** +- * Verify that the provided certs include the +- * framework signing certificate. +- * +- * @param certs the list of certs to be checked. +- * @throws Exception if the list of certs did not contain +- * the framework signing certificate +- */ +- static void verifyPolicySigned(java.security.cert.Certificate[] certs) +- throws Exception { +- } +- +- /** +- * Returns the permissions which are bundled with the JAR file, +- * aka the "cryptoperms" file. +- * +- * NOTE: if this JarVerifier instance is constructed with "savePerms" +- * equal to false, then this method would always return null. +- */ +- CryptoPermissions getPermissions() { +- return appPerms; +- } +-} +diff -r 4aebfff4f8a2 jdk/src/share/classes/javax/crypto/JceSecurity.java +--- openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurity.java Mon Sep 15 11:38:34 2008 +0200 ++++ openjdk/jdk/src/share/classes/javax/crypto/JceSecurity.java Thu Sep 25 17:45:37 2008 +0200 +@@ -25,11 +25,7 @@ + + package javax.crypto; + +-import java.lang.ref.*; + import java.util.*; +-import java.util.jar.*; +-import java.io.*; +-import java.net.URL; + import java.security.*; + + import java.security.Provider.Service; +@@ -48,23 +44,8 @@ + + final class JceSecurity { + ++ // Used in KeyGenerator, Cipher and KeyAgreement. + static final SecureRandom RANDOM = new SecureRandom(); +- +- // The defaultPolicy and exemptPolicy will be set up +- // in the static initializer. +- private static CryptoPermissions defaultPolicy = null; +- private static CryptoPermissions exemptPolicy = null; +- +- // Map of the providers we already have verified +- // value == PROVIDER_VERIFIED is successfully verified +- // value is failure cause Exception in error case +- private final static Map verificationResults = new IdentityHashMap(); +- +- // Map of the providers currently being verified +- private final static Map verifyingProviders = new IdentityHashMap(); +- - // Set the default value. May be changed in the static initializer. - private static boolean isRestricted = true; -+ // Set the default value. -+ private static final boolean isRestricted = false; /* * Don't let anyone instantiate this. -@@ -72,26 +72,6 @@ +@@ -72,48 +53,16 @@ private JceSecurity() { } @@ -300,10 +575,147 @@ diff -ur openjdk.orig/jdk/src/share/clas static Instance getInstance(String type, Class clazz, String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException { -@@ -239,93 +219,6 @@ - return (url == NULL_URL) ? null : url; - } - + Service s = GetInstance.getService(type, algorithm, provider); +- Exception ve = getVerificationResult(s.getProvider()); +- if (ve != null) { +- String msg = "JCE cannot authenticate the provider " + provider; +- throw (NoSuchProviderException) +- new NoSuchProviderException(msg).initCause(ve); +- } + return GetInstance.getInstance(s, clazz); + } + + static Instance getInstance(String type, Class clazz, String algorithm, + Provider provider) throws NoSuchAlgorithmException { + Service s = GetInstance.getService(type, algorithm, provider); +- Exception ve = JceSecurity.getVerificationResult(provider); +- if (ve != null) { +- String msg = "JCE cannot authenticate the provider " +- + provider.getName(); +- throw new SecurityException(msg, ve); +- } + return GetInstance.getInstance(s, clazz); + } + +@@ -123,10 +72,6 @@ + NoSuchAlgorithmException failure = null; + for (Iterator t = services.iterator(); t.hasNext(); ) { + Service s = (Service)t.next(); +- if (canUseProvider(s.getProvider()) == false) { +- // allow only signed providers +- continue; +- } + try { + Instance instance = GetInstance.getInstance(s, clazz); + return instance; +@@ -138,203 +83,10 @@ + + " not available", failure); + } + +- /** +- * Verify if the JAR at URL codeBase is a signed exempt application +- * JAR file and returns the permissions bundled with the JAR. +- * +- * @throws Exception on error From mark at klomp.org Thu Sep 25 11:56:48 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 25 Sep 2008 20:56:48 +0200 Subject: Cleaning up crypto support In-Reply-To: <1219931049.4019.32.camel@dijkstra.wildebeest.org> References: <1219931049.4019.32.camel@dijkstra.wildebeest.org> Message-ID: <1222369008.3266.91.camel@dijkstra.wildebeest.org> Hi, On Thu, 2008-08-28 at 15:44 +0200, Mark Wielaard wrote: > There is still a lot of cruft in the codebase for preventing the usage > of certain crypto algorithms or key-sizes. And we were actually shipping > restricted policies preventing people from using unlimted crypto. Oops. > > So if you saw: "java.securityInvalidKeyException: Illegal key size or > default parameters" that was caused by wrongly installed security policy > files. The code was actually there, just not properly activated. > > This patch cleans up the crypto code so it doesn't go out of its way to > prevent usage of "restricted crypto" and makes sure no restricted crypto > security policies are installed. I cleaned it up a bit more. It now removes all the unneeded classes like JarVerifier (that didn't actually do anything) and JceSecurityManager (that did all the unnecessary tricky class loader stack walking stuff) and reduces the JceSecurity class to just the method getInstance() and the static field RANDOM for the shared SecureRandom instance. For now I also kept the canUseProvider() method, that can now just return true. This last one was kept because the SecretKeyFactory, KeyGenerator, Mac and KeyAgreement classes still call it. It could be removed completely but I wanted to keep something that in principle could be easily used for some closed proprietary version that still insists on this "restricted crypto" thing. I believe this version is pretty clean. And it should be simple to verify that it works correctly now since all unnecessary code is just thrown out. Of course I threw all the crypto and security tests at it that I could find and all happily passed. I did alter the TestUtil class so that it always checks all algorithms and full keys. It would be nice to push this in OpenJDK proper so there is less divergence and so the GPLed version always has full crypto support enabled. If you still want to support a ClosedJDK with restricted crypto support then all you have to do it provide your own Cipher and JceSecurity class, plus any of the now removed auxiliary classes JarVerfifier and JceSecurityManager. Everything else can be the same between the free openjdk and proprietary closedjdk. Please let me know if you would need any help integrating this. I did already push it into icedtea6. Thanks, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-clean-crypto.patch Type: text/x-patch Size: 41904 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080925/dc0d181c/icedtea-clean-crypto.patch From mark at klomp.org Thu Sep 25 14:09:12 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 25 Sep 2008 23:09:12 +0200 Subject: OpenJDK 6 build 12 source posted (directaudio/alsa backend) In-Reply-To: <48D8EB31.60004@sun.com> References: <48CAB08F.6010407@sun.com> <1221402124.3542.40.camel@dijkstra.wildebeest.org> <48D7F80E.6060802@sun.com> <1222164525.3178.48.camel@dijkstra.wildebeest.org> <48D8EB31.60004@sun.com> Message-ID: <1222376952.3266.94.camel@dijkstra.wildebeest.org> Hi Joe, On Tue, 2008-09-23 at 06:12 -0700, Joseph D. Darcy wrote: > Mark Wielaard wrote: > > On Mon, 2008-09-22 at 12:54 -0700, Joseph D. Darcy wrote: > >> Mark Wielaard wrote: > >>> Although not in your changelogs, I saw you also included two of my fixes > >>> for the ALSA directaudio backend which I posted back in May on > >>> sound-dev, and which are included in icedtea already. > >>> - The sloppy open/close patch: > >>> http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000053.html > >>> - The ALSA native lock patch: > >>> http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000054.html > >>> > >>> Although it makes some applets that use some primitive sound output work > >>> better I never got a real response. Did you get someone from the sound > >>> team to look at these patches? They do seem to work for me and the few > >>> test users of those applets, but a full review by one of the sound > >>> engineers would be appreciated. They don't seem to be in the JDK7 tree. > >>> > >> No; the patches were not explicitly reviewed; Alex, please take a look > >> at them. > > > > Thanks. > > > >> Neither Gervill nor your patches have yet been incorporated into JDK 7. > > > > What is the reason for having them in JDK6, but not in JDK7? > > Just no one at Sun has gotten around to doing it yet for JDK 7. Is there anything Sun specific that is needed for moving stuff between 6 and 7? Need any help? If it comes from icedtea then Andrew has almost certainly already created patches against 7 for icedtea7. Cheers, Mark From gnu_andrew at member.fsf.org Thu Sep 25 14:27:50 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Thu, 25 Sep 2008 22:27:50 +0100 Subject: OpenJDK 6 build 12 source posted (directaudio/alsa backend) In-Reply-To: <1222376952.3266.94.camel@dijkstra.wildebeest.org> References: <48CAB08F.6010407@sun.com> <1221402124.3542.40.camel@dijkstra.wildebeest.org> <48D7F80E.6060802@sun.com> <1222164525.3178.48.camel@dijkstra.wildebeest.org> <48D8EB31.60004@sun.com> <1222376952.3266.94.camel@dijkstra.wildebeest.org> Message-ID: <20080925212750.GE27651@rivendell.middle-earth.co.uk> On 23:09 Thu 25 Sep , Mark Wielaard wrote: > Hi Joe, > > On Tue, 2008-09-23 at 06:12 -0700, Joseph D. Darcy wrote: > > Mark Wielaard wrote: > > > On Mon, 2008-09-22 at 12:54 -0700, Joseph D. Darcy wrote: > > >> Mark Wielaard wrote: > > >>> Although not in your changelogs, I saw you also included two of my fixes > > >>> for the ALSA directaudio backend which I posted back in May on > > >>> sound-dev, and which are included in icedtea already. > > >>> - The sloppy open/close patch: > > >>> http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000053.html > > >>> - The ALSA native lock patch: > > >>> http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000054.html > > >>> > > >>> Although it makes some applets that use some primitive sound output work > > >>> better I never got a real response. Did you get someone from the sound > > >>> team to look at these patches? They do seem to work for me and the few > > >>> test users of those applets, but a full review by one of the sound > > >>> engineers would be appreciated. They don't seem to be in the JDK7 tree. > > >>> > > >> No; the patches were not explicitly reviewed; Alex, please take a look > > >> at them. > > > > > > Thanks. > > > > > >> Neither Gervill nor your patches have yet been incorporated into JDK 7. > > > > > > What is the reason for having them in JDK6, but not in JDK7? > > > > Just no one at Sun has gotten around to doing it yet for JDK 7. > > Is there anything Sun specific that is needed for moving stuff between 6 > and 7? Need any help? If it comes from icedtea then Andrew has almost > certainly already created patches against 7 for icedtea7. > > Cheers, > > Mark > Yes, IcedTea7 has all the IcedTea6 patches up to about a week ago, including the Gervill overlay and Mark's sound patch. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From mark at klomp.org Thu Sep 25 14:45:45 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 25 Sep 2008 21:45:45 +0000 Subject: changeset in /hg/icedtea6: * patches/icedtea-lucene-crash.patch:... Message-ID: changeset b5b66d8e6014 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=b5b66d8e6014 description: * patches/icedtea-lucene-crash.patch: New patch. * Makefile.am (NON_ZERO_PATCHES): Add icedtea-lucene-crash.patch. * HACKING: Document icedtea-lucene-crash.patch. diffstat: 4 files changed, 75 insertions(+), 2 deletions(-) ChangeLog | 8 +++- HACKING | 1 Makefile.am | 4 +- patches/icedtea-lucene-crash.patch | 64 ++++++++++++++++++++++++++++++++++++ diffs (108 lines): diff -r 09fccdb9f333 -r b5b66d8e6014 ChangeLog --- a/ChangeLog Thu Sep 25 20:42:43 2008 +0200 +++ b/ChangeLog Thu Sep 25 23:35:32 2008 +0200 @@ -1,4 +1,10 @@ 2008-08-28 Mark Wielaard +2008-09-25 Mark Wielaard + + * patches/icedtea-lucene-crash.patch: New patch. + * Makefile.am (NON_ZERO_PATCHES): Add icedtea-lucene-crash.patch. + * HACKING: Document icedtea-lucene-crash.patch. + +2008-09-25 Mark Wielaard * patches/icedtea-clean-crypto.patch: Cleaned up. Remove unneeded classes JarVerifier and JceSecurityManager diff -r 09fccdb9f333 -r b5b66d8e6014 HACKING --- a/HACKING Thu Sep 25 20:42:43 2008 +0200 +++ b/HACKING Thu Sep 25 23:35:32 2008 +0200 @@ -64,6 +64,7 @@ The following patches are only applied t * icedtea-sparc.patch: Add support for GNU/Linux on SPARC. * icedtea-jdk-docs-target.patch: Always set DOCS_TARGET. +* icedtea-lucene-crash.patch: Fix lucene bad code generation bug #6707044. The following patches are only applied to OpenJDK in IcedTea: diff -r 09fccdb9f333 -r b5b66d8e6014 Makefile.am --- a/Makefile.am Thu Sep 25 20:42:43 2008 +0200 +++ b/Makefile.am Thu Sep 25 23:35:32 2008 +0200 @@ -427,7 +427,9 @@ ZERO_PATCHES = \ patches/icedtea-ia64-bugfix.patch # Patches needed when not using the newer OpenJDK 7 HotSpot for zero. -NON_ZERO_PATCHES = patches/icedtea-signed-types-hot6.patch +NON_ZERO_PATCHES = \ + patches/icedtea-signed-types-hot6.patch \ + patches/icedtea-lucene-crash.patch if ZERO_BUILD ZERO_PATCHES_COND = $(ZERO_PATCHES) diff -r 09fccdb9f333 -r b5b66d8e6014 patches/icedtea-lucene-crash.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/icedtea-lucene-crash.patch Thu Sep 25 23:35:32 2008 +0200 @@ -0,0 +1,64 @@ +diff -r 4aebfff4f8a2 hotspot/src/share/vm/opto/parse2.cpp +--- openjdk.orig/hotspot/src/share/vm/opto/parse2.cpp Mon Sep 15 11:38:34 2008 +0200 ++++ openjdk/hotspot/src/share/vm/opto/parse2.cpp Thu Sep 25 21:54:26 2008 +0200 +@@ -868,6 +868,8 @@ + return prob < PROB_MIN; + } + ++//-------------------------------repush_if_args-------------------------------- ++// Push arguments of an "if" bytecode back onto the stack by adjusting _sp. + inline void Parse::repush_if_args() { + #ifndef PRODUCT + if (PrintOpto && WizardMode) { +@@ -896,7 +898,6 @@ + if (PrintOpto && Verbose) + tty->print_cr("Never-taken backedge stops compilation at bci %d",bci()); + #endif +- repush_if_args(); // to gather stats on loop + uncommon_trap(Deoptimization::Reason_unreached, + Deoptimization::Action_reinterpret, + NULL, "cold"); +diff -r 51798f0e554f test/compiler/6707044/LuceneCrash.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ openjdk/hotspot/test/compiler/6707044/LuceneCrash.java Thu Sep 25 21:55:28 2008 +0200 +@@ -0,0 +1,40 @@ ++/* ++ * @test ++ * @bug 6707044 ++ * @summary uncommon_trap of ifnull bytecode leaves garbage on expression stack ++ * @run main/othervm -Xbatch LuceneCrash ++ */ ++public class LuceneCrash { ++ ++ public static void main(String[] args) throws Throwable { ++ new LuceneCrash().crash(); ++ } ++ ++ private Object alwaysNull; ++ ++ final void crash() throws Throwable { ++ for (int r = 0; r < 3; r++) { ++ for (int docNum = 0; docNum < 10000;) { ++ if (r < 2) { ++ for(int j=0;j<3000;j++) ++ docNum++; ++ } else { ++ docNum++; ++ doNothing(getNothing()); ++ if (alwaysNull != null) { ++ throw new RuntimeException("BUG: checkAbort is always null: r=" + r + " of 3; docNum=" + docNum); ++ } ++ } ++ } ++ } ++ } ++ ++ Object getNothing() { ++ return this; ++ } ++ ++ int x; ++ void doNothing(Object o) { ++ x++; ++ } ++} From Kelly.Ohair at Sun.COM Thu Sep 25 14:53:27 2008 From: Kelly.Ohair at Sun.COM (Kelly O'Hair) Date: Thu, 25 Sep 2008 14:53:27 -0700 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <48D9C77D.5030506@sun.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> <48D13DAE.9030009@sun.com> <48D2502A.7020001@sun.com> <48D802A2.6080509@sun.com> <48D9C77D.5030506@sun.com> Message-ID: <48DC0857.5070804@sun.com> Just FYI... I'm starting to work on the OpenJDK6 Mercurial conversion. My plan is for Build 5 to be the Rev 0 changeset, and I will try and create changesets for each of the bug fixes in a Build. So I'll be going through the list of fixes for each build, try and create a changeset for it, and at the end I'll copy in the final source for that build and see what I missed. The final changeset may be one for the remaining bugs fixed. Then I'll tag that changeset and move on to the next build. I'm calling this Total Recall, in that I'm essentially doing a replay of the Build 5 through Build 12 changes. This is a bit time consuming and some of the data I need is buried in our own internal build system (JPRT) or internal file servers. Once we get out there with a public Mercurial system I hope I never have to do this again. :^( So I'll start with the Build 6 changes and go from there. If you have Build 6 patch files for specific fixes, and can email me them or point me at them, that could help me out. One of my concerns is that normally we want every changeset fully vetted with regards to at least building on all platforms. Unfortunately with Teamware, the changes are often not kept in any sequential order like the Mercurial changesets, they are independent SCCS file changes. The history file can help me, but I'm dealing with a very old DSCM system here. So I'll try and re-create the same order the changes were made, and then occasionally make sure it builds on all platforms. The final sources for each Build we know builds ok on all platforms, those are effectively the source bundle drops. So I can't guarantee that every changeset is cleanly buildable on all platforms. Is that acceptable to everyone? -kto Joseph D. Darcy wrote: > Joseph D. Darcy wrote: >> Joseph D. Darcy wrote: >>> Kelly O'Hair wrote: >>>> Speaking from experience, any attempts at cleanly creating changesets >>>> from TeamWare data alone is a waste of time. Just doesn't work well. >>>> Granted we have pretty complete OpenJDK6 changeset data (data beyond >>>> the TeamWare data) and could potentially do this, it's quite a bit of >>>> grunt work to accomplish. Before we go off on this kind of adventure >>>> we need to make sure the time spent is worth it. >>>> A different approach would be to create changesets per build/promotion, >>>> but those kind of large changesets can have limited usefulness. >>>> >>>> I'll try and talk to Joe about this tomorrow. >>>> >>>> Also, don't forget that the OpenJDK7 sources are a Mercurial forest, >>>> not just one repository. I assume that we want to mimic the same >>>> forest layout, keeping the langtools, corba, jaxp, jaxws, and hotspot >>>> sources in their own repositories, separate from the core 'jdk' >>>> repository. >>>> That allows us to do some plug and play with these repositories >>>> between OpenJDK6 and OpenJDK7. >>>> >>>> -kto >>> Yes, my thinking has been to mirror the overall JDK 7 repository >>> forest structure in OpenJDK 6. >> >> Quick follow-up, I've been traveling recently and haven't had a chance >> to chat with Kelly yet. >> >> Given that there is currently the per-build external Mercurial >> repository and that it is easy to get the list of bugs fixed in a >> build, retroactively synthesizing the (approximate) patches associated >> with a set of bugs *might* be workable since figuring out the bug <-> >> file mapping shouldn't be that bad. If those interested in seeing the >> past history synthesized these patches, I could focus on finishing >> getting the OpenJDK build 12++ code ready for Mercurial and then >> reverse apply the set of patches to get back to the earlier public >> source drops. However, this might be more work than I think and I'll >> want to talk to Kelly about the detailed logistics of what would be >> necessary for this to happen. >> >> My priority is on getting the "official" Mercurial repository up and >> running so we can collaborate there going forward as opposed to >> spending lots of time on retrofitting the existing build history into >> the new repository. >> >> Also, in the future I'd like to consider an infrastructure where areas >> like corba, jaxp, and jaxws for OpenJDK 6 could be managed as patches >> to an imported code base rather than having a fully populated copy of >> the code under revision management for the release. >> >> Cheers, > > Kelly and I chatted on Tuesday. We'll be working on getting the > official OpenJDK 6 Mercurial repositories up and open for business. > > We agreed to publish the future repositories with at least as much > version information as the one Mark Wielaard setup, that is, at least > one changeset per build going back to the first published OpenJDK6 > build, b05. If people would like to see more fine grained changesets > with more detailed changeset -> bugid grouping, Martin, Mark W., and > others could help carve up the big build-to-build patches and sent us > the decomposition before the official Mercurial transitional. > Alternatively, if that decomposition isn't finished before we want to go > live with the repositories, Kelly though that adding supplementary > changsets with this information might be able to be added later. Kelly, > please fill in any details here. > > In the near term, we will probably have a forest of repositories as in > JDK 7. However, longer term I would be happy if only hotspot, jdk, and > langtools were full repositories and jaxp, jaxws, and corba repos were > just vestiges that applied a few patches to upstream sources. We'll > have to work out some logistical details with the HotSpot team to mesh > with their "HotSpot Express" release model. > > -Joe > > The per-build bug lists below are raw lists from the bug database with a > small amount of filtering to remove a handful of bugs whose changes only > touch closed JDK code; I might have missed one or two of these bugs > fixes that aren't present in the open code. > > Fixed in b06 - > http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-February/000016.html > > 6601458: Move java.math tests from closed to open > 6499487: [zh_CN] README_zh_CN in jdk is out of sync with the english README > 6566218: l10n of 6476932 > 6536195: flaw in DatatypeConverter > 6536209: flaw in SAAJMetaFactory > 6588002: XSLTProcessorApplet still allows reading from forbidden URLs > 6587132: Code changes behavior when compiled > 6635776: Regression in jaxb tests with JDk6 U4 > 6559283: Duplicate GPL notices in src/share/classes/com/sun/xml/internal > 6590857: Drag & Drop arbitrary file copy > 6662775: Move Imaging and color classes from closed to open > 6606396: Notepad demo doesn't run in Japanese locale. > 6646197: (tz) Support tzdata2007k > 6509039: Swedish localization has incorrect am/pm markers in FormatData_sv > 6573250: Java.util.Currency.getSymbol(Locale) returns wrong value when > locale is not US. > 6610748: Dateformat - AM-PM indicator in Finnish appears to be from English > 6645268: Country/language names with locale fi_FI are incorrect for > FRANCE/FRENCH > 6645405: Errors in Hungarian local-specific formatting. (L10N part of > 6609703) > 6650730: Lithuanian locale date and number formats mismatch. > 4225362: localized DateFormatSymbols for fr_FR is wrong > 6450945: The week day for Saturday and the first week day in Romania > locale are incorrect > 6609737: DateFormat incorrect for German locale > 6647063: java/text/Format/NumberFormat/CurrencyFormat.java fails > 6652200: test/java/util/TimeZone/Bug6329116.java fails > 6598520: (tz) Windows time zone mapping table needs to be updated for > KB933360 > 6605798: JAX-WS RI 2.1.1 should be integrated in OpenJDK6 > 6661448: Make the SNMP agent optional when OPENJDK=true and > IMPORT_BINARY_PLUGS=false > 6662581: jdk/make/common/internal/Defs-corba.gmk doesnot list all files > to be imported: some classes missing > 6667532: Update OpenJDK 6 make/README > 6676375: Make sure MOTIF_REQUIRED=false when OPENJDK=true > > > Fixed in b07 - > http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-March/000026.html > > 6586752: Window decorations do not appear > 6642034: System.getProperty("os.name") returns Windows Vista on Windows > Server 2008 (longhorn) > 6671051: (process) Runtime.exec() hangs if signalled during fork/exec > 6636951: javax.swing.plaf SigTest Failures in OpenJDK 6 > 6662830: OpenJDK build testing results > 6668781: Openjdk windows cygwin build failure: no rule to make > linker_md.obj target > 6669175: Add OpenJDK(TM) notification > 6672710: Allow for openjdk sound to be built without the binary plugs > (IMPORT_BINARY_PLUGS=false) > 6672777: Broken deploy build from jdk fix 6668781 for cygwin windows > 6674015: Update trademark notification to version 1.1 > 6674314: Setting MOTIF_REQUIRED to 'false' doesn't work > > > Fixed in b08 - > http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-March/000033.html > > 6613927: Compilation of splashscreen png library failed on Ubuntu 7.04 > (64bit) > 6578538: com.sun.crypto.provider.SunJCE instance leak using KRB5 and > LoginContext > 6679296: sec-lib.zip and friends inadvertantly added to the 6-open and > jdk7 b19 directories > 6679994: Undocumented .jar files in JDK 6 Open: > hotspot/agent/src/share/lib > 6680088: SSLEngineDeadlock workaround for 6519515 needed by OpenJDK builds > > > Fixed b09 - > http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-April/000039.html > > 6602007: Transition to Mercurial: Remove SCCS keywords from files in > the test/ directory > 6633656: Cross platform print dialog doesn't check for orientation being > unsupported. > 6672868: Package javax.xml.ws.wsaddressing not included in > make/docs/CORE_PKGS.gmk > 6650748: (tz) Java runtime doesn't detect VET time zone correctly on > Windows > 6679340: (tz) Support tzdata2008b > 6678161: Printing to remote non-Postscript printer does not work in Linux > > > Fixed in b10 - > http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-May/000058.html > > 6683078: Update JCE framework and provider builds to work on read-only > filesystems > 6604044: java crashes talking to second X screen > 6684582: Launcher needs improved error reporting > 6644659: Error in default target of make/javax/crypto in OpenJDK build > 6691185: (coll) TreeMap.navigableKeySet's descendingIterator method > starts at first instead of last entry > 6691215: (coll) IdentityHashMap.containsValue(null) returns true when > null value not present > 6523403: OSS CMM: Need to provide lcms library with PYCC and LINEAR_RGB > OS ICC profiles > 6682167: Add cygwin faq to README-builds.html > 6695553: Cleanup GPLv2+SPL legal notices in hat sources > 6563616: Clarify instructions for unpacking openjdk binary "plug" > 6611685: Incorrect link to CA certs info from build README > 6597857: JDK build instructions need to be updated > (BUILD_JDK_IMPORT_PATH, BUILD_BINARY_PLUGS_PATH) > 6636469: Java Fullscreen Exclusive Mode not working with Xorg server > 1.3.0 and above > 6602426: TEST_BUG: test/sun/misc/Version/VersionCheck.java fails > 6479286: LTP: XMLEncoder does not persist LineBorder properly > 6673853: LegacyIntrospectorTest is testing an old deprecated com.sun API > not present in OpenJDK. > 6707643: (tz) Support tzdata2008c > 6702956: OpenJDK: replace encumbered code (software synthesizer) > 6703931: Remove jaxws doc-files from the jdk > 6704655: Test test/java/lang/reflect/Generics/Probe.java fails under > OpenJDK > 6705893: javax.script tests should not require a js engine on OpenJDK > > > Fixed in b11 - > http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-July/000067.html > > 6542088: JAX-WS server allows XXE attacks > 6332953: JMX agent should bind to loopback address when starting the > local connector server > 6665028: native code of method j*.text.Bidi.nativeBidiChars is using the > contents of a primitive array direct > 6661918: Array reference changes behavior when compiled > 6624717: Corrupted combo box, GTK L&F, Ubuntu 7.10 > 6621691: (dc) test/java/nio/channels/DatagramChannel/NotBound.java > missing public modifier > 6691328: DragSourceContext returns unexpected cursor > 6685178: REGRESSION: NPE in ConnectorBootstrap when > Agent.getManagementProperties() returns null. > 6607339: IncrementalSAXSource_Filter still allows reading of local files > 6601377: hotspot/src/share/vm/prims/jvmtiLib.xsl generates files with > incorrect legal notices > 6589868: transition to Mercurial: need to eliminate dependencies on SCCS > keywords > 6681796: hotspot build failure on gcc 4.2.x (ubuntu 8.04) w/ openjdk6 > 6695776: corba jscheme jar files in repository could be built from source > 6695777: Queens.class should be built from source, not put in source repo > 6565364: update legal notices in corba > 6695765: Remove winver.exe completely from jdk sources > 6705945: com.sun.tools.javac.zip files do not have valid copyright > 6596323: (fc) ClosedByInterruptException not thrown by the interrupt > method (lnx) > 6710579: (ch) test/java/nio/channels/AsyncCloseAndInterrupt fails (lnx) > 6623167: C2 crashed in StoreCMNode::Value > 6497639: Profiling Swing application caused JVM crash > 6599425: OopMapCache::lookup() can cause later crash or assert() failure > 6659207: access violation in CompilerThread0 > 6614100: EXCEPTION_ACCESS_VIOLATION while running Eclipse with 1.6.0_05-ea > 6608764: test/closed/java/awt/Focus/TemporaryLostComponentDeadlock fails > 6620632: DTD event is missing entity and notation information > 6601384: hotspot/src/share/vm/adlc/archDesc.cpp generates files with > incorrect legal notices > 6710791: Remove files or build them from source: maf-1_0.jar, jlfgr-1_0.jar > 6713083: hotspot copy.cpp and vmStructs_parNew.hpp source files contains > proprietary sun notice > 6717575: Make sanity prints duplicated BUILD_JDK messages > 6717694: Normalize src/share/classes/com/sun/media/sound > > > Fixed in b12 - > http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-September/000150.html > > 6590549: Cygwin build of OpenJDK has problems and not very well documented > 6635663: make/tools/AutoMulti/{AutoMulti,TestALFGenerator}.java still > generate files with wrong legal notices > 6719182: update legal notice in > src/share/classes/java/lang/instrument/package.html > 6714428: 'os.name' system property shows wrong value on 64-bit Windows XP > 6720240: IOB exception when getting font metrics of hershey font > 6548261: Use of SE in make/common/Defs-windows.gmk > 6681798: (build) CharsetEncoder.java fails to compile in openjdk6 on > ubuntu 8.04 > 6372405: Server thread hangs when fragments don't complete because of > connection abort > 5104239: Java: thread deadlock > 6191561: JCK15: > api/org_omg/PortableInterceptor/ClientRequestInfo/index.html#RIMethods > sometime hang > 6486322: org.omg.CORBA.ORB.init() thread safety issue > 6465377: NullPointerException for RMI ORB in 1.5.0_08 > 6438259: Wrong repository ID generated by IDLJ > 6509042: javac rejects class literals in enum constructors > 6627362: javac generates code that uses array.clone, which is not > available on JavaCard > 6627364: javac needs Float and Double on the bootclasspath even when not > directly used > 6627366: javac needs Cloneable and Serializable on the classpath even > when not directly used > 6665223: Static import of inherited protected method causes compiler > exception > 6538484: JAF fails in Turkish locale > 6699090: Avoid NPE if parse fails in isMimeTypeEqual, do a string > comparison instead > 6176978: current Javadoc's invocation and extension (Doclet) mechanisms > are problematic > 6681889: JSN security test headline/noWarningApp failed with NPE exception > 6732815: CORBA_2_3 java sources not explicitly compiled > 6734545: Corrections to missing explicit corba sources on javac compile > lines > 6573268: Four JCK-devtools-6a tests report OOM: Java Heap space since > JDK7 b14 > 6720349: (ch) Channels tests depending on hosts inside Sun > 6739302: Check that deserialization preserves EnumSet integrity > 6730743: (tz) Support tzdata2008e > 6741642: bad enum definition in ciTypeFlow.hpp > 6717691: Update Gervill with post 1.0 fixes > 6733501: Apply IcedTea little cms patches > 6735154: Apply IcedTea Color.createContext patch > 6738894: Merge jaxp fixes from 6 update train into OpenJDK 6 > 6740210: Update Gervill with more post 1.0 fixes > 6748247: Further update Gervill with still more post 1.0 fixes From mark at klomp.org Thu Sep 25 14:57:56 2008 From: mark at klomp.org (Mark Wielaard) Date: Thu, 25 Sep 2008 23:57:56 +0200 Subject: hotspot JIT producing incorrect code -how should I report a bug? In-Reply-To: <487E66C9.4050601@Sun.COM> References: <4873C510.6030100@streambase.com> <4873DBBF.1020900@sun.com> <48740CBD.8060705@streambase.com> <4876805F.4030700@Sun.COM> <487E66C9.4050601@Sun.COM> Message-ID: <20080925215747.GA16445@gnu.wildebeest.org> Hi, On Wed, Jul 16, 2008 at 02:23:21PM -0700, Chuck Rasbold wrote: > Ismael Juma wrote: > > Chuck Rasbold writes: > > > >>Thanks for bringing 6707044 to our attention. Is was previously misfiled > >>in the wrong subcategory. I'm looking into a diagnosis right now. > > > > Thanks for looking into it Chuck. It looks like a scary bug and it would > > be very nice to get a fix. > > With a fix now in jdk7/hotspot-comp/hotspot, we're now looking into > getting this fix backported into the 6u10 release. This was indeed a scary bug. And easily triggered. I backported it to the jdk6 hotspot as used in icedtea. I also added the test case for it (that obviously fails before and succeeds after the patch). It would be nice if it could also be added to the hotspot tests. There are unfortunately very little public tests for hotspot and increasing their number would help with making sure no regressings slip in. I didn't take your followup patches (for #6726504 and #6730192) because I wanted a minimal backport. But if you think it would be good to backport those too then I will be happy to take a stab at it. Cheers, Mark P.S. Note to Gary, I didn't try to fix it in the zero hotspot 7b24 version. We should probably just refresh that one completely. -------------- next part -------------- diff -r 4aebfff4f8a2 hotspot/src/share/vm/opto/parse2.cpp --- openjdk.orig/hotspot/src/share/vm/opto/parse2.cpp Mon Sep 15 11:38:34 2008 +0200 +++ openjdk/hotspot/src/share/vm/opto/parse2.cpp Thu Sep 25 21:54:26 2008 +0200 @@ -868,6 +868,8 @@ return prob < PROB_MIN; } +//-------------------------------repush_if_args-------------------------------- +// Push arguments of an "if" bytecode back onto the stack by adjusting _sp. inline void Parse::repush_if_args() { #ifndef PRODUCT if (PrintOpto && WizardMode) { @@ -896,7 +898,6 @@ if (PrintOpto && Verbose) tty->print_cr("Never-taken backedge stops compilation at bci %d",bci()); #endif - repush_if_args(); // to gather stats on loop uncommon_trap(Deoptimization::Reason_unreached, Deoptimization::Action_reinterpret, NULL, "cold"); diff -r 51798f0e554f test/compiler/6707044/LuceneCrash.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ openjdk/hotspot/test/compiler/6707044/LuceneCrash.java Thu Sep 25 21:55:28 2008 +0200 @@ -0,0 +1,40 @@ +/* + * @test + * @bug 6707044 + * @summary uncommon_trap of ifnull bytecode leaves garbage on expression stack + * @run main/othervm -Xbatch LuceneCrash + */ +public class LuceneCrash { + + public static void main(String[] args) throws Throwable { + new LuceneCrash().crash(); + } + + private Object alwaysNull; + + final void crash() throws Throwable { + for (int r = 0; r < 3; r++) { + for (int docNum = 0; docNum < 10000;) { + if (r < 2) { + for(int j=0;j<3000;j++) + docNum++; + } else { + docNum++; + doNothing(getNothing()); + if (alwaysNull != null) { + throw new RuntimeException("BUG: checkAbort is always null: r=" + r + " of 3; docNum=" + docNum); + } + } + } + } + } + + Object getNothing() { + return this; + } + + int x; + void doNothing(Object o) { + x++; + } +} From mark at klomp.org Thu Sep 25 15:17:52 2008 From: mark at klomp.org (Mark Wielaard) Date: Fri, 26 Sep 2008 00:17:52 +0200 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <48DC0857.5070804@sun.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> <48D13DAE.9030009@sun.com> <48D2502A.7020001@sun.com> <48D802A2.6080509@sun.com> <48D9C77D.5030506@sun.com> <48DC0857.5070804@sun.com> Message-ID: <1222381072.3266.102.camel@dijkstra.wildebeest.org> Hi Kelly, On Thu, 2008-09-25 at 14:53 -0700, Kelly O'Hair wrote: > I'm starting to work on the OpenJDK6 Mercurial conversion. My plan is for > Build 5 to be the Rev 0 changeset, and I will try and create changesets > for each of the bug fixes in a Build. Would it be possible to reconstruct the openjdk7 revision that was the original starting point for the openjdk6 tree? That would be very helpful to have for forward and backward porting between the two trees. If you could make that rev0 and then have one giant changeset to build 5 as rev1 that would be really great. For example we have found some nasty AWT bugs that have been fixed in openjdk7, but it was somewhat hard to track down what was needed because the origin of the awt code in openjdk6 wasn't exactly known. > So I'll be going through the list of fixes for each build, try and create a > changeset for it, and at the end I'll copy in the final source for that > build and see what I missed. The final changeset may be one for the remaining > bugs fixed. Then I'll tag that changeset and move on to the next build. > I'm calling this Total Recall, in that I'm essentially doing a replay > of the Build 5 through Build 12 changes. Wow. That is really, really great. And it must be a real pain to go through all that. Thanks a lot for doing this! Hope it will not drive you mad. > One of my concerns is that normally we want every changeset fully vetted > with regards to at least building on all platforms. > Unfortunately with Teamware, the changes are often not kept in any sequential > order like the Mercurial changesets, they are independent SCCS file changes. > The history file can help me, but I'm dealing with a very old DSCM system here. > > So I'll try and re-create the same order the changes were made, and then > occasionally make sure it builds on all platforms. > The final sources for each Build we know builds ok on all platforms, those > are effectively the source bundle drops. > So I can't guarantee that every changeset is cleanly buildable on all > platforms. > Is that acceptable to everyone? It would certainly be to me. I am already very pleased that you are attempting to get more than just one changeset per build drop. I think the data will mostly be used for historical purposes (what was changed when together with what?). Not for actually building. Thanks, Mark From Chuck.Rasbold at Sun.COM Thu Sep 25 15:31:59 2008 From: Chuck.Rasbold at Sun.COM (Chuck Rasbold) Date: Thu, 25 Sep 2008 15:31:59 -0700 Subject: hotspot JIT producing incorrect code -how should I report a bug? In-Reply-To: <20080925215747.GA16445@gnu.wildebeest.org> References: <4873C510.6030100@streambase.com> <4873DBBF.1020900@sun.com> <48740CBD.8060705@streambase.com> <4876805F.4030700@Sun.COM> <487E66C9.4050601@Sun.COM> <20080925215747.GA16445@gnu.wildebeest.org> Message-ID: <48DC115F.2050106@sun.com> Mark - I don't think that you need to backport #6726504 and #6730192. The first was just a clean up and the second a bug fix for the cleanup (he writes while eating humble pie). As for the test case, I love it, but based on the channel in which the test case was submitted, Sun does not have ownership rights to the code, so I can't add it to OpenJDK. I am not a lawyer, but someone who is should feel free to correct me. -- Chuck On 09/25/08 14:57, Mark Wielaard wrote: > Hi, > > On Wed, Jul 16, 2008 at 02:23:21PM -0700, Chuck Rasbold wrote: >> Ismael Juma wrote: >>> Chuck Rasbold writes: >>> >>>> Thanks for bringing 6707044 to our attention. Is was previously misfiled >>>> in the wrong subcategory. I'm looking into a diagnosis right now. >>> Thanks for looking into it Chuck. It looks like a scary bug and it would >>> be very nice to get a fix. >> With a fix now in jdk7/hotspot-comp/hotspot, we're now looking into >> getting this fix backported into the 6u10 release. > > This was indeed a scary bug. And easily triggered. > I backported it to the jdk6 hotspot as used in icedtea. > I also added the test case for it (that obviously fails before and > succeeds after the patch). It would be nice if it could also be added > to the hotspot tests. There are unfortunately very little public tests > for hotspot and increasing their number would help with making sure > no regressings slip in. > > I didn't take your followup patches (for #6726504 and #6730192) because > I wanted a minimal backport. But if you think it would be good to > backport those too then I will be happy to take a stab at it. > > Cheers, > > Mark > > P.S. Note to Gary, I didn't try to fix it in the zero hotspot 7b24 > version. We should probably just refresh that one completely. > From Kelly.Ohair at Sun.COM Thu Sep 25 15:48:36 2008 From: Kelly.Ohair at Sun.COM (Kelly O'Hair) Date: Thu, 25 Sep 2008 15:48:36 -0700 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <1222381072.3266.102.camel@dijkstra.wildebeest.org> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <1ccfd1c10809141921m1565d916rf50c4b822536d7f0@mail.gmail.com> <1221576082.3889.10.camel@dijkstra.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> <48D13DAE.9030009@sun.com> <48D2502A.7020001@sun.com> <48D802A2.6080509@sun.com> <48D9C77D.5030506@sun.com> <48DC0857.5070804@sun.com> <1222381072.3266.102.camel@dijkstra.wildebeest.org> Message-ID: <48DC1544.5070507@sun.com> Mark Wielaard wrote: > Hi Kelly, > > On Thu, 2008-09-25 at 14:53 -0700, Kelly O'Hair wrote: >> I'm starting to work on the OpenJDK6 Mercurial conversion. My plan is for >> Build 5 to be the Rev 0 changeset, and I will try and create changesets >> for each of the bug fixes in a Build. > > Would it be possible to reconstruct the openjdk7 revision that was the > original starting point for the openjdk6 tree? That would be very > helpful to have for forward and backward porting between the two trees. > If you could make that rev0 and then have one giant changeset to build 5 > as rev1 that would be really great. Sorry... unknown legal issues may be lurking in Builds 0-4, not sure I want to go there. :^( > > For example we have found some nasty AWT bugs that have been fixed in > openjdk7, but it was somewhat hard to track down what was needed because > the origin of the awt code in openjdk6 wasn't exactly known. > >> So I'll be going through the list of fixes for each build, try and create a >> changeset for it, and at the end I'll copy in the final source for that >> build and see what I missed. The final changeset may be one for the remaining >> bugs fixed. Then I'll tag that changeset and move on to the next build. >> I'm calling this Total Recall, in that I'm essentially doing a replay >> of the Build 5 through Build 12 changes. > > Wow. That is really, really great. And it must be a real pain to go > through all that. Thanks a lot for doing this! Hope it will not drive > you mad. Mad? Mad? Ha Ha! ... Hopefully they aren't coming to take me away... http://uk.youtube.com/watch?v=2o7bMdAyPes > >> One of my concerns is that normally we want every changeset fully vetted >> with regards to at least building on all platforms. >> Unfortunately with Teamware, the changes are often not kept in any sequential >> order like the Mercurial changesets, they are independent SCCS file changes. >> The history file can help me, but I'm dealing with a very old DSCM system here. >> >> So I'll try and re-create the same order the changes were made, and then >> occasionally make sure it builds on all platforms. >> The final sources for each Build we know builds ok on all platforms, those >> are effectively the source bundle drops. >> So I can't guarantee that every changeset is cleanly buildable on all >> platforms. >> Is that acceptable to everyone? > > It would certainly be to me. I am already very pleased that you are > attempting to get more than just one changeset per build drop. I think > the data will mostly be used for historical purposes (what was changed > when together with what?). Not for actually building. Good. I'll do the best I can... -kto > > Thanks, > > Mark > From mark at klomp.org Fri Sep 26 04:02:20 2008 From: mark at klomp.org (Mark Wielaard) Date: Fri, 26 Sep 2008 13:02:20 +0200 Subject: hotspot JIT producing incorrect code -how should I report a bug? In-Reply-To: <48DC115F.2050106@sun.com> References: <4873C510.6030100@streambase.com> <4873DBBF.1020900@sun.com> <48740CBD.8060705@streambase.com> <4876805F.4030700@Sun.COM> <487E66C9.4050601@Sun.COM> <20080925215747.GA16445@gnu.wildebeest.org> <48DC115F.2050106@sun.com> Message-ID: <1222426940.3266.109.camel@dijkstra.wildebeest.org> Hi Chuck, On Thu, 2008-09-25 at 15:31 -0700, Chuck Rasbold wrote: > I don't think that you need to backport #6726504 and #6730192. Thanks for the info. > As for the test case, I love it, but based on the channel in which the > test case was submitted, Sun does not have ownership rights to the code, > so I can't add it to OpenJDK. I am not a lawyer, but someone who is > should feel free to correct me. You probably cannot claim copyright on the test case itself. But I would be surprised if when you ask the submitter to use the testcase you would be denied that. Obviously it was submitted precisely to get you a good testcase. Cheers, Mark From mark at klomp.org Fri Sep 26 04:20:37 2008 From: mark at klomp.org (Mark Wielaard) Date: Fri, 26 Sep 2008 11:20:37 +0000 Subject: changeset in /hg/icedtea6: * patches/icedtea-6712835-ifnode.patc... Message-ID: changeset 210cf639f45c in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=210cf639f45c description: * patches/icedtea-6712835-ifnode.patch: New patch. * Makefile.am (NON_ZERO_PATCHES): Add icedtea-6712835-ifnode.patch * HACKING: Document patches/icedtea-6712835-ifnode.patch. diffstat: 4 files changed, 34 insertions(+), 1 deletion(-) ChangeLog | 6 ++++++ HACKING | 1 + Makefile.am | 3 ++- patches/icedtea-6712835-ifnode.patch | 25 +++++++++++++++++++++++++ diffs (66 lines): diff -r a5883d41d7ec -r 210cf639f45c ChangeLog --- a/ChangeLog Fri Sep 26 11:58:58 2008 +0200 +++ b/ChangeLog Fri Sep 26 12:04:02 2008 +0200 @@ -1,3 +1,9 @@ 2008-09-26 Mark Wielaard + + * patches/icedtea-6712835-ifnode.patch: New patch. + * Makefile.am (NON_ZERO_PATCHES): Add icedtea-6712835-ifnode.patch + * HACKING: Document patches/icedtea-6712835-ifnode.patch. + 2008-09-26 Mark Wielaard * patches/icedtea-6700047-loopopts.patch: New patch. diff -r a5883d41d7ec -r 210cf639f45c HACKING --- a/HACKING Fri Sep 26 11:58:58 2008 +0200 +++ b/HACKING Fri Sep 26 12:04:02 2008 +0200 @@ -67,6 +67,7 @@ The following patches are only applied t * icedtea-jdk-docs-target.patch: Always set DOCS_TARGET. * icedtea-lucene-crash.patch: Fix lucene bad code generation bug #6707044. * icedtea-6700047-loopopts.patch: Fix partial peeling issue, bug #6700047. +* icedtea-6712835-ifnode.patch: Fix infinite loop in PhaseIterGVN::transform. The following patches are only applied to OpenJDK in IcedTea: diff -r a5883d41d7ec -r 210cf639f45c Makefile.am --- a/Makefile.am Fri Sep 26 11:58:58 2008 +0200 +++ b/Makefile.am Fri Sep 26 12:04:02 2008 +0200 @@ -430,7 +430,8 @@ NON_ZERO_PATCHES = \ NON_ZERO_PATCHES = \ patches/icedtea-signed-types-hot6.patch \ patches/icedtea-lucene-crash.patch \ - patches/icedtea-6700047-loopopts.patch + patches/icedtea-6700047-loopopts.patch \ + patches/icedtea-6712835-ifnode.patch if ZERO_BUILD ZERO_PATCHES_COND = $(ZERO_PATCHES) diff -r a5883d41d7ec -r 210cf639f45c patches/icedtea-6712835-ifnode.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/icedtea-6712835-ifnode.patch Fri Sep 26 12:04:02 2008 +0200 @@ -0,0 +1,25 @@ +6712835: Server compiler fails with assertion (loop_count < K,"infinite loop in PhaseIterGVN::transform") + +diff -r 4aebfff4f8a2 hotspot/src/share/vm/opto/ifnode.cpp +--- openjdk.orig/hotspot/src/share/vm/opto/ifnode.cpp Mon Sep 15 11:38:34 2008 +0200 ++++ openjdk/hotspot/src/share/vm/opto/ifnode.cpp Fri Sep 26 11:56:32 2008 +0200 +@@ -569,6 +569,11 @@ + int true_path = phi->is_diamond_phi(); + if( true_path == 0 ) return NULL; + ++ // Make sure that iff and the control of the phi are different. This ++ // should really only happen for dead control flow since it requires ++ // an illegal cycle. ++ if (phi->in(0)->in(1)->in(0) == iff) return NULL; ++ + // phi->region->if_proj->ifnode->bool->cmp + BoolNode *bol2 = phi->in(0)->in(1)->in(0)->in(1)->as_Bool(); + +@@ -595,6 +600,7 @@ + } + + Node* new_bol = (flip ? phase->transform( bol2->negate(phase) ) : bol2); ++ assert(new_bol != iff->in(1), "must make progress"); + iff->set_req(1, new_bol); + // Intervening diamond probably goes dead + phase->C->set_major_progress(); From mark at klomp.org Fri Sep 26 04:20:36 2008 From: mark at klomp.org (Mark Wielaard) Date: Fri, 26 Sep 2008 11:20:36 +0000 Subject: changeset in /hg/icedtea6: * patches/icedtea-hotspot7-tests.patc... Message-ID: changeset f2f33bede67b in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=f2f33bede67b description: * patches/icedtea-hotspot7-tests.patch: New patch. * Makefile.am (ICEDTEA_PATCHES): Add icedtea-hotspot7-tests.patch. * HACKING: Document icedtea-hotspot7-tests.patch. diffstat: 4 files changed, 7416 insertions(+) ChangeLog | 6 HACKING | 1 Makefile.am | 1 patches/icedtea-hotspot7-tests.patch | 7408 ++++++++++++++++++++++++++++++++++ diffs (truncated from 7447 to 500 lines): diff -r b5b66d8e6014 -r f2f33bede67b ChangeLog --- a/ChangeLog Thu Sep 25 23:35:32 2008 +0200 +++ b/ChangeLog Fri Sep 26 11:37:46 2008 +0200 @@ -1,3 +1,9 @@ 2008-09-25 Mark Wielaard + + * patches/icedtea-hotspot7-tests.patch: New patch. + * Makefile.am (ICEDTEA_PATCHES): Add icedtea-hotspot7-tests.patch. + * HACKING: Document icedtea-hotspot7-tests.patch. + 2008-09-25 Mark Wielaard * patches/icedtea-lucene-crash.patch: New patch. diff -r b5b66d8e6014 -r f2f33bede67b HACKING --- a/HACKING Thu Sep 25 23:35:32 2008 +0200 +++ b/HACKING Fri Sep 26 11:37:46 2008 +0200 @@ -59,6 +59,7 @@ The following patches are currently appl * icedtea-alpha-fixes.patch: Fix build issues on alpha-linux. * icedtea-arch.patch: Add support for additional architectures. * icedtea-alt-jar.patch: Add support for using an alternate jar tool in JDK building. +* icedtea-hotspot7-tests.patch: Adds hotspot compiler tests from jdk7 tree. The following patches are only applied to OpenJDK6 in IcedTea6: diff -r b5b66d8e6014 -r f2f33bede67b Makefile.am --- a/Makefile.am Thu Sep 25 23:35:32 2008 +0200 +++ b/Makefile.am Fri Sep 26 11:37:46 2008 +0200 @@ -448,6 +448,7 @@ ICEDTEA_FSG_PATCHES = ICEDTEA_PATCHES = \ $(ZERO_PATCHES_COND) \ + patches/icedtea-hotspot7-tests.patch \ patches/icedtea-copy-plugs.patch \ patches/icedtea-version.patch \ patches/icedtea-text-relocations.patch \ diff -r b5b66d8e6014 -r f2f33bede67b patches/icedtea-hotspot7-tests.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/icedtea-hotspot7-tests.patch Fri Sep 26 11:37:46 2008 +0200 @@ -0,0 +1,7408 @@ +diff -r 4aebfff4f8a2 hotspot/test/compiler/6646019/Test.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ openjdk/hotspot/test/compiler/6646019/Test.java Fri Sep 26 09:52:43 2008 +0200 +@@ -0,0 +1,52 @@ ++/* ++ * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, ++ * CA 95054 USA or visit www.sun.com if you need additional information or ++ * have any questions. ++ * ++ */ ++ ++/* ++ * @test ++ * @bug 6646019 ++ * @summary array subscript expressions become top() with -d64 ++ * @run main/othervm -Xcomp -XX:CompileOnly=Test.test Test ++*/ ++ ++ ++public class Test { ++ final static int i = 2076285318; ++ long l = 2; ++ short s; ++ ++ public static void main(String[] args) { ++ Test t = new Test(); ++ try { t.test(); } ++ catch (Throwable e) { ++ if (t.l != 5) { ++ System.out.println("Fails: " + t.l + " != 5"); ++ } ++ } ++ } ++ ++ private void test() { ++ l = 5; ++ l = (new short[(byte)-2])[(byte)(l = i)]; ++ } ++} +diff -r 4aebfff4f8a2 hotspot/test/compiler/6646020/Tester.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ openjdk/hotspot/test/compiler/6646020/Tester.java Fri Sep 26 09:52:43 2008 +0200 +@@ -0,0 +1,886 @@ ++/* ++ * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, ++ * CA 95054 USA or visit www.sun.com if you need additional information or ++ * have any questions. ++ */ ++ ++/* ++ * @test ++ * @bug 6646020 ++ * @summary assert(in_bb(n),"must be in block") in -Xcomp mode ++ */ ++ ++/* Complexity upper bound: 3361 ops */ ++ ++class Tester_Class_0 { ++ static byte var_1; ++ ++ ++ public Tester_Class_0() ++ { ++ "".length(); ++ { ++ var_1 = (var_1 = (new byte[(byte)'D'])[(byte)2.40457E38F]); ++ var_1 = (var_1 = (byte)1.738443503665377E307); ++ var_1 = (var_1 = (byte)1237144669662298112L); ++ } ++ var_1 = "baldh".equalsIgnoreCase("") ? (var_1 = (byte)7.2932087E37F) : (byte)3909726578709910528L; ++ var_1 = (var_1 = (var_1 = (var_1 = (byte)7.223761846153971E307))); ++ var_1 = (var_1 = (var_1 = (var_1 = (var_1 = (byte)((short)7860452029249754112L + (byte)1.7374232546809952E308))))); ++ var_1 = (!true ? (var_1 = (byte)4359229782598970368L) : (short)(byte)1.7509836746850026E308) >= 'P' ? (var_1 = (byte)3.275114793095594E307) : (byte)(- ((byte)1.5595572E38F) / 8.2971296E37F); ++ byte var_9 = (true ? true : (false ? true : false)) ? (var_1 = (var_1 = (byte)9.928434E37F)) : (var_1 = (byte)9.785060633966518E307); ++ final byte var_10 = 53; ++ var_9 <<= (true | true) & (((var_10 == "".substring(2001075014).compareToIgnoreCase("rhbytggv") ? !true : ! !true) ? !false : false) ? !true & true : !false) ? var_10 : var_10; ++ var_9 <<= - (var_9 -= - ~6397182310329038848L >> (char)955837891 << (short)- - -8.4452034E37F >> + ~5485157895941338112L); ++ --var_9; ++ var_9 >>= 'V'; ++ var_9 -= (new char[var_10])[var_9]; ++ double var_11; ++ var_11 = (var_11 = (new int[var_9 = (var_9 %= 684423748)])[var_9]); ++ var_9 /= 'q'; ++ var_9 *= ~var_9 | (short)1.7667766368850557E308 - "w".trim().charAt(- (var_9 /= + (var_11 = 'q'))); ++ if (var_10 <= 605036859609030656L | !false & false) ++ { ++ var_9 >>>= false ^ false ? (new short[var_10])[var_10] : (short)1013619326108001280L; ++ } ++ else ++ { ++ var_11 = var_9; ++ } ++ var_9 -= 'X'; ++ var_9 *= 'E'; ++ { ++ var_9 ^= (new short[var_9])[var_9 >>>= 'c']; ++ } ++ var_11 = 4315867074042433536L; ++ double var_12 = 1.2183900219527627E308; ++ var_9 <<= (false ? !false : false) ? '\\' : 'D'; ++ } ++ ++ ++ ++ ++ private final long func_0() ++ { ++ float var_2 = 0F; ++ var_1 = (var_1 = (var_1 = (byte)((short)1.4106931056021857E308 % var_2))); ++ for (new String(); true & (! !true ^ !false | false) && var_2 < 1; var_1 = (var_1 = (var_1 = (var_1 = (byte)1183673628639185920L)))) ++ { ++ var_1 = true | false ? (var_1 = (byte)1.6263855E37F) : (byte)'O'; ++ var_2++; ++ "fui".toUpperCase(); ++ final int var_3 = (var_1 = (var_1 = (byte)'i')) + (byte)2008561384 / (byte)1.4413369179905006E308; ++ } ++ var_1 = (var_1 = false ^ false ? (byte)2.3850814E38F : (byte)4.42887E37F); ++ final float var_4 = 3.052265E38F; ++ var_1 = (var_1 = (var_1 = (var_1 = (var_1 = (byte)'o')))); ++ long var_5; ++ var_1 = (var_1 = (byte)((var_1 = (byte)1913212786) * (var_1 = (byte)var_2))); ++ var_5 = (short)3.2024069E38F * (short)(var_5 = 'Q'); ++ var_5 = (false ? true : false) ? (short)1098137179 : (byte)~695765814858203136L; ++ var_1 = (var_1 = true & false ^ true ? (byte)1662737306 : (byte)'r'); ++ { ++ (true ? "a" : "lymivj".toString()).codePointCount((short)3.032349E38F + (var_1 = (var_1 = (var_1 = (var_1 = (byte)1.3159799E37F)))), (byte)2.0898819853138264E307 & (new short[(byte)(short)var_2])[var_1 = (byte)(short)4.859332921376913E307]); ++ } ++ double var_6; ++ var_6 = 1359078277; ++ final float var_7 = 3.5952457E37F; ++ var_5 = ('u' | 9005660398910009344L) << 'j'; ++ int var_8; ++ var_5 = (!false || true & !false) && false ? (byte)1836342254 : (byte)1.4836203E38F; ++ var_1 = (var_1 = (var_1 = (var_1 = (byte)1.5824984701060493E308))); ++ var_1 = (var_1 = (var_1 = (byte)~ (var_1 = (var_1 = (var_1 = (byte)var_7))))); ++ return +9.067416E37F <= (true | true ^ false ? (var_1 = (byte)(short)1.5243446E38F) : (var_1 = (byte)1.6893049E37F)) ? (byte)~4408841475280588800L - (var_5 = (var_1 = (byte)2.1542209E38F)) : (var_8 = (short)var_4); ++ } ++ ++ protected final static double func_1(final char arg_0, final long arg_1) ++ { ++ var_1 = (short)8779631802405542912L << 'x' <= arg_0 ? (byte)+9.96859509852443E307 : (var_1 = (var_1 = (byte)(short)5.218454879223281E307)); ++ return 5.57437404144192E307; ++ } ++ ++ double func_2(byte arg_0, final boolean arg_1, Object arg_2) ++ { ++ arg_2 = arg_1 != arg_1 ? "wq" : "w"; ++ arg_2 = arg_2; ++ if (arg_1) ++ { ++ arg_2 = false & arg_1 ? "hasmp" : (arg_2 = arg_2); ++ } ++ else ++ { ++ arg_2 = "lcquv"; ++ } ++ arg_0 -= arg_1 ^ false ? (arg_0 |= (short)arg_0) : (~3462197988186869760L | 7274210797196514304L) % - - + +130998764279904256L; ++ arg_0 &= (true ? - - ~7861994999369861120L << 'l' : 'c') * 1246069704; ++ return (arg_1 ? 9.311174E37F : 1.7085558737202237E308) * 1168887722; ++ } ++ ++ public String toString() ++ { ++ String result = "[\n"; ++ result += "Tester_Class_0.var_1 = "; result += Tester.Printer.print(var_1); ++ result += ""; ++ result += "\n]"; ++ return result; ++ } ++} ++ ++ ++final class Tester_Class_1 extends Tester_Class_0 { ++ static Object var_13; ++ final static boolean var_14 = false | (false ? false : true); ++ Object var_15; ++ static byte var_16; ++ final long var_17 = (long)(-9.40561658911133E307 - (short)2.2016736E38F) ^ (char)1099667310; ++ static boolean var_18; ++ static float var_19; ++ final static byte var_20 = 123; ++ static byte var_21 = var_1 = (var_1 = var_20); ++ final static float var_22 = 1.5415572E38F; ++ ++ ++ public Tester_Class_1() ++ { ++ char[][] var_39; ++ boolean var_40 = false | !var_14; ++ if (var_14) ++ { ++ final String[] var_41 = (new String[var_21][var_20])[var_21 *= var_21]; ++ var_15 = (new Tester_Class_0[var_20])[var_20]; ++ --var_21; ++ int var_42; ++ } ++ else ++ { ++ var_19 = (short)325110146; ++ } ++ var_40 &= true; ++ var_13 = (((new Tester_Class_1[var_21 |= (new char[var_20])[var_21]])[var_21]).var_15 = (new String[var_21][var_20][var_20])[var_21 >>= (byte)(int)var_22]); ++ var_15 = "m"; ++ } ++ ++ ++ ++ ++ ++ protected final static Tester_Class_0 func_0(final char arg_0, boolean arg_1) ++ { ++ final short var_23 = false ? (short)2.2956268E38F : var_20; ++ { ++ ((new Tester_Class_1[var_21])[var_20]).var_15 = ((new Tester_Class_0[var_20][var_21])[var_21])[var_20]; ++ } ++ var_19 = var_23; ++ { ++ var_21++; ++ --var_21; ++ var_13 = (false ? arg_1 : arg_1) ? "" : "aianteahl"; ++ arg_1 ^= ! (var_14 ? var_14 : !var_14); ++ } ++ (arg_1 ? "rq" : "certd").trim(); ++ arg_1 ^= 's' < var_22; ++ var_19 = 'T'; ++ var_19 = var_14 ? --var_21 : var_20; ++ var_19 = (var_21 >>>= ~ -1559436447128426496L >> 88912720393932800L) | (new char[var_20][var_21])[var_21][var_20]; ++ short var_24 = 7601; ++ if (arg_1) ++ { ++ var_13 = (new Tester_Class_0[var_20])[var_21]; ++ } ++ else ++ { ++ var_19 = var_23; ++ } ++ var_19 = var_24; ++ var_19 = 174274929356416000L; ++ return arg_1 ? (Tester_Class_0)(new Object[var_20])[var_21 >>>= - ((byte)6471979169965446144L)] : (new Tester_Class_0[var_21])[var_20]; ++ } ++ ++ private static int func_1(final Object arg_0, final boolean arg_1) ++ { ++ var_19 = 'N'; ++ var_13 = "ftspm".toUpperCase(); ++ var_18 = arg_1 ? !arg_1 : var_14; ++ var_19 = var_21 % 'j'; ++ { ++ var_13 = new short[var_21 >>= 8019540572802872320L]; ++ } ++ final Tester_Class_0 var_25 = arg_1 ? ((short)1.3614569631193786E308 >= (short)var_20 ? func_0('O', true) : (Tester_Class_0)arg_0) : func_0('e', false); ++ "cltpxrg".offsetByCodePoints((new short[var_20])[(byte)'F'] & var_20, 942627356); ++ final Object var_26 = ((new Tester_Class_1[var_21])[var_20]).var_15 = arg_0; ++ { ++ var_21 |= 'H'; ++ } ++ var_19 = 4705089801895780352L; ++ var_19 = (var_18 = arg_1 & false) ? var_20 : (! (~var_21 > var_22) ? (new short[var_20])[var_21] : (short)3904907750551380992L); ++ var_18 = false; ++ { ++ var_18 = "aoy".startsWith("ia", 18060804); ++ if (true) ++ { ++ final short var_27 = 4832; ++ } ++ else ++ { ++ var_18 = (var_18 = arg_1) ? !false : !var_14; ++ } ++ var_18 = (var_18 = var_14); ++ var_19 = 'L'; ++ } ++ func_0((false ? ! ((var_21 -= 4.670301365216022E307) > 1.1839209E37F) : (var_18 = false)) ? 's' : 'R', 'Z' > - ((long)var_21) << 2585724390819764224L & var_25.func_2(var_21, false, var_13 = var_25) != 4918861136400833536L); ++ double var_28 = 0; ++ var_21 %= -var_28; ++ for (byte var_29 = 91; arg_1 && (var_28 < 1 && false); var_19 = var_20) ++ { ++ var_19 = (var_18 = arg_1) & (var_18 = false) ? 'm' : '['; ++ var_28++; ++ var_18 = var_14; ++ var_21 += (short)1363703973; ++ } ++ var_19 = (var_19 = var_22); ++ var_18 = (var_18 = false | false ? 1743087391 <= (var_21 >>= 8790741242417599488L) : !arg_1); ++ var_18 = true | true; ++ --var_21; ++ var_18 = !var_14 & false; ++ "mt".indexOf(var_14 ? new String("fpu") : "awivb", (var_14 ? !true : (var_18 = var_14)) ? + ++var_21 : ~var_20); ++ return (short)(new float[var_21--])[var_21] & ((var_18 = false) ? (var_21 *= 'N') : var_20 + (short)1680927063794178048L) & 1839004800; ++ } ++ ++ protected static int func_2(Tester_Class_0[][] arg_0) ++ { ++ ((new Tester_Class_1[var_20][var_21])[var_20][var_20]).var_15 = ((new int[var_21][var_21][(byte)var_22])[var_21 <<= var_20])[var_20]; ++ ((new Tester_Class_1[var_20])[var_20]).var_15 = "d"; ++ int var_30 = 0; ++ "joxjgpywp".lastIndexOf(1834367264 >> var_21, (byte)7.572305E37F >>> (false ? (short)2.3909862E38F : + - +3939434849912855552L)); ++ while (var_14 | false ^ var_14 && (var_30 < 1 && true)) ++ { ++ var_1 = var_20; ++ var_30++; ++ var_13 = new float[var_21][--var_21]; ++ boolean var_31; ++ } ++ var_19 = ((new Tester_Class_1[var_21])[var_20]).var_17 <= (~2158227803735181312L & 6001748808824762368L) ? (short)var_20 : var_20; ++ var_18 = (var_18 = true); ++ return (byte)(new short[var_20])[var_20] >>> ((new char[var_21][var_21])[var_21 |= 6074708801143703552L])[var_20]; ++ } ++ ++ private final String func_3(boolean arg_0, short arg_1, short arg_2) ++ { ++ var_13 = (Tester_Class_0)((arg_0 ^= arg_0) ? (var_13 = (var_15 = (var_15 = "grfphyrs"))) : (var_13 = new Object[var_21 *= ']'])); ++ if (true & ! (arg_0 ^= !arg_0 | true)) ++ { ++ boolean var_32 = true; ++ var_19 = --arg_1; ++ arg_2 <<= var_21; ++ } ++ else ++ { ++ arg_0 |= false; ++ } ++ var_21 >>>= arg_1; ++ final float var_33 = 2.5500976E38F; ++ return ""; ++ } ++ ++ private static String func_4(final double arg_0, final Object arg_1, final short[] arg_2, final char arg_3) ++ { ++ float var_34; ++ var_21++; ++ ((new Tester_Class_1[var_20])[var_20]).var_15 = false ? arg_1 : arg_1; ++ var_13 = arg_1; ++ var_19 = var_22; ++ var_13 = new long[var_21 /= 1038797776 + var_21][--var_21]; ++ ++var_21; ++ var_18 = false && false; ++ var_21--; ++ "".lastIndexOf("kjro"); ++ final int var_35 = (var_21 <<= var_21--) * var_21--; ++ if ("kohilkx".startsWith("gy", var_35)) ++ { ++ var_34 = 2.0849673E37F; ++ } ++ else ++ { ++ double var_36 = arg_0; ++ } ++ var_34 = (var_21 /= var_20); ++ { ++ func_2(new Tester_Class_0[var_20][var_21]); ++ var_34 = var_20 * (- ~5805881602002385920L / arg_3) << (short)~8041668398152312832L; ++ var_13 = (var_13 = "qfwbfdf"); ++ } ++ ((new Tester_Class_1[var_20])[var_21 += var_20]).var_15 = false ? func_0(arg_3, var_14) : func_0('J', var_18 = var_14); ++ var_18 = (var_18 = var_14) & var_14; ++ if ((new boolean[var_21])[var_21 >>= 121380821]) ++ { ++ var_34 = 1382979413; ++ } ++ else ++ { ++ var_34 = (var_20 & var_20) + (true ? 'I' : arg_3); ++ } ++ byte var_37; ++ ((new Tester_Class_1[var_20][var_21])[var_14 ^ var_14 | !var_14 ? var_20 : var_20][var_21 ^= (short)1692053070 & + ~7232298887878750208L - 1512699919]).var_15 = arg_2; ++ byte var_38 = 1; ++ var_38 -= arg_0; ++ var_34 = arg_3; ++ return var_14 ? "" : "xgkr".toUpperCase(); ++ } ++ ++ public String toString() ++ { ++ String result = "[\n"; ++ result += "Tester_Class_1.var_1 = "; result += Tester.Printer.print(var_1); ++ result += "\n"; ++ result += "Tester_Class_1.var_16 = "; result += Tester.Printer.print(var_16); ++ result += "\n"; ++ result += "Tester_Class_1.var_20 = "; result += Tester.Printer.print(var_20); ++ result += "\n"; ++ result += "Tester_Class_1.var_21 = "; result += Tester.Printer.print(var_21); ++ result += "\n"; ++ result += "Tester_Class_1.var_14 = "; result += Tester.Printer.print(var_14); ++ result += "\n"; ++ result += "Tester_Class_1.var_18 = "; result += Tester.Printer.print(var_18); ++ result += "\n"; ++ result += "Tester_Class_1.var_17 = "; result += Tester.Printer.print(var_17); ++ result += "\n"; ++ result += "Tester_Class_1.var_19 = "; result += Tester.Printer.print(var_19); ++ result += "\n"; ++ result += "Tester_Class_1.var_22 = "; result += Tester.Printer.print(var_22); ++ result += "\n"; ++ result += "Tester_Class_1.var_13 = "; result += Tester.Printer.print(var_13); ++ result += "\n"; ++ result += "Tester_Class_1.var_15 = "; result += Tester.Printer.print(var_15); ++ result += ""; ++ result += "\n]"; ++ return result; ++ } ++} ++ ++ ++class Tester_Class_2 extends Tester_Class_0 { ++ final int var_43 = 1600723343; ++ static long var_44 = ~1297640037857117184L; ++ static String var_45 = "ejaglds"; ++ double var_46; ++ static float var_47 = 7.9423827E37F; ++ static Tester_Class_1[][] var_48; ++ ++ ++ public Tester_Class_2() ++ { ++ var_45 = (var_45 = "nkulkweqt"); ++ var_47 %= (new char[Tester_Class_1.var_21 >>= (short)Tester_Class_1.var_20])[Tester_Class_1.var_20]; ++ { ++ Tester_Class_1.var_18 = Tester_Class_1.var_14; ++ } ++ var_47 %= 1.559461406041646E308; ++ var_44 -= Tester_Class_1.var_21++ & ((new Tester_Class_1[Tester_Class_1.var_20])[Tester_Class_1.var_20]).var_17; ++ var_44 *= false ? (short)Tester_Class_1.var_20 : (short)var_47; ++ Tester_Class_1.var_13 = (new Tester_Class_1().var_15 = new char[Tester_Class_1.var_20]); ++ var_46 = 'i'; ++ double var_49 = var_46 = false ? (var_47 *= (var_46 = var_43)) : Tester_Class_1.var_20; ++ var_49 += 'k'; ++ } From mark at klomp.org Fri Sep 26 04:20:36 2008 From: mark at klomp.org (Mark Wielaard) Date: Fri, 26 Sep 2008 11:20:36 +0000 Subject: changeset in /hg/icedtea6: * patches/icedtea-6700047-loopopts.pa... Message-ID: changeset a5883d41d7ec in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=a5883d41d7ec description: * patches/icedtea-6700047-loopopts.patch: New patch. * Makefile.am (NON_ZERO_PATCHES): Add icedtea-6700047-loopopts.patch. * HACKING: Document patches/icedtea-6700047-loopopts.patch. diffstat: 4 files changed, 44 insertions(+), 2 deletions(-) ChangeLog | 8 ++++++- HACKING | 1 Makefile.am | 3 +- patches/icedtea-6700047-loopopts.patch | 34 ++++++++++++++++++++++++++++++++ diffs (77 lines): diff -r f2f33bede67b -r a5883d41d7ec ChangeLog --- a/ChangeLog Fri Sep 26 11:37:46 2008 +0200 +++ b/ChangeLog Fri Sep 26 11:58:58 2008 +0200 @@ -1,4 +1,10 @@ 2008-09-25 Mark Wielaard +2008-09-26 Mark Wielaard + + * patches/icedtea-6700047-loopopts.patch: New patch. + * Makefile.am (NON_ZERO_PATCHES): Add icedtea-6700047-loopopts.patch. + * HACKING: Document patches/icedtea-6700047-loopopts.patch. + +2008-09-26 Mark Wielaard * patches/icedtea-hotspot7-tests.patch: New patch. * Makefile.am (ICEDTEA_PATCHES): Add icedtea-hotspot7-tests.patch. diff -r f2f33bede67b -r a5883d41d7ec HACKING --- a/HACKING Fri Sep 26 11:37:46 2008 +0200 +++ b/HACKING Fri Sep 26 11:58:58 2008 +0200 @@ -66,6 +66,7 @@ The following patches are only applied t * icedtea-sparc.patch: Add support for GNU/Linux on SPARC. * icedtea-jdk-docs-target.patch: Always set DOCS_TARGET. * icedtea-lucene-crash.patch: Fix lucene bad code generation bug #6707044. +* icedtea-6700047-loopopts.patch: Fix partial peeling issue, bug #6700047. The following patches are only applied to OpenJDK in IcedTea: diff -r f2f33bede67b -r a5883d41d7ec Makefile.am --- a/Makefile.am Fri Sep 26 11:37:46 2008 +0200 +++ b/Makefile.am Fri Sep 26 11:58:58 2008 +0200 @@ -429,7 +429,8 @@ ZERO_PATCHES = \ # Patches needed when not using the newer OpenJDK 7 HotSpot for zero. NON_ZERO_PATCHES = \ patches/icedtea-signed-types-hot6.patch \ - patches/icedtea-lucene-crash.patch + patches/icedtea-lucene-crash.patch \ + patches/icedtea-6700047-loopopts.patch if ZERO_BUILD ZERO_PATCHES_COND = $(ZERO_PATCHES) diff -r f2f33bede67b -r a5883d41d7ec patches/icedtea-6700047-loopopts.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/icedtea-6700047-loopopts.patch Fri Sep 26 11:58:58 2008 +0200 @@ -0,0 +1,34 @@ +6700047: C2 failed in idom_no_update +Summary: partial peeling shouldn't place clones into loop + +diff -r 4aebfff4f8a2 hotspot/src/share/vm/opto/loopopts.cpp +--- openjdk.orig/hotspot/src/share/vm/opto/loopopts.cpp Mon Sep 15 11:38:34 2008 +0200 ++++ openjdk/hotspot/src/share/vm/opto/loopopts.cpp Fri Sep 26 11:29:06 2008 +0200 +@@ -1865,18 +1865,19 @@ + _igvn.hash_delete(use); + use->set_req(j, n_clone); + _igvn._worklist.push(use); ++ Node* use_c; + if (!use->is_Phi()) { +- Node* use_c = has_ctrl(use) ? get_ctrl(use) : use->in(0); +- set_ctrl(n_clone, use_c); +- assert(!loop->is_member(get_loop(use_c)), "should be outside loop"); +- get_loop(use_c)->_body.push(n_clone); ++ use_c = has_ctrl(use) ? get_ctrl(use) : use->in(0); + } else { + // Use in a phi is considered a use in the associated predecessor block +- Node *prevbb = use->in(0)->in(j); +- set_ctrl(n_clone, prevbb); +- assert(!loop->is_member(get_loop(prevbb)), "should be outside loop"); +- get_loop(prevbb)->_body.push(n_clone); ++ use_c = use->in(0)->in(j); + } ++ if (use_c->is_CountedLoop()) { ++ use_c = use_c->in(LoopNode::EntryControl); ++ } ++ set_ctrl(n_clone, use_c); ++ assert(!loop->is_member(get_loop(use_c)), "should be outside loop"); ++ get_loop(use_c)->_body.push(n_clone); + _igvn.register_new_node_with_optimizer(n_clone); + #if !defined(PRODUCT) + if (TracePartialPeeling) { From mark at klomp.org Fri Sep 26 04:20:52 2008 From: mark at klomp.org (Mark Wielaard) Date: Fri, 26 Sep 2008 13:20:52 +0200 Subject: More hotspot tests and some backported fixes Message-ID: <1222428052.3266.116.camel@dijkstra.wildebeest.org> Hi, I noticed openjdk6 and openjdk7 seem to have a mutually exclusive set of tests under hotspot/test/compiler. Since I believe having more tests is a good thing I merged them in icedtea6. That uncovered two crasher bugs in the hotspot form openjdk6 that we use. So I tracked down the fixes for those and backported them (patches attached). All 20 tests now PASS. It is probably a good idea to also merge the tests from 6 to 7. But I haven't done that yet. Note that again I did only backport for the hotspot from openjdk6, not the one that zero/shark uses (7b24). Cheers, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-6700047-loopopts.patch Type: text/x-patch Size: 1446 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080926/f24bdf5d/icedtea-6700047-loopopts.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-6712835-ifnode.patch Type: text/x-patch Size: 1037 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080926/f24bdf5d/icedtea-6712835-ifnode.patch From omajid at redhat.com Fri Sep 26 08:21:26 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 26 Sep 2008 15:21:26 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-25 Omair Majid changeset 9c11cbf114f3 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=9c11cbf114f3 description: 2008-09-25 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fixed code formatting. (open): Changed modifier from public to protected. PulseAudioClip wont expose this meaningless (for a Clip) function. (createStream): Changed modifier from public to private. Dont want this function exposed. (addStreamListeners): Likewise. (connect): Likewise. (open): Changed modifier from public to proected. Dont want this method exposed for all subclasses of PulseAudioDataLine. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java (open): Removed redundant method. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java (open): New function. Implements a required function for SourceDataLine interface. Previous implementation was through DataLine.open which was made protected. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java (open): New function. Implements a required function for TargetDataLine interface. Previous implementation was through DataLine.open which was made protected. (connectLine): Change modifier to protected. diffstat: 4 files changed, 64 insertions(+), 67 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 49 ++++---- src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java | 9 - src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 60 ++++------ src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 13 +- diffs (306 lines): diff -r 4e1873a3f88f -r 9c11cbf114f3 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Thu Sep 25 11:44:25 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Thu Sep 25 13:54:01 2008 -0400 @@ -77,21 +77,19 @@ public abstract class PulseAudioDataLine protected Stream stream; private ArrayList synchronizedLines; - public void open(AudioFormat format, int bufferSize) + protected void open(AudioFormat format, int bufferSize) throws LineUnavailableException { if (isOpen) { - throw new IllegalStateException("DataLine is already open"); + throw new IllegalStateException("Line is already open"); } createStream(format); - addStreamListeners(); connect(null, bufferSize); - - } - - public void createStream(AudioFormat format) + } + + private void createStream(AudioFormat format) throws LineUnavailableException { for (AudioFormat myFormat : supportedFormats) { @@ -104,7 +102,7 @@ public abstract class PulseAudioDataLine } currentFormat = format; - super.open(); + isOpen = true; } } @@ -112,11 +110,11 @@ public abstract class PulseAudioDataLine throw new IllegalArgumentException("Invalid format"); } - System.out.println("Stream " + stream + " created"); - - } - - public void addStreamListeners() { + // System.out.println("Stream " + stream + " created"); + + } + + private void addStreamListeners() { Stream.StateListener openCloseListener = new Stream.StateListener() { @Override @@ -124,7 +122,7 @@ public abstract class PulseAudioDataLine synchronized (eventLoop.threadLock) { /* - * Not the order: first we notify all the listeners, and + * Note the order: first we notify all the listeners, and * then return. this means no race conditions when the * listeners are removed before they get called by close * @@ -166,7 +164,7 @@ public abstract class PulseAudioDataLine @Override public void update() { dataWritten = false; - + if (!corked) { fireLineEvent(new LineEvent(PulseAudioDataLine.this, LineEvent.Type.STOP, AudioSystem.NOT_SPECIFIED)); @@ -214,7 +212,7 @@ public abstract class PulseAudioDataLine stream.addCorkListener(corkListener); } - public void connect(Stream masterStream, int bufferSize) + private void connect(Stream masterStream, int bufferSize) throws LineUnavailableException { try { @@ -223,9 +221,9 @@ public abstract class PulseAudioDataLine } } catch (LineUnavailableException e) { // error connecting to the server! - //stream.removePlaybackStartedListener(startedListener); - //stream.removeUnderflowListener(stoppedListener); - //stream.removeStateListener(openCloseListener); + // stream.removePlaybackStartedListener(startedListener); + // stream.removeUnderflowListener(stoppedListener); + // stream.removeStateListener(openCloseListener); stream.free(); stream = null; throw e; @@ -248,7 +246,7 @@ public abstract class PulseAudioDataLine } } - public void open(AudioFormat format) throws LineUnavailableException { + protected void open(AudioFormat format) throws LineUnavailableException { open(format, DEFAULT_BUFFER_SIZE); } @@ -333,11 +331,12 @@ public abstract class PulseAudioDataLine op.waitForCompletion(); op.releaseReference(); isStarted = true; - - /*if (dataWritten) { - fireLineEvent(new LineEvent(PulseAudioDataLine.this, - LineEvent.Type.START, AudioSystem.NOT_SPECIFIED)); - }*/ + + /* + * if (dataWritten) { fireLineEvent(new + * LineEvent(PulseAudioDataLine.this, LineEvent.Type.START, + * AudioSystem.NOT_SPECIFIED)); } + */ } diff -r 4e1873a3f88f -r 9c11cbf114f3 src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Thu Sep 25 11:44:25 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Thu Sep 25 13:54:01 2008 -0400 @@ -44,7 +44,6 @@ import javax.sound.sampled.Line; import javax.sound.sampled.Line; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineListener; -import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.Control.Type; abstract class PulseAudioLine implements Line { @@ -112,13 +111,7 @@ abstract class PulseAudioLine implements return isOpen; } - @Override - public void open() throws LineUnavailableException { - /*if (isOpen) { - throw new IllegalStateException("Line is already open"); - }*/ - isOpen = true; - } + public void removeLineListener(LineListener listener) { lineListeners.remove(listener); diff -r 4e1873a3f88f -r 9c11cbf114f3 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Thu Sep 25 11:44:25 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Thu Sep 25 13:54:01 2008 -0400 @@ -84,6 +84,11 @@ public class PulseAudioSourceDataLine ex } + @Override + public void open(AudioFormat format) throws LineUnavailableException { + open(format, DEFAULT_BUFFER_SIZE); + } + public byte[] native_setVolume(float value) { return stream.native_setVolume(value); } @@ -105,25 +110,25 @@ public class PulseAudioSourceDataLine ex } - protected void connectLine(int bufferSize, Stream masterStream) throws LineUnavailableException { + protected void connectLine(int bufferSize, Stream masterStream) + throws LineUnavailableException { StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( - bufferSize, bufferSize / 4, bufferSize / 8, + bufferSize, bufferSize / 4, bufferSize / 8, ((bufferSize / 10) > 100 ? bufferSize / 10 : 100), 0); - - if(masterStream != null) { - synchronized (eventLoop.threadLock) { - stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, masterStream.getStreamPointer()); + if (masterStream != null) { + synchronized (eventLoop.threadLock) { + stream.connectForPlayback(Stream.DEFAULT_DEVICE, + bufferAttributes, masterStream.getStreamPointer()); } } else { synchronized (eventLoop.threadLock) { - stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, null); - } - } - } - - + stream.connectForPlayback(Stream.DEFAULT_DEVICE, + bufferAttributes, null); + } + } + } @Override public int write(byte[] data, int offset, int length) { @@ -133,11 +138,10 @@ public class PulseAudioSourceDataLine ex throw new IllegalStateException("must call open() before write()"); } - - /*if (!isStarted) { - throw new IllegalStateException("must call start() before write()"); - }*/ - + /* + * if (!isStarted) { throw new IllegalStateException("must call start() + * before write()"); } + */ int frameSize = currentFormat.getFrameSize(); if (length % frameSize != 0) { @@ -158,15 +162,13 @@ public class PulseAudioSourceDataLine ex int sizeWritten = 0; - - boolean interrupted = false; while (remainingLength != 0) { synchronized (eventLoop.threadLock) { availableSize = stream.getWritableSize(); - + do { if (availableSize < 0) { return sizeWritten; @@ -181,29 +183,25 @@ public class PulseAudioSourceDataLine ex } } - + availableSize = stream.getWritableSize(); - //System.out.println(availableSize); - + // System.out.println(availableSize); } while (availableSize == 0); - if (availableSize > remainingLength) { availableSize = remainingLength; } /* write a little bit of the buffer */ - - stream.write(data, position, availableSize); - //System.out.println("written " + availableSize); - + + stream.write(data, position, availableSize); + // System.out.println("written " + availableSize); sizeWritten += availableSize; position += availableSize; remainingLength -= availableSize; - } - } - + } + } // all the data should have been played by now assert (sizeWritten == length); diff -r 4e1873a3f88f -r 9c11cbf114f3 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Thu Sep 25 11:44:25 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Thu Sep 25 13:54:01 2008 -0400 @@ -80,12 +80,18 @@ public class PulseAudioTargetDataLine ex super.open(format, bufferSize); currentFramePosition = 0; - + PulseAudioMixer parentMixer = PulseAudioMixer.getInstance(); parentMixer.addTargetLine(this); } - protected void connectLine(int bufferSize, Stream masterStream) throws LineUnavailableException{ + @Override + public void open(AudioFormat format) throws LineUnavailableException { + open(format, DEFAULT_BUFFER_SIZE); + } + + protected void connectLine(int bufferSize, Stream masterStream) + throws LineUnavailableException { StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( bufferSize, 0, 0, 0, bufferSize / 10); synchronized (eventLoop.threadLock) { @@ -130,7 +136,8 @@ public class PulseAudioTargetDataLine ex sizeRead += bytesRead; position += bytesRead; remainingLength -= bytesRead; - currentFramePosition += bytesRead / currentFormat.getFrameSize(); + currentFramePosition += bytesRead + / currentFormat.getFrameSize(); } } From omajid at redhat.com Fri Sep 26 08:21:26 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 26 Sep 2008 15:21:26 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-26 Omair Majid changeset bfc67049ee9f in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=bfc67049ee9f description: 2008-09-26 Omair Majid merged changes diffstat: 6 files changed, 146 insertions(+), 49 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 15 + src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 49 ++--- src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java | 9 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 5 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 21 +- unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 96 +++++++++- diffs (384 lines): diff -r 6201d96f7b94 -r bfc67049ee9f src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Thu Sep 25 14:33:45 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Sep 26 11:21:24 2008 -0400 @@ -100,7 +100,9 @@ public class PulseAudioClip extends Puls } else { synchronized (clipLock) { currentFrame = startFrame; - loopsLeft--; + if (loopsLeft != Integer.MIN_VALUE) { + loopsLeft--; + } } } @@ -192,17 +194,20 @@ public class PulseAudioClip extends Puls } - protected void connectLine(int bufferSize, Stream masterStream) throws LineUnavailableException{ + protected void connectLine(int bufferSize, Stream masterStream) + throws LineUnavailableException { StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( bufferSize, bufferSize / 2, bufferSize / 2, bufferSize / 2, 0); - if(masterStream != null) { + if (masterStream != null) { synchronized (eventLoop.threadLock) { - stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, masterStream.getStreamPointer()); + stream.connectForPlayback(Stream.DEFAULT_DEVICE, + bufferAttributes, masterStream.getStreamPointer()); } } else { synchronized (eventLoop.threadLock) { - stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, null); + stream.connectForPlayback(Stream.DEFAULT_DEVICE, + bufferAttributes, null); } } } diff -r 6201d96f7b94 -r bfc67049ee9f src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Thu Sep 25 14:33:45 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Sep 26 11:21:24 2008 -0400 @@ -77,21 +77,19 @@ public abstract class PulseAudioDataLine protected Stream stream; private ArrayList synchronizedLines; - public void open(AudioFormat format, int bufferSize) + protected void open(AudioFormat format, int bufferSize) throws LineUnavailableException { if (isOpen) { - throw new IllegalStateException("DataLine is already open"); + throw new IllegalStateException("Line is already open"); } createStream(format); - addStreamListeners(); connect(null, bufferSize); - - } - - public void createStream(AudioFormat format) + } + + private void createStream(AudioFormat format) throws LineUnavailableException { for (AudioFormat myFormat : supportedFormats) { @@ -104,7 +102,7 @@ public abstract class PulseAudioDataLine } currentFormat = format; - super.open(); + isOpen = true; } } @@ -112,11 +110,11 @@ public abstract class PulseAudioDataLine throw new IllegalArgumentException("Invalid format"); } - System.out.println("Stream " + stream + " created"); - - } - - public void addStreamListeners() { + // System.out.println("Stream " + stream + " created"); + + } + + private void addStreamListeners() { Stream.StateListener openCloseListener = new Stream.StateListener() { @Override @@ -124,7 +122,7 @@ public abstract class PulseAudioDataLine synchronized (eventLoop.threadLock) { /* - * Not the order: first we notify all the listeners, and + * Note the order: first we notify all the listeners, and * then return. this means no race conditions when the * listeners are removed before they get called by close * @@ -166,7 +164,7 @@ public abstract class PulseAudioDataLine @Override public void update() { dataWritten = false; - + if (!corked) { fireLineEvent(new LineEvent(PulseAudioDataLine.this, LineEvent.Type.STOP, AudioSystem.NOT_SPECIFIED)); @@ -214,7 +212,7 @@ public abstract class PulseAudioDataLine stream.addCorkListener(corkListener); } - public void connect(Stream masterStream, int bufferSize) + private void connect(Stream masterStream, int bufferSize) throws LineUnavailableException { try { @@ -223,9 +221,9 @@ public abstract class PulseAudioDataLine } } catch (LineUnavailableException e) { // error connecting to the server! - //stream.removePlaybackStartedListener(startedListener); - //stream.removeUnderflowListener(stoppedListener); - //stream.removeStateListener(openCloseListener); + // stream.removePlaybackStartedListener(startedListener); + // stream.removeUnderflowListener(stoppedListener); + // stream.removeStateListener(openCloseListener); stream.free(); stream = null; throw e; @@ -248,7 +246,7 @@ public abstract class PulseAudioDataLine } } - public void open(AudioFormat format) throws LineUnavailableException { + protected void open(AudioFormat format) throws LineUnavailableException { open(format, DEFAULT_BUFFER_SIZE); } @@ -333,11 +331,12 @@ public abstract class PulseAudioDataLine op.waitForCompletion(); op.releaseReference(); isStarted = true; - - /*if (dataWritten) { - fireLineEvent(new LineEvent(PulseAudioDataLine.this, - LineEvent.Type.START, AudioSystem.NOT_SPECIFIED)); - }*/ + + /* + * if (dataWritten) { fireLineEvent(new + * LineEvent(PulseAudioDataLine.this, LineEvent.Type.START, + * AudioSystem.NOT_SPECIFIED)); } + */ } diff -r 6201d96f7b94 -r bfc67049ee9f src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Thu Sep 25 14:33:45 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java Fri Sep 26 11:21:24 2008 -0400 @@ -44,7 +44,6 @@ import javax.sound.sampled.Line; import javax.sound.sampled.Line; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineListener; -import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.Control.Type; abstract class PulseAudioLine implements Line { @@ -112,13 +111,7 @@ abstract class PulseAudioLine implements return isOpen; } - @Override - public void open() throws LineUnavailableException { - /*if (isOpen) { - throw new IllegalStateException("Line is already open"); - }*/ - isOpen = true; - } + public void removeLineListener(LineListener listener) { lineListeners.remove(listener); diff -r 6201d96f7b94 -r bfc67049ee9f src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Thu Sep 25 14:33:45 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 26 11:21:24 2008 -0400 @@ -84,6 +84,11 @@ public class PulseAudioSourceDataLine ex } + @Override + public void open(AudioFormat format) throws LineUnavailableException { + open(format, DEFAULT_BUFFER_SIZE); + } + public byte[] native_setVolume(float value) { return stream.native_setVolume(value); } diff -r 6201d96f7b94 -r bfc67049ee9f src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Thu Sep 25 14:33:45 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Fri Sep 26 11:21:24 2008 -0400 @@ -80,12 +80,18 @@ public class PulseAudioTargetDataLine ex super.open(format, bufferSize); currentFramePosition = 0; - + PulseAudioMixer parentMixer = PulseAudioMixer.getInstance(); parentMixer.addTargetLine(this); } - protected void connectLine(int bufferSize, Stream masterStream) throws LineUnavailableException{ + @Override + public void open(AudioFormat format) throws LineUnavailableException { + open(format, DEFAULT_BUFFER_SIZE); + } + + protected void connectLine(int bufferSize, Stream masterStream) + throws LineUnavailableException { StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( bufferSize, 0, 0, 0, bufferSize / 10); synchronized (eventLoop.threadLock) { @@ -130,7 +136,8 @@ public class PulseAudioTargetDataLine ex sizeRead += bytesRead; position += bytesRead; remainingLength -= bytesRead; - currentFramePosition += bytesRead / currentFormat.getFrameSize(); + currentFramePosition += bytesRead + / currentFormat.getFrameSize(); } } @@ -170,7 +177,13 @@ public class PulseAudioTargetDataLine ex throw new IllegalStateException("Line must be open"); } - // FIXME how to flush a target data line + Operation operation; + synchronized (eventLoop.threadLock) { + operation = stream.flush(); + } + operation.waitForCompletion(); + operation.releaseReference(); + } public int available() { diff -r 6201d96f7b94 -r bfc67049ee9f unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Thu Sep 25 14:33:45 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Fri Sep 26 11:21:24 2008 -0400 @@ -55,7 +55,6 @@ import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; public class PulseAudioTargetDataLineTest { @@ -67,7 +66,7 @@ public class PulseAudioTargetDataLineTes int stopped = 0; AudioFormat aSupportedFormat = new AudioFormat( - AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 10, true); + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); @Before public void setUp() throws LineUnavailableException { @@ -147,6 +146,74 @@ public class PulseAudioTargetDataLineTes } @Test + public void testOpenWithFormat() throws LineUnavailableException { + System.out.println("This test checks that read() sort of wroks"); + + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + targetDataLine.open(aSupportedFormat); + + } + + @Test + public void testRead() throws LineUnavailableException { + System.out.println("This test checks that read() sort of wroks"); + + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + targetDataLine.open(aSupportedFormat); + + byte[] buffer = new byte[1000]; + for (int i = 0; i < buffer.length; i++) { + buffer[i] = 0; + } + targetDataLine.start(); + + targetDataLine.read(buffer, 0, buffer.length); + Assert.assertTrue(buffer[999] != 0); + + buffer = new byte[1000]; + for (int i = 0; i < buffer.length; i++) { + buffer[i] = 0; + } + + targetDataLine.read(buffer, 0, buffer.length - 2); + Assert.assertTrue(buffer[999] == 0); + + targetDataLine.stop(); + targetDataLine.close(); + + } + + @Test(expected = IllegalArgumentException.class) + public void testReadLessThanFrameSize() throws LineUnavailableException { + System.out.println("This test checks that read() throws an exception " + + "when not reading an integral number of frames"); + + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + AudioFormat breakingFormat = new AudioFormat( + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 2, 2, 44100f, + true); + targetDataLine.open(breakingFormat); + + byte[] buffer = new byte[1000]; + for (int i = 0; i < buffer.length; i++) { + buffer[i] = 0; + } + targetDataLine.start(); + + targetDataLine.read(buffer, 0, buffer.length - 1); + + targetDataLine.stop(); + targetDataLine.close(); + + } + + @Test public void testDrain() throws LineUnavailableException, InterruptedException { System.out @@ -193,16 +260,31 @@ public class PulseAudioTargetDataLineTes } - @Ignore - @Test - public void testFlush() { - + @Test + public void testFlush() throws LineUnavailableException { + System.out.println("This test checks that flush() wroks"); + + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + targetDataLine.open(); + + byte[] buffer = new byte[1000]; + for (int i = 0; i < buffer.length; i++) { + buffer[i] = 0; + } + targetDataLine.start(); + + targetDataLine.read(buffer, 0, buffer.length); + targetDataLine.stop(); + targetDataLine.flush(); + targetDataLine.close(); } @Test(expected = IllegalStateException.class) public void testFlushWithoutOpen() throws LineUnavailableException { System.out - .println("This test checks that drain() fails on a line not opened"); + .println("This test checks that flush() fails on a line not opened"); targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( TargetDataLine.class)); From omajid at redhat.com Fri Sep 26 08:21:26 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 26 Sep 2008 15:21:26 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-26 Omair Majid changeset d040c92fd62b in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=d040c92fd62b description: 2008-09-26 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java (flush): Implemented function. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Fixed aSupportedFormat to have a proper frame rate. (testOpenWithFormat): New function. Tests that the TargetDataLine can open with another format than the default one. (testRead): New function. Reads from the TargetDataLine and checks that the buffer was written to. (testReadLessThanFrameSize): New function. Tests that not reading an integral number of frames throws an exception. (testFlush): Implemented function. Flushes a TargetDataLine. No longer an @Ignored test. diffstat: 2 files changed, 96 insertions(+), 8 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 8 unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 96 +++++++++- diffs (150 lines): diff -r 9c11cbf114f3 -r d040c92fd62b src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Thu Sep 25 13:54:01 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Fri Sep 26 11:04:04 2008 -0400 @@ -177,7 +177,13 @@ public class PulseAudioTargetDataLine ex throw new IllegalStateException("Line must be open"); } - // FIXME how to flush a target data line + Operation operation; + synchronized (eventLoop.threadLock) { + operation = stream.flush(); + } + operation.waitForCompletion(); + operation.releaseReference(); + } public int available() { diff -r 9c11cbf114f3 -r d040c92fd62b unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Thu Sep 25 13:54:01 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Fri Sep 26 11:04:04 2008 -0400 @@ -55,7 +55,6 @@ import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; public class PulseAudioTargetDataLineTest { @@ -67,7 +66,7 @@ public class PulseAudioTargetDataLineTes int stopped = 0; AudioFormat aSupportedFormat = new AudioFormat( - AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 10, true); + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); @Before public void setUp() throws LineUnavailableException { @@ -147,6 +146,74 @@ public class PulseAudioTargetDataLineTes } @Test + public void testOpenWithFormat() throws LineUnavailableException { + System.out.println("This test checks that read() sort of wroks"); + + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + targetDataLine.open(aSupportedFormat); + + } + + @Test + public void testRead() throws LineUnavailableException { + System.out.println("This test checks that read() sort of wroks"); + + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + targetDataLine.open(aSupportedFormat); + + byte[] buffer = new byte[1000]; + for (int i = 0; i < buffer.length; i++) { + buffer[i] = 0; + } + targetDataLine.start(); + + targetDataLine.read(buffer, 0, buffer.length); + Assert.assertTrue(buffer[999] != 0); + + buffer = new byte[1000]; + for (int i = 0; i < buffer.length; i++) { + buffer[i] = 0; + } + + targetDataLine.read(buffer, 0, buffer.length - 2); + Assert.assertTrue(buffer[999] == 0); + + targetDataLine.stop(); + targetDataLine.close(); + + } + + @Test(expected = IllegalArgumentException.class) + public void testReadLessThanFrameSize() throws LineUnavailableException { + System.out.println("This test checks that read() throws an exception " + + "when not reading an integral number of frames"); + + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + AudioFormat breakingFormat = new AudioFormat( + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 2, 2, 44100f, + true); + targetDataLine.open(breakingFormat); + + byte[] buffer = new byte[1000]; + for (int i = 0; i < buffer.length; i++) { + buffer[i] = 0; + } + targetDataLine.start(); + + targetDataLine.read(buffer, 0, buffer.length - 1); + + targetDataLine.stop(); + targetDataLine.close(); + + } + + @Test public void testDrain() throws LineUnavailableException, InterruptedException { System.out @@ -193,16 +260,31 @@ public class PulseAudioTargetDataLineTes } - @Ignore - @Test - public void testFlush() { - + @Test + public void testFlush() throws LineUnavailableException { + System.out.println("This test checks that flush() wroks"); + + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + targetDataLine.open(); + + byte[] buffer = new byte[1000]; + for (int i = 0; i < buffer.length; i++) { + buffer[i] = 0; + } + targetDataLine.start(); + + targetDataLine.read(buffer, 0, buffer.length); + targetDataLine.stop(); + targetDataLine.flush(); + targetDataLine.close(); } @Test(expected = IllegalStateException.class) public void testFlushWithoutOpen() throws LineUnavailableException { System.out - .println("This test checks that drain() fails on a line not opened"); + .println("This test checks that flush() fails on a line not opened"); targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( TargetDataLine.class)); From omajid at redhat.com Fri Sep 26 08:21:26 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 26 Sep 2008 15:21:26 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-25 Omair Majid changeset 4e1873a3f88f in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=4e1873a3f88f description: 2008-09-25 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (ClipThread.run): Dont let loopsLeft wrap around when looping continuously. diffstat: 1 file changed, 10 insertions(+), 5 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 15 ++++++---- diffs (39 lines): diff -r e29a9eb84a4e -r 4e1873a3f88f src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Wed Sep 24 10:51:53 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Thu Sep 25 11:44:25 2008 -0400 @@ -100,7 +100,9 @@ public class PulseAudioClip extends Puls } else { synchronized (clipLock) { currentFrame = startFrame; - loopsLeft--; + if (loopsLeft != Integer.MIN_VALUE) { + loopsLeft--; + } } } @@ -192,17 +194,20 @@ public class PulseAudioClip extends Puls } - protected void connectLine(int bufferSize, Stream masterStream) throws LineUnavailableException{ + protected void connectLine(int bufferSize, Stream masterStream) + throws LineUnavailableException { StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( bufferSize, bufferSize / 2, bufferSize / 2, bufferSize / 2, 0); - if(masterStream != null) { + if (masterStream != null) { synchronized (eventLoop.threadLock) { - stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, masterStream.getStreamPointer()); + stream.connectForPlayback(Stream.DEFAULT_DEVICE, + bufferAttributes, masterStream.getStreamPointer()); } } else { synchronized (eventLoop.threadLock) { - stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, null); + stream.connectForPlayback(Stream.DEFAULT_DEVICE, + bufferAttributes, null); } } } From Dalibor.Topic at Sun.COM Fri Sep 26 09:30:53 2008 From: Dalibor.Topic at Sun.COM (Dalibor Topic) Date: Fri, 26 Sep 2008 18:30:53 +0200 Subject: hotspot JIT producing incorrect code -how should I report a bug? In-Reply-To: <1222426940.3266.109.camel@dijkstra.wildebeest.org> References: <4873C510.6030100@streambase.com> <4873DBBF.1020900@sun.com> <48740CBD.8060705@streambase.com> <4876805F.4030700@Sun.COM> <487E66C9.4050601@Sun.COM> <20080925215747.GA16445@gnu.wildebeest.org> <48DC115F.2050106@sun.com> <1222426940.3266.109.camel@dijkstra.wildebeest.org> Message-ID: <48DD0E3D.1040507@sun.com> Mark Wielaard wrote: > You probably cannot claim copyright on the test case itself. But I would > be surprised if when you ask the submitter to use the testcase you would > be denied that. Obviously it was submitted precisely to get you a good > testcase. I'm happy to do the asking - could you point me to the test case & the submitter? cheers, dalibor topic -- ******************************************************************* Dalibor Topic Tel: (+49 40) 23 646 738 Java F/OSS Ambassador AIM: robiladonaim Sun Microsystems GmbH Mobile: (+49 177) 2664 192 Nagelsweg 55 http://openjdk.java.net D-20097 Hamburg mailto:Dalibor.Topic at sun.com Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten Amtsgericht M?nchen: HRB 161028 Gesch?ftsf?hrer: Thomas Schr?der, Wolfgang Engels, Dr. Roland B?mer Vorsitzender des Aufsichtsrates: Martin H?ring From Joe.Darcy at Sun.COM Fri Sep 26 11:57:35 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Fri, 26 Sep 2008 11:57:35 -0700 Subject: OpenJDK 6 build 12 source posted (directaudio/alsa backend) In-Reply-To: <1222376952.3266.94.camel@dijkstra.wildebeest.org> References: <48CAB08F.6010407@sun.com> <1221402124.3542.40.camel@dijkstra.wildebeest.org> <48D7F80E.6060802@sun.com> <1222164525.3178.48.camel@dijkstra.wildebeest.org> <48D8EB31.60004@sun.com> <1222376952.3266.94.camel@dijkstra.wildebeest.org> Message-ID: <48DD309F.2000206@sun.com> Mark Wielaard wrote: > Hi Joe, > > On Tue, 2008-09-23 at 06:12 -0700, Joseph D. Darcy wrote: > >> Mark Wielaard wrote: >> >>> On Mon, 2008-09-22 at 12:54 -0700, Joseph D. Darcy wrote: >>> >>>> Mark Wielaard wrote: >>>> >>>>> Although not in your changelogs, I saw you also included two of my fixes >>>>> for the ALSA directaudio backend which I posted back in May on >>>>> sound-dev, and which are included in icedtea already. >>>>> - The sloppy open/close patch: >>>>> http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000053.html >>>>> - The ALSA native lock patch: >>>>> http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000054.html >>>>> >>>>> Although it makes some applets that use some primitive sound output work >>>>> better I never got a real response. Did you get someone from the sound >>>>> team to look at these patches? They do seem to work for me and the few >>>>> test users of those applets, but a full review by one of the sound >>>>> engineers would be appreciated. They don't seem to be in the JDK7 tree. >>>>> >>>>> >>>> No; the patches were not explicitly reviewed; Alex, please take a look >>>> at them. >>>> >>> Thanks. >>> >>> >>>> Neither Gervill nor your patches have yet been incorporated into JDK 7. >>>> >>> What is the reason for having them in JDK6, but not in JDK7? >>> >> Just no one at Sun has gotten around to doing it yet for JDK 7. >> > > Is there anything Sun specific that is needed for moving stuff between 6 > and 7? Need any help? If it comes from icedtea then Andrew has almost > certainly already created patches against 7 for icedtea7. > I believe the plan of record was to replace the JDK 7 sound engine with Gervill, as done in OpenJDK 6; that is, the encumbered sound engine would be excised from JDK 7 entirely as opposed to maintaining it for ClosedJDK builds and using Gervill for openjdk=true builds. Alex, please confirm. Thanks, -Joe From omajid at redhat.com Fri Sep 26 14:26:41 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 26 Sep 2008 21:26:41 +0000 Subject: changeset in /hg/pulseaudio: 2009-08-26 Omair Majid changeset 313b9ddd2f04 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=313b9ddd2f04 description: 2009-08-26 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Removec commented out methods. Not needed anymore since the parent class doesnt expose them either. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Removed unused variables and imports. (reconnectForSyncrhonization): Throws an exception if an error occurred instead of dumping the stack trace. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java (synchronize): Anticipate an exception being thrown from the call to reconnectForSynchronization and pass it up to the caller. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Removed unused varaibles and imports. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java (testSynchronization): New function. Tests if synchronization works. A copy of the current test in main() to prevent it from being lost if main is changed. diffstat: 5 files changed, 125 insertions(+), 61 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 14 - src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 21 -- src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java | 65 ++++--- src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 3 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java | 83 +++++++++- diffs (335 lines): diff -r bfc67049ee9f -r 313b9ddd2f04 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Sep 26 11:21:24 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Sep 26 11:51:32 2008 -0400 @@ -399,20 +399,6 @@ public class PulseAudioClip extends Puls } - // FIXME This is not exposed by the Clip interface, but becomes available if - // using PulseAudioClip - // @Override - // public void open(AudioFormat format, int bufferSize) - // throws LineUnavailableException { - // throw new IllegalArgumentException("open(AudioFormat, int) on a Clip is - // not allowed"); - // } - - @Override - // public void open(AudioFormat format) throws LineUnavailableException { - // throw new IllegalArgumentException("open(AudioFormat) on a Clip is not - // allowed"); - // } public byte[] native_setVolume(float value) { return stream.native_setVolume(value); } diff -r bfc67049ee9f -r 313b9ddd2f04 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Sep 26 11:21:24 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Sep 26 11:51:32 2008 -0400 @@ -37,7 +37,6 @@ exception statement from your version. package org.classpath.icedtea.pulseaudio; -import java.util.ArrayList; import java.util.concurrent.Semaphore; import javax.sound.sampled.AudioFormat; @@ -75,7 +74,6 @@ public abstract class PulseAudioDataLine protected EventLoop eventLoop = null; protected Semaphore semaphore = new Semaphore(0); protected Stream stream; - private ArrayList synchronizedLines; protected void open(AudioFormat format, int bufferSize) throws LineUnavailableException { @@ -283,7 +281,8 @@ public abstract class PulseAudioDataLine } - public void reconnectforSynchronization(Stream masterStream) { + public void reconnectforSynchronization(Stream masterStream) + throws LineUnavailableException { sendEvents = false; drain(); @@ -295,19 +294,11 @@ public abstract class PulseAudioDataLine } catch (InterruptedException e) { throw new RuntimeException("unable to prepare stream"); } - try { - createStream(getFormat()); - } catch (LineUnavailableException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + + createStream(getFormat()); addStreamListeners(); - try { - connect(masterStream, getBufferSize()); - } catch (LineUnavailableException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + connect(masterStream, getBufferSize()); + sendEvents = true; } diff -r bfc67049ee9f -r 313b9ddd2f04 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Fri Sep 26 11:21:24 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java Fri Sep 26 11:51:32 2008 -0400 @@ -53,7 +53,6 @@ import javax.sound.sampled.Clip; import javax.sound.sampled.Clip; import javax.sound.sampled.Control; import javax.sound.sampled.DataLine; -import javax.sound.sampled.FloatControl; import javax.sound.sampled.Line; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineListener; @@ -407,20 +406,30 @@ public class PulseAudioMixer implements break; } } - if(masterStream == null) { - //for now, can't synchronize lines if none of them is open (no stream pointer to pass) - //will see what to do about this later + if (masterStream == null) { + // for now, can't synchronize lines if none of them is open (no + // stream pointer to pass) + // will see what to do about this later throw new IllegalArgumentException(); } - - for(Line line : lines) { - if(line != masterStream) { - - ((PulseAudioDataLine) line).reconnectforSynchronization(((PulseAudioDataLine) masterStream).getStream()); - - } - } - + + try { + + for (Line line : lines) { + if (line != masterStream) { + + ((PulseAudioDataLine) line) + .reconnectforSynchronization(((PulseAudioDataLine) masterStream) + .getStream()); + + } + } + } catch (LineUnavailableException e) { + // we couldn't reconnect, so tell the user we failed by throwing an + // exception + throw new IllegalArgumentException(e); + } + } @Override @@ -466,7 +475,7 @@ public class PulseAudioMixer implements synchronized (lineListeners) { lineListeners.clear(); } - + refreshSourceAndTargetLines(); } @@ -655,7 +664,7 @@ public class PulseAudioMixer implements public static void debug(String string) { System.out.println("DEBUG: " + string); } - + public static void main(String[] args) throws Exception { Mixer.Info mixerInfos[] = AudioSystem.getMixerInfo(); Mixer.Info selectedMixerInfo = null; @@ -685,18 +694,17 @@ public class PulseAudioMixer implements line2 = (PulseAudioSourceDataLine) mixer.getLine(new Line.Info( SourceDataLine.class)); line2.setName("Line 2"); - ThreadWriter writer1 = mixer.new ThreadWriter(line1, fileName1); ThreadWriter writer2 = mixer.new ThreadWriter(line2, fileName2); - //line2.start(); - // line1.start(); - + // line2.start(); + // line1.start(); + Line[] lines = { line1, line2 }; mixer.synchronize(lines, true); - - // line2.stop(); - + + // line2.stop(); + debug("PulseAudioMixer: " + line1.getName() + " and " + line2.getName() + " synchronized"); writer1.start(); @@ -704,8 +712,8 @@ public class PulseAudioMixer implements debug("PulseAudioMixer: writers started"); line2.start(); - //line1.stop(); - //line1.start(); + // line1.stop(); + // line1.start(); debug("PulseAudioMixer: Started a line"); writer1.join(); @@ -743,8 +751,8 @@ public class PulseAudioMixer implements public void run() { debug("PulseAudioMixer: ThreadWriter: run(): entering"); - //line.start(); - //debug("PulseAudioMixer: " + line.getName() + " started"); + // line.start(); + // debug("PulseAudioMixer: " + line.getName() + " started"); byte[] abData = new byte[1000]; int bytesRead = 0; @@ -753,8 +761,9 @@ public class PulseAudioMixer implements bytesRead = audioInputStream.read(abData, 0, abData.length); if (bytesRead > 0) { line.write(abData, 0, bytesRead); - //debug("PulseAudioMixer: wrote " + bytesRead + "data on " - // + line.getName()); + // debug("PulseAudioMixer: wrote " + bytesRead + "data + // on " + // + line.getName()); } } } catch (IOException e) { diff -r bfc67049ee9f -r 313b9ddd2f04 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 26 11:21:24 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 26 11:51:32 2008 -0400 @@ -44,8 +44,6 @@ import javax.sound.sampled.LineUnavailab import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; -import org.classpath.icedtea.pulseaudio.Stream.WriteListener; - public class PulseAudioSourceDataLine extends PulseAudioDataLine implements SourceDataLine, PulseAudioPlaybackLine { @@ -53,7 +51,6 @@ public class PulseAudioSourceDataLine ex private PulseAudioVolumeControl volumeControl; private boolean muted; private float volume; - private int bytesAvailableToWrite; private long currentFramePosition = 0; diff -r bfc67049ee9f -r 313b9ddd2f04 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Fri Sep 26 11:21:24 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Fri Sep 26 11:51:32 2008 -0400 @@ -60,6 +60,7 @@ import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; public class PulseAudioSourceDataLineTest { @@ -334,7 +335,6 @@ public class PulseAudioSourceDataLineTes sourceDataLine.start(); - Thread.sleep(2000); // System.out.println("waiting for thread to finish"); @@ -980,6 +980,87 @@ public class PulseAudioSourceDataLineTes } + public static void debug(String string) { + System.out.println("DEBUG: " + string); + } + + @Ignore + @Test + public void testSynchronization() throws Exception { + Mixer.Info mixerInfos[] = AudioSystem.getMixerInfo(); + Mixer.Info selectedMixerInfo = null; + // int i = 0; + for (Mixer.Info info : mixerInfos) { + // System.out.println("Mixer Line " + i++ + ": " + info.getName() + + // " " + info.getDescription()); + if (info.getName().contains("PulseAudio")) { + selectedMixerInfo = info; + System.out.println(selectedMixerInfo); + } + } + + PulseAudioMixer mixer = (PulseAudioMixer) AudioSystem + .getMixer(selectedMixerInfo); + + mixer.open(); + + String fileName1 = "testsounds/startup.wav"; + File soundFile1 = new File(fileName1); + AudioInputStream audioInputStream1 = AudioSystem + .getAudioInputStream(soundFile1); + + PulseAudioSourceDataLine line1; + line1 = (PulseAudioSourceDataLine) mixer.getLine(new Line.Info( + SourceDataLine.class)); + line1.setName("Line 1"); + + String fileName2 = "testsounds/logout.wav"; + File soundFile = new File(fileName2); + AudioInputStream audioInputStream2 = AudioSystem + .getAudioInputStream(soundFile); + + PulseAudioSourceDataLine line2; + line2 = (PulseAudioSourceDataLine) mixer.getLine(new Line.Info( + SourceDataLine.class)); + line2.setName("Line 2"); + + ThreadWriter writer1 = new ThreadWriter(audioInputStream1, line1); + ThreadWriter writer2 = new ThreadWriter(audioInputStream2, line2); + // line2.start(); + // line1.start(); + + Line[] lines = { line1, line2 }; + mixer.synchronize(lines, true); + + // line2.stop(); + + debug("PulseAudioMixer: " + line1.getName() + " and " + line2.getName() + + " synchronized"); + writer1.start(); + writer2.start(); + + debug("PulseAudioMixer: writers started"); + line2.start(); + // line1.stop(); + // line1.start(); + debug("PulseAudioMixer: Started a line"); + + writer1.join(); + writer2.join(); + + debug("PulseAudioMixer: both lines joined"); + + line2.close(); + debug("PulseAudioMixer: " + line2.getName() + " closed"); + + line1.close(); + debug("PulseAudioMixer: " + line1.getName() + " closed"); + + mixer.close(); + debug("PulseAudioMixer: mixer closed"); + + } + @After public void tearDown() throws Exception { started = 0; From omajid at redhat.com Fri Sep 26 14:26:41 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 26 Sep 2008 21:26:41 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-26 Omair Majid changeset e0d34e48bc29 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=e0d34e48bc29 description: 2008-09-26 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java (write): Removed commented out chceck for isStarted. Initialize availableSize to 0. Reduced calls to stream.getAvailableSize. currentFramePosition is now updated on every iteration of the loop. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Fixed aSupportedFormat to have a proper frameRate. (testFindLineWithFormat): Fixed frame rate paramter in the audio format the test is looking for by using aSupportedFormat. diffstat: 2 files changed, 15 insertions(+), 21 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 25 ++++------ unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java | 11 +--- diffs (108 lines): diff -r 313b9ddd2f04 -r e0d34e48bc29 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 26 11:51:32 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 26 12:54:37 2008 -0400 @@ -135,11 +135,6 @@ public class PulseAudioSourceDataLine ex throw new IllegalStateException("must call open() before write()"); } - /* - * if (!isStarted) { throw new IllegalStateException("must call start() - * before write()"); } - */ - int frameSize = currentFormat.getFrameSize(); if (length % frameSize != 0) { throw new IllegalArgumentException( @@ -155,7 +150,7 @@ public class PulseAudioSourceDataLine ex int position = offset; int remainingLength = length; - int availableSize; + int availableSize = 0; int sizeWritten = 0; @@ -164,16 +159,17 @@ public class PulseAudioSourceDataLine ex while (remainingLength != 0) { synchronized (eventLoop.threadLock) { - availableSize = stream.getWritableSize(); do { + availableSize = stream.getWritableSize(); + if (availableSize < 0) { return sizeWritten; } if (availableSize == 0) { try { - eventLoop.threadLock.wait(100); + eventLoop.threadLock.wait(); } catch (InterruptedException e) { // ignore for now interrupted = true; @@ -181,28 +177,29 @@ public class PulseAudioSourceDataLine ex } - availableSize = stream.getWritableSize(); - // System.out.println(availableSize); - } while (availableSize == 0); if (availableSize > remainingLength) { availableSize = remainingLength; } + + // only write entire frames, so round down avialableSize to a + // multiple of frameSize + availableSize = (availableSize / frameSize) * frameSize; + /* write a little bit of the buffer */ - stream.write(data, position, availableSize); - // System.out.println("written " + availableSize); sizeWritten += availableSize; position += availableSize; remainingLength -= availableSize; + + currentFramePosition += availableSize / frameSize; } } // all the data should have been played by now assert (sizeWritten == length); - currentFramePosition += (sizeWritten / getFormat().getFrameSize()); /* * FIXME when the stream is flushed() etc, instead of returning length * this should unblock and return the the size of data written so far diff -r 313b9ddd2f04 -r e0d34e48bc29 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Fri Sep 26 11:51:32 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Fri Sep 26 12:54:37 2008 -0400 @@ -74,7 +74,7 @@ public class PulseAudioSourceDataLineTes int closed = 0; AudioFormat aSupportedFormat = new AudioFormat( - AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 10, true); + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); class ThreadWriter extends Thread { SourceDataLine line; @@ -481,12 +481,9 @@ public class PulseAudioSourceDataLineTes public void testFindLineWithFormat() throws LineUnavailableException { System.out .println("This test tries to find a line with a valid format"); - AudioFormat wantedFormat = new AudioFormat( - AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 10, true); - System.out.println(wantedFormat); - - sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( - SourceDataLine.class, wantedFormat)); + + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, aSupportedFormat)); sourceDataLine.open(); System.out.println(sourceDataLine.getFormat()); sourceDataLine.close(); From omajid at redhat.com Fri Sep 26 14:26:41 2008 From: omajid at redhat.com (Omair Majid) Date: Fri, 26 Sep 2008 21:26:41 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-26 Omair Majid changeset f29cbcfbc354 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=f29cbcfbc354 description: 2008-09-26 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Moved framesSinceOpen to parent class PulseAudioDataLine. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Added framesSinceOpen. (addStreamListeners): framesSinceOpen is now passed as the position to all LineEvents being thrown. (start): Likewise. (stop): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Renamed currentFramePosition to framesSinceOpen which moved to the parent class. (PulseAudioSourceDataLine): Renamed currentFramePosition to framesSinceOpen. (getFramePosition): Likewise. (getLongFramePosition): Likewise. (getMicrosecondPosition): Likewise. * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Renamed currentFramePosition to framesSinceOpen which moved to parent class. (open): Renamed currentFramePosition to framesSinceOpen. (read): Likewise. (getFramePosition): Likewise. (getLongFramePosition): Likewise. (getMicrosecondPosition): Likewise. (start): Pass framesSinceOpen as the frame position at which the start event occured. (stop): framesSinceOpen is now passed as the position to LineEvent being raised. diffstat: 4 files changed, 28 insertions(+), 39 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 3 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 16 ++-- src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java | 10 +- src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 38 ++++------ diffs (222 lines): diff -r e0d34e48bc29 -r f29cbcfbc354 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Sep 26 12:54:37 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Fri Sep 26 13:27:33 2008 -0400 @@ -66,9 +66,6 @@ public class PulseAudioClip extends Puls private int startFrame = 0; // the ending frame of the loop private int endFrame = 0; - - // the total number of frames played since this line was opened - private int framesSinceOpen = 0; public static final String DEFAULT_CLIP_NAME = "Clip"; diff -r e0d34e48bc29 -r f29cbcfbc354 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Sep 26 12:54:37 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Sep 26 13:27:33 2008 -0400 @@ -70,6 +70,8 @@ public abstract class PulseAudioDataLine protected boolean sendEvents = true; protected int bufferSize = 0; + // the total number of frames played since this line was opened + protected long framesSinceOpen = 0; protected EventLoop eventLoop = null; protected Semaphore semaphore = new Semaphore(0); @@ -136,8 +138,7 @@ public abstract class PulseAudioDataLine if (sendEvents) { fireLineEvent(new LineEvent( PulseAudioDataLine.this, - LineEvent.Type.OPEN, - AudioSystem.NOT_SPECIFIED)); + LineEvent.Type.OPEN, framesSinceOpen)); } semaphore.release(); @@ -146,8 +147,7 @@ public abstract class PulseAudioDataLine if (sendEvents) { fireLineEvent((new LineEvent( PulseAudioDataLine.this, - LineEvent.Type.CLOSE, - AudioSystem.NOT_SPECIFIED))); + LineEvent.Type.CLOSE, framesSinceOpen))); } semaphore.release(); @@ -165,7 +165,7 @@ public abstract class PulseAudioDataLine if (!corked) { fireLineEvent(new LineEvent(PulseAudioDataLine.this, - LineEvent.Type.STOP, AudioSystem.NOT_SPECIFIED)); + LineEvent.Type.STOP, framesSinceOpen)); } } @@ -179,7 +179,7 @@ public abstract class PulseAudioDataLine dataWritten = true; if (!corked) { fireLineEvent(new LineEvent(PulseAudioDataLine.this, - LineEvent.Type.START, AudioSystem.NOT_SPECIFIED)); + LineEvent.Type.START, framesSinceOpen)); } } @@ -326,7 +326,7 @@ public abstract class PulseAudioDataLine /* * if (dataWritten) { fireLineEvent(new * LineEvent(PulseAudioDataLine.this, LineEvent.Type.START, - * AudioSystem.NOT_SPECIFIED)); } + * framesSinceOpen)); } */ } @@ -352,7 +352,7 @@ public abstract class PulseAudioDataLine isStarted = false; if (dataWritten) { fireLineEvent(new LineEvent(PulseAudioDataLine.this, - LineEvent.Type.STOP, AudioSystem.NOT_SPECIFIED)); + LineEvent.Type.STOP, framesSinceOpen)); } isStarted = false; diff -r e0d34e48bc29 -r f29cbcfbc354 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 26 12:54:37 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java Fri Sep 26 13:27:33 2008 -0400 @@ -52,8 +52,6 @@ public class PulseAudioSourceDataLine ex private boolean muted; private float volume; - private long currentFramePosition = 0; - public PulseAudioSourceDataLine(EventLoop eventLoop, AudioFormat[] formats, AudioFormat defaultFormat) { @@ -194,7 +192,7 @@ public class PulseAudioSourceDataLine ex position += availableSize; remainingLength -= availableSize; - currentFramePosition += availableSize / frameSize; + framesSinceOpen += availableSize / frameSize; } } @@ -219,17 +217,17 @@ public class PulseAudioSourceDataLine ex }; public int getFramePosition() { - return (int) currentFramePosition; + return (int) framesSinceOpen; } public long getLongFramePosition() { - return currentFramePosition; + return framesSinceOpen; } public long getMicrosecondPosition() { float frameRate = currentFormat.getFrameRate(); - float time = currentFramePosition / frameRate; // seconds + float time = framesSinceOpen / frameRate; // seconds long microseconds = (long) (time * 1000); return microseconds; } diff -r e0d34e48bc29 -r f29cbcfbc354 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Fri Sep 26 12:54:37 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Fri Sep 26 13:27:33 2008 -0400 @@ -38,15 +38,12 @@ package org.classpath.icedtea.pulseaudio package org.classpath.icedtea.pulseaudio; import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.TargetDataLine; public class PulseAudioTargetDataLine extends PulseAudioDataLine implements TargetDataLine { - - private long currentFramePosition = 0; public PulseAudioTargetDataLine(EventLoop eventLoop, AudioFormat[] formats, AudioFormat defaultFormat) { @@ -79,7 +76,7 @@ public class PulseAudioTargetDataLine ex super.open(format, bufferSize); - currentFramePosition = 0; + framesSinceOpen = 0; PulseAudioMixer parentMixer = PulseAudioMixer.getInstance(); parentMixer.addTargetLine(this); @@ -136,8 +133,7 @@ public class PulseAudioTargetDataLine ex sizeRead += bytesRead; position += bytesRead; remainingLength -= bytesRead; - currentFramePosition += bytesRead - / currentFormat.getFrameSize(); + framesSinceOpen += bytesRead / currentFormat.getFrameSize(); } } @@ -178,12 +174,12 @@ public class PulseAudioTargetDataLine ex } Operation operation; - synchronized (eventLoop.threadLock) { - operation = stream.flush(); - } - operation.waitForCompletion(); - operation.releaseReference(); - + synchronized (eventLoop.threadLock) { + operation = stream.flush(); + } + operation.waitForCompletion(); + operation.releaseReference(); + } public int available() { @@ -197,15 +193,15 @@ public class PulseAudioTargetDataLine ex } public int getFramePosition() { - return (int) currentFramePosition; + return (int) framesSinceOpen; } public long getLongFramePosition() { - return currentFramePosition; + return framesSinceOpen; } public long getMicrosecondPosition() { - return (long) (currentFramePosition / currentFormat.getFrameRate()); + return (long) (framesSinceOpen / currentFormat.getFrameRate()); } /* @@ -218,16 +214,14 @@ public class PulseAudioTargetDataLine ex public void start() { super.start(); - fireLineEvent(new LineEvent(this, LineEvent.Type.START, - AudioSystem.NOT_SPECIFIED)); + fireLineEvent(new LineEvent(this, LineEvent.Type.START, framesSinceOpen)); } @Override public void stop() { super.stop(); - fireLineEvent(new LineEvent(this, LineEvent.Type.STOP, - AudioSystem.NOT_SPECIFIED)); - } - -} \ No newline at end of file + fireLineEvent(new LineEvent(this, LineEvent.Type.STOP, framesSinceOpen)); + } + +} From gnu_andrew at member.fsf.org Fri Sep 26 15:12:47 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Fri, 26 Sep 2008 22:12:47 +0000 Subject: changeset in /hg/icedtea: Update to b36. Message-ID: changeset d8f5772482ea in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=d8f5772482ea description: Update to b36. 2008-09-26 Andrew John Hughes * patches/icedtea-override.patch: Removed. @Override problems fixed globally. * Makefile.am: Updated to b36 and added the @Override find/perl fix discussed on list with Chris Jester-Young. * generated/java/nio/ByteBuffer.java, * generated/java/nio/CharBuffer.java, * generated/java/nio/DirectByteBuffer.java, * generated/java/nio/DirectByteBufferR.java, * generated/java/nio/DirectCharBufferRS.java, * generated/java/nio/DirectCharBufferRU.java, * generated/java/nio/DirectCharBufferS.java, * generated/java/nio/DirectCharBufferU.java, * generated/java/nio/DirectDoubleBufferRS.java, * generated/java/nio/DirectDoubleBufferRU.java, * generated/java/nio/DirectDoubleBufferS.java, * generated/java/nio/DirectDoubleBufferU.java, * generated/java/nio/DirectFloatBufferRS.java, * generated/java/nio/DirectFloatBufferRU.java, * generated/java/nio/DirectFloatBufferS.java, * generated/java/nio/DirectFloatBufferU.java, * generated/java/nio/DirectIntBufferRS.java, * generated/java/nio/DirectIntBufferRU.java, * generated/java/nio/DirectIntBufferS.java, * generated/java/nio/DirectIntBufferU.java, * generated/java/nio/DirectLongBufferRS.java, * generated/java/nio/DirectLongBufferRU.java, * generated/java/nio/DirectLongBufferS.java, * generated/java/nio/DirectLongBufferU.java, * generated/java/nio/DirectShortBufferRS.java, * generated/java/nio/DirectShortBufferRU.java, * generated/java/nio/DirectShortBufferS.java, * generated/java/nio/DirectShortBufferU.java, * generated/java/nio/DoubleBuffer.java, * generated/java/nio/FloatBuffer.java, * generated/java/nio/IntBuffer.java, * generated/java/nio/LongBuffer.java, * generated/java/nio/ShortBuffer.java, * generated/java/nio/charset/CharsetEncoder.java: Regenerated. * generated/sun/nio/ch/SocketOptionRegistry.java: Generated as a result of S4654044. * patches/icedtea-ant.patch, * patches/icedtea-override-redirect-metacity.patch: Updated against b36; a chunk in each no longer applies. diffstat: 40 files changed, 550 insertions(+), 266 deletions(-) ChangeLog | 49 +++++++++ Makefile.am | 36 +++--- generated/java/nio/ByteBuffer.java | 2 generated/java/nio/CharBuffer.java | 2 generated/java/nio/DirectByteBuffer.java | 53 ++++++---- generated/java/nio/DirectByteBufferR.java | 11 ++ generated/java/nio/DirectCharBufferRS.java | 11 ++ generated/java/nio/DirectCharBufferRU.java | 11 ++ generated/java/nio/DirectCharBufferS.java | 21 +++- generated/java/nio/DirectCharBufferU.java | 21 +++- generated/java/nio/DirectDoubleBufferRS.java | 11 ++ generated/java/nio/DirectDoubleBufferRU.java | 11 ++ generated/java/nio/DirectDoubleBufferS.java | 21 +++- generated/java/nio/DirectDoubleBufferU.java | 21 +++- generated/java/nio/DirectFloatBufferRS.java | 11 ++ generated/java/nio/DirectFloatBufferRU.java | 11 ++ generated/java/nio/DirectFloatBufferS.java | 21 +++- generated/java/nio/DirectFloatBufferU.java | 21 +++- generated/java/nio/DirectIntBufferRS.java | 11 ++ generated/java/nio/DirectIntBufferRU.java | 11 ++ generated/java/nio/DirectIntBufferS.java | 21 +++- generated/java/nio/DirectIntBufferU.java | 21 +++- generated/java/nio/DirectLongBufferRS.java | 11 ++ generated/java/nio/DirectLongBufferRU.java | 11 ++ generated/java/nio/DirectLongBufferS.java | 21 +++- generated/java/nio/DirectLongBufferU.java | 21 +++- generated/java/nio/DirectShortBufferRS.java | 11 ++ generated/java/nio/DirectShortBufferRU.java | 11 ++ generated/java/nio/DirectShortBufferS.java | 21 +++- generated/java/nio/DirectShortBufferU.java | 21 +++- generated/java/nio/DoubleBuffer.java | 2 generated/java/nio/FloatBuffer.java | 2 generated/java/nio/IntBuffer.java | 2 generated/java/nio/LongBuffer.java | 2 generated/java/nio/ShortBuffer.java | 2 generated/java/nio/charset/CharsetEncoder.java | 8 - generated/sun/nio/ch/SocketOptionRegistry.java | 83 +++++++++++++++ patches/icedtea-ant.patch | 46 +++----- patches/icedtea-override-redirect-metacity.patch | 17 --- patches/icedtea-override.patch | 115 ---------------------- diffs (truncated from 1853 to 500 lines): diff -r 031b41c24fc4 -r d8f5772482ea ChangeLog --- a/ChangeLog Sat Sep 13 03:54:24 2008 +0100 +++ b/ChangeLog Fri Sep 26 23:12:33 2008 +0100 @@ -1,3 +1,52 @@ 2008-09-13 Andrew John Hughes + + * patches/icedtea-override.patch: + Removed. @Override problems fixed globally. + * Makefile.am: + Updated to b36 and added the @Override + find/perl fix discussed on list with + Chris Jester-Young. + * generated/java/nio/ByteBuffer.java, + * generated/java/nio/CharBuffer.java, + * generated/java/nio/DirectByteBuffer.java, + * generated/java/nio/DirectByteBufferR.java, + * generated/java/nio/DirectCharBufferRS.java, + * generated/java/nio/DirectCharBufferRU.java, + * generated/java/nio/DirectCharBufferS.java, + * generated/java/nio/DirectCharBufferU.java, + * generated/java/nio/DirectDoubleBufferRS.java, + * generated/java/nio/DirectDoubleBufferRU.java, + * generated/java/nio/DirectDoubleBufferS.java, + * generated/java/nio/DirectDoubleBufferU.java, + * generated/java/nio/DirectFloatBufferRS.java, + * generated/java/nio/DirectFloatBufferRU.java, + * generated/java/nio/DirectFloatBufferS.java, + * generated/java/nio/DirectFloatBufferU.java, + * generated/java/nio/DirectIntBufferRS.java, + * generated/java/nio/DirectIntBufferRU.java, + * generated/java/nio/DirectIntBufferS.java, + * generated/java/nio/DirectIntBufferU.java, + * generated/java/nio/DirectLongBufferRS.java, + * generated/java/nio/DirectLongBufferRU.java, + * generated/java/nio/DirectLongBufferS.java, + * generated/java/nio/DirectLongBufferU.java, + * generated/java/nio/DirectShortBufferRS.java, + * generated/java/nio/DirectShortBufferRU.java, + * generated/java/nio/DirectShortBufferS.java, + * generated/java/nio/DirectShortBufferU.java, + * generated/java/nio/DoubleBuffer.java, + * generated/java/nio/FloatBuffer.java, + * generated/java/nio/IntBuffer.java, + * generated/java/nio/LongBuffer.java, + * generated/java/nio/ShortBuffer.java, + * generated/java/nio/charset/CharsetEncoder.java: + Regenerated. + * generated/sun/nio/ch/SocketOptionRegistry.java: + Generated as a result of S4654044. + * patches/icedtea-ant.patch, + * patches/icedtea-override-redirect-metacity.patch: + Updated against b36; a chunk in each no longer applies. + 2008-09-13 Andrew John Hughes * Makefile.am: Add the project name diff -r 031b41c24fc4 -r d8f5772482ea Makefile.am --- a/Makefile.am Sat Sep 13 03:54:24 2008 +0100 +++ b/Makefile.am Fri Sep 26 23:12:33 2008 +0100 @@ -1,6 +1,6 @@ OPENJDK_DATE = 11_sep_2008 -OPENJDK_DATE = 11_sep_2008 -OPENJDK_MD5SUM = 324ee7ead3c2e548a129730685815da4 -OPENJDK_VERSION = b35 +OPENJDK_DATE = 25_sep_2008 +OPENJDK_MD5SUM = 6432f04891bc0e61142a73bb8500314c +OPENJDK_VERSION = b36 CACAO_VERSION = 0.99.3 CACAO_MD5SUM = 80de3ad344c1a20c086ec5f1390bd1b8 @@ -549,7 +549,6 @@ ICEDTEA_PATCHES = \ patches/icedtea-shark-build.patch \ patches/icedtea-toolkit.patch \ patches/icedtea-security-updates.patch \ - patches/icedtea-override.patch \ patches/icedtea-constructor-properties.patch \ patches/icedtea-jsoundhs.patch \ patches/icedtea-jdk-docs-target.patch \ @@ -678,20 +677,7 @@ stamps/patch.stamp: stamps/patch-fsg.sta echo ERROR patch $${all_patches_ok} FAILED! ; \ echo WARNING make clean-patch before retrying a fix ; \ false; \ - fi ; \ - if [ -e $(abs_top_srcdir)/.hg ]; then \ - revision="-r`(cd $(srcdir); $(HG) tip|grep changeset|cut -d':' -f2|sed -r 's#\W+##')`" ; \ - fi ; \ - icedtea_version="$(PACKAGE_VERSION)$${revision}" ; \ - if test x"$(PROJECT_NAME)" != "xjdk7"; then \ - proj_suffix="-$(PROJECT_NAME)"; \ - fi ; \ - if test x"$(VERSION_SUFFIX)" != "x"; then \ - ver_suffix="-$(VERSION_SUFFIX)"; \ - fi ; \ - sed -i "s#IcedTea#IcedTea $${icedtea_version}#" openjdk/jdk/make/common/shared/Defs.gmk ; \ - sed -i "s#BUILD_VARIANT_RELEASE)#BUILD_VARIANT_RELEASE)$${proj_suffix}$${ver_suffix}#" \ - openjdk/jdk/make/common/shared/Defs.gmk + fi ; clean-patch: rm -f stamps/patch.stamp @@ -774,6 +760,20 @@ clean-patch-fsg: fi stamps/overlay.stamp: stamps/patch.stamp + if [ -e $(abs_top_srcdir)/.hg ]; then \ + revision="-r`(cd $(srcdir); $(HG) tip|grep changeset|cut -d':' -f2|sed -r 's#\W+##')`" ; \ + fi ; \ + icedtea_version="$(PACKAGE_VERSION)$${revision}" ; \ + if test x"$(PROJECT_NAME)" != "xjdk7"; then \ + proj_suffix="-$(PROJECT_NAME)"; \ + fi ; \ + if test x"$(VERSION_SUFFIX)" != "x"; then \ + ver_suffix="-$(VERSION_SUFFIX)"; \ + fi ; \ + sed -i "s#IcedTea#IcedTea $${icedtea_version}#" openjdk/jdk/make/common/shared/Defs.gmk ; \ + sed -i "s#BUILD_VARIANT_RELEASE)#BUILD_VARIANT_RELEASE)$${proj_suffix}$${ver_suffix}#" \ + openjdk/jdk/make/common/shared/Defs.gmk; \ + find openjdk -name '*.java' -exec sed -i 's/^[[:space:]]*@Override//' {} + ; \ cp -r $(abs_top_srcdir)/overlays/openjdk/* openjdk/ \ && touch stamps/overlay.stamp diff -r 031b41c24fc4 -r d8f5772482ea generated/java/nio/ByteBuffer.java --- a/generated/java/nio/ByteBuffer.java Sat Sep 13 03:54:24 2008 +0100 +++ b/generated/java/nio/ByteBuffer.java Fri Sep 26 23:12:33 2008 +0100 @@ -1061,7 +1061,7 @@ public abstract class ByteBuffer - + /** * Returns the current hash code of this buffer. diff -r 031b41c24fc4 -r d8f5772482ea generated/java/nio/CharBuffer.java --- a/generated/java/nio/CharBuffer.java Sat Sep 13 03:54:24 2008 +0100 +++ b/generated/java/nio/CharBuffer.java Fri Sep 26 23:12:33 2008 +0100 @@ -1061,7 +1061,7 @@ public abstract class CharBuffer - + /** * Returns the current hash code of this buffer. diff -r 031b41c24fc4 -r d8f5772482ea generated/java/nio/DirectByteBuffer.java --- a/generated/java/nio/DirectByteBuffer.java Sat Sep 13 03:54:24 2008 +0100 +++ b/generated/java/nio/DirectByteBuffer.java Fri Sep 26 23:12:33 2008 +0100 @@ -47,6 +47,9 @@ class DirectByteBuffer // Cached unsafe-access object protected static final Unsafe unsafe = Bits.unsafe(); + // Cached array base offset + private static final long arrayBaseOffset = (long)unsafe.arrayBaseOffset(byte[].class); + // Cached unaligned-access capability protected static final boolean unaligned = Bits.unaligned(); @@ -71,11 +74,13 @@ class DirectByteBuffer private static Unsafe unsafe = Unsafe.getUnsafe(); private long address; + private long size; private int capacity; - private Deallocator(long address, int capacity) { + private Deallocator(long address, long size, int capacity) { assert (address != 0); this.address = address; + this.size = size; this.capacity = capacity; } @@ -86,7 +91,7 @@ class DirectByteBuffer } unsafe.freeMemory(address); address = 0; - Bits.unreserveMemory(capacity); + Bits.unreserveMemory(size, capacity); } } @@ -110,23 +115,25 @@ class DirectByteBuffer DirectByteBuffer(int cap) { // package-private super(-1, 0, cap, cap, false); - Bits.reserveMemory(cap); int ps = Bits.pageSize(); + int size = cap + ps; + Bits.reserveMemory(size, cap); + long base = 0; try { - base = unsafe.allocateMemory(cap + ps); + base = unsafe.allocateMemory(size); } catch (OutOfMemoryError x) { - Bits.unreserveMemory(cap); + Bits.unreserveMemory(size, cap); throw x; } - unsafe.setMemory(base, cap + ps, (byte) 0); + unsafe.setMemory(base, size, (byte) 0); if (base % ps != 0) { // Round up to page boundary address = base + ps - (base & (ps - 1)); } else { address = base; } - cleaner = Cleaner.create(this, new Deallocator(base, cap)); + cleaner = Cleaner.create(this, new Deallocator(base, size, cap)); @@ -238,14 +245,16 @@ class DirectByteBuffer if (length > rem) throw new BufferUnderflowException(); - if (order() != ByteOrder.nativeOrder()) - Bits.copyToByteArray(ix(pos), dst, - offset << 0, - length << 0); - else - Bits.copyToByteArray(ix(pos), dst, - offset << 0, - length << 0); + + + + + + + + Bits.copyToArray(ix(pos), dst, arrayBaseOffset, + offset << 0, + length << 0); position(pos + length); } else { super.get(dst, offset, length); @@ -328,12 +337,14 @@ class DirectByteBuffer if (length > rem) throw new BufferOverflowException(); - if (order() != ByteOrder.nativeOrder()) - Bits.copyFromByteArray(src, offset << 0, - ix(pos), length << 0); - else - Bits.copyFromByteArray(src, offset << 0, - ix(pos), length << 0); + + + + + + + Bits.copyFromArray(src, arrayBaseOffset, offset << 0, + ix(pos), length << 0); position(pos + length); } else { super.put(src, offset, length); diff -r 031b41c24fc4 -r d8f5772482ea generated/java/nio/DirectByteBufferR.java --- a/generated/java/nio/DirectByteBufferR.java Sat Sep 13 03:54:24 2008 +0100 +++ b/generated/java/nio/DirectByteBufferR.java Fri Sep 26 23:12:33 2008 +0100 @@ -105,9 +105,16 @@ class DirectByteBufferR + + + + + // Primary constructor // DirectByteBufferR(int cap) { // package-private + + @@ -258,6 +265,8 @@ class DirectByteBufferR + + public ByteBuffer put(byte x) { @@ -318,6 +327,8 @@ class DirectByteBufferR } public ByteBuffer put(byte[] src, int offset, int length) { + + diff -r 031b41c24fc4 -r d8f5772482ea generated/java/nio/DirectCharBufferRS.java --- a/generated/java/nio/DirectCharBufferRS.java Sat Sep 13 03:54:24 2008 +0100 +++ b/generated/java/nio/DirectCharBufferRS.java Fri Sep 26 23:12:33 2008 +0100 @@ -159,6 +159,13 @@ class DirectCharBufferRS + + + + + + + // For duplicates and slices // DirectCharBufferRS(DirectBuffer db, // package-private @@ -258,6 +265,8 @@ class DirectCharBufferRS + + public CharBuffer put(char x) { @@ -318,6 +327,8 @@ class DirectCharBufferRS } public CharBuffer put(char[] src, int offset, int length) { + + diff -r 031b41c24fc4 -r d8f5772482ea generated/java/nio/DirectCharBufferRU.java --- a/generated/java/nio/DirectCharBufferRU.java Sat Sep 13 03:54:24 2008 +0100 +++ b/generated/java/nio/DirectCharBufferRU.java Fri Sep 26 23:12:33 2008 +0100 @@ -159,6 +159,13 @@ class DirectCharBufferRU + + + + + + + // For duplicates and slices // DirectCharBufferRU(DirectBuffer db, // package-private @@ -258,6 +265,8 @@ class DirectCharBufferRU + + public CharBuffer put(char x) { @@ -318,6 +327,8 @@ class DirectCharBufferRU } public CharBuffer put(char[] src, int offset, int length) { + + diff -r 031b41c24fc4 -r d8f5772482ea generated/java/nio/DirectCharBufferS.java --- a/generated/java/nio/DirectCharBufferS.java Sat Sep 13 03:54:24 2008 +0100 +++ b/generated/java/nio/DirectCharBufferS.java Fri Sep 26 23:12:33 2008 +0100 @@ -47,6 +47,9 @@ class DirectCharBufferS // Cached unsafe-access object protected static final Unsafe unsafe = Bits.unsafe(); + // Cached array base offset + private static final long arrayBaseOffset = (long)unsafe.arrayBaseOffset(char[].class); + // Cached unaligned-access capability protected static final boolean unaligned = Bits.unaligned(); @@ -97,7 +100,11 @@ class DirectCharBufferS + + public Cleaner cleaner() { return null; } + + @@ -238,14 +245,16 @@ class DirectCharBufferS if (length > rem) throw new BufferUnderflowException(); + if (order() != ByteOrder.nativeOrder()) Bits.copyToCharArray(ix(pos), dst, offset << 1, length << 1); else - Bits.copyToByteArray(ix(pos), dst, - offset << 1, - length << 1); + + Bits.copyToArray(ix(pos), dst, arrayBaseOffset, + offset << 1, + length << 1); position(pos + length); } else { super.get(dst, offset, length); @@ -328,12 +337,14 @@ class DirectCharBufferS if (length > rem) throw new BufferOverflowException(); + if (order() != ByteOrder.nativeOrder()) Bits.copyFromCharArray(src, offset << 1, ix(pos), length << 1); else - Bits.copyFromByteArray(src, offset << 1, - ix(pos), length << 1); + + Bits.copyFromArray(src, arrayBaseOffset, offset << 1, + ix(pos), length << 1); position(pos + length); } else { super.put(src, offset, length); diff -r 031b41c24fc4 -r d8f5772482ea generated/java/nio/DirectCharBufferU.java --- a/generated/java/nio/DirectCharBufferU.java Sat Sep 13 03:54:24 2008 +0100 +++ b/generated/java/nio/DirectCharBufferU.java Fri Sep 26 23:12:33 2008 +0100 @@ -47,6 +47,9 @@ class DirectCharBufferU // Cached unsafe-access object protected static final Unsafe unsafe = Bits.unsafe(); + // Cached array base offset + private static final long arrayBaseOffset = (long)unsafe.arrayBaseOffset(char[].class); + // Cached unaligned-access capability protected static final boolean unaligned = Bits.unaligned(); @@ -97,7 +100,11 @@ class DirectCharBufferU + + public Cleaner cleaner() { return null; } + + @@ -238,14 +245,16 @@ class DirectCharBufferU if (length > rem) throw new BufferUnderflowException(); + if (order() != ByteOrder.nativeOrder()) Bits.copyToCharArray(ix(pos), dst, offset << 1, length << 1); else - Bits.copyToByteArray(ix(pos), dst, - offset << 1, - length << 1); + + Bits.copyToArray(ix(pos), dst, arrayBaseOffset, + offset << 1, + length << 1); position(pos + length); } else { super.get(dst, offset, length); @@ -328,12 +337,14 @@ class DirectCharBufferU if (length > rem) throw new BufferOverflowException(); + if (order() != ByteOrder.nativeOrder()) Bits.copyFromCharArray(src, offset << 1, ix(pos), length << 1); else - Bits.copyFromByteArray(src, offset << 1, - ix(pos), length << 1); + + Bits.copyFromArray(src, arrayBaseOffset, offset << 1, + ix(pos), length << 1); position(pos + length); } else { super.put(src, offset, length); diff -r 031b41c24fc4 -r d8f5772482ea generated/java/nio/DirectDoubleBufferRS.java --- a/generated/java/nio/DirectDoubleBufferRS.java Sat Sep 13 03:54:24 2008 +0100 +++ b/generated/java/nio/DirectDoubleBufferRS.java Fri Sep 26 23:12:33 2008 +0100 @@ -159,6 +159,13 @@ class DirectDoubleBufferRS + + + From gnu_andrew at member.fsf.org Fri Sep 26 15:18:18 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Fri, 26 Sep 2008 23:18:18 +0100 Subject: Updated IcedTea to b36 Message-ID: <20080926221818.GA10172@rivendell.middle-earth.co.uk> $ /home/andrew/builder/icedtea/openjdk/build/linux-amd64/bin/java -version java version "1.7.0_0" IcedTea 1.8-pre-r1226 Runtime Environment (build 1.7.0_0-b36) OpenJDK 64-Bit Server VM (build 1.7.0_0-b36, mixed mode) The main issues this time were: S4640544 New I/O: Complete socket-channel functionality S6682020 Support monitoring of direct and mapped buffer usage Both these changes required re-generating the NIO files (S6682020) or generating a new file (S4640544) for the hotspot-tools part of the build. Can someone explain to me what this is for, as it seems to pull in more stuff every time? Soon we will be building half the JDK into that file... Other than that, I applied the @Override stripping discussed on list, so the icedtea-override.patch could be dropped and new issues didn't have to be patched (e.g. java.lang.Thread now includes them...sigh). ChangeLog: 2008-09-26 Andrew John Hughes * patches/icedtea-override.patch: Removed. @Override problems fixed globally. * Makefile.am: Updated to b36 and added the @Override find/perl fix discussed on list with Chris Jester-Young. * generated/java/nio/ByteBuffer.java, * generated/java/nio/CharBuffer.java, * generated/java/nio/DirectByteBuffer.java, * generated/java/nio/DirectByteBufferR.java, * generated/java/nio/DirectCharBufferRS.java, * generated/java/nio/DirectCharBufferRU.java, * generated/java/nio/DirectCharBufferS.java, * generated/java/nio/DirectCharBufferU.java, * generated/java/nio/DirectDoubleBufferRS.java, * generated/java/nio/DirectDoubleBufferRU.java, * generated/java/nio/DirectDoubleBufferS.java, * generated/java/nio/DirectDoubleBufferU.java, * generated/java/nio/DirectFloatBufferRS.java, * generated/java/nio/DirectFloatBufferRU.java, * generated/java/nio/DirectFloatBufferS.java, * generated/java/nio/DirectFloatBufferU.java, * generated/java/nio/DirectIntBufferRS.java, * generated/java/nio/DirectIntBufferRU.java, * generated/java/nio/DirectIntBufferS.java, * generated/java/nio/DirectIntBufferU.java, * generated/java/nio/DirectLongBufferRS.java, * generated/java/nio/DirectLongBufferRU.java, * generated/java/nio/DirectLongBufferS.java, * generated/java/nio/DirectLongBufferU.java, * generated/java/nio/DirectShortBufferRS.java, * generated/java/nio/DirectShortBufferRU.java, * generated/java/nio/DirectShortBufferS.java, * generated/java/nio/DirectShortBufferU.java, * generated/java/nio/DoubleBuffer.java, * generated/java/nio/FloatBuffer.java, * generated/java/nio/IntBuffer.java, * generated/java/nio/LongBuffer.java, * generated/java/nio/ShortBuffer.java, * generated/java/nio/charset/CharsetEncoder.java: Regenerated. * generated/sun/nio/ch/SocketOptionRegistry.java: Generated as a result of S4654044. * patches/icedtea-ant.patch, * patches/icedtea-override-redirect-metacity.patch: Updated against b36; a chunk in each no longer applies. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -------------- next part -------------- A non-text attachment was scrubbed... Name: b36-01.diff.gz Type: application/octet-stream Size: 7425 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080926/2a864400/b36-01.diff.gz From gnu_andrew at member.fsf.org Fri Sep 26 15:42:35 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Fri, 26 Sep 2008 23:42:35 +0100 Subject: More hotspot tests and some backported fixes In-Reply-To: <1222428052.3266.116.camel@dijkstra.wildebeest.org> References: <1222428052.3266.116.camel@dijkstra.wildebeest.org> Message-ID: <20080926224235.GB10172@rivendell.middle-earth.co.uk> On 13:20 Fri 26 Sep , Mark Wielaard wrote: > Hi, > > I noticed openjdk6 and openjdk7 seem to have a mutually exclusive set of > tests under hotspot/test/compiler. Since I believe having more tests is > a good thing I merged them in icedtea6. That uncovered two crasher bugs > in the hotspot form openjdk6 that we use. So I tracked down the fixes > for those and backported them (patches attached). All 20 tests now PASS. > > It is probably a good idea to also merge the tests from 6 to 7. But I > haven't done that yet. > > Note that again I did only backport for the hotspot from openjdk6, not > the one that zero/shark uses (7b24). > > Cheers, > > Mark > 6700047: C2 failed in idom_no_update > Summary: partial peeling shouldn't place clones into loop > > diff -r 4aebfff4f8a2 hotspot/src/share/vm/opto/loopopts.cpp > --- openjdk.orig/hotspot/src/share/vm/opto/loopopts.cpp Mon Sep 15 11:38:34 2008 +0200 > +++ openjdk/hotspot/src/share/vm/opto/loopopts.cpp Fri Sep 26 11:29:06 2008 +0200 > @@ -1865,18 +1865,19 @@ > _igvn.hash_delete(use); > use->set_req(j, n_clone); > _igvn._worklist.push(use); > + Node* use_c; > if (!use->is_Phi()) { > - Node* use_c = has_ctrl(use) ? get_ctrl(use) : use->in(0); > - set_ctrl(n_clone, use_c); > - assert(!loop->is_member(get_loop(use_c)), "should be outside loop"); > - get_loop(use_c)->_body.push(n_clone); > + use_c = has_ctrl(use) ? get_ctrl(use) : use->in(0); > } else { > // Use in a phi is considered a use in the associated predecessor block > - Node *prevbb = use->in(0)->in(j); > - set_ctrl(n_clone, prevbb); > - assert(!loop->is_member(get_loop(prevbb)), "should be outside loop"); > - get_loop(prevbb)->_body.push(n_clone); > + use_c = use->in(0)->in(j); > } > + if (use_c->is_CountedLoop()) { > + use_c = use_c->in(LoopNode::EntryControl); > + } > + set_ctrl(n_clone, use_c); > + assert(!loop->is_member(get_loop(use_c)), "should be outside loop"); > + get_loop(use_c)->_body.push(n_clone); > _igvn.register_new_node_with_optimizer(n_clone); > #if !defined(PRODUCT) > if (TracePartialPeeling) { > 6712835: Server compiler fails with assertion (loop_count < K,"infinite loop in PhaseIterGVN::transform") > > diff -r 4aebfff4f8a2 hotspot/src/share/vm/opto/ifnode.cpp > --- openjdk.orig/hotspot/src/share/vm/opto/ifnode.cpp Mon Sep 15 11:38:34 2008 +0200 > +++ openjdk/hotspot/src/share/vm/opto/ifnode.cpp Fri Sep 26 11:56:32 2008 +0200 > @@ -569,6 +569,11 @@ > int true_path = phi->is_diamond_phi(); > if( true_path == 0 ) return NULL; > > + // Make sure that iff and the control of the phi are different. This > + // should really only happen for dead control flow since it requires > + // an illegal cycle. > + if (phi->in(0)->in(1)->in(0) == iff) return NULL; > + > // phi->region->if_proj->ifnode->bool->cmp > BoolNode *bol2 = phi->in(0)->in(1)->in(0)->in(1)->as_Bool(); > > @@ -595,6 +600,7 @@ > } > > Node* new_bol = (flip ? phase->transform( bol2->negate(phase) ) : bol2); > + assert(new_bol != iff->in(1), "must make progress"); > iff->set_req(1, new_bol); > // Intervening diamond probably goes dead > phase->C->set_major_progress(); Given that the b24 patch for zero only does a partial replacement of HotSpot (the old make and test directories) remain, the work probably still applies. On this note, though, I think it best if, instead of maintaining this patch, we download the last OpenJDK7 HotSpot for a zero build and use this. This also ensures zero continues working with 7 at no extra cost. If this seems a worthwhile proposal, I'll look into it over the next few days. This would of course mean that the zero HotSpot then has all the tests and fixes found in the OpenJDK7 one, instead of using a rapidly aging snapshot (b24 is 24 weeks old, at a rough guess - there's a build drop every two weeks and we are now on 36 - so about six months...) -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From gnu_andrew at member.fsf.org Fri Sep 26 19:24:56 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Sat, 27 Sep 2008 02:24:56 +0000 Subject: changeset in /hg/icedtea: Add building of native ecj via GCJ. Message-ID: changeset 7fad5dbdf081 in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=7fad5dbdf081 description: Add building of native ecj via GCJ. 2008-09-27 Andrew John Hughes * Makefile.am: Build native ecj if GCJ is available. * acinclude.m4: Cleanup macros. * configure.ac: Cleanup macros and check for GCJ. * javac.in: Use native-ecj binary when available. diffstat: 5 files changed, 88 insertions(+), 48 deletions(-) ChangeLog | 11 +++++++++ Makefile.am | 12 +++++++++- acinclude.m4 | 67 ++++++++++++++++++++++++---------------------------------- configure.ac | 37 ++++++++++++++++++++++++++------ javac.in | 9 ++++++- diffs (470 lines): diff -r d8f5772482ea -r 7fad5dbdf081 ChangeLog --- a/ChangeLog Fri Sep 26 23:12:33 2008 +0100 +++ b/ChangeLog Sat Sep 27 03:24:44 2008 +0100 @@ -1,3 +1,14 @@ 2008-09-26 Andrew John Hughes + + * Makefile.am: + Build native ecj if GCJ is available. + * acinclude.m4: + Cleanup macros. + * configure.ac: + Cleanup macros and check for GCJ. + * javac.in: + Use native-ecj binary when available. + 2008-09-26 Andrew John Hughes * patches/icedtea-override.patch: diff -r d8f5772482ea -r 7fad5dbdf081 Makefile.am --- a/Makefile.am Fri Sep 26 23:12:33 2008 +0100 +++ b/Makefile.am Sat Sep 27 03:24:44 2008 +0100 @@ -759,7 +759,15 @@ clean-patch-fsg: echo "WARNING Not all patches reverted cleanly" ; \ fi -stamps/overlay.stamp: stamps/patch.stamp +stamps/native-ecj.stamp: stamps/patch.stamp + mkdir -p stamps ; \ + if test "x${GCJ}" != x; then \ + ${GCJ} ${CFLAGS} -Wl,-Bsymbolic -o native-ecj \ + --main=org.eclipse.jdt.internal.compiler.batch.Main ${ECJ_JAR} ; \ + fi ; \ + touch stamps/native-ecj.stamp + +stamps/overlay.stamp: stamps/native-ecj.stamp if [ -e $(abs_top_srcdir)/.hg ]; then \ revision="-r`(cd $(srcdir); $(HG) tip|grep changeset|cut -d':' -f2|sed -r 's#\W+##')`" ; \ fi ; \ @@ -1554,6 +1562,8 @@ icedtea-debug: stamps/icedtea-debug.stam icedtea-ecj: stamps/icedtea-ecj.stamp +native-ecj: stamps/native-ecj.stamp + patch-ecj: stamps/patch-ecj.stamp patch: stamps/patch.stamp diff -r d8f5772482ea -r 7fad5dbdf081 acinclude.m4 --- a/acinclude.m4 Fri Sep 26 23:12:33 2008 +0100 +++ b/acinclude.m4 Sat Sep 27 03:24:44 2008 +0100 @@ -180,7 +180,7 @@ AC_DEFUN([FIND_JAVA], AC_DEFUN([WITH_OPENJDK_SRC_DIR], [ - AC_MSG_CHECKING(openjdk sources) + AC_MSG_CHECKING(for an OpenJDK source directory) AC_ARG_WITH([openjdk-src-dir], [AS_HELP_STRING(--with-openjdk-src-dir,specify the location of the openjdk sources)], [ @@ -203,7 +203,7 @@ AC_DEFUN([FIND_ECJ_JAR], [AS_HELP_STRING(--with-ecj-jar,specify location of the ECJ jar)], [ if test -f "${withval}"; then - AC_MSG_CHECKING(ecj jar) + AC_MSG_CHECKING(for an ecj jar) ECJ_JAR="${withval}" AC_MSG_RESULT(${withval}) fi @@ -244,7 +244,7 @@ AC_DEFUN([FIND_LIBGCJ_JAR], [AS_HELP_STRING(--with-libgcj-jar,specify location of the libgcj 4.3.x jar)], [ if test -f "${withval}"; then - AC_MSG_CHECKING(libgcj jar) + AC_MSG_CHECKING(for libgcj jar) LIBGCJ_JAR="${withval}" AC_MSG_RESULT(${withval}) fi @@ -281,7 +281,7 @@ AC_DEFUN([FIND_JAVAH], [AS_HELP_STRING(--with-javah,specify location of the javah)], [ if test -f "${withval}"; then - AC_MSG_CHECKING(javah) + AC_MSG_CHECKING(for javah) JAVAH="${withval}" AC_MSG_RESULT(${withval}) else @@ -309,7 +309,7 @@ AC_DEFUN([FIND_JAR], [AS_HELP_STRING(--with-jar,specify location of the jar)], [ if test -f "${withval}"; then - AC_MSG_CHECKING(jar) + AC_MSG_CHECKING(for jar) JAR="${withval}" AC_MSG_RESULT(${withval}) else @@ -328,7 +328,7 @@ AC_DEFUN([FIND_JAR], if test -z "${JAR}"; then AC_MSG_ERROR("jar was not found.") fi - AC_MSG_CHECKING([wether jar supports @ argument]) + AC_MSG_CHECKING([whether jar supports @ argument]) touch _config.txt cat >_config.list < This patch causes ecj to be built as a native binary and used by javac in place of java and ecj.jar if GCJ is found by configure. This speeds up the build quite a bit, especially when compared with building with gij or similar. I also cleaned up a number of configure messages and added ones which were missing. Committed to IcedTea7. ChangeLog: 2008-09-27 Andrew John Hughes * Makefile.am: Build native ecj if GCJ is available. * acinclude.m4: Cleanup macros. * configure.ac: Cleanup macros and check for GCJ. * javac.in: Use native-ecj binary when available. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -------------- next part -------------- diff -r d8f5772482ea Makefile.am --- a/Makefile.am Fri Sep 26 23:12:33 2008 +0100 +++ b/Makefile.am Sat Sep 27 03:23:05 2008 +0100 @@ -759,7 +759,15 @@ echo "WARNING Not all patches reverted cleanly" ; \ fi -stamps/overlay.stamp: stamps/patch.stamp +stamps/native-ecj.stamp: stamps/patch.stamp + mkdir -p stamps ; \ + if test "x${GCJ}" != x; then \ + ${GCJ} ${CFLAGS} -Wl,-Bsymbolic -o native-ecj \ + --main=org.eclipse.jdt.internal.compiler.batch.Main ${ECJ_JAR} ; \ + fi ; \ + touch stamps/native-ecj.stamp + +stamps/overlay.stamp: stamps/native-ecj.stamp if [ -e $(abs_top_srcdir)/.hg ]; then \ revision="-r`(cd $(srcdir); $(HG) tip|grep changeset|cut -d':' -f2|sed -r 's#\W+##')`" ; \ fi ; \ @@ -1554,6 +1562,8 @@ icedtea-ecj: stamps/icedtea-ecj.stamp +native-ecj: stamps/native-ecj.stamp + patch-ecj: stamps/patch-ecj.stamp patch: stamps/patch.stamp diff -r d8f5772482ea acinclude.m4 --- a/acinclude.m4 Fri Sep 26 23:12:33 2008 +0100 +++ b/acinclude.m4 Sat Sep 27 03:23:05 2008 +0100 @@ -180,7 +180,7 @@ AC_DEFUN([WITH_OPENJDK_SRC_DIR], [ - AC_MSG_CHECKING(openjdk sources) + AC_MSG_CHECKING(for an OpenJDK source directory) AC_ARG_WITH([openjdk-src-dir], [AS_HELP_STRING(--with-openjdk-src-dir,specify the location of the openjdk sources)], [ @@ -203,7 +203,7 @@ [AS_HELP_STRING(--with-ecj-jar,specify location of the ECJ jar)], [ if test -f "${withval}"; then - AC_MSG_CHECKING(ecj jar) + AC_MSG_CHECKING(for an ecj jar) ECJ_JAR="${withval}" AC_MSG_RESULT(${withval}) fi @@ -244,7 +244,7 @@ [AS_HELP_STRING(--with-libgcj-jar,specify location of the libgcj 4.3.x jar)], [ if test -f "${withval}"; then - AC_MSG_CHECKING(libgcj jar) + AC_MSG_CHECKING(for libgcj jar) LIBGCJ_JAR="${withval}" AC_MSG_RESULT(${withval}) fi @@ -281,7 +281,7 @@ [AS_HELP_STRING(--with-javah,specify location of the javah)], [ if test -f "${withval}"; then - AC_MSG_CHECKING(javah) + AC_MSG_CHECKING(for javah) JAVAH="${withval}" AC_MSG_RESULT(${withval}) else @@ -309,7 +309,7 @@ [AS_HELP_STRING(--with-jar,specify location of the jar)], [ if test -f "${withval}"; then - AC_MSG_CHECKING(jar) + AC_MSG_CHECKING(for jar) JAR="${withval}" AC_MSG_RESULT(${withval}) else @@ -328,7 +328,7 @@ if test -z "${JAR}"; then AC_MSG_ERROR("jar was not found.") fi - AC_MSG_CHECKING([wether jar supports @ argument]) + AC_MSG_CHECKING([whether jar supports @ argument]) touch _config.txt cat >_config.list < References: <4873C510.6030100@streambase.com> <4873DBBF.1020900@sun.com> <48740CBD.8060705@streambase.com> <4876805F.4030700@Sun.COM> <487E66C9.4050601@Sun.COM> <20080925215747.GA16445@gnu.wildebeest.org> <48DC115F.2050106@sun.com> <1222426940.3266.109.camel@dijkstra.wildebeest.org> <48DD0E3D.1040507@sun.com> Message-ID: <1222516216.22140.11.camel@hermans.wildebeest.org> Hi Dalibor, On Fri, 2008-09-26 at 18:30 +0200, Dalibor Topic wrote: > Mark Wielaard wrote: > > You probably cannot claim copyright on the test case itself. But I would > > be surprised if when you ask the submitter to use the testcase you would > > be denied that. Obviously it was submitted precisely to get you a good > > testcase. > I'm happy to do the asking - could you point me to the test case & the > submitter? I think it was the intention of the submitter of the bug report. See bug #6707044, which is a stripped down test case for the upstream Lucene bug at https://issues.apache.org/jira/browse/LUCENE-1282. The test case was attached to my backport patch in my previous email as applied to IcedTea6. Cheers, Mark From mark at klomp.org Sat Sep 27 05:03:40 2008 From: mark at klomp.org (Mark Wielaard) Date: Sat, 27 Sep 2008 14:03:40 +0200 Subject: On ecj and @Override annotations for interface methods In-Reply-To: <48D8F940.40600@sun.com> References: <20080917084136.GA10250@bamboo.destinee.acro.gen.nz> <48D0C79F.1080909@redhat.com> <20080917235155.GA10355@rivendell.middle-earth.co.uk> <20080918010821.GD10250@bamboo.destinee.acro.gen.nz> <17c6771e0809180328s3aeacca4m8a3969ba2abf4c84@mail.gmail.com> <1221735243.3256.14.camel@dijkstra.wildebeest.org> <17c6771e0809180426o5483138cnd801325aa004a7ee@mail.gmail.com> <1221737607.3256.22.camel@dijkstra.wildebeest.org> <20080918113722.GG10250@bamboo.destinee.acro.gen.nz> <1221738084.3256.24.camel@dijkstra.wildebeest.org> <1221739400.3256.34.camel@dijkstra.wildebeest.org> <48D263FD.1080702@sun.com> <1221748518.3256.59.camel@dijkstra.wildebeest.org> <48D2A430.2070903@sun.com> <1222164188.3178.42.camel@dijkstra.wildebeest.org> <48D8F940.40600@sun.com> Message-ID: <1222517020.22140.19.camel@hermans.wildebeest.org> Hi Joe, On Tue, 2008-09-23 at 07:12 -0700, Joseph D. Darcy wrote: > > Are these manpages written by hand these days? It has a comment that > > says: "Generated by html2man", but it doesn't say what the original html > > file is that it was generated from. > > > The process used in the past for man pages was that the docs team works > with us developers to write the HTML man pages, which are in turn > converted to SGML and *roff for Solaris and Linux, respectively. It > looks like the last update to the HTML page, 6392810 "javac manpage > needs to be updated to include JSR 269 and other Mustang options," did > not get converted to the other formats. If the actual *nix man pages, > regardless of format, are supposed to be generated in this fashion, it > would admittedly be a better architecture to have them as generated > files during the build and not track all three versions of the man page > under version control. So if the preferred form of the for making modifications to these documents is the HTML or SGML version that the doc team maintains it would be good to get those in the openjdk tree. Does the documentation team maintain their own repository for these documents? Thanks, Mark From mark at klomp.org Sat Sep 27 04:44:29 2008 From: mark at klomp.org (Mark Wielaard) Date: Sat, 27 Sep 2008 13:44:29 +0200 Subject: OpenJDK 6 build 12 source posted (directaudio/alsa backend) In-Reply-To: <48DD309F.2000206@sun.com> References: <48CAB08F.6010407@sun.com> <1221402124.3542.40.camel@dijkstra.wildebeest.org> <48D7F80E.6060802@sun.com> <1222164525.3178.48.camel@dijkstra.wildebeest.org> <48D8EB31.60004@sun.com> <1222376952.3266.94.camel@dijkstra.wildebeest.org> <48DD309F.2000206@sun.com> Message-ID: <1222515869.22140.7.camel@hermans.wildebeest.org> Hi Joe, On Fri, 2008-09-26 at 11:57 -0700, Joseph D. Darcy wrote: > Mark Wielaard wrote: > > On Tue, 2008-09-23 at 06:12 -0700, Joseph D. Darcy wrote: > >> Mark Wielaard wrote: > >>> On Mon, 2008-09-22 at 12:54 -0700, Joseph D. Darcy wrote: > >>>> Neither Gervill nor your patches have yet been incorporated into JDK 7. > >>>> > >>> What is the reason for having them in JDK6, but not in JDK7? > >>> > >> Just no one at Sun has gotten around to doing it yet for JDK 7. > > > > Is there anything Sun specific that is needed for moving stuff between 6 > > and 7? Need any help? If it comes from icedtea then Andrew has almost > > certainly already created patches against 7 for icedtea7. > > I believe the plan of record was to replace the JDK 7 sound engine with > Gervill, as done in OpenJDK 6; that is, the encumbered sound engine > would be excised from JDK 7 entirely as opposed to maintaining it for > ClosedJDK builds and using Gervill for openjdk=true builds. It would be nice to see the ClosedJDK part entirely disappear from OpenJDK7. That will certainly make the build system simpler. What is the plan for OpenJDK6? Will ClosedJDK6 and OpenKJDK6 be build from the same tree in the near future? Or will OpenJDK6 just remove the support for the "binary plugs" and make ClosedJDK6 a complete fork build from its own internal Sun tree? Cheers, Mark From mark at klomp.org Sat Sep 27 05:13:43 2008 From: mark at klomp.org (Mark Wielaard) Date: Sat, 27 Sep 2008 14:13:43 +0200 Subject: mercurial notifications In-Reply-To: <1222346736.3266.70.camel@dijkstra.wildebeest.org> References: <17c6771e0808291839y2a26b031pd4cb226c8facb51c@mail.gmail.com> <1220193060.3524.12.camel@hermans.wildebeest.org> <17c6771e0808311301x7c7281a5od6ae9a8cbc35084a@mail.gmail.com> <1222346736.3266.70.camel@dijkstra.wildebeest.org> Message-ID: <1222517623.22140.28.camel@hermans.wildebeest.org> Hi all, On Thu, 2008-09-25 at 14:45 +0200, Mark Wielaard wrote: > On Sun, 2008-08-31 at 21:01 +0100, Andrew John Hughes wrote: > > On 31/08/2008, Mark Wielaard wrote: > > > You managed to push this without generating a commit message. I cannot > > > figure out why that is. Do you have any idea how you got this commit in > > > "under the hgext.notify radar"? > > > > > Something is broken: > > > > remote: added 1 changesets with 2 changes to 2 files > > remote: error: incoming.notify hook raised an exception: cannot > > concatenate 'str' and 'NoneType' objects We finally found it! The issue is when your hgrc doesn't contain an email address. So please make sure that your ~/.hgrc contains at least the following: ### --- User interface [ui] ### username data to appear in comits ### it usually takes the form: Joe User username = My FullName If for some reason you need your global ~/.hgrc to contain something else than your full name then add this to your project specific hgrc: icedtea/.hg/hgrc icedtea6/.hg/hgrc icepick/.hg/hgrc pulseaudio/.hg/hgrc etc. That way your commits will always have a full name plus the email address added. Which will then be used to send to notification emails to the mailinglist. Thanks, Mark From Kelly.Ohair at Sun.COM Sat Sep 27 13:27:55 2008 From: Kelly.Ohair at Sun.COM (Kelly O'Hair) Date: Sat, 27 Sep 2008 13:27:55 -0700 Subject: mercurial notifications In-Reply-To: <1222517623.22140.28.camel@hermans.wildebeest.org> References: <17c6771e0808291839y2a26b031pd4cb226c8facb51c@mail.gmail.com> <1220193060.3524.12.camel@hermans.wildebeest.org> <17c6771e0808311301x7c7281a5od6ae9a8cbc35084a@mail.gmail.com> <1222346736.3266.70.camel@dijkstra.wildebeest.org> <1222517623.22140.28.camel@hermans.wildebeest.org> Message-ID: <48DE974B.7010006@sun.com> Humm... Anything in the [ui] username will be put into any changesets created by that user (e.g. hg commit or hg tag), verbatim, as a permanent record. In the OpenJDK project we insisted on people setting username to the OpenJDK name that you registered as, and ONLY that name. We were concerned about email addresses getting buried in the changesets and providing too much of a source of valid email addresses for spambots. Does the [email] settings not work? e.g. [email] from = your at email.address Seems like it should. -kto Mark Wielaard wrote: > Hi all, > > On Thu, 2008-09-25 at 14:45 +0200, Mark Wielaard wrote: >> On Sun, 2008-08-31 at 21:01 +0100, Andrew John Hughes wrote: >>> On 31/08/2008, Mark Wielaard wrote: >>>> You managed to push this without generating a commit message. I cannot >>>> figure out why that is. Do you have any idea how you got this commit in >>>> "under the hgext.notify radar"? >>>> >>> Something is broken: >>> >>> remote: added 1 changesets with 2 changes to 2 files >>> remote: error: incoming.notify hook raised an exception: cannot >>> concatenate 'str' and 'NoneType' objects > > We finally found it! > The issue is when your hgrc doesn't contain an email address. > So please make sure that your ~/.hgrc contains at least the following: > > ### --- User interface > [ui] > ### username data to appear in comits > ### it usually takes the form: Joe User > username = My FullName > > If for some reason you need your global ~/.hgrc to contain something > else than your full name then add this to your project specific hgrc: > icedtea/.hg/hgrc > icedtea6/.hg/hgrc > icepick/.hg/hgrc > pulseaudio/.hg/hgrc > etc. > > That way your commits will always have a full name plus the email > address added. Which will then be used to send to notification emails to > the mailinglist. > > Thanks, > > Mark > From gnu_andrew at member.fsf.org Sat Sep 27 16:46:37 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Sun, 28 Sep 2008 00:46:37 +0100 Subject: mercurial notifications In-Reply-To: <1222517623.22140.28.camel@hermans.wildebeest.org> References: <17c6771e0808291839y2a26b031pd4cb226c8facb51c@mail.gmail.com> <1220193060.3524.12.camel@hermans.wildebeest.org> <17c6771e0808311301x7c7281a5od6ae9a8cbc35084a@mail.gmail.com> <1222346736.3266.70.camel@dijkstra.wildebeest.org> <1222517623.22140.28.camel@hermans.wildebeest.org> Message-ID: <17c6771e0809271646i7fa7b14dq2f84c85df1566795@mail.gmail.com> 2008/9/27 Mark Wielaard : > Hi all, > > On Thu, 2008-09-25 at 14:45 +0200, Mark Wielaard wrote: >> On Sun, 2008-08-31 at 21:01 +0100, Andrew John Hughes wrote: >> > On 31/08/2008, Mark Wielaard wrote: >> > > You managed to push this without generating a commit message. I cannot >> > > figure out why that is. Do you have any idea how you got this commit in >> > > "under the hgext.notify radar"? >> > > >> > Something is broken: >> > >> > remote: added 1 changesets with 2 changes to 2 files >> > remote: error: incoming.notify hook raised an exception: cannot >> > concatenate 'str' and 'NoneType' objects > > We finally found it! > The issue is when your hgrc doesn't contain an email address. > So please make sure that your ~/.hgrc contains at least the following: > > ### --- User interface > [ui] > ### username data to appear in comits > ### it usually takes the form: Joe User > username = My FullName > > If for some reason you need your global ~/.hgrc to contain something > else than your full name then add this to your project specific hgrc: > icedtea/.hg/hgrc > icedtea6/.hg/hgrc > icepick/.hg/hgrc > pulseaudio/.hg/hgrc > etc. > > That way your commits will always have a full name plus the email > address added. Which will then be used to send to notification emails to > the mailinglist. > > Thanks, > > Mark > > Yes as you'll have noticed my commits now come through since setting this in icedtea6/.hg/hgrc. -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From mark at klomp.org Sun Sep 28 01:29:38 2008 From: mark at klomp.org (Mark Wielaard) Date: Sun, 28 Sep 2008 10:29:38 +0200 Subject: mercurial notifications In-Reply-To: <48DE974B.7010006@sun.com> References: <17c6771e0808291839y2a26b031pd4cb226c8facb51c@mail.gmail.com> <1220193060.3524.12.camel@hermans.wildebeest.org> <17c6771e0808311301x7c7281a5od6ae9a8cbc35084a@mail.gmail.com> <1222346736.3266.70.camel@dijkstra.wildebeest.org> <1222517623.22140.28.camel@hermans.wildebeest.org> <48DE974B.7010006@sun.com> Message-ID: <1222590578.3236.10.camel@hermans.wildebeest.org> Hi Kelly, On Sat, 2008-09-27 at 13:27 -0700, Kelly O'Hair wrote: > Anything in the [ui] username will be put into any changesets created > by that user (e.g. hg commit or hg tag), verbatim, as a permanent record. > In the OpenJDK project we insisted on people setting username to the > OpenJDK name that you registered as, and ONLY that name. I assumed this was an old leftover from the time that development was centralized. Now that development is done in the open, with multiple parties and using a distributed source code management system it seems somewhat odd to introduce a naming scheme for developers that is centralized again. Also since there is no ChangeLog file in the various openjdk repositories it is harder to see who really made a change if someone isn't using their full name and email address. Personally I have found it pretty hard to only have these handles without any other identifying information in the commit messages. People do have names :) And having contact information for changesets is a good thing imho. > Does the [email] settings not work? e.g. > > [email] > from = your at email.address > > Seems like it should. Maybe we can get the notify extension to use that locally. But that still doesn't give you the full name and email address of the person actually having done the commit into the repository that the extension is monitoring. If the information isn't put into the commit message it is essentially lost and cannot easily be recovered when moving patch sets between repos. Cheers, Mark From gnu_andrew at member.fsf.org Sun Sep 28 14:25:27 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Sun, 28 Sep 2008 22:25:27 +0100 Subject: preparing a icedtea-1.3 release? In-Reply-To: <1222636644.3271.10.camel@dijkstra.wildebeest.org> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> Message-ID: <20080928212527.GA7083@rivendell.middle-earth.co.uk> On 23:17 Sun 28 Sep , Mark Wielaard wrote: > Hi, > > On Sun, 2008-09-28 at 17:48 +0200, Matthias Klose wrote: > > The last icedtea release 1.2 (bases on b09) was four months ago. I would like to > > prepare a 1.3 release based ob b12. are there currently outstanding issues? > > Good idea. There have been lots of improvements since the last official > 1.2 release. Including various security and crasher issues, that we > really should make sure are picked up by the various distros. > Lillian already mentioned she is working on this in her blog. http://langel.wordpress.com/2008/09/24/women-in-foss/ This really should have been sent to distro-pkg-dev as well. > > - general? > > I would like to get the better version reporting in that you and andrew > suggested. Andrew already has something in icedtea[7]. > With 7 it currently gives: java version "1.7.0_0" IcedTea 1.8-pre-r1226 Runtime Environment (build 1.7.0_0-b36) OpenJDK 64-Bit Server VM (build 1.7.0_0-b36, mixed mode) Releases built from a tarball would simplify to just IcedTea 1.8 (for example). The revision is automatically picked up if the source directory is a Mercurial repository, and the other part is taken from configure. The other related patch adds support for a custom version tag giving: $ java -version java version "1.6.0-gentoo" IcedTea6 1.2 Runtime Environment (build 1.6.0-gentoo-b09) OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode) (I applied the patch to the Gentoo ebuilds for IcedTea6) IcedTea6, unlike IcedTea7, seems to have dropped using IcedTea at all in favour of OpenJDK, which I feel is confusing, given we are patching the resulting build so much. > > - cacao? > > - icedtea plugin? > > - zero/shark? > > Lets make sure that cacao and zero/shark are synced and the default > configure options set. Deepak, do you feel the liveconnect/icedteaplugin > support is ready for being enabled by default? > Would be nice if twisti released his latest stuff so the build was against 0.99.4 or whatever. I believe he has some related fixes. > > If possible I aim for a release candidate for the next weekend and for a final > > release in about two weeks. > > I'll work on some release notes to summarize all the new stuff. > As I've said before, I'll merge and follow this with a 1.8 for IcedTea7. It would be nice to get the NIO support in before this. > Cheers, > > Mark > Cheers, -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From doko at ubuntu.com Sun Sep 28 14:53:13 2008 From: doko at ubuntu.com (Matthias Klose) Date: Sun, 28 Sep 2008 23:53:13 +0200 Subject: preparing a icedtea-1.3 release? In-Reply-To: <20080928212527.GA7083@rivendell.middle-earth.co.uk> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <20080928212527.GA7083@rivendell.middle-earth.co.uk> Message-ID: <48DFFCC9.3010907@ubuntu.com> Andrew John Hughes schrieb: > On 23:17 Sun 28 Sep , Mark Wielaard wrote: > xxx already mentioned she is working on this in her blog. > > This really should have been sent to distro-pkg-dev as well. it would be nice if this ml would be enough to follow openjdk/ icedtea packaging, without having to follow N blogs. but maybe I'm old fashioned ... anyway, it's good to see that other people think about a release as well :) Matthias From mark at klomp.org Sun Sep 28 15:08:12 2008 From: mark at klomp.org (Mark Wielaard) Date: Mon, 29 Sep 2008 00:08:12 +0200 Subject: preparing a icedtea-1.3 release? In-Reply-To: <20080928212527.GA7083@rivendell.middle-earth.co.uk> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <20080928212527.GA7083@rivendell.middle-earth.co.uk> Message-ID: <1222639692.3271.48.camel@dijkstra.wildebeest.org> Hi Andrew, On Sun, 2008-09-28 at 22:25 +0100, Andrew John Hughes wrote: > > I would like to get the better version reporting in that you and andrew > > suggested. Andrew already has something in icedtea[7]. > > > With 7 it currently gives: > > java version "1.7.0_0" > IcedTea 1.8-pre-r1226 Runtime Environment (build 1.7.0_0-b36) > OpenJDK 64-Bit Server VM (build 1.7.0_0-b36, mixed mode) > > Releases built from a tarball would simplify to just IcedTea 1.8 (for example). > The revision is automatically picked up if the source directory is a Mercurial > repository, and the other part is taken from configure. > > The other related patch adds support for a custom version tag giving: > > $ java -version > java version "1.6.0-gentoo" > IcedTea6 1.2 Runtime Environment (build 1.6.0-gentoo-b09) > OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode) > > (I applied the patch to the Gentoo ebuilds for IcedTea6) > > IcedTea6, unlike IcedTea7, seems to have dropped using IcedTea at all > in favour of OpenJDK, which I feel is confusing, given we are patching > the resulting build so much. Yes, we need the extra version/name to avoid confusion and to get better bug reports. There has been some confusion in the past because a) we reused the bxx number for different releases and b) a distro might have backported a patch already. Cheers, Mark From gnu_andrew at member.fsf.org Sun Sep 28 15:16:34 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Sun, 28 Sep 2008 23:16:34 +0100 Subject: preparing a icedtea-1.3 release? In-Reply-To: <48DFFCC9.3010907@ubuntu.com> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <20080928212527.GA7083@rivendell.middle-earth.co.uk> <48DFFCC9.3010907@ubuntu.com> Message-ID: <20080928221634.GA6795@rivendell.middle-earth.co.uk> On 23:53 Sun 28 Sep , Matthias Klose wrote: > Andrew John Hughes schrieb: > > On 23:17 Sun 28 Sep , Mark Wielaard wrote: > > xxx already mentioned she is working on this in her blog. > > > > This really should have been sent to distro-pkg-dev as well. > > > it would be nice if this ml would be enough to follow openjdk/ > icedtea packaging, without having to follow N blogs. but maybe > I'm old fashioned ... > > > anyway, it's good to see that other people think about a release as well :) > > Matthias I mentioned it precisely because there are so many lists. distro-pkg-dev is the older list and has traditionally been used for IcedTea discussion. Not having this discussion involve that list may miss a number of people, especially as IcedTea is not just concerned with the OpenJDK6 tree. FWIW, distro-pkg-dev should be enough to follow OpenJDK/IcedTea packaging. jdk6-dev has only really been used for announcing new build drops and discussion thereof. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From doko at ubuntu.com Sun Sep 28 15:22:42 2008 From: doko at ubuntu.com (Matthias Klose) Date: Mon, 29 Sep 2008 00:22:42 +0200 Subject: preparing a icedtea-1.3 release? In-Reply-To: <20080928221634.GA6795@rivendell.middle-earth.co.uk> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <20080928212527.GA7083@rivendell.middle-earth.co.uk> <48DFFCC9.3010907@ubuntu.com> <20080928221634.GA6795@rivendell.middle-earth.co.uk> Message-ID: <48E003B2.5020402@ubuntu.com> Andrew John Hughes schrieb: > On 23:53 Sun 28 Sep , Matthias Klose wrote: >> Andrew John Hughes schrieb: >>> On 23:17 Sun 28 Sep , Mark Wielaard wrote: >>> xxx already mentioned she is working on this in her blog. >>> >>> This really should have been sent to distro-pkg-dev as well. >> >> it would be nice if this ml would be enough to follow openjdk/ >> icedtea packaging, without having to follow N blogs. but maybe >> I'm old fashioned ... >> >> >> anyway, it's good to see that other people think about a release as well :) >> >> Matthias > > I mentioned it precisely because there are so many lists. > distro-pkg-dev is the older list and has traditionally been used for > IcedTea discussion. Not having this discussion involve that list may > miss a number of people, especially as IcedTea is not just concerned > with the OpenJDK6 tree. FWIW, distro-pkg-dev should be enough to > follow OpenJDK/IcedTea packaging. jdk6-dev has only really been used > for announcing new build drops and discussion thereof. agreed, my mistake. did choose the wrong list, but at least I didn't blog =) Matthias From Joe.Darcy at Sun.COM Sun Sep 28 16:12:23 2008 From: Joe.Darcy at Sun.COM (Joseph D. Darcy) Date: Sun, 28 Sep 2008 16:12:23 -0700 Subject: OpenJDK 6 build 12 source posted (directaudio/alsa backend) In-Reply-To: <1222515869.22140.7.camel@hermans.wildebeest.org> References: <48CAB08F.6010407@sun.com> <1221402124.3542.40.camel@dijkstra.wildebeest.org> <48D7F80E.6060802@sun.com> <1222164525.3178.48.camel@dijkstra.wildebeest.org> <48D8EB31.60004@sun.com> <1222376952.3266.94.camel@dijkstra.wildebeest.org> <48DD309F.2000206@sun.com> <1222515869.22140.7.camel@hermans.wildebeest.org> Message-ID: <48E00F57.6000100@sun.com> Hello Mark. Mark Wielaard wrote: > Hi Joe, > > On Fri, 2008-09-26 at 11:57 -0700, Joseph D. Darcy wrote: > >> Mark Wielaard wrote: >> >>> On Tue, 2008-09-23 at 06:12 -0700, Joseph D. Darcy wrote: >>> >>>> Mark Wielaard wrote: >>>> >>>>> On Mon, 2008-09-22 at 12:54 -0700, Joseph D. Darcy wrote: >>>>> >>>>>> Neither Gervill nor your patches have yet been incorporated into JDK 7. >>>>>> >>>>>> >>>>> What is the reason for having them in JDK6, but not in JDK7? >>>>> >>>>> >>>> Just no one at Sun has gotten around to doing it yet for JDK 7. >>>> >>> Is there anything Sun specific that is needed for moving stuff between 6 >>> and 7? Need any help? If it comes from icedtea then Andrew has almost >>> certainly already created patches against 7 for icedtea7. >>> >> I believe the plan of record was to replace the JDK 7 sound engine with >> Gervill, as done in OpenJDK 6; that is, the encumbered sound engine >> would be excised from JDK 7 entirely as opposed to maintaining it for >> ClosedJDK builds and using Gervill for openjdk=true builds. >> > > It would be nice to see the ClosedJDK part entirely disappear from > OpenJDK7. That will certainly make the build system simpler. > It would certainly be simpler; I think the closed sound code can go away, but other differences will probably remain, at least for a while. > What is the plan for OpenJDK6? Will ClosedJDK6 and OpenKJDK6 be build > from the same tree in the near future? Or will OpenJDK6 just remove the > support for the "binary plugs" and make ClosedJDK6 a complete fork build > from its own internal Sun tree? > > The current situation is that the OpenJDK 6 code base and the "ClosedJDK 6" code base used for the update releases are much more similar in some areas than others. The last common point for both releases is the JDK 6 first-ship code base (since OpenJDK 6 branched off of a JDK 7 build). However, after my recent bug porting efforts for OpenJDK 6 b12, some areas of the logical forest (jaxp, jaxws, corba) are all but identical and certain kinds of bug fixes, including security bugs, have been applied to both trains. (For the morbidly curious, I'm planning a blog post on the logistics of my recent bug porting effort.) I've been working internally to figure out a plan for maintaining OpenJDK 6 and ClosedJDK 6 in parallel; I'll post to the list when I have something definitive to say. For OpenJDK 6 proper, I certainly want to resolve the few remaining JCK issues and remove the lone remaining binary plug for SNMP. -Joe From gnu_andrew at member.fsf.org Sun Sep 28 16:46:17 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 29 Sep 2008 00:46:17 +0100 Subject: preparing a icedtea-1.3 release? In-Reply-To: <1222639692.3271.48.camel@dijkstra.wildebeest.org> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <20080928212527.GA7083@rivendell.middle-earth.co.uk> <1222639692.3271.48.camel@dijkstra.wildebeest.org> Message-ID: <20080928234617.GB6795@rivendell.middle-earth.co.uk> On 00:08 Mon 29 Sep , Mark Wielaard wrote: > Hi Andrew, > > On Sun, 2008-09-28 at 22:25 +0100, Andrew John Hughes wrote: > > > I would like to get the better version reporting in that you and andrew > > > suggested. Andrew already has something in icedtea[7]. > > > > > With 7 it currently gives: > > > > java version "1.7.0_0" > > IcedTea 1.8-pre-r1226 Runtime Environment (build 1.7.0_0-b36) > > OpenJDK 64-Bit Server VM (build 1.7.0_0-b36, mixed mode) > > > > Releases built from a tarball would simplify to just IcedTea 1.8 (for example). > > The revision is automatically picked up if the source directory is a Mercurial > > repository, and the other part is taken from configure. > > > > The other related patch adds support for a custom version tag giving: > > > > $ java -version > > java version "1.6.0-gentoo" > > IcedTea6 1.2 Runtime Environment (build 1.6.0-gentoo-b09) > > OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode) > > > > (I applied the patch to the Gentoo ebuilds for IcedTea6) > > > > IcedTea6, unlike IcedTea7, seems to have dropped using IcedTea at all > > in favour of OpenJDK, which I feel is confusing, given we are patching > > the resulting build so much. > > Yes, we need the extra version/name to avoid confusion and to get better > bug reports. There has been some confusion in the past because a) we > reused the bxx number for different releases and b) a distro might have > backported a patch already. > > Cheers, > > Mark > Yes, this is exactly what I considered when writing the patches. I posted the output here so people could discuss the results and any problems before we commit this to the IcedTea6 tree as well. Including the Mercurial revision gives us a version of IcedTea down to the commit. I would suggest that distros and the like adding changes beyond what's in the repository or a particular released version add an additional tag (e.g. 'gentoo' above) so we at least know we are not working with a vanilla IcedTea install. Both concepts have been common practice with GCC for some time AFAIK. $ gcc --version gcc (Gentoo 4.3.9999 p1.1) 4.3.3 20080924 (prerelease) $ /home/andrew/build/gcj/bin/gcc --version gcc (GCC) 4.4.0 20080913 (experimental) [gcj/classpath-098-merge-branch revision 140651] -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From doko at ubuntu.com Sun Sep 28 17:07:48 2008 From: doko at ubuntu.com (Matthias Klose) Date: Mon, 29 Sep 2008 02:07:48 +0200 Subject: preparing a icedtea-1.3 release? In-Reply-To: <20080928234617.GB6795@rivendell.middle-earth.co.uk> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <20080928212527.GA7083@rivendell.middle-earth.co.uk> <1222639692.3271.48.camel@dijkstra.wildebeest.org> <20080928234617.GB6795@rivendell.middle-earth.co.uk> Message-ID: <48E01C54.50600@ubuntu.com> Andrew John Hughes schrieb: > On 00:08 Mon 29 Sep , Mark Wielaard wrote: >> Hi Andrew, >> >> On Sun, 2008-09-28 at 22:25 +0100, Andrew John Hughes wrote: >>>> I would like to get the better version reporting in that you and andrew >>>> suggested. Andrew already has something in icedtea[7]. >>>> >>> With 7 it currently gives: >>> >>> java version "1.7.0_0" >>> IcedTea 1.8-pre-r1226 Runtime Environment (build 1.7.0_0-b36) >>> OpenJDK 64-Bit Server VM (build 1.7.0_0-b36, mixed mode) >>> >>> Releases built from a tarball would simplify to just IcedTea 1.8 (for example). >>> The revision is automatically picked up if the source directory is a Mercurial >>> repository, and the other part is taken from configure. >>> >>> The other related patch adds support for a custom version tag giving: >>> >>> $ java -version >>> java version "1.6.0-gentoo" >>> IcedTea6 1.2 Runtime Environment (build 1.6.0-gentoo-b09) >>> OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode) >>> >>> (I applied the patch to the Gentoo ebuilds for IcedTea6) >>> >>> IcedTea6, unlike IcedTea7, seems to have dropped using IcedTea at all >>> in favour of OpenJDK, which I feel is confusing, given we are patching >>> the resulting build so much. >> Yes, we need the extra version/name to avoid confusion and to get better >> bug reports. There has been some confusion in the past because a) we >> reused the bxx number for different releases and b) a distro might have >> backported a patch already. >> >> Cheers, >> >> Mark >> > > Yes, this is exactly what I considered when writing the patches. I > posted the output here so people could discuss the results and any > problems before we commit this to the IcedTea6 tree as well. > > Including the Mercurial revision gives us a version of IcedTea down to > the commit. I would suggest that distros and the like adding changes beyond > what's in the repository or a particular released version add an additional > tag (e.g. 'gentoo' above) so we at least know we are not working with a > vanilla IcedTea install. usually the vcs repository is not included in the source upload. relying on anything but a checkout would be bad. Note that gcc does explicitely check in such information (DATE) or does update this information (LAST_UPDATED, via contrib/gcc_update). > Both concepts have been common practice with GCC for some time AFAIK. > > $ gcc --version > gcc (Gentoo 4.3.9999 p1.1) 4.3.3 20080924 (prerelease) > > $ /home/andrew/build/gcj/bin/gcc --version > gcc (GCC) 4.4.0 20080913 (experimental) [gcj/classpath-098-merge-branch revision 140651] How to include this? "Gentoo 4.3.9999 p1.1" is the package version as uploaded. My question was how to include this package version string such it is displayed in the version information and in the hs_log* files (including any epoch version in the packaging). Matthias From gnu_andrew at member.fsf.org Sun Sep 28 19:30:47 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 29 Sep 2008 03:30:47 +0100 Subject: preparing a icedtea-1.3 release? In-Reply-To: <48E01C54.50600@ubuntu.com> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <20080928212527.GA7083@rivendell.middle-earth.co.uk> <1222639692.3271.48.camel@dijkstra.wildebeest.org> <20080928234617.GB6795@rivendell.middle-earth.co.uk> <48E01C54.50600@ubuntu.com> Message-ID: <20080929023047.GA24922@rivendell.middle-earth.co.uk> On 02:07 Mon 29 Sep , Matthias Klose wrote: > Andrew John Hughes schrieb: > > On 00:08 Mon 29 Sep , Mark Wielaard wrote: > >> Hi Andrew, > >> > >> On Sun, 2008-09-28 at 22:25 +0100, Andrew John Hughes wrote: > >>>> I would like to get the better version reporting in that you and andrew > >>>> suggested. Andrew already has something in icedtea[7]. > >>>> > >>> With 7 it currently gives: > >>> > >>> java version "1.7.0_0" > >>> IcedTea 1.8-pre-r1226 Runtime Environment (build 1.7.0_0-b36) > >>> OpenJDK 64-Bit Server VM (build 1.7.0_0-b36, mixed mode) > >>> > >>> Releases built from a tarball would simplify to just IcedTea 1.8 (for example). > >>> The revision is automatically picked up if the source directory is a Mercurial > >>> repository, and the other part is taken from configure. > >>> > >>> The other related patch adds support for a custom version tag giving: > >>> > >>> $ java -version > >>> java version "1.6.0-gentoo" > >>> IcedTea6 1.2 Runtime Environment (build 1.6.0-gentoo-b09) > >>> OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode) > >>> > >>> (I applied the patch to the Gentoo ebuilds for IcedTea6) > >>> > >>> IcedTea6, unlike IcedTea7, seems to have dropped using IcedTea at all > >>> in favour of OpenJDK, which I feel is confusing, given we are patching > >>> the resulting build so much. > >> Yes, we need the extra version/name to avoid confusion and to get better > >> bug reports. There has been some confusion in the past because a) we > >> reused the bxx number for different releases and b) a distro might have > >> backported a patch already. > >> > >> Cheers, > >> > >> Mark > >> > > > > Yes, this is exactly what I considered when writing the patches. I > > posted the output here so people could discuss the results and any > > problems before we commit this to the IcedTea6 tree as well. > > > > Including the Mercurial revision gives us a version of IcedTea down to > > the commit. I would suggest that distros and the like adding changes beyond > > what's in the repository or a particular released version add an additional > > tag (e.g. 'gentoo' above) so we at least know we are not working with a > > vanilla IcedTea install. > > usually the vcs repository is not included in the source upload. relying on > anything but a checkout would be bad. > > Note that gcc does explicitely check in such information (DATE) or does update > this information (LAST_UPDATED, via contrib/gcc_update). > > > Both concepts have been common practice with GCC for some time AFAIK. > > > > $ gcc --version > > gcc (Gentoo 4.3.9999 p1.1) 4.3.3 20080924 (prerelease) > > > > $ /home/andrew/build/gcj/bin/gcc --version > > gcc (GCC) 4.4.0 20080913 (experimental) [gcj/classpath-098-merge-branch revision 140651] > > How to include this? "Gentoo 4.3.9999 p1.1" is the package version as uploaded. > My question was how to include this package version string such it is displayed > in the version information and in the hs_log* files (including any epoch version > in the packaging). > > Matthias > Something like: IcedTea6 1.2 (UberDistro-6.8p6) Runtime Environment (build 1.6.0-gentoo-b09) ? What about for HotSpot? -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From matthew.flaschen at gatech.edu Sun Sep 28 21:01:56 2008 From: matthew.flaschen at gatech.edu (Matthew Flaschen) Date: Mon, 29 Sep 2008 00:01:56 -0400 Subject: JNLP failures building latest hg of IcedTea Message-ID: <48E05334.2000807@gatech.edu> When I attempt to build latest hg, it fails with JNLP-related errors. I used the configure option: ./configure --with-icedtea --with-icedtea-home=/usr/lib/jvm/java-7-icedtea This is on a Ubuntu Gutsy Gibbon system, so this configure is pointing to pre-baked IcedTea, which has worked in the past as a bootstrap. The first error I notice in the build is a linker error: /tmp/ccblTWPB.o: In function `main': /tmp/ccDARcma.i:11: undefined reference to `org::eclipse::jdt::internal::compiler::batch::Main::class$' but the build does not stop until the below. Any suggestions or requests for info are welcome. Matt Flaschen ------------------------------------------------------------------------------------------ /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:53: cannot find symbol symbol : class Launcher location: package net.sourceforge.jnlp import net.sourceforge.jnlp.Launcher; ^ /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:54: package net.sourceforge.jnlp.runtime does not exist import net.sourceforge.jnlp.runtime.JNLPRuntime; ^ /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:83: cannot find symbol symbol : variable JNLPRuntime location: class net.sourceforge.jnlp.about.Main JNLPRuntime.setExitClass(Main.class); ^ /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:126: cannot find symbol symbol : class Launcher location: class net.sourceforge.jnlp.about.Main Launcher launcher = new Launcher( ^ /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:126: cannot find symbol symbol : class Launcher location: class net.sourceforge.jnlp.about.Main Launcher launcher = new Launcher( ^ /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:127: cannot find symbol symbol : variable JNLPRuntime location: class net.sourceforge.jnlp.about.Main JNLPRuntime.getDefaultLaunchHandler()); ^ 6 errors make: *** [stamps/extra-class-files.stamp] Error 1 From twisti at complang.tuwien.ac.at Mon Sep 29 00:27:28 2008 From: twisti at complang.tuwien.ac.at (Christian Thalinger) Date: Mon, 29 Sep 2008 09:27:28 +0200 Subject: preparing a icedtea-1.3 release? In-Reply-To: <20080928212527.GA7083@rivendell.middle-earth.co.uk> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <20080928212527.GA7083@rivendell.middle-earth.co.uk> Message-ID: <1222673248.3299.2.camel@cthalinger> On Sun, 2008-09-28 at 22:25 +0100, Andrew John Hughes wrote: > > Lets make sure that cacao and zero/shark are synced and the default > > configure options set. Deepak, do you feel the liveconnect/icedteaplugin > > support is ready for being enabled by default? > > > > Would be nice if twisti released his latest stuff so the build was against > 0.99.4 or whatever. I believe he has some related fixes. Right, there are a number of fixes. I try to make a 0.99.4 release this week. - Christian From gbenson at redhat.com Mon Sep 29 00:35:44 2008 From: gbenson at redhat.com (Gary Benson) Date: Mon, 29 Sep 2008 08:35:44 +0100 Subject: preparing a icedtea-1.3 release? In-Reply-To: <1222673248.3299.2.camel@cthalinger> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <20080928212527.GA7083@rivendell.middle-earth.co.uk> <1222673248.3299.2.camel@cthalinger> Message-ID: <20080929073544.GA3780@redhat.com> Christian Thalinger wrote: > On Sun, 2008-09-28 at 22:25 +0100, Andrew John Hughes wrote: > > Would be nice if twisti released his latest stuff so the build was > > against 0.99.4 or whatever. I believe he has some related fixes. > > Right, there are a number of fixes. I try to make a 0.99.4 release > this week. I'll put the latest Shark stuff in there too. Cheers, Gary -- http://gbenson.net/ From mark at klomp.org Mon Sep 29 05:10:03 2008 From: mark at klomp.org (Mark Wielaard) Date: Mon, 29 Sep 2008 14:10:03 +0200 Subject: OpenJDK 6 build 12 source posted (directaudio/alsa backend) In-Reply-To: <48E0B14C.4000107@sun.com> References: <48CAB08F.6010407@sun.com> <1221402124.3542.40.camel@dijkstra.wildebeest.org> <48D7F80E.6060802@sun.com> <1222164525.3178.48.camel@dijkstra.wildebeest.org> <48D8EB31.60004@sun.com> <1222376952.3266.94.camel@dijkstra.wildebeest.org> <48DD309F.2000206@sun.com> <48E0B14C.4000107@sun.com> Message-ID: <1222690203.3529.2.camel@dijkstra.wildebeest.org> Hi Alex, On Mon, 2008-09-29 at 14:43 +0400, Alex Menkov wrote: > Yes, the plan is to drop JavaSound encumbered code from JDK7 (and add Gervill). > I still have no all required approvals for integrate Gervill into JDK7 :( Who are you waiting for to get approval and where is this being discussed? What are the differences in required approvals needed for 6 and 7? Thanks, Mark From langel at redhat.com Mon Sep 29 06:45:28 2008 From: langel at redhat.com (Lillian Angel) Date: Mon, 29 Sep 2008 09:45:28 -0400 Subject: preparing a icedtea-1.3 release? In-Reply-To: <20080928212527.GA7083@rivendell.middle-earth.co.uk> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <20080928212527.GA7083@rivendell.middle-earth.co.uk> Message-ID: <48E0DBF8.7070804@redhat.com> Andrew John Hughes wrote: > On 23:17 Sun 28 Sep , Mark Wielaard wrote: >> Hi, >> >> On Sun, 2008-09-28 at 17:48 +0200, Matthias Klose wrote: >>> The last icedtea release 1.2 (bases on b09) was four months ago. I would like to >>> prepare a 1.3 release based ob b12. are there currently outstanding issues? >> Good idea. There have been lots of improvements since the last official >> 1.2 release. Including various security and crasher issues, that we >> really should make sure are picked up by the various distros. >> > > Lillian already mentioned she is working on this in her blog. > > http://langel.wordpress.com/2008/09/24/women-in-foss/ > > This really should have been sent to distro-pkg-dev as well. I have been waiting for the PulseAudio and LiveConnect work before going ahead with a release. Is everyone ok with waiting for these? > >>> - general? >> I would like to get the better version reporting in that you and andrew >> suggested. Andrew already has something in icedtea[7]. >> > > With 7 it currently gives: > > java version "1.7.0_0" > IcedTea 1.8-pre-r1226 Runtime Environment (build 1.7.0_0-b36) > OpenJDK 64-Bit Server VM (build 1.7.0_0-b36, mixed mode) > > Releases built from a tarball would simplify to just IcedTea 1.8 (for example). > The revision is automatically picked up if the source directory is a Mercurial > repository, and the other part is taken from configure. > > The other related patch adds support for a custom version tag giving: > > $ java -version > java version "1.6.0-gentoo" > IcedTea6 1.2 Runtime Environment (build 1.6.0-gentoo-b09) > OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode) > > (I applied the patch to the Gentoo ebuilds for IcedTea6) > > IcedTea6, unlike IcedTea7, seems to have dropped using IcedTea at all > in favour of OpenJDK, which I feel is confusing, given we are patching > the resulting build so much. > >>> - cacao? >>> - icedtea plugin? >>> - zero/shark? >> Lets make sure that cacao and zero/shark are synced and the default >> configure options set. Deepak, do you feel the liveconnect/icedteaplugin >> support is ready for being enabled by default? >> > > Would be nice if twisti released his latest stuff so the build was against > 0.99.4 or whatever. I believe he has some related fixes. > >>> If possible I aim for a release candidate for the next weekend and for a final >>> release in about two weeks. >> I'll work on some release notes to summarize all the new stuff. >> > > As I've said before, I'll merge and follow this with a 1.8 for IcedTea7. > It would be nice to get the NIO support in before this. > >> Cheers, Lillian From mvyskocil at suse.cz Mon Sep 29 07:24:46 2008 From: mvyskocil at suse.cz (Michal Vyskocil) Date: Mon, 29 Sep 2008 16:24:46 +0200 Subject: openjdk6 b12 - checksums and rigths Message-ID: <200809291624.47019.mvyskocil@suse.cz> Hi all, the checksums of the openjdk6 b12 [1] doesn't match. The expected [2] values are: sha1 (openjdk-6-src-b12-28_aug_2008.zip) = ef886ca34c30d2bc19da4c41a8e5bc099a732652 md5 (openjdk-6-src-b12-28_aug_2008.zip) = 031afd3f857eea4cb054503a2bd6352e But I've got (tested on two independent machines. The files was downloaded using wget): $ sha1sum openjdk-6-src-b12-28_aug_2008.tar.gz fa864012b9f07042a1ea1e6c620abe5675f58827 openjdk-6-src-b12-28_aug_2008.tar.gz $ md5sum openjdk-6-src-b12-28_aug_2008.tar.gz b53e1ef643909ce82721ee4c970d958b openjdk-6-src-b12-28_aug_2008.tar.gz Anyone has a same problem? [1] http://download.java.net/openjdk/jdk6/promoted/b12/openjdk-6-src- b12-28_aug_2008.tar.gz [2] http://download.java.net/openjdk/jdk6/promoted/b12/openjdk-6-src- b12-28_aug_2008.md5 BTW: I have found that a default file mode is 0444 instead of 0644 as in a previous version. Is the openjdk6 archive corrupted? Best Regards Michal Vyskocil From alex.menkov at sun.com Mon Sep 29 03:43:24 2008 From: alex.menkov at sun.com (Alex Menkov) Date: Mon, 29 Sep 2008 14:43:24 +0400 Subject: OpenJDK 6 build 12 source posted (directaudio/alsa backend) In-Reply-To: <48DD309F.2000206@sun.com> References: <48CAB08F.6010407@sun.com> <1221402124.3542.40.camel@dijkstra.wildebeest.org> <48D7F80E.6060802@sun.com> <1222164525.3178.48.camel@dijkstra.wildebeest.org> <48D8EB31.60004@sun.com> <1222376952.3266.94.camel@dijkstra.wildebeest.org> <48DD309F.2000206@sun.com> Message-ID: <48E0B14C.4000107@sun.com> Yes, the plan is to drop JavaSound encumbered code from JDK7 (and add Gervill). I still have no all required approvals for integrate Gervill into JDK7 :( Regards Alex Joseph D. Darcy wrote: > Mark Wielaard wrote: >> Hi Joe, >> >> On Tue, 2008-09-23 at 06:12 -0700, Joseph D. Darcy wrote: >> >>> Mark Wielaard wrote: >>> >>>> On Mon, 2008-09-22 at 12:54 -0700, Joseph D. Darcy wrote: >>>> >>>>> Mark Wielaard wrote: >>>>> >>>>>> Although not in your changelogs, I saw you also included two of my >>>>>> fixes >>>>>> for the ALSA directaudio backend which I posted back in May on >>>>>> sound-dev, and which are included in icedtea already. >>>>>> - The sloppy open/close patch: >>>>>> http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000053.html >>>>>> - The ALSA native lock patch: >>>>>> http://mail.openjdk.java.net/pipermail/sound-dev/2008-May/000054.html >>>>>> >>>>>> Although it makes some applets that use some primitive sound >>>>>> output work >>>>>> better I never got a real response. Did you get someone from the >>>>>> sound >>>>>> team to look at these patches? They do seem to work for me and the >>>>>> few >>>>>> test users of those applets, but a full review by one of the sound >>>>>> engineers would be appreciated. They don't seem to be in the JDK7 >>>>>> tree. >>>>>> >>>>> No; the patches were not explicitly reviewed; Alex, please take a >>>>> look at them. >>>>> >>>> Thanks. >>>> >>>>> Neither Gervill nor your patches have yet been incorporated into >>>>> JDK 7. >>>>> >>>> What is the reason for having them in JDK6, but not in JDK7? >>>> >>> Just no one at Sun has gotten around to doing it yet for JDK 7. >>> >> >> Is there anything Sun specific that is needed for moving stuff between 6 >> and 7? Need any help? If it comes from icedtea then Andrew has almost >> certainly already created patches against 7 for icedtea7. >> > > I believe the plan of record was to replace the JDK 7 sound engine with > Gervill, as done in OpenJDK 6; that is, the encumbered sound engine > would be excised from JDK 7 entirely as opposed to maintaining it for > ClosedJDK builds and using Gervill for openjdk=true builds. > > Alex, please confirm. > > Thanks, > > -Joe > From dbhole at redhat.com Mon Sep 29 09:04:46 2008 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 29 Sep 2008 16:04:46 +0000 Subject: changeset in /hg/icedtea6: Added IcedTeaPlugin.jar to ignore list. Message-ID: changeset 9ff3417e28cc in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=9ff3417e28cc description: Added IcedTeaPlugin.jar to ignore list. diffstat: 1 file changed, 1 insertion(+) .hgignore | 1 + diffs (11 lines): diff -r 210cf639f45c -r 9ff3417e28cc .hgignore --- a/.hgignore Fri Sep 26 12:04:02 2008 +0200 +++ b/.hgignore Mon Sep 29 12:04:41 2008 -0400 @@ -25,6 +25,7 @@ gcjwebplugin.so gcjwebplugin.so IcedTeaPlugin.o IcedTeaPlugin.so +IcedTeaPlugin.jar extra-source-files.txt rt-source-files.txt hotspot-tools-source-files.txt From gnu_andrew at member.fsf.org Mon Sep 29 09:48:59 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 29 Sep 2008 17:48:59 +0100 Subject: JNLP failures building latest hg of IcedTea In-Reply-To: <48E05334.2000807@gatech.edu> References: <48E05334.2000807@gatech.edu> Message-ID: <20080929164859.GB1303@rivendell.middle-earth.co.uk> On 00:01 Mon 29 Sep , Matthew Flaschen wrote: > When I attempt to build latest hg, it fails with JNLP-related errors. I > used the configure option: > > ./configure --with-icedtea --with-icedtea-home=/usr/lib/jvm/java-7-icedtea > > This is on a Ubuntu Gutsy Gibbon system, so this configure is pointing > to pre-baked IcedTea, which has worked in the past as a bootstrap. > > The first error I notice in the build is a linker error: > > /tmp/ccblTWPB.o: In function `main': > /tmp/ccDARcma.i:11: undefined reference to > `org::eclipse::jdt::internal::compiler::batch::Main::class$' > > but the build does not stop until the below. Any suggestions or > requests for info are welcome. > > Matt Flaschen > > ------------------------------------------------------------------------------------------ > > /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:53: > cannot find symbol > symbol : class Launcher > location: package net.sourceforge.jnlp > import net.sourceforge.jnlp.Launcher; > ^ > /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:54: > package net.sourceforge.jnlp.runtime does not exist > import net.sourceforge.jnlp.runtime.JNLPRuntime; > ^ > /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:83: > cannot find symbol > symbol : variable JNLPRuntime > location: class net.sourceforge.jnlp.about.Main > JNLPRuntime.setExitClass(Main.class); > ^ > /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:126: > cannot find symbol > symbol : class Launcher > location: class net.sourceforge.jnlp.about.Main > Launcher launcher = new Launcher( > ^ > /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:126: > cannot find symbol > symbol : class Launcher > location: class net.sourceforge.jnlp.about.Main > Launcher launcher = new Launcher( > ^ > /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java:127: > cannot find symbol > symbol : variable JNLPRuntime > location: class net.sourceforge.jnlp.about.Main > > JNLPRuntime.getDefaultLaunchHandler()); > ^ > 6 errors > make: *** [stamps/extra-class-files.stamp] Error 1 It's a little hard to diagnose exactly the problem you're encountering from the little information you've given here. Can you please include the commands that lead to each error? I assume this is IcedTea7 not IcedTea6 -- you didn't mention this in your original mail. It seems to be an issue related to creating native_ecj and/or the use of a 'quick' build via --with-icedtea, but I can't tell for sure without more information from you. Incidentally, what does gcj --version give? Thanks, -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From doko at ubuntu.com Mon Sep 29 10:58:29 2008 From: doko at ubuntu.com (Matthias Klose) Date: Mon, 29 Sep 2008 19:58:29 +0200 Subject: preparing a icedtea-1.3 release? In-Reply-To: <48E0DB14.2050903@redhat.com> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <48E0DB14.2050903@redhat.com> Message-ID: <48E11745.4090701@ubuntu.com> [dropping the jdk6-dev list, adding distro-pkg-dev] Lillian Angel schrieb: > Hi, > > Mark Wielaard wrote: >> Hi, >> >> On Sun, 2008-09-28 at 17:48 +0200, Matthias Klose wrote: >>> The last icedtea release 1.2 (bases on b09) was four months ago. I >>> would like to >>> prepare a 1.3 release based ob b12. are there currently outstanding >>> issues? >> >> Good idea. There have been lots of improvements since the last official >> 1.2 release. Including various security and crasher issues, that we >> really should make sure are picked up by the various distros. >> >>> - general? >> >> I would like to get the better version reporting in that you and andrew >> suggested. Andrew already has something in icedtea[7]. >> >>> - cacao? >>> - icedtea plugin? >>> - zero/shark? >> >> Lets make sure that cacao and zero/shark are synced and the default >> configure options set. Deepak, do you feel the liveconnect/icedteaplugin >> support is ready for being enabled by default? >> >>> If possible I aim for a release candidate for the next weekend and >>> for a final >>> release in about two weeks. >> >> I'll work on some release notes to summarize all the new stuff. > > I would like to wait until we have the PulseAudio work integrated and, > if possible, Deepak's LiveConnect work. LiveConnect is disabled by default, so that should be fine (although a working LiveConnect would be very welcome). How invasive are the PulseAudio changes, how well is it tested, can it be turned off like the icedtea plugin? The trunk is currently relatively stable. Matthias From iivan at redhat.com Mon Sep 29 11:02:51 2008 From: iivan at redhat.com (Ioana Ivan) Date: Mon, 29 Sep 2008 18:02:51 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-29 Ioana Ivan changeset b4390e330ff7 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=b4390e330ff7 description: 2008-09-29 Ioana Ivan * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java: removed all references to the boolean variable corked since it was redundant. (start) : only send a START event if there's been a call to stop between the last call to start and this one. (stop): only send a STOP event if there's been a call to start between the last call the stop and this one. (startedListener.update): send a START event the first time data is being written to the line and after an underflow. diffstat: 2 files changed, 44 insertions(+), 30 deletions(-) ChangeLog | 11 + src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 63 +++++----- diffs (153 lines): diff -r f29cbcfbc354 -r b4390e330ff7 ChangeLog --- a/ChangeLog Fri Sep 26 13:27:33 2008 -0400 +++ b/ChangeLog Mon Sep 29 14:01:57 2008 -0400 @@ -1,3 +1,14 @@ 2008-09-25 Ioana Ivan +2008-09-25 Ioana Ivan + * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java: + removed all references to the boolean variable corked since it was + redundant. + (start) : only send a START event if there's been a call to stop between + the last call to start and this one. + (stop): only send a STOP event if there's been a call to start between + the last call the stop and this one. + (startedListener.update): send a START event the first time data is + being written to the line and after an underflow. + 2008-09-25 Ioana Ivan * src/native/org_classpath_icedtea_Stream.c diff -r f29cbcfbc354 -r b4390e330ff7 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Sep 26 13:27:33 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Mon Sep 29 14:01:57 2008 -0400 @@ -58,8 +58,9 @@ public abstract class PulseAudioDataLine // true between start() and stop() protected boolean isStarted = false; + //true between a started and an underflow callback protected boolean dataWritten = false; - protected boolean corked = true; + // true if a stream has been paused // protected boolean isPaused = false; @@ -160,14 +161,14 @@ public abstract class PulseAudioDataLine Stream.UnderflowListener stoppedListener = new Stream.UnderflowListener() { @Override + public void update() { dataWritten = false; - - if (!corked) { - fireLineEvent(new LineEvent(PulseAudioDataLine.this, - LineEvent.Type.STOP, framesSinceOpen)); - } - + System.out.println("underflow"); + // always send a STOP event on an underflow (assumption: + // an underflow can't happen while the stream is corked) + fireLineEvent(new LineEvent(PulseAudioDataLine.this, + LineEvent.Type.STOP, framesSinceOpen)); } }; stream.addUnderflowListener(stoppedListener); @@ -175,12 +176,16 @@ public abstract class PulseAudioDataLine Stream.PlaybackStartedListener startedListener = new Stream.PlaybackStartedListener() { @Override public void update() { - - dataWritten = true; - if (!corked) { + System.out.println("started callback"); + + //only send a START event in the beginning and following + //an underflow + if (!dataWritten) { fireLineEvent(new LineEvent(PulseAudioDataLine.this, LineEvent.Type.START, framesSinceOpen)); } + + dataWritten = true; } }; @@ -308,26 +313,25 @@ public abstract class PulseAudioDataLine "Line must be open()ed before it can be start()ed"); } - if (!corked) { - System.out.println("Already started, returning"); + if (isStarted) { return; - } - - corked = false; + + } + + Operation op; synchronized (eventLoop.threadLock) { op = stream.unCork(); + if (dataWritten && (!isStarted)) { + fireLineEvent(new LineEvent(PulseAudioDataLine.this, + LineEvent.Type.START, framesSinceOpen)); + } } op.waitForCompletion(); op.releaseReference(); isStarted = true; - /* - * if (dataWritten) { fireLineEvent(new - * LineEvent(PulseAudioDataLine.this, LineEvent.Type.START, - * framesSinceOpen)); } - */ } @@ -337,26 +341,25 @@ public abstract class PulseAudioDataLine "Line must be open()ed before it can be start()ed"); } - if (corked) { + if (!isStarted) { return; } - corked = true; + isStarted = true; Operation op; synchronized (eventLoop.threadLock) { op = stream.cork(); + // if there are no data on the line when stop was called, + // don't send a stop event + if (dataWritten && (isStarted)) { + fireLineEvent(new LineEvent(PulseAudioDataLine.this, + LineEvent.Type.STOP, framesSinceOpen)); + } } op.waitForCompletion(); op.releaseReference(); isStarted = false; - if (dataWritten) { - fireLineEvent(new LineEvent(PulseAudioDataLine.this, - LineEvent.Type.STOP, framesSinceOpen)); - } - - isStarted = false; - } /* @@ -381,7 +384,7 @@ public abstract class PulseAudioDataLine } public boolean isRunning() { - return !corked && dataWritten; + return isStarted && dataWritten; } protected abstract void connectLine(int bufferSize, Stream masterStream) From langel at redhat.com Mon Sep 29 12:26:39 2008 From: langel at redhat.com (Lillian Angel) Date: Mon, 29 Sep 2008 15:26:39 -0400 Subject: preparing a icedtea-1.3 release? In-Reply-To: <48E11745.4090701@ubuntu.com> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <48E0DB14.2050903@redhat.com> <48E11745.4090701@ubuntu.com> Message-ID: <48E12BEF.90401@redhat.com> Hi, Matthias Klose wrote: > [dropping the jdk6-dev list, adding distro-pkg-dev] > > Lillian Angel schrieb: >> Hi, >> >> Mark Wielaard wrote: >>> Hi, >>> >>> On Sun, 2008-09-28 at 17:48 +0200, Matthias Klose wrote: >>>> The last icedtea release 1.2 (bases on b09) was four months ago. I >>>> would like to >>>> prepare a 1.3 release based ob b12. are there currently outstanding >>>> issues? >>> Good idea. There have been lots of improvements since the last official >>> 1.2 release. Including various security and crasher issues, that we >>> really should make sure are picked up by the various distros. >>> >>>> - general? >>> I would like to get the better version reporting in that you and andrew >>> suggested. Andrew already has something in icedtea[7]. >>> >>>> - cacao? >>>> - icedtea plugin? >>>> - zero/shark? >>> Lets make sure that cacao and zero/shark are synced and the default >>> configure options set. Deepak, do you feel the liveconnect/icedteaplugin >>> support is ready for being enabled by default? >>> >>>> If possible I aim for a release candidate for the next weekend and >>>> for a final >>>> release in about two weeks. >>> I'll work on some release notes to summarize all the new stuff. >> I would like to wait until we have the PulseAudio work integrated and, >> if possible, Deepak's LiveConnect work. > > LiveConnect is disabled by default, so that should be fine (although a working > LiveConnect would be very welcome). > > How invasive are the PulseAudio changes, how well is it tested, can it be turned > off like the icedtea plugin? The trunk is currently relatively stable. It will not be enabled by default, just because we are not sure how well it will work with other distros. Though, it will be enabled in Fedora, so if we are going to have a full 1.3 release, it will need to go through the TCK testing before it gets pushed into Fedora. So, ultimately I would like to see both of these new features in F-10 (which is still quite a ways off). Also, they would be excellent milestones to reach for the next release. Though, in the future, I hope it does not take another 4 months to make an official release. Cheers, Lillian From omajid at redhat.com Mon Sep 29 12:57:42 2008 From: omajid at redhat.com (Omair Majid) Date: Mon, 29 Sep 2008 19:57:42 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-29 Omair Majid changeset 5ab54b0ca4ea in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=5ab54b0ca4ea description: 2008-09-29 Omair Majid merged changes diffstat: 5 files changed, 302 insertions(+), 30 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 3 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 152 ++++++++- src/java/org/classpath/icedtea/pulseaudio/Stream.java | 13 src/native/org_classpath_icedtea_pulseaudio_Stream.c | 2 unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 162 +++++++++- diffs (truncated from 516 to 500 lines): diff -r b4390e330ff7 -r 5ab54b0ca4ea src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Mon Sep 29 14:01:57 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Mon Sep 29 15:57:43 2008 -0400 @@ -266,8 +266,6 @@ public abstract class PulseAudioDataLine "Line must be open for close() to work"); } - drain(); - synchronized (eventLoop.threadLock) { stream.disconnect(); } @@ -283,6 +281,7 @@ public abstract class PulseAudioDataLine } super.close(); + isStarted = false; } diff -r b4390e330ff7 -r 5ab54b0ca4ea src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Mon Sep 29 14:01:57 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Mon Sep 29 15:57:43 2008 -0400 @@ -45,6 +45,20 @@ public class PulseAudioTargetDataLine ex public class PulseAudioTargetDataLine extends PulseAudioDataLine implements TargetDataLine { + /* + * This contains the data from the PulseAudio buffer that has since been + * dropped. If 20 bytes of a fragment of size 200 are read, the other 180 + * are dumped in this + */ + byte[] fragmentBuffer; + + /* + * these are set to true only by the respective functions (flush(), drain()) + * set to false only by read() + */ + boolean flushed = false; + boolean drained = false; + public PulseAudioTargetDataLine(EventLoop eventLoop, AudioFormat[] formats, AudioFormat defaultFormat) { supportedFormats = formats; @@ -55,7 +69,7 @@ public class PulseAudioTargetDataLine ex } @Override - public void close() { + synchronized public void close() { if (!isOpen) { throw new IllegalStateException( "Line cant be closed if it isnt open"); @@ -68,7 +82,7 @@ public class PulseAudioTargetDataLine ex } @Override - public void open(AudioFormat format, int bufferSize) + synchronized public void open(AudioFormat format, int bufferSize) throws LineUnavailableException { if (isOpen) { throw new IllegalStateException("already open"); @@ -83,14 +97,16 @@ public class PulseAudioTargetDataLine ex } @Override - public void open(AudioFormat format) throws LineUnavailableException { + synchronized public void open(AudioFormat format) + throws LineUnavailableException { open(format, DEFAULT_BUFFER_SIZE); } protected void connectLine(int bufferSize, Stream masterStream) throws LineUnavailableException { + int fragmentSize = bufferSize / 10 > 500 ? bufferSize / 10 : 500; StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( - bufferSize, 0, 0, 0, bufferSize / 10); + bufferSize, 0, 0, 0, fragmentSize); synchronized (eventLoop.threadLock) { stream.connectForRecording(Stream.DEFAULT_DEVICE, bufferAttributes); } @@ -123,24 +139,113 @@ public class PulseAudioTargetDataLine ex int remainingLength = length; int sizeRead = 0; - while (remainingLength != 0) { - - synchronized (eventLoop.threadLock) { - int bytesRead = stream.read(data, remainingLength, position); - if (bytesRead < 0) { - return sizeRead; - } + /* bytes read on each iteration of loop */ + int bytesRead; + + /* + * to read, we first take stuff from the fragmentBuffer + */ + + /* on first read() of the line, fragmentBuffer is null */ + if (fragmentBuffer != null) { + synchronized (this) { + + boolean fragmentBufferSmaller = fragmentBuffer.length < length; + int smallerBufferLength = Math.min(fragmentBuffer.length, + length); + System.arraycopy(fragmentBuffer, 0, data, position, + smallerBufferLength); + framesSinceOpen += smallerBufferLength + / currentFormat.getFrameSize(); + + if (!fragmentBufferSmaller) { + /* + * if fragment was larger, then we already have all the data + * we need. clean up the buffer before returning. Make a new + * fragmentBuffer from the remaining bytes + */ + int remainingBytesInFragment = (fragmentBuffer.length - length); + byte[] newFragmentBuffer = new byte[remainingBytesInFragment]; + System.arraycopy(fragmentBuffer, length, newFragmentBuffer, + 0, newFragmentBuffer.length); + fragmentBuffer = newFragmentBuffer; + return length; + } + + /* done with fragment buffer, remove it */ + bytesRead = smallerBufferLength; sizeRead += bytesRead; position += bytesRead; remainingLength -= bytesRead; - framesSinceOpen += bytesRead / currentFormat.getFrameSize(); - + fragmentBuffer = null; + + } + } + + /* + * if we need to read more data, then we read from PulseAudio's buffer + */ + while (remainingLength != 0) { + synchronized (this) { + + if (!isOpen || !isStarted) { + return sizeRead; + } + + if (flushed) { + flushed = false; + return sizeRead; + } + + if (drained) { + drained = false; + return sizeRead; + } + + byte[] currentFragment; + synchronized (eventLoop.threadLock) { + + /* read a fragment, and drop it from the server */ + currentFragment = stream.peek(); + stream.drop(); + if (currentFragment == null) { + System.out + .println("DEBUG: PulseAudioTargetDataLine:read(): error in stream.peek()"); + return sizeRead; + } + + bytesRead = Math.min(currentFragment.length, + remainingLength); + + /* + * we read more than we required, save the rest of the data + * in the fragmentBuffer + */ + if (bytesRead < currentFragment.length) { + /* allocate a buffer to store unsaved data */ + fragmentBuffer = new byte[currentFragment.length + - bytesRead]; + + /* copy over the unsaved data */ + System.arraycopy(currentFragment, bytesRead, + fragmentBuffer, 0, currentFragment.length + - bytesRead); + } + + System.arraycopy(currentFragment, 0, data, position, + bytesRead); + + sizeRead += bytesRead; + position += bytesRead; + remainingLength -= bytesRead; + framesSinceOpen += bytesRead / currentFormat.getFrameSize(); + } } } // all the data should have been played by now assert (sizeRead == length); - // currentFramePosition += (sizeWritten/getFormat().getFrameSize()); + /* * FIXME when the stream is flushed() etc, instead of returning length * this should unblock and return the the size of data written so far @@ -156,9 +261,18 @@ public class PulseAudioTargetDataLine ex throw new IllegalStateException("must call open() before drain()"); } + synchronized (this) { + drained = true; + } + // blocks when there is data on the line // http://www.jsresources.org/faq_audio.html#stop_drain_tdl - while (isStarted) { + while (true) { + synchronized (this) { + if (!isStarted || !isOpen) { + break; + } + } try { Thread.sleep(100); } catch (InterruptedException e) { @@ -179,6 +293,10 @@ public class PulseAudioTargetDataLine ex } operation.waitForCompletion(); operation.releaseReference(); + + synchronized (this) { + flushed = true; + } } @@ -211,14 +329,14 @@ public class PulseAudioTargetDataLine ex */ @Override - public void start() { + synchronized public void start() { super.start(); fireLineEvent(new LineEvent(this, LineEvent.Type.START, framesSinceOpen)); } @Override - public void stop() { + synchronized public void stop() { super.stop(); fireLineEvent(new LineEvent(this, LineEvent.Type.STOP, framesSinceOpen)); diff -r b4390e330ff7 -r 5ab54b0ca4ea src/java/org/classpath/icedtea/pulseaudio/Stream.java --- a/src/java/org/classpath/icedtea/pulseaudio/Stream.java Mon Sep 29 14:01:57 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Stream.java Mon Sep 29 15:57:43 2008 -0400 @@ -54,7 +54,7 @@ public class Stream { public interface StateListener { public void update(); } - + public interface CorkListener { public void update(); } @@ -163,9 +163,6 @@ public class Stream { private native int native_pa_stream_write(byte[] data, int offset, int length); - - private native int native_pa_stream_read(byte[] array, int length, - int position); private native byte[] native_pa_stream_peek(); @@ -323,7 +320,7 @@ public class Stream { underflowListeners.remove(listener); } } - + public void addCorkListener(CorkListener listener) { synchronized (corkListeners) { corkListeners.add(listener); @@ -501,10 +498,6 @@ public class Stream { return native_pa_stream_write(data, offset, length); } - public int read(byte[] array, int length, int position) { - return native_pa_stream_read(array, length, position); - } - /** * Read the next fragment from the buffer (for recording). * @@ -636,7 +629,7 @@ public class Stream { } } } - + @SuppressWarnings("unused") private void corkCallback() { synchronized (corkListeners) { diff -r b4390e330ff7 -r 5ab54b0ca4ea src/native/org_classpath_icedtea_pulseaudio_Stream.c --- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c Mon Sep 29 14:01:57 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c Mon Sep 29 15:57:43 2008 -0400 @@ -525,6 +525,7 @@ JNIEXPORT jint JNICALL Java_org_classpat return value; } +/* JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1read (JNIEnv *env, jobject obj, jbyteArray array, jint length, jint offset) { pa_stream *stream = getJavaPointer(env, obj, STREAM_POINTER); @@ -540,6 +541,7 @@ JNIEXPORT jint JNICALL Java_org_classpat pa_stream_drop(stream); return read_length; } +*/ /* * Class: org_classpath_icedtea_pulseaudio_Stream diff -r b4390e330ff7 -r 5ab54b0ca4ea unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Mon Sep 29 14:01:57 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Mon Sep 29 15:57:43 2008 -0400 @@ -55,6 +55,7 @@ import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; public class PulseAudioTargetDataLineTest { @@ -67,6 +68,28 @@ public class PulseAudioTargetDataLineTes AudioFormat aSupportedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); + + class ThreadReader extends Thread { + TargetDataLine line; + byte[] buffer; + + public ThreadReader(TargetDataLine line, byte[] buffer) + throws LineUnavailableException { + + this.line = line; + this.buffer = buffer; + + } + + @Override + public void run() { + int bytesRead = 0; + + bytesRead = line.read(buffer, 0, buffer.length); + // System.out.println("read data"); + + } + } @Before public void setUp() throws LineUnavailableException { @@ -147,7 +170,7 @@ public class PulseAudioTargetDataLineTes @Test public void testOpenWithFormat() throws LineUnavailableException { - System.out.println("This test checks that read() sort of wroks"); + System.out.println("This test checks that open(AudioFormat) works"); targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( TargetDataLine.class)); @@ -211,6 +234,143 @@ public class PulseAudioTargetDataLineTes targetDataLine.stop(); targetDataLine.close(); + } + + @Test + public void testReadAndClose() throws LineUnavailableException, + InterruptedException { + System.out.println("This test tries to close a line while " + + "read()ing to check that read() returns"); + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + AudioFormat breakingFormat = new AudioFormat( + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 2, 2, 44100f, + true); + targetDataLine.open(breakingFormat); + targetDataLine.start(); + byte[] buffer = new byte[1000000]; + + ThreadReader reader = new ThreadReader(targetDataLine, buffer); + reader.start(); + + Thread.sleep(100); + + Assert.assertTrue(reader.isAlive()); + + targetDataLine.close(); + + reader.join(500); + + Assert.assertFalse(reader.isAlive()); + + } + + @Test + public void testReadAndStop() throws LineUnavailableException, + InterruptedException { + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + AudioFormat breakingFormat = new AudioFormat( + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 2, 2, 44100f, + true); + targetDataLine.open(breakingFormat); + targetDataLine.start(); + byte[] buffer = new byte[10000000]; + + ThreadReader reader = new ThreadReader(targetDataLine, buffer); + reader.start(); + + Thread.sleep(100); + + Assert.assertTrue(reader.isAlive()); + + targetDataLine.stop(); + + Thread.sleep(100); + + Assert.assertFalse(reader.isAlive()); + + targetDataLine.close(); + + } + + // this is kind of messed up + // drain should hang on a started data line + // but read should return + @Test + public void testReadAndDrain() throws LineUnavailableException, + InterruptedException { + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + AudioFormat breakingFormat = new AudioFormat( + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 2, 2, 44100f, + true); + targetDataLine.open(breakingFormat); + targetDataLine.start(); + byte[] buffer = new byte[10000000]; + + ThreadReader reader = new ThreadReader(targetDataLine, buffer); + reader.start(); + + Thread.sleep(100); + + Assert.assertTrue(reader.isAlive()); + + Thread drainer = new Thread() { + + @Override + public void run() { + targetDataLine.drain(); + + } + + }; + + drainer.start(); + + Thread.sleep(100); + + Assert.assertFalse(reader.isAlive()); + + targetDataLine.stop(); + + Thread.sleep(100); + Assert.assertFalse(drainer.isAlive()); + + targetDataLine.close(); + } + + @Test + public void testReadAndFlush() throws LineUnavailableException, + InterruptedException { + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + AudioFormat breakingFormat = new AudioFormat( + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 2, 2, 44100f, + true); + targetDataLine.open(breakingFormat); + targetDataLine.start(); + byte[] buffer = new byte[10000000]; + + ThreadReader reader = new ThreadReader(targetDataLine, buffer); + reader.start(); From omajid at redhat.com Mon Sep 29 12:57:41 2008 From: omajid at redhat.com (Omair Majid) Date: Mon, 29 Sep 2008 19:57:41 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-29 Omair Majid changeset b185dd9217bb in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=b185dd9217bb description: 2008-09-29 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java New class variables flushed and drained. (close): Now synchronized. (open): Likewise. (open): Likewise. (read): Likewise. Return when flush()ed, drain()ed, stop()ed or close()d. (drain): Synchronized. Sets drained to true. (flush): Sets flushed to true. (start): Synchronized. (stop): Synchronized. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java (testReadAndDrain): Fixed test and made it active. diffstat: 2 files changed, 127 insertions(+), 66 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 173 ++++++---- unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 20 - diffs (290 lines): diff -r 350bc72ba495 -r b185dd9217bb src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Mon Sep 29 15:16:15 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Mon Sep 29 15:56:36 2008 -0400 @@ -52,6 +52,13 @@ public class PulseAudioTargetDataLine ex */ byte[] fragmentBuffer; + /* + * these are set to true only by the respective functions (flush(), drain()) + * set to false only by read() + */ + boolean flushed = false; + boolean drained = false; + public PulseAudioTargetDataLine(EventLoop eventLoop, AudioFormat[] formats, AudioFormat defaultFormat) { supportedFormats = formats; @@ -62,7 +69,7 @@ public class PulseAudioTargetDataLine ex } @Override - public void close() { + synchronized public void close() { if (!isOpen) { throw new IllegalStateException( "Line cant be closed if it isnt open"); @@ -75,7 +82,7 @@ public class PulseAudioTargetDataLine ex } @Override - public void open(AudioFormat format, int bufferSize) + synchronized public void open(AudioFormat format, int bufferSize) throws LineUnavailableException { if (isOpen) { throw new IllegalStateException("already open"); @@ -90,7 +97,8 @@ public class PulseAudioTargetDataLine ex } @Override - public void open(AudioFormat format) throws LineUnavailableException { + synchronized public void open(AudioFormat format) + throws LineUnavailableException { open(format, DEFAULT_BUFFER_SIZE); } @@ -140,72 +148,98 @@ public class PulseAudioTargetDataLine ex /* on first read() of the line, fragmentBuffer is null */ if (fragmentBuffer != null) { - - boolean fragmentBufferSmaller = fragmentBuffer.length < length; - int smallerBufferLength = Math.min(fragmentBuffer.length, length); - System.arraycopy(fragmentBuffer, 0, data, position, - smallerBufferLength); - - if (!fragmentBufferSmaller) { - /* - * if fragment was larger, then we already have all the data we - * need. clean up the buffer before returning. Make a new - * fragmentBuffer from the remaining bytes - */ - int remainingBytesInFragment = (fragmentBuffer.length - length); - byte[] newFragmentBuffer = new byte[remainingBytesInFragment]; - System.arraycopy(fragmentBuffer, length, newFragmentBuffer, 0, - newFragmentBuffer.length); - fragmentBuffer = newFragmentBuffer; - return length; - } - - /* done with fragment buffer, remove it */ - bytesRead = smallerBufferLength; - sizeRead += bytesRead; - position += bytesRead; - remainingLength -= bytesRead; - fragmentBuffer = null; + synchronized (this) { + + boolean fragmentBufferSmaller = fragmentBuffer.length < length; + int smallerBufferLength = Math.min(fragmentBuffer.length, + length); + System.arraycopy(fragmentBuffer, 0, data, position, + smallerBufferLength); + framesSinceOpen += smallerBufferLength + / currentFormat.getFrameSize(); + + if (!fragmentBufferSmaller) { + /* + * if fragment was larger, then we already have all the data + * we need. clean up the buffer before returning. Make a new + * fragmentBuffer from the remaining bytes + */ + int remainingBytesInFragment = (fragmentBuffer.length - length); + byte[] newFragmentBuffer = new byte[remainingBytesInFragment]; + System.arraycopy(fragmentBuffer, length, newFragmentBuffer, + 0, newFragmentBuffer.length); + fragmentBuffer = newFragmentBuffer; + return length; + } + + /* done with fragment buffer, remove it */ + bytesRead = smallerBufferLength; + sizeRead += bytesRead; + position += bytesRead; + remainingLength -= bytesRead; + fragmentBuffer = null; + + } } /* * if we need to read more data, then we read from PulseAudio's buffer */ while (remainingLength != 0) { - byte[] currentFragment; - synchronized (eventLoop.threadLock) { - - /* read a fragment, and drop it from the server */ - currentFragment = stream.peek(); - stream.drop(); - if (currentFragment == null) { - System.out - .println("DEBUG: PulseAudioTargetDataLine:read(): error in stream.peek()"); + synchronized (this) { + + if (!isOpen || !isStarted) { return sizeRead; } - bytesRead = Math.min(currentFragment.length, remainingLength); - - /* - * we read more than we required, save the rest of the data in - * the fragmentBuffer - */ - if (bytesRead < currentFragment.length) { - /* allocate a buffer to store unsaved data */ - fragmentBuffer = new byte[currentFragment.length - - bytesRead]; - /* copy over the unsaved data */ - System.arraycopy(currentFragment, bytesRead, - fragmentBuffer, 0, fragmentBuffer.length - - bytesRead); - } - - System.arraycopy(currentFragment, 0, data, position, bytesRead); - - sizeRead += bytesRead; - position += bytesRead; - remainingLength -= bytesRead; - framesSinceOpen += bytesRead / currentFormat.getFrameSize(); + if (flushed) { + flushed = false; + return sizeRead; + } + + if (drained) { + drained = false; + return sizeRead; + } + + byte[] currentFragment; + synchronized (eventLoop.threadLock) { + + /* read a fragment, and drop it from the server */ + currentFragment = stream.peek(); + stream.drop(); + if (currentFragment == null) { + System.out + .println("DEBUG: PulseAudioTargetDataLine:read(): error in stream.peek()"); + return sizeRead; + } + + bytesRead = Math.min(currentFragment.length, + remainingLength); + + /* + * we read more than we required, save the rest of the data + * in the fragmentBuffer + */ + if (bytesRead < currentFragment.length) { + /* allocate a buffer to store unsaved data */ + fragmentBuffer = new byte[currentFragment.length + - bytesRead]; + + /* copy over the unsaved data */ + System.arraycopy(currentFragment, bytesRead, + fragmentBuffer, 0, currentFragment.length + - bytesRead); + } + + System.arraycopy(currentFragment, 0, data, position, + bytesRead); + + sizeRead += bytesRead; + position += bytesRead; + remainingLength -= bytesRead; + framesSinceOpen += bytesRead / currentFormat.getFrameSize(); + } } } @@ -227,9 +261,18 @@ public class PulseAudioTargetDataLine ex throw new IllegalStateException("must call open() before drain()"); } + synchronized (this) { + drained = true; + } + // blocks when there is data on the line // http://www.jsresources.org/faq_audio.html#stop_drain_tdl - while (isStarted) { + while (true) { + synchronized (this) { + if (!isStarted || !isOpen) { + break; + } + } try { Thread.sleep(100); } catch (InterruptedException e) { @@ -250,6 +293,10 @@ public class PulseAudioTargetDataLine ex } operation.waitForCompletion(); operation.releaseReference(); + + synchronized (this) { + flushed = true; + } } @@ -282,14 +329,14 @@ public class PulseAudioTargetDataLine ex */ @Override - public void start() { + synchronized public void start() { super.start(); fireLineEvent(new LineEvent(this, LineEvent.Type.START, framesSinceOpen)); } @Override - public void stop() { + synchronized public void stop() { super.stop(); fireLineEvent(new LineEvent(this, LineEvent.Type.STOP, framesSinceOpen)); diff -r 350bc72ba495 -r b185dd9217bb unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Mon Sep 29 15:16:15 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Mon Sep 29 15:56:36 2008 -0400 @@ -299,7 +299,6 @@ public class PulseAudioTargetDataLineTes // this is kind of messed up // drain should hang on a started data line // but read should return - @Ignore @Test public void testReadAndDrain() throws LineUnavailableException, InterruptedException { @@ -320,12 +319,27 @@ public class PulseAudioTargetDataLineTes Assert.assertTrue(reader.isAlive()); - targetDataLine.drain(); + Thread drainer = new Thread() { + + @Override + public void run() { + targetDataLine.drain(); + + } + + }; + + drainer.start(); Thread.sleep(100); Assert.assertFalse(reader.isAlive()); - targetDataLine.stop(); + + targetDataLine.stop(); + + Thread.sleep(100); + Assert.assertFalse(drainer.isAlive()); + targetDataLine.close(); } From omajid at redhat.com Mon Sep 29 12:57:41 2008 From: omajid at redhat.com (Omair Majid) Date: Mon, 29 Sep 2008 19:57:41 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-29 Omair Majid changeset 350bc72ba495 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=350bc72ba495 description: 2008-09-29 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java fragmentBuffer is a new class variable that stores partial fragments. (read): Modified function to work mostly in java. Also takes care of partial fragments that occur when PulseAudio's fragment size does not match the buffer length provided by java. * src/java/org/classpath/icedtea/pulseaudio/Stream.java (native_pa_stream_read): Removed function. (read): Removed function. * src/native/org_classpath_icedtea_pulseaudio_Stream.c (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1read): Commented out function. * unittests/org/classpath/icedtea/pulseadio/PulseAudioTargetDataLineTest.java (testOpenWithFormat): Fixed output message. diffstat: 4 files changed, 83 insertions(+), 17 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 83 +++++++++- src/java/org/classpath/icedtea/pulseaudio/Stream.java | 13 - src/native/org_classpath_icedtea_pulseaudio_Stream.c | 2 unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 2 diffs (203 lines): diff -r f508adb1c908 -r 350bc72ba495 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Mon Sep 29 13:50:48 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Mon Sep 29 15:16:15 2008 -0400 @@ -45,6 +45,13 @@ public class PulseAudioTargetDataLine ex public class PulseAudioTargetDataLine extends PulseAudioDataLine implements TargetDataLine { + /* + * This contains the data from the PulseAudio buffer that has since been + * dropped. If 20 bytes of a fragment of size 200 are read, the other 180 + * are dumped in this + */ + byte[] fragmentBuffer; + public PulseAudioTargetDataLine(EventLoop eventLoop, AudioFormat[] formats, AudioFormat defaultFormat) { supportedFormats = formats; @@ -89,8 +96,9 @@ public class PulseAudioTargetDataLine ex protected void connectLine(int bufferSize, Stream masterStream) throws LineUnavailableException { + int fragmentSize = bufferSize / 10 > 500 ? bufferSize / 10 : 500; StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( - bufferSize, 0, 0, 0, bufferSize / 10); + bufferSize, 0, 0, 0, fragmentSize); synchronized (eventLoop.threadLock) { stream.connectForRecording(Stream.DEFAULT_DEVICE, bufferAttributes); } @@ -123,24 +131,87 @@ public class PulseAudioTargetDataLine ex int remainingLength = length; int sizeRead = 0; + /* bytes read on each iteration of loop */ + int bytesRead; + + /* + * to read, we first take stuff from the fragmentBuffer + */ + + /* on first read() of the line, fragmentBuffer is null */ + if (fragmentBuffer != null) { + + boolean fragmentBufferSmaller = fragmentBuffer.length < length; + int smallerBufferLength = Math.min(fragmentBuffer.length, length); + System.arraycopy(fragmentBuffer, 0, data, position, + smallerBufferLength); + + if (!fragmentBufferSmaller) { + /* + * if fragment was larger, then we already have all the data we + * need. clean up the buffer before returning. Make a new + * fragmentBuffer from the remaining bytes + */ + int remainingBytesInFragment = (fragmentBuffer.length - length); + byte[] newFragmentBuffer = new byte[remainingBytesInFragment]; + System.arraycopy(fragmentBuffer, length, newFragmentBuffer, 0, + newFragmentBuffer.length); + fragmentBuffer = newFragmentBuffer; + return length; + } + + /* done with fragment buffer, remove it */ + bytesRead = smallerBufferLength; + sizeRead += bytesRead; + position += bytesRead; + remainingLength -= bytesRead; + fragmentBuffer = null; + } + + /* + * if we need to read more data, then we read from PulseAudio's buffer + */ while (remainingLength != 0) { - + byte[] currentFragment; synchronized (eventLoop.threadLock) { - int bytesRead = stream.read(data, remainingLength, position); - if (bytesRead < 0) { + + /* read a fragment, and drop it from the server */ + currentFragment = stream.peek(); + stream.drop(); + if (currentFragment == null) { + System.out + .println("DEBUG: PulseAudioTargetDataLine:read(): error in stream.peek()"); return sizeRead; } + + bytesRead = Math.min(currentFragment.length, remainingLength); + + /* + * we read more than we required, save the rest of the data in + * the fragmentBuffer + */ + if (bytesRead < currentFragment.length) { + /* allocate a buffer to store unsaved data */ + fragmentBuffer = new byte[currentFragment.length + - bytesRead]; + /* copy over the unsaved data */ + System.arraycopy(currentFragment, bytesRead, + fragmentBuffer, 0, fragmentBuffer.length + - bytesRead); + } + + System.arraycopy(currentFragment, 0, data, position, bytesRead); + sizeRead += bytesRead; position += bytesRead; remainingLength -= bytesRead; framesSinceOpen += bytesRead / currentFormat.getFrameSize(); - } } // all the data should have been played by now assert (sizeRead == length); - // currentFramePosition += (sizeWritten/getFormat().getFrameSize()); + /* * FIXME when the stream is flushed() etc, instead of returning length * this should unblock and return the the size of data written so far diff -r f508adb1c908 -r 350bc72ba495 src/java/org/classpath/icedtea/pulseaudio/Stream.java --- a/src/java/org/classpath/icedtea/pulseaudio/Stream.java Mon Sep 29 13:50:48 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/Stream.java Mon Sep 29 15:16:15 2008 -0400 @@ -54,7 +54,7 @@ public class Stream { public interface StateListener { public void update(); } - + public interface CorkListener { public void update(); } @@ -163,9 +163,6 @@ public class Stream { private native int native_pa_stream_write(byte[] data, int offset, int length); - - private native int native_pa_stream_read(byte[] array, int length, - int position); private native byte[] native_pa_stream_peek(); @@ -323,7 +320,7 @@ public class Stream { underflowListeners.remove(listener); } } - + public void addCorkListener(CorkListener listener) { synchronized (corkListeners) { corkListeners.add(listener); @@ -501,10 +498,6 @@ public class Stream { return native_pa_stream_write(data, offset, length); } - public int read(byte[] array, int length, int position) { - return native_pa_stream_read(array, length, position); - } - /** * Read the next fragment from the buffer (for recording). * @@ -636,7 +629,7 @@ public class Stream { } } } - + @SuppressWarnings("unused") private void corkCallback() { synchronized (corkListeners) { diff -r f508adb1c908 -r 350bc72ba495 src/native/org_classpath_icedtea_pulseaudio_Stream.c --- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c Mon Sep 29 13:50:48 2008 -0400 +++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c Mon Sep 29 15:16:15 2008 -0400 @@ -525,6 +525,7 @@ JNIEXPORT jint JNICALL Java_org_classpat return value; } +/* JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1read (JNIEnv *env, jobject obj, jbyteArray array, jint length, jint offset) { pa_stream *stream = getJavaPointer(env, obj, STREAM_POINTER); @@ -540,6 +541,7 @@ JNIEXPORT jint JNICALL Java_org_classpat pa_stream_drop(stream); return read_length; } +*/ /* * Class: org_classpath_icedtea_pulseaudio_Stream diff -r f508adb1c908 -r 350bc72ba495 unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Mon Sep 29 13:50:48 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Mon Sep 29 15:16:15 2008 -0400 @@ -170,7 +170,7 @@ public class PulseAudioTargetDataLineTes @Test public void testOpenWithFormat() throws LineUnavailableException { - System.out.println("This test checks that read() sort of wroks"); + System.out.println("This test checks that open(AudioFormat) works"); targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( TargetDataLine.class)); From omajid at redhat.com Mon Sep 29 12:57:41 2008 From: omajid at redhat.com (Omair Majid) Date: Mon, 29 Sep 2008 19:57:41 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-29 Omair Majid changeset f508adb1c908 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=f508adb1c908 description: 2008-09-29 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java (close): Dont drain the line on close. Also mark the line as stopped. * unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java (ThreaderReader): New class. Reads a targetDataLine in a thread. (testReadAndClose): New function. Tests the effects of read() and close() on the same line. (testReadAndStop): New function. Tests the effects of read() and stop() on a TargetDataLine. (testReadAndDrain): New function. Tests the effects of read() and drain() on a TargetDataLine. (testReadAndFlush): New function. Tests the effects of read() and flush() on a TargetDataLine. diffstat: 2 files changed, 147 insertions(+), 2 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java | 3 unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java | 146 ++++++++++ diffs (190 lines): diff -r f29cbcfbc354 -r f508adb1c908 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Fri Sep 26 13:27:33 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java Mon Sep 29 13:50:48 2008 -0400 @@ -261,8 +261,6 @@ public abstract class PulseAudioDataLine "Line must be open for close() to work"); } - drain(); - synchronized (eventLoop.threadLock) { stream.disconnect(); } @@ -278,6 +276,7 @@ public abstract class PulseAudioDataLine } super.close(); + isStarted = false; } diff -r f29cbcfbc354 -r f508adb1c908 unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Fri Sep 26 13:27:33 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLineTest.java Mon Sep 29 13:50:48 2008 -0400 @@ -55,6 +55,7 @@ import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; public class PulseAudioTargetDataLineTest { @@ -67,6 +68,28 @@ public class PulseAudioTargetDataLineTes AudioFormat aSupportedFormat = new AudioFormat( AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 1, 1, 44100f, true); + + class ThreadReader extends Thread { + TargetDataLine line; + byte[] buffer; + + public ThreadReader(TargetDataLine line, byte[] buffer) + throws LineUnavailableException { + + this.line = line; + this.buffer = buffer; + + } + + @Override + public void run() { + int bytesRead = 0; + + bytesRead = line.read(buffer, 0, buffer.length); + // System.out.println("read data"); + + } + } @Before public void setUp() throws LineUnavailableException { @@ -214,6 +237,129 @@ public class PulseAudioTargetDataLineTes } @Test + public void testReadAndClose() throws LineUnavailableException, + InterruptedException { + System.out.println("This test tries to close a line while " + + "read()ing to check that read() returns"); + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + AudioFormat breakingFormat = new AudioFormat( + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 2, 2, 44100f, + true); + targetDataLine.open(breakingFormat); + targetDataLine.start(); + byte[] buffer = new byte[1000000]; + + ThreadReader reader = new ThreadReader(targetDataLine, buffer); + reader.start(); + + Thread.sleep(100); + + Assert.assertTrue(reader.isAlive()); + + targetDataLine.close(); + + reader.join(500); + + Assert.assertFalse(reader.isAlive()); + + } + + @Test + public void testReadAndStop() throws LineUnavailableException, + InterruptedException { + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + AudioFormat breakingFormat = new AudioFormat( + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 2, 2, 44100f, + true); + targetDataLine.open(breakingFormat); + targetDataLine.start(); + byte[] buffer = new byte[10000000]; + + ThreadReader reader = new ThreadReader(targetDataLine, buffer); + reader.start(); + + Thread.sleep(100); + + Assert.assertTrue(reader.isAlive()); + + targetDataLine.stop(); + + Thread.sleep(100); + + Assert.assertFalse(reader.isAlive()); + + targetDataLine.close(); + + } + + // this is kind of messed up + // drain should hang on a started data line + // but read should return + @Ignore + @Test + public void testReadAndDrain() throws LineUnavailableException, + InterruptedException { + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + AudioFormat breakingFormat = new AudioFormat( + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 2, 2, 44100f, + true); + targetDataLine.open(breakingFormat); + targetDataLine.start(); + byte[] buffer = new byte[10000000]; + + ThreadReader reader = new ThreadReader(targetDataLine, buffer); + reader.start(); + + Thread.sleep(100); + + Assert.assertTrue(reader.isAlive()); + + targetDataLine.drain(); + + Thread.sleep(100); + + Assert.assertFalse(reader.isAlive()); + targetDataLine.stop(); + targetDataLine.close(); + } + + @Test + public void testReadAndFlush() throws LineUnavailableException, + InterruptedException { + targetDataLine = (TargetDataLine) mixer.getLine(new Line.Info( + TargetDataLine.class)); + Assert.assertNotNull(targetDataLine); + AudioFormat breakingFormat = new AudioFormat( + AudioFormat.Encoding.PCM_UNSIGNED, 44100f, 8, 2, 2, 44100f, + true); + targetDataLine.open(breakingFormat); + targetDataLine.start(); + byte[] buffer = new byte[10000000]; + + ThreadReader reader = new ThreadReader(targetDataLine, buffer); + reader.start(); + + Thread.sleep(100); + + Assert.assertTrue(reader.isAlive()); + + targetDataLine.flush(); + + Thread.sleep(100); + + Assert.assertFalse(reader.isAlive()); + + targetDataLine.stop(); + targetDataLine.close(); + } + + @Test public void testDrain() throws LineUnavailableException, InterruptedException { System.out From matthew.flaschen at gatech.edu Mon Sep 29 13:41:03 2008 From: matthew.flaschen at gatech.edu (Matthew Flaschen) Date: Mon, 29 Sep 2008 16:41:03 -0400 Subject: JNLP failures building latest hg of IcedTea In-Reply-To: <20080929164859.GB1303@rivendell.middle-earth.co.uk> References: <48E05334.2000807@gatech.edu> <20080929164859.GB1303@rivendell.middle-earth.co.uk> Message-ID: <48E13D5F.80907@gatech.edu> Andrew John Hughes wrote: > It's a little hard to diagnose exactly the problem you're encountering > from the little information you've given here. Can you please include > the commands that lead to each error? Sure. It's just: matthew at matthew-e1505:~/Code/Java/IcedTea/icedtea7% ./configure --with-icedtea --with-icedtea-home=/usr/lib/jvm/java-7-icedtea matthew at matthew-e1505:~/Code/Java/IcedTea/icedtea7% make make is the last command I executed. > I assume this is IcedTea7 not IcedTea6 -- you didn't mention this in > your original mail. That's right. > It seems to be an issue related to creating native_ecj > and/or the use of a 'quick' build via --with-icedtea, but I can't tell > for sure without more information from you. Incidentally, what does > gcj --version give? Glad to provide whatever info helps. matthew at matthew-e1505:~/Code/Java/IcedTea/icedtea7% gcj --version gcj (GCC) 4.2.1 (Ubuntu 4.2.1-5ubuntu5) Matt Flaschne From langel at redhat.com Mon Sep 29 13:54:15 2008 From: langel at redhat.com (Lillian Angel) Date: Mon, 29 Sep 2008 16:54:15 -0400 Subject: preparing a icedtea-1.3 release? In-Reply-To: <48E12BEF.90401@redhat.com> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <48E0DB14.2050903@redhat.com> <48E11745.4090701@ubuntu.com> <48E12BEF.90401@redhat.com> Message-ID: <48E14077.1060203@redhat.com> Lillian Angel wrote: > Hi, > > Matthias Klose wrote: >> [dropping the jdk6-dev list, adding distro-pkg-dev] >> >> Lillian Angel schrieb: >>> Hi, >>> >>> Mark Wielaard wrote: >>>> Hi, >>>> >>>> On Sun, 2008-09-28 at 17:48 +0200, Matthias Klose wrote: >>>>> The last icedtea release 1.2 (bases on b09) was four months ago. I >>>>> would like to >>>>> prepare a 1.3 release based ob b12. are there currently outstanding >>>>> issues? >>>> Good idea. There have been lots of improvements since the last official >>>> 1.2 release. Including various security and crasher issues, that we >>>> really should make sure are picked up by the various distros. >>>> >>>>> - general? >>>> I would like to get the better version reporting in that you and andrew >>>> suggested. Andrew already has something in icedtea[7]. >>>> >>>>> - cacao? >>>>> - icedtea plugin? >>>>> - zero/shark? >>>> Lets make sure that cacao and zero/shark are synced and the default >>>> configure options set. Deepak, do you feel the >>>> liveconnect/icedteaplugin >>>> support is ready for being enabled by default? >>>> >>>>> If possible I aim for a release candidate for the next weekend and >>>>> for a final >>>>> release in about two weeks. >>>> I'll work on some release notes to summarize all the new stuff. >>> I would like to wait until we have the PulseAudio work integrated and, >>> if possible, Deepak's LiveConnect work. >> >> LiveConnect is disabled by default, so that should be fine (although a >> working >> LiveConnect would be very welcome). >> >> How invasive are the PulseAudio changes, how well is it tested, can it >> be turned >> off like the icedtea plugin? The trunk is currently relatively stable. > > It will not be enabled by default, just because we are not sure how well > it will work with other distros. Though, it will be enabled in Fedora, > so if we are going to have a full 1.3 release, it will need to go > through the TCK testing before it gets pushed into Fedora. So, > ultimately I would like to see both of these new features in F-10 (which > is still quite a ways off). Also, they would be excellent milestones to > reach for the next release. > > Though, in the future, I hope it does not take another 4 months to make > an official release. After some discussion on IRC, we decided to aim for a release during the week of October 14 to accommodate the Ubuntu release, PulseAudio and LiveConnect. Cheers, Lillian From gnu_andrew at member.fsf.org Mon Sep 29 13:56:44 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 29 Sep 2008 21:56:44 +0100 Subject: preparing a icedtea-1.3 release? In-Reply-To: <48E14077.1060203@redhat.com> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <48E0DB14.2050903@redhat.com> <48E11745.4090701@ubuntu.com> <48E12BEF.90401@redhat.com> <48E14077.1060203@redhat.com> Message-ID: <20080929205644.GC1303@rivendell.middle-earth.co.uk> On 16:54 Mon 29 Sep , Lillian Angel wrote: > > > Lillian Angel wrote: >> Hi, >> Matthias Klose wrote: >>> [dropping the jdk6-dev list, adding distro-pkg-dev] >>> >>> Lillian Angel schrieb: >>>> Hi, >>>> >>>> Mark Wielaard wrote: >>>>> Hi, >>>>> >>>>> On Sun, 2008-09-28 at 17:48 +0200, Matthias Klose wrote: >>>>>> The last icedtea release 1.2 (bases on b09) was four months ago. I >>>>>> would like to >>>>>> prepare a 1.3 release based ob b12. are there currently outstanding >>>>>> issues? >>>>> Good idea. There have been lots of improvements since the last official >>>>> 1.2 release. Including various security and crasher issues, that we >>>>> really should make sure are picked up by the various distros. >>>>> >>>>>> - general? >>>>> I would like to get the better version reporting in that you and andrew >>>>> suggested. Andrew already has something in icedtea[7]. >>>>> >>>>>> - cacao? >>>>>> - icedtea plugin? >>>>>> - zero/shark? >>>>> Lets make sure that cacao and zero/shark are synced and the default >>>>> configure options set. Deepak, do you feel the >>>>> liveconnect/icedteaplugin >>>>> support is ready for being enabled by default? >>>>> >>>>>> If possible I aim for a release candidate for the next weekend and >>>>>> for a final >>>>>> release in about two weeks. >>>>> I'll work on some release notes to summarize all the new stuff. >>>> I would like to wait until we have the PulseAudio work integrated and, >>>> if possible, Deepak's LiveConnect work. >>> >>> LiveConnect is disabled by default, so that should be fine (although a >>> working >>> LiveConnect would be very welcome). >>> >>> How invasive are the PulseAudio changes, how well is it tested, can it be >>> turned >>> off like the icedtea plugin? The trunk is currently relatively stable. >> It will not be enabled by default, just because we are not sure how well >> it will work with other distros. Though, it will be enabled in Fedora, so >> if we are going to have a full 1.3 release, it will need to go through the >> TCK testing before it gets pushed into Fedora. So, ultimately I would like >> to see both of these new features in F-10 (which is still quite a ways >> off). Also, they would be excellent milestones to reach for the next >> release. >> Though, in the future, I hope it does not take another 4 months to make an >> official release. > > After some discussion on IRC, we decided to aim for a release during the > week of October 14 to accommodate the Ubuntu release, PulseAudio and > LiveConnect. > > > Cheers, > Lillian Sounds good to me. Thanks for taking this on. I'll try and do a 1.8 for IcedTea7 soon after that. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From matthew.flaschen at gatech.edu Mon Sep 29 13:57:18 2008 From: matthew.flaschen at gatech.edu (Matthew Flaschen) Date: Mon, 29 Sep 2008 16:57:18 -0400 Subject: openjdk6 b12 - checksums and rigths In-Reply-To: <200809291624.47019.mvyskocil@suse.cz> References: <200809291624.47019.mvyskocil@suse.cz> Message-ID: <48E1412E.4060303@gatech.edu> Michal Vyskocil wrote: > $ sha1sum openjdk-6-src-b12-28_aug_2008.tar.gz > fa864012b9f07042a1ea1e6c620abe5675f58827 openjdk-6-src-b12-28_aug_2008.tar.gz > > $ md5sum openjdk-6-src-b12-28_aug_2008.tar.gz > b53e1ef643909ce82721ee4c970d958b openjdk-6-src-b12-28_aug_2008.tar.gz > > Anyone has a same problem? Your sums are accurate, but note that the download is a tar.gz while the checksum refers to a zip. It would certainly be nice if the md5 file provided both. Matt Flaschen From omajid at redhat.com Mon Sep 29 14:19:47 2008 From: omajid at redhat.com (Omair Majid) Date: Mon, 29 Sep 2008 21:19:47 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-29 Omair Majid changeset 59f5e34743f6 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=59f5e34743f6 description: 2008-09-29 Omair Majid * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java (testWriteAndClose): New test. Tries to close() a SourceDataLine during a write(). (testWriteAndStop): New test. Tries to stop() a SourceDataLine during a write(). (testWriteAndFlush): New test. Tries to flush() a SourceDataLine during a write(). diffstat: 1 file changed, 161 insertions(+) unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java | 161 ++++++++++ diffs (178 lines): diff -r 5ab54b0ca4ea -r 59f5e34743f6 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Mon Sep 29 15:57:43 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Mon Sep 29 17:14:41 2008 -0400 @@ -41,6 +41,7 @@ import static org.junit.Assert.assertNot import java.io.File; import java.io.IOException; +import java.net.UnknownHostException; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; @@ -229,6 +230,166 @@ public class PulseAudioSourceDataLineTes } @Test + public void testWriteAndClose() throws UnsupportedAudioFileException, + IOException, LineUnavailableException, InterruptedException { + System.out.println("This test tires to close the line during a write"); + + File soundFile = new File("testsounds/startup.wav"); + final AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + AudioFormat audioFormat = audioInputStream.getFormat(); + + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, audioFormat)); + Assert.assertNotNull(sourceDataLine); + + sourceDataLine.open(audioFormat); + sourceDataLine.start(); + + Thread writer = new Thread() { + + @Override + public void run() { + try { + final byte[] abData = new byte[10000000]; + + int bytesRead = 0; + while (bytesRead >= 0) { + bytesRead = audioInputStream.read(abData, 0, + abData.length); + if (bytesRead > 0) { + sourceDataLine.write(abData, 0, bytesRead); + } + } + } catch (UnknownHostException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + }; + + writer.start(); + Thread.sleep(100); + + sourceDataLine.close(); + + writer.join(500); + Assert.assertFalse(writer.isAlive()); + + } + + @Test + public void testWriteAndStop() throws UnsupportedAudioFileException, + IOException, LineUnavailableException, InterruptedException { + System.out.println("This test tires to stop the line during a write"); + + File soundFile = new File("testsounds/startup.wav"); + final AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + AudioFormat audioFormat = audioInputStream.getFormat(); + + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, audioFormat)); + Assert.assertNotNull(sourceDataLine); + + sourceDataLine.open(audioFormat); + sourceDataLine.start(); + + Thread writer = new Thread() { + + @Override + public void run() { + try { + final byte[] abData = new byte[10000000]; + + int bytesRead = 0; + while (bytesRead >= 0) { + bytesRead = audioInputStream.read(abData, 0, + abData.length); + if (bytesRead > 0) { + sourceDataLine.write(abData, 0, bytesRead); + } + } + } catch (UnknownHostException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + }; + + writer.start(); + + Thread.sleep(500); + + sourceDataLine.stop(); + + writer.join(500); + Assert.assertFalse(writer.isAlive()); + + sourceDataLine.close(); + + } + + @Test + public void testWriteAndFlush() throws UnsupportedAudioFileException, + IOException, LineUnavailableException, InterruptedException { + + System.out.println("This test tries to flush a line during a write"); + + File soundFile = new File("testsounds/startup.wav"); + final AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + AudioFormat audioFormat = audioInputStream.getFormat(); + + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, audioFormat)); + Assert.assertNotNull(sourceDataLine); + + sourceDataLine.open(audioFormat); + sourceDataLine.start(); + + Thread writer = new Thread() { + + @Override + public void run() { + try { + final byte[] abData = new byte[10000000]; + + int bytesRead = 0; + while (bytesRead >= 0) { + bytesRead = audioInputStream.read(abData, 0, + abData.length); + if (bytesRead > 0) { + sourceDataLine.write(abData, 0, bytesRead); + } + } + } catch (UnknownHostException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + }; + + writer.start(); + + Thread.sleep(100); + + sourceDataLine.flush(); + + writer.join(500); + Assert.assertFalse(writer.isAlive()); + + sourceDataLine.stop(); + sourceDataLine.close(); + } + + @Test public void testStartedStopped() throws LineUnavailableException, UnsupportedAudioFileException, IOException { From bugzilla-daemon at icedtea.classpath.org Mon Sep 29 15:06:30 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 29 Sep 2008 22:06:30 +0000 Subject: [Bug 198] New: java-1.6.0-openjdk-plugin Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=198 Summary: java-1.6.0-openjdk-plugin Product: IcedTea Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: skvidal at fedoraproject.org When I attempt to use the plugin to get to the remote console on my ibm RSAII server administrator card it does not allow the applet to initialize java-1.6.0-openjdk-1.6.0.0-0.18.b09.fc9.i386 on fedora 9 I'll attach the output from the console -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Mon Sep 29 15:07:05 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 29 Sep 2008 22:07:05 +0000 Subject: [Bug 198] java-1.6.0-openjdk-plugin Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=198 ------- Comment #1 from skvidal at fedoraproject.org 2008-09-29 22:07 ------- Created an attachment (id=102) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=102&action=view) output to console when firefox is run -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Mon Sep 29 15:19:34 2008 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 29 Sep 2008 22:19:34 +0000 Subject: [Bug 198] java-1.6.0-openjdk-plugin Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=198 langel at redhat.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at icedtea.classpath|dbhole at redhat.com |.org | -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. You are the assignee for the bug, or are watching the assignee. From gnu_andrew at member.fsf.org Mon Sep 29 17:44:09 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Tue, 30 Sep 2008 01:44:09 +0100 Subject: JNLP failures building latest hg of IcedTea In-Reply-To: <48E13D5F.80907@gatech.edu> References: <48E05334.2000807@gatech.edu> <20080929164859.GB1303@rivendell.middle-earth.co.uk> <48E13D5F.80907@gatech.edu> Message-ID: <20080930004409.GE1303@rivendell.middle-earth.co.uk> On 16:41 Mon 29 Sep , Matthew Flaschen wrote: > Andrew John Hughes wrote: > > It's a little hard to diagnose exactly the problem you're encountering > > from the little information you've given here. Can you please include > > the commands that lead to each error? > > Sure. It's just: > > matthew at matthew-e1505:~/Code/Java/IcedTea/icedtea7% ./configure > --with-icedtea --with-icedtea-home=/usr/lib/jvm/java-7-icedtea > > matthew at matthew-e1505:~/Code/Java/IcedTea/icedtea7% make > > make is the last command I executed. > I picked up this from your first e-mail. I mean the commands run by make immediately above the error output. > > I assume this is IcedTea7 not IcedTea6 -- you didn't mention this in > > your original mail. > > That's right. > > > It seems to be an issue related to creating native_ecj > > and/or the use of a 'quick' build via --with-icedtea, but I can't tell > > for sure without more information from you. Incidentally, what does > > gcj --version give? > > Glad to provide whatever info helps. > > matthew at matthew-e1505:~/Code/Java/IcedTea/icedtea7% gcj --version > gcj (GCC) 4.2.1 (Ubuntu 4.2.1-5ubuntu5) > Hmmm, mine is 4.3.1, may be an issue with this older gcj but this failure shouldn't affect the rest of the build as it should fall back on interpreted ecj. Do you get a native-ecj file in your build directory? > > Matt Flaschne > Thanks, -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080930/3c215148/attachment.bin From matthew.flaschen at gatech.edu Mon Sep 29 18:25:48 2008 From: matthew.flaschen at gatech.edu (Matthew Flaschen) Date: Mon, 29 Sep 2008 21:25:48 -0400 Subject: JNLP failures building latest hg of IcedTea In-Reply-To: <20080930004409.GE1303@rivendell.middle-earth.co.uk> References: <48E05334.2000807@gatech.edu> <20080929164859.GB1303@rivendell.middle-earth.co.uk> <48E13D5F.80907@gatech.edu> <20080930004409.GE1303@rivendell.middle-earth.co.uk> Message-ID: <48E1801C.6070806@gatech.edu> Andrew John Hughes wrote: > I picked up this from your first e-mail. I mean the commands run by > make immediately above the error output. I'm attaching the full build log, for completeness. The commands leading up to the linker error are: if test "x/usr/bin/gcj" != x; then \ /usr/bin/gcj -g -O2 -Wl,-Bsymbolic -o native-ecj \ --main=org.eclipse.jdt.internal.compiler.batch.Main ; \ fi ; \ touch stamps/native-ecj.stamp /tmp/ccdsNPzJ.o: In function `main': /tmp/ccjkhu7s.i:11: undefined reference to `org::eclipse::jdt::internal::compiler::batch::Main::class$' collect2: ld returned 1 exit status The commands just before the build fails are: if ! test -d /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0 ; \ then \ /usr/lib/jvm/java-7-icedtea/bin/javac -J-Xmx512m -g -d extra-lib \ -source 1.5 \ -sourcepath extra -cp /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/jre/lib/rt.jar \ -bootclasspath '' @extra-source-files.txt ; \ else \ /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/bin/javac -J-Xmx512m -g -d extra-lib \ -source 1.5 \ -sourcepath extra -cp /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/jre/lib/rt.jar \ -bootclasspath '' @extra-source-files.txt ; \ fi I'm fairly sure it's taking the second branch, as that directory does exist. As I noted it fails on /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java , which is one of the two files in extra-source-files.txt. > Hmmm, mine is 4.3.1, may be an issue with this older gcj but this > failure shouldn't affect the rest of the build as it should fall > back on interpreted ecj. Do you get a native-ecj file in your > build directory? No, native-ecj doesn't build. Matt Flaschen -------------- next part -------------- A non-text attachment was scrubbed... Name: build.2008-09-29.log Type: text/x-log Size: 54496 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20080929/bacc1728/build.2008-09-29.log From gnu_andrew at member.fsf.org Tue Sep 30 02:21:53 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Tue, 30 Sep 2008 10:21:53 +0100 Subject: JNLP failures building latest hg of IcedTea In-Reply-To: <48E1801C.6070806@gatech.edu> References: <48E05334.2000807@gatech.edu> <20080929164859.GB1303@rivendell.middle-earth.co.uk> <48E13D5F.80907@gatech.edu> <20080930004409.GE1303@rivendell.middle-earth.co.uk> <48E1801C.6070806@gatech.edu> Message-ID: <17c6771e0809300221x744dc00ex4f2ff96fbfc8b0a2@mail.gmail.com> 2008/9/30 Matthew Flaschen : > Andrew John Hughes wrote: >> I picked up this from your first e-mail. I mean the commands run by >> make immediately above the error output. > > I'm attaching the full build log, for completeness. > > The commands leading up to the linker error are: > > if test "x/usr/bin/gcj" != x; then \ > /usr/bin/gcj -g -O2 -Wl,-Bsymbolic -o native-ecj \ > --main=org.eclipse.jdt.internal.compiler.batch.Main ; \ > fi ; \ > touch stamps/native-ecj.stamp > /tmp/ccdsNPzJ.o: In function `main': > /tmp/ccjkhu7s.i:11: undefined reference to > `org::eclipse::jdt::internal::compiler::batch::Main::class$' > collect2: ld returned 1 exit status > > The commands just before the build fails are: > > if ! test -d /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0 ; \ > then \ > /usr/lib/jvm/java-7-icedtea/bin/javac -J-Xmx512m -g -d extra-lib \ > -source 1.5 \ > -sourcepath extra -cp > /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/jre/lib/rt.jar \ > -bootclasspath '' @extra-source-files.txt ; \ > else \ > > /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/bin/javac > -J-Xmx512m -g -d extra-lib \ > -source 1.5 \ > -sourcepath extra -cp > /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/jre/lib/rt.jar \ > -bootclasspath '' @extra-source-files.txt ; \ > fi > > I'm fairly sure it's taking the second branch, as that directory does exist. > > As I noted it fails on > /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java > , which is one of the two files in extra-source-files.txt. > >> Hmmm, mine is 4.3.1, may be an issue with this older gcj but this >> failure shouldn't affect the rest of the build as it should fall >> back on interpreted ecj. Do you get a native-ecj file in your >> build directory? > > No, native-ecj doesn't build. > > Matt Flaschen > Ok I now think the whole native-ecj thing is a misnomer and not related. The lack of a binary would mean that the interpreted version would be used anyway by the javac.in script, but a --with-icedtea build doesn't use this anyway. /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/bin/javac will actually be a symlink to /usr/lib/jvm/java-7-icedtea/bin/javac so the two branches of the if statement above are equivalent. So the problem is: /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/bin/javac -J-Xmx512m -g -d extra-lib \ -source 1.5 \ -sourcepath extra -cp /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/jre/lib/rt.jar \ -bootclasspath '' @extra-source-files.txt ; \ And I have a feeling it may be that your IcedTea is too old to use for a --with-icedtea build (i.e. it lacks some features of the netx support that the build expects to find there). A full build would compile them instead of expecting them to be in rt.jar. I'll try and do a --with-icedtea build myself with current IcedTea7 and see if I get the same failure, but this is probably because the one in Ubuntu Gutsy Gibbon will be very old now. -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From gnu_andrew at member.fsf.org Tue Sep 30 02:24:57 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Tue, 30 Sep 2008 10:24:57 +0100 Subject: JNLP failures building latest hg of IcedTea In-Reply-To: <17c6771e0809300221x744dc00ex4f2ff96fbfc8b0a2@mail.gmail.com> References: <48E05334.2000807@gatech.edu> <20080929164859.GB1303@rivendell.middle-earth.co.uk> <48E13D5F.80907@gatech.edu> <20080930004409.GE1303@rivendell.middle-earth.co.uk> <48E1801C.6070806@gatech.edu> <17c6771e0809300221x744dc00ex4f2ff96fbfc8b0a2@mail.gmail.com> Message-ID: <17c6771e0809300224n236dd4dftcf9cef1ef1006714@mail.gmail.com> 2008/9/30 Andrew John Hughes : > 2008/9/30 Matthew Flaschen : >> Andrew John Hughes wrote: >>> I picked up this from your first e-mail. I mean the commands run by >>> make immediately above the error output. >> >> I'm attaching the full build log, for completeness. >> >> The commands leading up to the linker error are: >> >> if test "x/usr/bin/gcj" != x; then \ >> /usr/bin/gcj -g -O2 -Wl,-Bsymbolic -o native-ecj \ >> --main=org.eclipse.jdt.internal.compiler.batch.Main ; \ >> fi ; \ >> touch stamps/native-ecj.stamp >> /tmp/ccdsNPzJ.o: In function `main': >> /tmp/ccjkhu7s.i:11: undefined reference to >> `org::eclipse::jdt::internal::compiler::batch::Main::class$' >> collect2: ld returned 1 exit status >> >> The commands just before the build fails are: >> >> if ! test -d /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0 ; \ >> then \ >> /usr/lib/jvm/java-7-icedtea/bin/javac -J-Xmx512m -g -d extra-lib \ >> -source 1.5 \ >> -sourcepath extra -cp >> /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/jre/lib/rt.jar \ >> -bootclasspath '' @extra-source-files.txt ; \ >> else \ >> >> /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/bin/javac >> -J-Xmx512m -g -d extra-lib \ >> -source 1.5 \ >> -sourcepath extra -cp >> /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/jre/lib/rt.jar \ >> -bootclasspath '' @extra-source-files.txt ; \ >> fi >> >> I'm fairly sure it's taking the second branch, as that directory does exist. >> >> As I noted it fails on >> /home/matthew/Code/Java/IcedTea/icedtea7/extra/net/sourceforge/jnlp/about/Main.java >> , which is one of the two files in extra-source-files.txt. >> >>> Hmmm, mine is 4.3.1, may be an issue with this older gcj but this >>> failure shouldn't affect the rest of the build as it should fall >>> back on interpreted ecj. Do you get a native-ecj file in your >>> build directory? >> >> No, native-ecj doesn't build. >> >> Matt Flaschen >> > > Ok I now think the whole native-ecj thing is a misnomer and not related. > The lack of a binary would mean that the interpreted version would be used > anyway by the javac.in script, but a --with-icedtea build doesn't use > this anyway. > /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/bin/javac > will actually > be a symlink to /usr/lib/jvm/java-7-icedtea/bin/javac so the two > branches of the if > statement above are equivalent. > > So the problem is: > > /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/bin/javac > -J-Xmx512m -g -d extra-lib \ > -source 1.5 \ > -sourcepath extra -cp > /home/matthew/Code/Java/IcedTea/icedtea7/bootstrap/jdk1.6.0/jre/lib/rt.jar > \ > -bootclasspath '' @extra-source-files.txt ; \ > > And I have a feeling it may be that your IcedTea is too old to use for > a --with-icedtea build > (i.e. it lacks some features of the netx support that the build > expects to find there). A full > build would compile them instead of expecting them to be in rt.jar. > I'll try and do a --with-icedtea > build myself with current IcedTea7 and see if I get the same failure, > but this is probably because > the one in Ubuntu Gutsy Gibbon will be very old now. > -- > Andrew :-) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 > FWIW I just checked the IcedTea6 build I have here (quite old now - based on b11) and Launcher.class is in its rt.jar. So I strongly think this is a case of the IcedTea being too old to build against using the 'quick' method. -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From gbenson at redhat.com Tue Sep 30 05:42:16 2008 From: gbenson at redhat.com (Gary Benson) Date: Tue, 30 Sep 2008 12:42:16 +0000 Subject: changeset in /hg/icedtea6: 2008-09-30 Gary Benson changeset 28523a4d7bd6 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=28523a4d7bd6 description: 2008-09-30 Gary Benson * patches/icedtea-shark.patch: Updated to latest Shark. * ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp: Likewise. * ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp: Likewise. * ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp: Likewise. * ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp: Likewise. * ports/hotspot/src/cpu/zero/vm/frame_zero.cpp: Likewise. * ports/hotspot/src/cpu/zero/vm/frame_zero.hpp: Likewise. * ports/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp: Likewise. * ports/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp: Likewise. * ports/hotspot/src/cpu/zero/vm/interpreter_zero.cpp: Likewise. * ports/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp: Likewise. * ports/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp: Likewise. * ports/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp: Likewise. * ports/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp: Likewise. * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp: Likewise. * ports/hotspot/src/cpu/zero/vm/stack_zero.hpp: Likewise. * ports/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp: Likewise. * ports/hotspot/src/share/vm/includeDB_shark: Likewise. * ports/hotspot/src/share/vm/shark/sharkBlock.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkBlock.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkBuilder.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkBuilder.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkCompiler.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkEntry.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkFunction.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkFunction.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkMonitor.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkMonitor.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkRuntime.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkRuntime.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkState.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkState.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkState.inline.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkType.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkValue.hpp: Likewise. * ports/hotspot/src/cpu/zero/vm/deoptimizerFrame_zero.hpp: New file. * ports/hotspot/src/share/vm/shark/sharkBytecodeTracer.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkBytecodeTracer.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkStateScanner.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkStateScanner.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkValue.inline.hpp: Likewise. diffstat: 47 files changed, 4107 insertions(+), 1340 deletions(-) ChangeLog | 49 patches/icedtea-shark.patch | 115 ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp | 4 ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp | 184 + ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp | 6 ports/hotspot/src/cpu/zero/vm/deoptimizerFrame_zero.hpp | 49 ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp | 7 ports/hotspot/src/cpu/zero/vm/frame_zero.cpp | 26 ports/hotspot/src/cpu/zero/vm/frame_zero.hpp | 21 ports/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp | 11 ports/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp | 9 ports/hotspot/src/cpu/zero/vm/interpreter_zero.cpp | 12 ports/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp | 54 ports/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp | 4 ports/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp | 4 ports/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp | 2 ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp | 126 - ports/hotspot/src/cpu/zero/vm/stack_zero.hpp | 43 ports/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp | 9 ports/hotspot/src/share/vm/includeDB_shark | 57 ports/hotspot/src/share/vm/shark/sharkBlock.cpp | 1438 +++++++----- ports/hotspot/src/share/vm/shark/sharkBlock.hpp | 319 +- ports/hotspot/src/share/vm/shark/sharkBuilder.cpp | 2 ports/hotspot/src/share/vm/shark/sharkBuilder.hpp | 2 ports/hotspot/src/share/vm/shark/sharkBytecodeTracer.cpp | 114 ports/hotspot/src/share/vm/shark/sharkBytecodeTracer.hpp | 49 ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp | 225 + ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp | 353 ++ ports/hotspot/src/share/vm/shark/sharkCompiler.cpp | 51 ports/hotspot/src/share/vm/shark/sharkCompiler.hpp | 8 ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp | 23 ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp | 1 ports/hotspot/src/share/vm/shark/sharkEntry.cpp | 15 ports/hotspot/src/share/vm/shark/sharkFunction.cpp | 138 - ports/hotspot/src/share/vm/shark/sharkFunction.hpp | 122 - ports/hotspot/src/share/vm/shark/sharkMonitor.cpp | 40 ports/hotspot/src/share/vm/shark/sharkMonitor.hpp | 6 ports/hotspot/src/share/vm/shark/sharkRuntime.cpp | 437 +++ ports/hotspot/src/share/vm/shark/sharkRuntime.hpp | 89 ports/hotspot/src/share/vm/shark/sharkState.cpp | 437 ++- ports/hotspot/src/share/vm/shark/sharkState.hpp | 127 - ports/hotspot/src/share/vm/shark/sharkState.inline.hpp | 49 ports/hotspot/src/share/vm/shark/sharkStateScanner.cpp | 101 ports/hotspot/src/share/vm/shark/sharkStateScanner.hpp | 76 ports/hotspot/src/share/vm/shark/sharkType.cpp | 4 ports/hotspot/src/share/vm/shark/sharkValue.hpp | 395 ++- ports/hotspot/src/share/vm/shark/sharkValue.inline.hpp | 34 diffs (truncated from 7231 to 500 lines): diff -r 9ff3417e28cc -r 28523a4d7bd6 ChangeLog --- a/ChangeLog Mon Sep 29 12:04:41 2008 -0400 +++ b/ChangeLog Tue Sep 30 08:42:10 2008 -0400 @@ -1,3 +1,52 @@ 2008-09-26 Mark Wielaard + + * patches/icedtea-shark.patch: Updated to latest Shark. + * ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/frame_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/frame_zero.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/interpreter_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/stack_zero.hpp: Likewise. + * ports/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp: Likewise. + * ports/hotspot/src/share/vm/includeDB_shark: Likewise. + * ports/hotspot/src/share/vm/shark/sharkBlock.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkBlock.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkBuilder.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkBuilder.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkCompiler.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkEntry.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkFunction.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkFunction.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkMonitor.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkMonitor.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkRuntime.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkRuntime.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkState.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkState.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkState.inline.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkType.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkValue.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/deoptimizerFrame_zero.hpp: New file. + * ports/hotspot/src/share/vm/shark/sharkBytecodeTracer.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkBytecodeTracer.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkStateScanner.cpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkStateScanner.hpp: Likewise. + * ports/hotspot/src/share/vm/shark/sharkValue.inline.hpp: Likewise. + 2008-09-26 Mark Wielaard * patches/icedtea-6712835-ifnode.patch: New patch. diff -r 9ff3417e28cc -r 28523a4d7bd6 patches/icedtea-shark.patch --- a/patches/icedtea-shark.patch Mon Sep 29 12:04:41 2008 -0400 +++ b/patches/icedtea-shark.patch Tue Sep 30 08:42:10 2008 -0400 @@ -303,3 +303,118 @@ diff -r ef3bb05d21d5 openjdk/hotspot/src } +diff -r 70711eb56d8e openjdk/hotspot/src/share/vm/ci/ciTypeFlow.hpp +--- openjdk/hotspot/src/share/vm/ci/ciTypeFlow.hpp Mon Sep 29 08:47:58 2008 +0100 ++++ openjdk/hotspot/src/share/vm/ci/ciTypeFlow.hpp Mon Sep 29 08:51:58 2008 +0100 +@@ -94,9 +94,17 @@ public: + private: + GrowableArray* _set; + ++#ifdef SHARK ++ // XXX This can be removed if it turns out we have to deal ++ // with T_ADDRESS values the same as everything else. ++ public: ++#endif // SHARK + JsrRecord* record_at(int i) { + return _set->at(i); + } ++#ifdef SHARK ++ private: ++#endif // SHARK + + // Insert the given JsrRecord into the JsrSet, maintaining the order + // of the set and replacing any element with the same entry address. +@@ -515,6 +523,13 @@ public: + ciType* local_type_at(int i) const { return _state->local_type_at(i); } + ciType* stack_type_at(int i) const { return _state->stack_type_at(i); } + ++ // access to the JSRs ++#ifdef SHARK ++ // XXX This can be removed if it turns out we have to deal ++ // with T_ADDRESS values the same as everything else. ++ JsrSet* jsrset() const { return _jsrs; } ++#endif // SHARK ++ + // Get the successors for this Block. + GrowableArray* successors(ciBytecodeStream* str, + StateVector* state, +diff -r 70711eb56d8e openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp +--- openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp Mon Sep 29 08:47:58 2008 +0100 ++++ openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp Mon Sep 29 08:54:36 2008 +0100 +@@ -217,6 +217,7 @@ Deoptimization::UnrollBlock* Deoptimizat + + } + ++#ifndef SHARK + // Compute the caller frame based on the sender sp of stub_frame and stored frame sizes info. + CodeBlob* cb = stub_frame.cb(); + // Verify we have the right vframeArray +@@ -227,6 +228,10 @@ Deoptimization::UnrollBlock* Deoptimizat + assert(cb->is_deoptimization_stub() || cb->is_uncommon_trap_stub(), "just checking"); + Events::log("fetch unroll sp " INTPTR_FORMAT, unpack_sp); + #endif ++#else ++ intptr_t* unpack_sp = stub_frame.sender(&dummy_map).unextended_sp(); ++#endif // !SHARK ++ + // This is a guarantee instead of an assert because if vframe doesn't match + // we will unpack the wrong deoptimized frame and wind up in strange places + // where it will be very difficult to figure out what went wrong. Better +@@ -337,7 +342,9 @@ Deoptimization::UnrollBlock* Deoptimizat + + frame_pcs[0] = deopt_sender.raw_pc(); + ++#ifndef SHARK + assert(CodeCache::find_blob_unsafe(frame_pcs[0]) != NULL, "bad pc"); ++#endif // SHARK + + UnrollBlock* info = new UnrollBlock(array->frame_size() * BytesPerWord, + caller_adjustment * BytesPerWord, +@@ -832,7 +839,20 @@ vframeArray* Deoptimization::create_vfra + // stuff a C2I adapter we can properly fill in the callee-save + // register locations. + frame caller = fr.sender(reg_map); ++#ifdef ZERO ++ int frame_size; ++ { ++ // In zero, frame::sp() is the *end* of the frame, so ++ // caller.sp() - fr.sp() is the size of the *caller*. ++ RegisterMap dummy_map(thread, false); ++ frame frame_1 = thread->last_frame(); ++ frame frame_2 = frame_1.sender(&dummy_map); ++ assert(frame_2.sp() == fr.sp(), "should be"); ++ frame_size = frame_2.sp() - frame_1.sp(); ++ } ++#else + int frame_size = caller.sp() - fr.sp(); ++#endif // ZERO + + frame sender = caller; + +diff -r 70711eb56d8e openjdk/hotspot/src/share/vm/runtime/vframeArray.cpp +--- openjdk/hotspot/src/share/vm/runtime/vframeArray.cpp Mon Sep 29 08:47:58 2008 +0100 ++++ openjdk/hotspot/src/share/vm/runtime/vframeArray.cpp Mon Sep 29 08:56:26 2008 +0100 +@@ -64,6 +64,11 @@ void vframeArrayElement::fill_in(compile + assert(monitor->owner() == NULL || (!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern()), "object must be null or locked, and unbiased"); + BasicObjectLock* dest = _monitors->at(index); + dest->set_obj(monitor->owner()); ++#ifdef SHARK ++ // XXX This can be removed when Shark knows ++ // which monitors are in use. ++ if (monitor->owner()) ++#endif // SHARK + monitor->lock()->move_to(monitor->owner(), dest->lock()); + } + } +@@ -262,6 +267,11 @@ void vframeArrayElement::unpack_on_stack + top = iframe()->previous_monitor_in_interpreter_frame(top); + BasicObjectLock* src = _monitors->at(index); + top->set_obj(src->obj()); ++#ifdef SHARK ++ // XXX This can be removed when Shark knows ++ // which monitors are in use. ++ if (src->obj()) ++#endif // SHARK + src->lock()->move_to(src->obj(), top->lock()); + } + if (ProfileInterpreter) { diff -r 9ff3417e28cc -r 28523a4d7bd6 ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp Mon Sep 29 12:04:41 2008 -0400 +++ b/ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp Tue Sep 30 08:42:10 2008 -0400 @@ -42,6 +42,10 @@ inline void set_method(methodOop new_method) { _method = new_method; + } + inline interpreterState self_link() + { + return _self_link; } inline void set_self_link(interpreterState new_self_link) { diff -r 9ff3417e28cc -r 28523a4d7bd6 ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Mon Sep 29 12:04:41 2008 -0400 +++ b/ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Tue Sep 30 08:42:10 2008 -0400 @@ -56,7 +56,24 @@ void CppInterpreter::normal_entry(method // Allocate and initialize our frame. InterpreterFrame *frame = InterpreterFrame::build(stack, method, thread); thread->push_zero_frame(frame); + + // Execute those bytecodes! + main_loop(0, THREAD); +} + +void CppInterpreter::main_loop(int recurse, TRAPS) +{ + JavaThread *thread = (JavaThread *) THREAD; + ZeroStack *stack = thread->zero_stack(); + + // If we are entering from a deopt we may need to call + // ourself a few times in order to get to our frame. + if (recurse) + main_loop(recurse - 1, THREAD); + + InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame(); interpreterState istate = frame->interpreter_state(); + methodOop method = istate->method(); intptr_t *result = NULL; int result_slots = 0; @@ -79,13 +96,13 @@ void CppInterpreter::normal_entry(method // Examine the message from the interpreter to decide what to do if (istate->msg() == BytecodeInterpreter::call_method) { - method = istate->callee(); + methodOop callee = istate->callee(); // Trim back the stack to put the parameters at the top stack->set_sp(istate->stack() + 1); // Make the call - Interpreter::invoke_method(method, istate->callee_entry_point(), THREAD); + Interpreter::invoke_method(callee, istate->callee_entry_point(), THREAD); fixup_after_potential_safepoint(); // Convert the result @@ -95,7 +112,6 @@ void CppInterpreter::normal_entry(method stack->set_sp(istate->stack_limit() + 1); // Resume the interpreter - method = istate->method(); istate->set_msg(BytecodeInterpreter::method_resume); } else if (istate->msg() == BytecodeInterpreter::more_monitors) { @@ -689,6 +705,139 @@ InterpreterGenerator::InterpreterGenerat generate_all(); } +// Deoptimization helpers + +InterpreterFrame *InterpreterFrame::build(ZeroStack* stack, int size) +{ + int size_in_words = size >> LogBytesPerWord; + assert(size_in_words * wordSize == size, "unaligned"); + assert(size_in_words >= header_words, "too small"); + + if (size_in_words > stack->available_words()) { + Unimplemented(); + } + + stack->push(0); // next_frame, filled in later + intptr_t *fp = stack->sp(); + assert(fp - stack->sp() == next_frame_off, "should be"); + + stack->push(INTERPRETER_FRAME); + assert(fp - stack->sp() == frame_type_off, "should be"); + + interpreterState istate = + (interpreterState) stack->alloc(sizeof(BytecodeInterpreter)); + assert(fp - stack->sp() == istate_off, "should be"); + istate->set_self_link(NULL); // mark invalid + + stack->alloc((size_in_words - header_words) * wordSize); + + return (InterpreterFrame *) fp; +} + +int AbstractInterpreter::layout_activation(methodOop method, + int tempcount, + int popframe_extra_args, + int moncount, + int callee_param_count, + int callee_locals, + frame* caller, + frame* interpreter_frame, + bool is_top_frame) +{ + assert(popframe_extra_args == 0, "what to do?"); + assert(!is_top_frame || (!callee_locals && !callee_param_count), + "top frame should have no caller") + + // This code must exactly match what InterpreterFrame::build + // does (the full InterpreterFrame::build, that is, not the + // one that creates empty frames for the deoptimizer). + // + // If interpreter_frame is not NULL then it will be filled in. + // It's size is determined by a previous call to this method, + // so it should be correct. + // + // Note that tempcount is the current size of the expression + // stack. For top most frames we will allocate a full sized + // expression stack and not the trimmed version that non-top + // frames have. + + int header_words = InterpreterFrame::header_words; + int monitor_words = moncount * frame::interpreter_frame_monitor_size(); + int stack_words = is_top_frame ? method->max_stack() : tempcount; + int callee_extra_locals = callee_locals - callee_param_count; + + if (interpreter_frame) { + intptr_t *locals = interpreter_frame->sp() + method->max_locals(); + interpreterState istate = interpreter_frame->get_interpreterState(); + intptr_t *monitor_base = (intptr_t*) istate; + intptr_t *stack_base = monitor_base - monitor_words; + intptr_t *stack = stack_base - tempcount - 1; + + BytecodeInterpreter::layout_interpreterState(istate, + caller, + NULL, + method, + locals, + stack, + stack_base, + monitor_base, + NULL, + is_top_frame); + } + return header_words + monitor_words + stack_words + callee_extra_locals; +} + +void BytecodeInterpreter::layout_interpreterState(interpreterState istate, + frame* caller, + frame* current, + methodOop method, + intptr_t* locals, + intptr_t* stack, + intptr_t* stack_base, + intptr_t* monitor_base, + intptr_t* frame_bottom, + bool is_top_frame) +{ + istate->set_locals(locals); + istate->set_method(method); + istate->set_self_link(istate); + istate->set_prev_link(NULL); + // thread will be set by a hacky repurposing of frame::patch_pc() + // bcp will be set by vframeArrayElement::unpack_on_stack() + istate->set_constants(method->constants()->cache()); + istate->set_msg(BytecodeInterpreter::method_resume); + istate->set_bcp_advance(0); + istate->set_oop_temp(NULL); + istate->set_mdx(NULL); + if (caller->is_interpreted_frame()) { + interpreterState prev = caller->get_interpreterState(); + prev->set_callee(method); + if (*prev->bcp() == Bytecodes::_invokeinterface) + prev->set_bcp_advance(5); + else + prev->set_bcp_advance(3); + } + istate->set_callee(NULL); + istate->set_monitor_base((BasicObjectLock *) monitor_base); + istate->set_stack_base(stack_base); + istate->set_stack(stack); + istate->set_stack_limit(stack_base - method->max_stack() - 1); +} + +address CppInterpreter::return_entry(TosState state, int length) +{ + Unimplemented(); +} + +address CppInterpreter::deopt_entry(TosState state, int length) +{ +#ifdef SHARK + return NULL; +#else + Unimplemented(); +#endif // SHARK +} + // Helper for (runtime) stack overflow checks int AbstractInterpreter::size_top_interpreter_activation(methodOop method) @@ -696,34 +845,15 @@ int AbstractInterpreter::size_top_interp return 0; } -// Deoptimization helpers for C++ interpreter - -int AbstractInterpreter::layout_activation(methodOop method, - int tempcount, - int popframe_extra_args, - int moncount, - int callee_param_count, - int callee_locals, - frame* caller, - frame* interpreter_frame, - bool is_top_frame) -{ - Unimplemented(); -} - -address CppInterpreter::return_entry(TosState state, int length) -{ - Unimplemented(); -} - -address CppInterpreter::deopt_entry(TosState state, int length) -{ - Unimplemented(); -} +// Helper for figuring out if frames are interpreter frames bool CppInterpreter::contains(address pc) { +#ifdef PRODUCT ShouldNotCallThis(); +#else + return false; // make frame::print_value_on work +#endif // !PRODUCT } // Result handlers and convertors diff -r 9ff3417e28cc -r 28523a4d7bd6 ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp Mon Sep 29 12:04:41 2008 -0400 +++ b/ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp Tue Sep 30 08:42:10 2008 -0400 @@ -28,9 +28,13 @@ // Size of interpreter code const static int InterpreterCodeSize = 6 * K; - private: + public: // Method entries static void normal_entry(methodOop method, intptr_t UNUSED, TRAPS); static void native_entry(methodOop method, intptr_t UNUSED, TRAPS); static void accessor_entry(methodOop method, intptr_t UNUSED, TRAPS); static void empty_entry(methodOop method, intptr_t UNUSED, TRAPS); + + public: + // Main loop of normal_entry + static void main_loop(int recurse, TRAPS); diff -r 9ff3417e28cc -r 28523a4d7bd6 ports/hotspot/src/cpu/zero/vm/deoptimizerFrame_zero.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ports/hotspot/src/cpu/zero/vm/deoptimizerFrame_zero.hpp Tue Sep 30 08:42:10 2008 -0400 @@ -0,0 +1,49 @@ +/* + * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2008 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// | ... | +// +--------------------+ ------------------ +// | frame_type | low addresses +// | next_frame | high addresses +// +--------------------+ ------------------ +// | ... | + +class DeoptimizerFrame : public ZeroFrame { + friend class ZeroStackPrinter; + + private: + DeoptimizerFrame() : ZeroFrame() + { + ShouldNotCallThis(); + } + + protected: + enum Layout { + header_words = jf_header_words + }; + + public: + static DeoptimizerFrame *build(ZeroStack* stack); +}; diff -r 9ff3417e28cc -r 28523a4d7bd6 ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp Mon Sep 29 12:04:41 2008 -0400 +++ b/ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp Tue Sep 30 08:42:10 2008 -0400 @@ -36,12 +36,7 @@ void Disassembler::decode(nmethod *nm, o { From gbenson at redhat.com Tue Sep 30 05:45:14 2008 From: gbenson at redhat.com (Gary Benson) Date: Tue, 30 Sep 2008 13:45:14 +0100 Subject: preparing a icedtea-1.3 release? In-Reply-To: <20080929073544.GA3780@redhat.com> References: <48DFA75E.6080906@ubuntu.com> <1222636644.3271.10.camel@dijkstra.wildebeest.org> <20080928212527.GA7083@rivendell.middle-earth.co.uk> <1222673248.3299.2.camel@cthalinger> <20080929073544.GA3780@redhat.com> Message-ID: <20080930124514.GB3147@redhat.com> Gary Benson wrote: > Christian Thalinger wrote: > > On Sun, 2008-09-28 at 22:25 +0100, Andrew John Hughes wrote: > > > Would be nice if twisti released his latest stuff so the build > > > was against 0.99.4 or whatever. I believe he has some related > > > fixes. > > > > Right, there are a number of fixes. I try to make a 0.99.4 > > release this week. > > I'll put the latest Shark stuff in there too. It's in. Cheers, Gary -- http://gbenson.net/ From langel at redhat.com Tue Sep 30 06:53:23 2008 From: langel at redhat.com (Lillian Angel) Date: Tue, 30 Sep 2008 13:53:23 +0000 Subject: changeset in /hg/icedtea6: 2008-09-30 Lillian Angel changeset 4089c5ff39f2 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=4089c5ff39f2 description: 2008-09-30 Lillian Angel * Makefile.am: Updated cleanup. diffstat: 2 files changed, 10 insertions(+), 2 deletions(-) ChangeLog | 4 ++++ Makefile.am | 8 ++++++-- diffs (36 lines): diff -r 28523a4d7bd6 -r 4089c5ff39f2 ChangeLog --- a/ChangeLog Tue Sep 30 08:42:10 2008 -0400 +++ b/ChangeLog Tue Sep 30 09:53:18 2008 -0400 @@ -1,3 +1,7 @@ 2008-09-30 Gary Benson + + * Makefile.am: Updated cleanup. + 2008-09-30 Gary Benson * patches/icedtea-shark.patch: Updated to latest Shark. diff -r 28523a4d7bd6 -r 4089c5ff39f2 Makefile.am --- a/Makefile.am Tue Sep 30 08:42:10 2008 -0400 +++ b/Makefile.am Tue Sep 30 09:53:18 2008 -0400 @@ -48,15 +48,19 @@ distclean-local: clean-copy clean-jtreg rm -rf hotspot-tools if ENABLE_LIVECONNECT rm -f IcedTeaPlugin.so + rm -rf IcedTeaPlugin.jar else if ENABLE_PLUGIN rm -f gcjwebplugin.so endif endif - rm -rf cacao +if WITH_VISUALVM rm -rf visualvm rm -rf netbeans - rm -f gcjwebplugin.so +endif +if WITH_CACAO + rm -rf cacao +endif install: From gnu_andrew at member.fsf.org Tue Sep 30 07:49:04 2008 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Tue, 30 Sep 2008 15:49:04 +0100 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <48DC1544.5070507@sun.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> <48D13DAE.9030009@sun.com> <48D2502A.7020001@sun.com> <48D802A2.6080509@sun.com> <48D9C77D.5030506@sun.com> <48DC0857.5070804@sun.com> <1222381072.3266.102.camel@dijkstra.wildebeest.org> <48DC1544.5070507@sun.com> Message-ID: <17c6771e0809300749y3125515ex9aea2d3b1b34446e@mail.gmail.com> 2008/9/25 Kelly O'Hair : > > > Mark Wielaard wrote: >> >> Hi Kelly, >> >> On Thu, 2008-09-25 at 14:53 -0700, Kelly O'Hair wrote: >>> >>> I'm starting to work on the OpenJDK6 Mercurial conversion. My plan is for >>> Build 5 to be the Rev 0 changeset, and I will try and create changesets >>> for each of the bug fixes in a Build. >> >> Would it be possible to reconstruct the openjdk7 revision that was the >> original starting point for the openjdk6 tree? That would be very >> helpful to have for forward and backward porting between the two trees. >> If you could make that rev0 and then have one giant changeset to build 5 >> as rev1 that would be really great. > > Sorry... unknown legal issues may be lurking in Builds 0-4, not sure I > want to go there. :^( > I don't think Mark's intention was to include builds 0 to 4, but to have the initial import as the OpenJDK7 build drop which was the original base for OpenJDK6 (this code has already been released) and then have the next commit as b5. >> >> For example we have found some nasty AWT bugs that have been fixed in >> openjdk7, but it was somewhat hard to track down what was needed because >> the origin of the awt code in openjdk6 wasn't exactly known. >> >>> So I'll be going through the list of fixes for each build, try and create >>> a >>> changeset for it, and at the end I'll copy in the final source for that >>> build and see what I missed. The final changeset may be one for the >>> remaining >>> bugs fixed. Then I'll tag that changeset and move on to the next build. >>> I'm calling this Total Recall, in that I'm essentially doing a replay >>> of the Build 5 through Build 12 changes. >> >> Wow. That is really, really great. And it must be a real pain to go >> through all that. Thanks a lot for doing this! Hope it will not drive >> you mad. > > Mad? Mad? Ha Ha! ... Hopefully they aren't coming to take me away... > http://uk.youtube.com/watch?v=2o7bMdAyPes > Indeed, this is really great. Thanks for doing it. >> >>> One of my concerns is that normally we want every changeset fully vetted >>> with regards to at least building on all platforms. >>> Unfortunately with Teamware, the changes are often not kept in any >>> sequential >>> order like the Mercurial changesets, they are independent SCCS file >>> changes. >>> The history file can help me, but I'm dealing with a very old DSCM system >>> here. >>> >>> So I'll try and re-create the same order the changes were made, and then >>> occasionally make sure it builds on all platforms. >>> The final sources for each Build we know builds ok on all platforms, >>> those >>> are effectively the source bundle drops. >>> So I can't guarantee that every changeset is cleanly buildable on all >>> platforms. >>> Is that acceptable to everyone? >> >> It would certainly be to me. I am already very pleased that you are >> attempting to get more than just one changeset per build drop. I think >> the data will mostly be used for historical purposes (what was changed >> when together with what?). Not for actually building. > > Good. I'll do the best I can... > > -kto > >> >> Thanks, >> >> Mark >> > Ok for me too. -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Tue Sep 30 08:49:17 2008 From: omajid at redhat.com (Omair Majid) Date: Tue, 30 Sep 2008 15:49:17 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-30 Omair Majid changeset 0894592be2a2 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=0894592be2a2 description: 2008-09-30 Omair Majid * configure.ac: Added explicit dependency on pulseaudio >=0.9.11 diffstat: 1 file changed, 3 insertions(+), 3 deletions(-) configure.ac | 6 +++--- diffs (19 lines): diff -r 59f5e34743f6 -r 0894592be2a2 configure.ac --- a/configure.ac Mon Sep 29 17:14:41 2008 -0400 +++ b/configure.ac Tue Sep 30 10:31:32 2008 -0400 @@ -4,12 +4,12 @@ AC_PROG_LIBTOOL AC_PROG_LIBTOOL dnl Check for pulseaudio libraries. -PKG_CHECK_MODULES(LIBPULSE,libpulse,[LIBPULSE_FOUND=yes] +PKG_CHECK_MODULES(LIBPULSE,[libpulse >= 0.9.11],[LIBPULSE_FOUND=yes] ,[LIBPULSE_FOUND=no]) if test "x${LIBPULSE_FOUND}" = xno then - AC_MSG_ERROR([Could not find pulseaudio libraries - \ - Try installing pulseaudio-libs-devel.]) + AC_MSG_ERROR([Could not find pulseaudio>=0.9.11 libraries - \ + Try installing pulseaudio-libs-devel>=0.9.11.]) fi AC_SUBST(LIBPULSE_CFLAGS) AC_SUBST(LIBPULSE_LIBS) From omajid at redhat.com Tue Sep 30 08:49:18 2008 From: omajid at redhat.com (Omair Majid) Date: Tue, 30 Sep 2008 15:49:18 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-30 Omair Majid changeset 609dcbe6d5b8 in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=609dcbe6d5b8 description: 2008-09-30 Omair Majid * unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java (testWriteWithoutStart): New function. Checks that writing to line that hasnt been started doesnt play any sound. (testDrainWithoutStart): fixed function. Tries to drain a line with data written to it that hasnt been started. Now writes in a separate thread so that the function doesnt block on write. (testFlushWithoutStart): New test. Tries to flush a line that hasnt been started. diffstat: 1 file changed, 92 insertions(+), 17 deletions(-) unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java | 109 ++++++++-- diffs (154 lines): diff -r 0894592be2a2 -r 609dcbe6d5b8 unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java --- a/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Tue Sep 30 10:31:32 2008 -0400 +++ b/unittests/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLineTest.java Tue Sep 30 11:49:05 2008 -0400 @@ -230,6 +230,59 @@ public class PulseAudioSourceDataLineTes } @Test + public void testWriteWithoutStart() throws UnsupportedAudioFileException, + IOException, LineUnavailableException, InterruptedException { + + System.out + .println("This test doesnt play a file; you shouldnt hear anything"); + + File soundFile = new File("testsounds/startup.wav"); + final AudioInputStream audioInputStream = AudioSystem + .getAudioInputStream(soundFile); + final AudioFormat audioFormat = audioInputStream.getFormat(); + + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, audioFormat)); + Assert.assertNotNull(sourceDataLine); + + Thread writer = new Thread() { + @Override + public void run() { + try { + sourceDataLine.open(audioFormat); + byte[] abData = new byte[1000]; + int bytesRead = 0; + int total = 0; + + while (bytesRead >= 0 && total < 50) { + bytesRead = audioInputStream.read(abData, 0, + abData.length); + if (bytesRead > 0) { + sourceDataLine.write(abData, 0, bytesRead); + } + total++; + } + } catch (LineUnavailableException e) { + Assert.fail(); + } catch (IOException e) { + Assert.fail(); + } + } + + }; + + writer.start(); + + Thread.sleep(100); + + writer.join(1000); + + /* assert that the writer is still waiting in write */ + Assert.assertTrue(writer.isAlive()); + + } + + @Test public void testWriteAndClose() throws UnsupportedAudioFileException, IOException, LineUnavailableException, InterruptedException { System.out.println("This test tires to close the line during a write"); @@ -393,6 +446,9 @@ public class PulseAudioSourceDataLineTes public void testStartedStopped() throws LineUnavailableException, UnsupportedAudioFileException, IOException { + System.out + .println("This test check START/STOP events. You should see 1 START and 1 STOP event"); + File soundFile = new File("testsounds/startup.wav"); AudioInputStream audioInputStream = AudioSystem .getAudioInputStream(soundFile); @@ -1013,7 +1069,7 @@ public class PulseAudioSourceDataLineTes UnsupportedAudioFileException, IOException, InterruptedException { File soundFile = new File("testsounds/logout.wav"); - AudioInputStream audioInputStream = AudioSystem + final AudioInputStream audioInputStream = AudioSystem .getAudioInputStream(soundFile); AudioFormat audioFormat = audioInputStream.getFormat(); @@ -1024,29 +1080,39 @@ public class PulseAudioSourceDataLineTes int available = sourceDataLine.available(); Assert.assertTrue(available > 1000); - byte[] abData = new byte[1000]; - int bytesRead = 0; - - bytesRead = audioInputStream.read(abData, 0, abData.length); - Assert.assertTrue(bytesRead > 0); - sourceDataLine.write(abData, 0, bytesRead); - - Runnable blocker = new Runnable() { + Thread writer = new Thread() { + @Override + public void run() { + try { + final byte[] abData = new byte[100000]; + int bytesRead = 0; + + bytesRead = audioInputStream.read(abData, 0, abData.length); + Assert.assertTrue(bytesRead > 0); + + sourceDataLine.write(abData, 0, bytesRead); + } catch (IOException e) { + + } + } + }; + + Thread drainer = new Thread() { @Override public void run() { sourceDataLine.drain(); } }; - Thread th = new Thread(blocker); - th.start(); - - th.join(1000); - - if (th.isAlive()) { + writer.start(); + drainer.start(); + + drainer.join(1000); + + if (drainer.isAlive()) { sourceDataLine.close(); - th.join(1000); - if (th.isAlive()) { + drainer.join(1000); + if (drainer.isAlive()) { Assert .fail("drain() does not return when the line has been closed"); } else { @@ -1086,6 +1152,15 @@ public class PulseAudioSourceDataLineTes sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( SourceDataLine.class, aSupportedFormat, 1000)); + sourceDataLine.flush(); + + } + + @Test + public void testFlushWithoutStart() throws LineUnavailableException { + sourceDataLine = (SourceDataLine) mixer.getLine(new DataLine.Info( + SourceDataLine.class, aSupportedFormat, 1000)); + sourceDataLine.open(); sourceDataLine.flush(); } From langel at redhat.com Tue Sep 30 10:20:50 2008 From: langel at redhat.com (Lillian Angel) Date: Tue, 30 Sep 2008 17:20:50 +0000 Subject: changeset in /hg/icedtea6: 2008-09-30 Lillian Angel changeset 0b0f039954b2 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=0b0f039954b2 description: 2008-09-30 Lillian Angel * Makefile.am (EXTRA_DIST): Added visualvm.desktop. * visualvm.desktop: New file. diffstat: 3 files changed, 17 insertions(+), 1 deletion(-) ChangeLog | 6 ++++++ Makefile.am | 2 +- visualvm.desktop | 10 ++++++++++ diffs (39 lines): diff -r 4089c5ff39f2 -r 0b0f039954b2 ChangeLog --- a/ChangeLog Tue Sep 30 09:53:18 2008 -0400 +++ b/ChangeLog Tue Sep 30 13:20:46 2008 -0400 @@ -1,3 +1,9 @@ 2008-09-30 Lillian Angel + + * Makefile.am + (EXTRA_DIST): Added visualvm.desktop. + * visualvm.desktop: New file. + 2008-09-30 Lillian Angel * Makefile.am: Updated cleanup. diff -r 4089c5ff39f2 -r 0b0f039954b2 Makefile.am --- a/Makefile.am Tue Sep 30 09:53:18 2008 -0400 +++ b/Makefile.am Tue Sep 30 13:20:46 2008 -0400 @@ -79,7 +79,7 @@ EXTRA_DIST = rt generated $(ICEDTEA_PATC $(ICEDTEA_ECJ_PATCH) gcjwebplugin.cc tools-copy contrib ports \ patches/icedtea-gcc-4.3.patch extra $(ZERO_PATCHES) \ patches/icedtea-arch.patch patches/icedtea-cacao.patch \ - javaws.png javaws.desktop \ + javaws.png javaws.desktop visualvm.desktop \ overlays extra jconsole.desktop policytool.desktop \ test/jtreg patches/icedtea-plugin.patch \ patches/icedtea-liveconnect.patch IcedTeaPlugin.cc \ diff -r 4089c5ff39f2 -r 0b0f039954b2 visualvm.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/visualvm.desktop Tue Sep 30 13:20:46 2008 -0400 @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=OpenJDK VisualVM +Comment=Integrates commandline JDK tools and profiling capabilites. +Exec=/usr/bin/jvisualvm +Icon=java +Terminal=false +Type=Application +Categories=Development;Java; +Version=1.0 +MimeType=application/x-java-jnlp-file; From langel at redhat.com Tue Sep 30 10:22:55 2008 From: langel at redhat.com (Lillian Angel) Date: Tue, 30 Sep 2008 17:22:55 +0000 Subject: changeset in /hg/icedtea6: Fixed typo Message-ID: changeset d03dd528c2ed in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=d03dd528c2ed description: Fixed typo diffstat: 1 file changed, 1 deletion(-) visualvm.desktop | 1 - diffs (8 lines): diff -r 0b0f039954b2 -r d03dd528c2ed visualvm.desktop --- a/visualvm.desktop Tue Sep 30 13:20:46 2008 -0400 +++ b/visualvm.desktop Tue Sep 30 13:22:52 2008 -0400 @@ -7,4 +7,3 @@ Type=Application Type=Application Categories=Development;Java; Version=1.0 -MimeType=application/x-java-jnlp-file; From omajid at redhat.com Tue Sep 30 11:44:01 2008 From: omajid at redhat.com (Omair Majid) Date: Tue, 30 Sep 2008 18:44:01 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-30 Omair Majid changeset 55bb87d31a6f in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=55bb87d31a6f description: 2008-09-30 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java (open): Initialize variables so reopening a line still leaves it in a valid state. (read): Fixed comments. (flush): Also clear the fragmentBuffer. diffstat: 1 file changed, 15 insertions(+), 6 deletions(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java | 21 +++++++--- diffs (81 lines): diff -r 609dcbe6d5b8 -r 55bb87d31a6f src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Tue Sep 30 11:49:05 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java Tue Sep 30 12:17:33 2008 -0400 @@ -90,8 +90,13 @@ public class PulseAudioTargetDataLine ex super.open(format, bufferSize); + /* initialize all the member variables */ framesSinceOpen = 0; - + fragmentBuffer = null; + flushed = false; + drained = false; + + /* add this open line to the mixer */ PulseAudioMixer parentMixer = PulseAudioMixer.getInstance(); parentMixer.addTargetLine(this); } @@ -115,6 +120,8 @@ public class PulseAudioTargetDataLine ex @Override public int read(byte[] data, int offset, int length) { + /* check state and inputs */ + if (!isOpen) { throw new IllegalStateException("must call open() before read()"); } @@ -134,6 +141,8 @@ public class PulseAudioTargetDataLine ex throw new ArrayIndexOutOfBoundsException("index: " + (length + offset) + " array size: " + data.length); } + + /* everything ok */ int position = offset; int remainingLength = length; @@ -246,10 +255,6 @@ public class PulseAudioTargetDataLine ex // all the data should have been played by now assert (sizeRead == length); - /* - * FIXME when the stream is flushed() etc, instead of returning length - * this should unblock and return the the size of data written so far - */ return sizeRead; } @@ -276,6 +281,7 @@ public class PulseAudioTargetDataLine ex try { Thread.sleep(100); } catch (InterruptedException e) { + // do nothing } } @@ -287,6 +293,7 @@ public class PulseAudioTargetDataLine ex throw new IllegalStateException("Line must be open"); } + /* flush the buffer on pulseaudio's side */ Operation operation; synchronized (eventLoop.threadLock) { operation = stream.flush(); @@ -296,6 +303,8 @@ public class PulseAudioTargetDataLine ex synchronized (this) { flushed = true; + /* flush the partial fragment we stored */ + fragmentBuffer = null; } } @@ -324,7 +333,7 @@ public class PulseAudioTargetDataLine ex /* * A TargetData starts when we ask it to and continues playing until we ask - * it to stop. there are no buffer underruns/overflows or anything so we + * it to stop. There are no buffer underruns/overflows or anything so we * will just fire the LineEvents manually */ From omajid at redhat.com Tue Sep 30 11:44:01 2008 From: omajid at redhat.com (Omair Majid) Date: Tue, 30 Sep 2008 18:44:01 +0000 Subject: changeset in /hg/pulseaudio: 2008-09-30 Omair Majid changeset a6a5ca46e90e in /hg/pulseaudio details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=a6a5ca46e90e description: 2008-09-30 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (open): Initialize varaibles to sane values on open to survive reopening. diffstat: 1 file changed, 7 insertions(+), 1 deletion(-) src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java | 8 +++++++- diffs (35 lines): diff -r 55bb87d31a6f -r a6a5ca46e90e src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 30 12:17:33 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 30 14:43:55 2008 -0400 @@ -70,7 +70,7 @@ public class PulseAudioClip extends Puls public static final String DEFAULT_CLIP_NAME = "Clip"; private Object clipLock = new Object(); - private int loopsLeft; + private int loopsLeft = 0; // private Semaphore clipSemaphore = new Semaphore(1); @@ -378,16 +378,22 @@ public class PulseAudioClip extends Puls super.open(format); this.data = new byte[bufferSize]; System.arraycopy(data, offset, this.data, 0, bufferSize); + frameCount = bufferSize / format.getFrameSize(); currentFrame = 0; framesSinceOpen = 0; + startFrame = 0; endFrame = frameCount - 1; + loopsLeft = 0; + PulseAudioVolumeControl volumeControl = new PulseAudioVolumeControl( this, eventLoop); PulseAudioMuteControl muteControl = new PulseAudioMuteControl(this, volumeControl); controls.add(volumeControl); controls.add(muteControl); + volume = volumeControl.getValue(); + muted = muteControl.getValue(); PulseAudioMixer mixer = PulseAudioMixer.getInstance(); mixer.addSourceLine(this); From Kelly.Ohair at Sun.COM Tue Sep 30 14:17:56 2008 From: Kelly.Ohair at Sun.COM (Kelly O'Hair) Date: Tue, 30 Sep 2008 14:17:56 -0700 Subject: Mercurial repo for openjdk6 drops In-Reply-To: <17c6771e0809300749y3125515ex9aea2d3b1b34446e@mail.gmail.com> References: <1221382347.22691.29.camel@hermans.wildebeest.org> <48CFE0C8.6090809@sun.com> <1221643827.3246.64.camel@dijkstra.wildebeest.org> <48D13DAE.9030009@sun.com> <48D2502A.7020001@sun.com> <48D802A2.6080509@sun.com> <48D9C77D.5030506@sun.com> <48DC0857.5070804@sun.com> <1222381072.3266.102.camel@dijkstra.wildebeest.org> <48DC1544.5070507@sun.com> <17c6771e0809300749y3125515ex9aea2d3b1b34446e@mail.gmail.com> Message-ID: <48E29784.7060408@sun.com> Andrew John Hughes wrote: > 2008/9/25 Kelly O'Hair : >> >> Mark Wielaard wrote: >>> Hi Kelly, >>> >>> On Thu, 2008-09-25 at 14:53 -0700, Kelly O'Hair wrote: >>>> I'm starting to work on the OpenJDK6 Mercurial conversion. My plan is for >>>> Build 5 to be the Rev 0 changeset, and I will try and create changesets >>>> for each of the bug fixes in a Build. >>> Would it be possible to reconstruct the openjdk7 revision that was the >>> original starting point for the openjdk6 tree? That would be very >>> helpful to have for forward and backward porting between the two trees. >>> If you could make that rev0 and then have one giant changeset to build 5 >>> as rev1 that would be really great. >> Sorry... unknown legal issues may be lurking in Builds 0-4, not sure I >> want to go there. :^( >> > > I don't think Mark's intention was to include builds 0 to 4, but to > have the initial > import as the OpenJDK7 build drop which was the original base for OpenJDK6 > (this code has already been released) and then have the next commit as b5. Easier said than done... We started with jdk7 b19, but it was jdk7 b23 that did the major restructuring of the source tree. So we started with something between jdk7 b19 and jdk7 b23. I'll use jdk7 b23 as rev0, so the first changeset will take us to openjdk6 b00 (the starting point for openjdk6), then a changeset for b1, b2. b3. b4, and b5. Then between b6 -> b12 there will be multiple changsets, the last one for each build bringing it into sync with the formal build source drops. That's my plan anyway... Having b0-b4 is a minor effort, and may help in sorting out where bugs got fixed prior to the official open source b5. > >>> For example we have found some nasty AWT bugs that have been fixed in >>> openjdk7, but it was somewhat hard to track down what was needed because >>> the origin of the awt code in openjdk6 wasn't exactly known. >>> >>>> So I'll be going through the list of fixes for each build, try and create >>>> a >>>> changeset for it, and at the end I'll copy in the final source for that >>>> build and see what I missed. The final changeset may be one for the >>>> remaining >>>> bugs fixed. Then I'll tag that changeset and move on to the next build. >>>> I'm calling this Total Recall, in that I'm essentially doing a replay >>>> of the Build 5 through Build 12 changes. >>> Wow. That is really, really great. And it must be a real pain to go >>> through all that. Thanks a lot for doing this! Hope it will not drive >>> you mad. >> Mad? Mad? Ha Ha! ... Hopefully they aren't coming to take me away... >> http://uk.youtube.com/watch?v=2o7bMdAyPes >> > > Indeed, this is really great. Thanks for doing it. No problemo... but wait to thank me until it's done... ;^) -kto > >>>> One of my concerns is that normally we want every changeset fully vetted >>>> with regards to at least building on all platforms. >>>> Unfortunately with Teamware, the changes are often not kept in any >>>> sequential >>>> order like the Mercurial changesets, they are independent SCCS file >>>> changes. >>>> The history file can help me, but I'm dealing with a very old DSCM system >>>> here. >>>> >>>> So I'll try and re-create the same order the changes were made, and then >>>> occasionally make sure it builds on all platforms. >>>> The final sources for each Build we know builds ok on all platforms, >>>> those >>>> are effectively the source bundle drops. >>>> So I can't guarantee that every changeset is cleanly buildable on all >>>> platforms. >>>> Is that acceptable to everyone? >>> It would certainly be to me. I am already very pleased that you are >>> attempting to get more than just one changeset per build drop. I think >>> the data will mostly be used for historical purposes (what was changed >>> when together with what?). Not for actually building. >> Good. I'll do the best I can... >> >> -kto >> >>> Thanks, >>> >>> Mark >>> > > Ok for me too.