From f9e8d5d1fb96a4d5514ff051e1565be49d153990 Mon Sep 17 00:00:00 2001 From: "guilhem.duche" Date: Sun, 28 Sep 2008 19:29:13 +0000 Subject: [PATCH] fixed the bug for java 1.5 git-svn-id: http://wiiusej.googlecode.com/svn/trunk@192 ae48ae66-6a45-0410-b38e-211266189506 --- WiiUseJ/README.TXT | 8 ++++++-- WiiUseJ/src/wiiusej/WiiUseApiManager.java | 1 - .../src/wiiusej/wiiusejevents/physicalevents/IREvent.java | 4 +++- .../src/wiiusej/wiiusejevents/utils/EventsGatherer.java | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/WiiUseJ/README.TXT b/WiiUseJ/README.TXT index 4b437e8..b99935f 100644 --- a/WiiUseJ/README.TXT +++ b/WiiUseJ/README.TXT @@ -38,9 +38,13 @@ Go to : http://wiiusej.googlecode.com/ for further documentations. CHANGELOG : +wiiusej 0.12b : +- make wiiusej compatible with java 1.5. +- fixed a bug that made Null pointer exception happen when disconnecting several wiimotes. + wiiusej 0.12a : -- added guitar hero controller support -- added classic controller support +- added guitar hero controller support. +- added classic controller support. wiiusej 0.12 : - added nunchuk support. diff --git a/WiiUseJ/src/wiiusej/WiiUseApiManager.java b/WiiUseJ/src/wiiusej/WiiUseApiManager.java index bea28df..05797c5 100644 --- a/WiiUseJ/src/wiiusej/WiiUseApiManager.java +++ b/WiiUseJ/src/wiiusej/WiiUseApiManager.java @@ -227,7 +227,6 @@ public class WiiUseApiManager extends Thread { } index++; } - } /** diff --git a/WiiUseJ/src/wiiusej/wiiusejevents/physicalevents/IREvent.java b/WiiUseJ/src/wiiusej/wiiusejevents/physicalevents/IREvent.java index 1873a8c..06648a1 100644 --- a/WiiUseJ/src/wiiusej/wiiusejevents/physicalevents/IREvent.java +++ b/WiiUseJ/src/wiiusej/wiiusejevents/physicalevents/IREvent.java @@ -108,7 +108,9 @@ public class IREvent extends GenericEvent { * @return the list of 2D points */ public IRSource[] getIRPoints() { - return java.util.Arrays.copyOfRange(IRPoints, 0, indexPoints); + IRSource[] ir = new IRSource[indexPoints]; + System.arraycopy(IRPoints, 0, ir, 0, indexPoints); + return ir; } /** diff --git a/WiiUseJ/src/wiiusej/wiiusejevents/utils/EventsGatherer.java b/WiiUseJ/src/wiiusej/wiiusejevents/utils/EventsGatherer.java index 14343a5..d89c994 100644 --- a/WiiUseJ/src/wiiusej/wiiusejevents/utils/EventsGatherer.java +++ b/WiiUseJ/src/wiiusej/wiiusejevents/utils/EventsGatherer.java @@ -490,7 +490,9 @@ public class EventsGatherer { * @return events received. */ public WiiUseApiEvent[] getEvents() { - return java.util.Arrays.copyOfRange(events, 0, index); + WiiUseApiEvent[] ev = new WiiUseApiEvent[index]; + System.arraycopy(events, 0, ev, 0, index); + return ev; } /**