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/attachment.ksh 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/attachment.bin -------------- 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/attachment.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/attachment.bin -------------- 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/attachment-0001.bin 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/attachment.ksh -------------- 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/attachment-0001.ksh 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 >