r44065 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44064‎ | r44065 | r44066 >
Date:12:11, 30 November 2008
Author:maikmerten
Status:deferred
Tags:
Comment:
actually make this compile on -target 1.1

Apparently on Java 1.1 Hashtable cannot take primitive types and actually wants objects, meaning I have to wrap integers and whatnot.

Ewww. The pain! It's in my head and *eats* my brain! Well, it's not thaaaat bad, but I still prefer Java 1.5 and up so I can continue being lazy.
Modified paths:
  • /trunk/cortado/src/com/fluendo/player/DurationScanner.java (modified) (history)

Diff [purge]

Index: trunk/cortado/src/com/fluendo/player/DurationScanner.java
@@ -105,12 +105,12 @@
106106
107107 while (oy.pageout(og) == 1) {
108108
109 - int serialno = og.serialno();
 109+ Integer serialno = new Integer(og.serialno());
110110 StreamState os = (StreamState) streamstates.get(serialno);
111111 if (os == null) {
112112 os = new StreamState();
113113 os.init(og.serialno());
114 - streamstates.put(og.serialno(), os);
 114+ streamstates.put(serialno, os);
115115 System.out.println("DurationScanner: created StreamState for stream no. " + serialno);
116116 }
117117
@@ -120,7 +120,7 @@
121121
122122 Integer type = (Integer) streamtype.get(serialno);
123123 if (type == null) {
124 - type = determineType(op);
 124+ type = new Integer(determineType(op));
125125 streamtype.put(serialno, type);
126126 if (comment != null) {
127127 streamcomment.put(serialno, comment);
@@ -128,14 +128,14 @@
129129 if (info != null) {
130130 streaminfo.put(serialno, info);
131131 }
132 - streamstartgranule.put(serialno, og.granulepos());
 132+ streamstartgranule.put(serialno, new Long(og.granulepos()));
133133 }
134134
135 - switch (type) {
 135+ switch (type.intValue()) {
136136 case VORBIS:
137137 {
138138 com.jcraft.jorbis.Info i = (com.jcraft.jorbis.Info) streaminfo.get(serialno);
139 - long startgranule = (Long) streamstartgranule.get(serialno);
 139+ long startgranule = ((Long) streamstartgranule.get(serialno)).longValue();
140140 float t = (float) (og.granulepos() - startgranule) / i.rate;
141141 if (t > time) {
142142 time = t;

Status & tagging log