Permalink
Browse files

reviews core/com/sun.

These patches are mainly good.  There are two classes that got moved to further_review_needed because they added @deprecated annotations to classes that were only deprecated in the javadoc.
  • Loading branch information...
1 parent 3fe5c95 commit 78d1535beaaab53e8f130ec3f0663a5243b8bcb0 @RichardWarburton RichardWarburton committed May 13, 2012
@@ -0,0 +1,35 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/rowset/CachedRowSetImpl.java
+--- a/src/share/classes/com/sun/rowset/CachedRowSetImpl.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/rowset/CachedRowSetImpl.java Mon Mar 12 23:16:13 2012 +0000
+@@ -2039,6 +2039,7 @@
+ * the cursor is not on a valid row, or this method fails
+ * @deprecated
+ */
++ @Deprecated
+ public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
+ Object value;
+ BigDecimal bDecimal, retVal;
+@@ -2374,6 +2375,7 @@
+ * @throws SQLException if an error occurs
+ * @deprecated
+ */
++ @Deprecated
+ public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
+ // always free an old stream
+ unicodeStream = null;
+@@ -2643,6 +2645,7 @@
+ * @deprecated Use the <code>getBigDecimal(String columnName)</code>
+ * method instead
+ */
++ @Deprecated
+ public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
+ return getBigDecimal(getColIdxByName(columnName), scale);
+ }
+@@ -2774,6 +2777,7 @@
+ * this rowset's rows or its insert row
+ * @deprecated use the method <code>getCharacterStream</code> instead
+ */
++ @Deprecated
+ public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
+ return getUnicodeStream(getColIdxByName(columnName));
+ }
@@ -0,0 +1,27 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java
+--- a/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java Mon Mar 12 23:16:13 2012 +0000
+@@ -1424,6 +1424,7 @@
+ * @throws SQLException if an error occurs
+ * @deprecated
+ */
++ @Deprecated
+ public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException();
+ }
+@@ -1653,6 +1654,7 @@
+ * @deprecated Use the <code>getBigDecimal(String columnName)</code>
+ * method instead
+ */
++ @Deprecated
+ public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
+ throw new UnsupportedOperationException();
+ }
+@@ -1784,6 +1786,7 @@
+ * this rowset's rows or its insert row
+ * @deprecated use the method <code>getCharacterStream</code> instead
+ */
++ @Deprecated
+ public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
+ throw new UnsupportedOperationException();
+ }
@@ -0,0 +1,29 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java
+--- a/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java Mon Mar 12 23:16:06 2012 +0000
+@@ -690,6 +690,7 @@
+ return metadata.compression == BI_RGB;
+ }
+
++ @SuppressWarnings("fallthrough")
+ public BufferedImage read(int imageIndex, ImageReadParam param)
+ throws IOException {
+
+@@ -767,14 +768,11 @@
+ // the sampleModel can be null in case of embedded image
+ if (sampleModel != null) {
+ if (sampleModel.getDataType() == DataBuffer.TYPE_BYTE)
+- bdata = (byte[])
+- ((DataBufferByte)raster.getDataBuffer()).getData();
++ bdata = ((DataBufferByte)raster.getDataBuffer()).getData();
+ else if (sampleModel.getDataType() == DataBuffer.TYPE_USHORT)
+- sdata = (short[])
+- ((DataBufferUShort)raster.getDataBuffer()).getData();
++ sdata = ((DataBufferUShort)raster.getDataBuffer()).getData();
+ else if (sampleModel.getDataType() == DataBuffer.TYPE_INT)
+- idata = (int[])
+- ((DataBufferInt)raster.getDataBuffer()).getData();
++ idata = ((DataBufferInt)raster.getDataBuffer()).getData();
+ }
+
+ // There should only be one tile.
@@ -0,0 +1,12 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java
+--- a/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java Mon Mar 12 23:16:07 2012 +0000
+@@ -582,7 +582,7 @@
+ imageSize = embedded_stream.size();
+
+ long endPos = stream.getStreamPosition();
+- fileSize = (int)(offset + imageSize);
++ fileSize = offset + imageSize;
+ stream.seek(headPos);
+ writeSize(fileSize, 2);
+ stream.seek(headPos);
@@ -0,0 +1,12 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java
+--- a/src/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java Mon Mar 12 23:16:07 2012 +0000
+@@ -143,7 +143,7 @@
+ }
+
+ static public int hash(short index, byte lastbyte) {
+- return ((int)((short)(lastbyte << 8) ^ index) & 0xFFFF) % HASHSIZE;
++ return (((short)(lastbyte << 8) ^ index) & 0xFFFF) % HASHSIZE;
+ }
+
+ /*
@@ -0,0 +1,12 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java
+--- a/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java Mon Mar 12 23:16:08 2012 +0000
+@@ -114,7 +114,7 @@
+ newGuy = (MarkerSegment) super.clone();
+ } catch (CloneNotSupportedException e) {} // won't happen
+ if (this.data != null) {
+- newGuy.data = (byte[]) data.clone();
++ newGuy.data = data.clone();
+ }
+ return newGuy;
+ }
@@ -0,0 +1,12 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/java/browser/dom/DOMService.java
+--- a/src/share/classes/com/sun/java/browser/dom/DOMService.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/java/browser/dom/DOMService.java Mon Mar 12 23:16:09 2012 +0000
+@@ -43,7 +43,7 @@
+ {
+ try
+ {
+- String provider = (String) java.security.AccessController.doPrivileged(
++ String provider = java.security.AccessController.doPrivileged(
+ new sun.security.action.GetPropertyAction("com.sun.java.browser.dom.DOMServiceProvider"));
+
+ Class clazz = DOMService.class.forName("sun.plugin.dom.DOMService");
@@ -0,0 +1,12 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java
+--- a/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java Mon Mar 12 23:16:09 2012 +0000
+@@ -283,7 +283,7 @@
+ public synchronized void refresh() throws IOException {
+ Properties props;
+ if (accessFileName == null)
+- props = (Properties) originalProps;
++ props = originalProps;
+ else
+ props = propertiesFromFile(accessFileName);
+ parseProperties(props);
@@ -0,0 +1,30 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/media/sound/AbstractMidiDevice.java
+--- a/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java Mon Mar 12 23:16:09 2012 +0000
+@@ -664,7 +664,7 @@
+ } else {
+ if (TRACE_TRANSMITTER) Printer.println("Sending packed message to "+size+" transmitter's receivers");
+ for (int i = 0; i < size; i++) {
+- Receiver receiver = ((Transmitter)transmitters.get(i)).getReceiver();
++ Receiver receiver = transmitters.get(i).getReceiver();
+ if (receiver != null) {
+ if (optimizedReceiverCount > 0) {
+ if (receiver instanceof MidiOutDevice.MidiOutReceiver) {
+@@ -690,7 +690,7 @@
+ int size = transmitters.size();
+ if (TRACE_TRANSMITTER) Printer.println("Sending long message to "+size+" transmitter's receivers");
+ for (int i = 0; i < size; i++) {
+- Receiver receiver = ((Transmitter)transmitters.get(i)).getReceiver();
++ Receiver receiver = transmitters.get(i).getReceiver();
+ if (receiver != null) {
+ //$$fb 2002-04-02: SysexMessages are mutable, so
+ // an application could change the contents of this object,
+@@ -726,7 +726,7 @@
+ } else {
+ if (TRACE_TRANSMITTER) Printer.println("Sending MIDI message to "+size+" transmitter's receivers");
+ for (int i = 0; i < size; i++) {
+- Receiver receiver = ((Transmitter)transmitters.get(i)).getReceiver();
++ Receiver receiver = transmitters.get(i).getReceiver();
+ if (receiver != null) {
+ //$$fb 2002-04-02: ShortMessages are mutable, so
+ // an application could change the contents of this object,
@@ -0,0 +1,12 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/media/sound/AiffFileReader.java
+--- a/src/share/classes/com/sun/media/sound/AiffFileReader.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/media/sound/AiffFileReader.java Mon Mar 12 23:16:10 2012 +0000
+@@ -429,7 +429,7 @@
+ int expon = 0;
+ long hiMant = 0, loMant = 0;
+ long t1, t2;
+- double HUGE = ((double)3.40282346638528860e+38);
++ double HUGE = 3.40282346638528860e+38;
+
+
+ expon = dis.readUnsignedShort();
@@ -0,0 +1,25 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/media/sound/AiffFileWriter.java
+--- a/src/share/classes/com/sun/media/sound/AiffFileWriter.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/media/sound/AiffFileWriter.java Mon Mar 12 23:16:10 2012 +0000
+@@ -247,18 +247,18 @@
+ while( (bytesRead = fileStream.read( buffer )) >= 0 ) {
+ if (maxLength>0) {
+ if( bytesRead < maxLength ) {
+- out.write( buffer, 0, (int)bytesRead );
++ out.write( buffer, 0, bytesRead );
+ bytesWritten += bytesRead;
+ maxLength -= bytesRead;
+ } else {
+- out.write( buffer, 0, (int)maxLength );
++ out.write( buffer, 0, maxLength );
+ bytesWritten += maxLength;
+ maxLength = 0;
+ break;
+ }
+
+ } else {
+- out.write( buffer, 0, (int)bytesRead );
++ out.write( buffer, 0, bytesRead );
+ bytesWritten += bytesRead;
+ }
+ }
@@ -0,0 +1,32 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/media/sound/AlawCodec.java
+--- a/src/share/classes/com/sun/media/sound/AlawCodec.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/media/sound/AlawCodec.java Mon Mar 12 23:16:10 2012 +0000
+@@ -318,7 +318,7 @@
+
+ // set the AudioInputStream length in frames if we know it
+ if (stream instanceof AudioInputStream) {
+- frameLength = ((AudioInputStream)stream).getFrameLength();
++ frameLength = stream.getFrameLength();
+ }
+
+ // set framePos to zero
+@@ -348,7 +348,7 @@
+ public int read() throws IOException {
+
+ byte[] b = new byte[1];
+- return (int)read(b, 0, b.length);
++ return read(b, 0, b.length);
+ }
+
+
+@@ -434,8 +434,8 @@
+ int readCount = super.read(b, readOffset, readLen);
+
+ for (i = off; i < (off + (readCount*2)); i+=2) {
+- b[i] = (byte)tabByte1[b[readOffset] & 0xFF];
+- b[i+1] = (byte)tabByte2[b[readOffset] & 0xFF];
++ b[i] = tabByte1[b[readOffset] & 0xFF];
++ b[i+1] = tabByte2[b[readOffset] & 0xFF];
+ readOffset++;
+ }
+
@@ -0,0 +1,24 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/media/sound/AuFileWriter.java
+--- a/src/share/classes/com/sun/media/sound/AuFileWriter.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/media/sound/AuFileWriter.java Mon Mar 12 23:16:11 2012 +0000
+@@ -318,17 +318,17 @@
+ while( (bytesRead = fileStream.read( buffer )) >= 0 ) {
+ if (maxLength>0) {
+ if( bytesRead < maxLength ) {
+- out.write( buffer, 0, (int)bytesRead );
++ out.write( buffer, 0, bytesRead );
+ bytesWritten += bytesRead;
+ maxLength -= bytesRead;
+ } else {
+- out.write( buffer, 0, (int)maxLength );
++ out.write( buffer, 0, maxLength );
+ bytesWritten += maxLength;
+ maxLength = 0;
+ break;
+ }
+ } else {
+- out.write( buffer, 0, (int)bytesRead );
++ out.write( buffer, 0, bytesRead );
+ bytesWritten += bytesRead;
+ }
+ }
@@ -0,0 +1,12 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/media/sound/RealTimeSequencer.java
+--- a/src/share/classes/com/sun/media/sound/RealTimeSequencer.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/media/sound/RealTimeSequencer.java Mon Mar 12 23:16:11 2012 +0000
+@@ -392,7 +392,7 @@
+ // last resort: return a standard tempo: 120bpm
+ return (float) MidiUtils.DEFAULT_TEMPO_MPQ;
+ }
+- return (float)getDataPump().getTempoMPQ();
++ return getDataPump().getTempoMPQ();
+ }
+
+
@@ -0,0 +1,12 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/media/sound/SoftInstrument.java
+--- a/src/share/classes/com/sun/media/sound/SoftInstrument.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/media/sound/SoftInstrument.java Mon Mar 12 23:16:12 2012 +0000
+@@ -44,7 +44,7 @@
+ ins.getDataClass());
+ data = ins.getData();
+ this.ins = ins;
+- initPerformers(((ModelInstrument)ins).getPerformers());
++ initPerformers(ins.getPerformers());
+ }
+
+ public SoftInstrument(ModelInstrument ins,
@@ -0,0 +1,23 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/media/sound/UlawCodec.java
+--- a/src/share/classes/com/sun/media/sound/UlawCodec.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/media/sound/UlawCodec.java Mon Mar 12 23:16:12 2012 +0000
+@@ -302,7 +302,7 @@
+
+ // set the AudioInputStream length in frames if we know it
+ if (stream instanceof AudioInputStream) {
+- frameLength = ((AudioInputStream)stream).getFrameLength();
++ frameLength = stream.getFrameLength();
+ }
+ // set framePos to zero
+ framePos = 0;
+@@ -407,8 +407,8 @@
+ return readCount;
+ }
+ for (i = off; i < (off + (readCount*2)); i+=2) {
+- b[i] = (byte)tabByte1[b[readOffset] & 0xFF];
+- b[i+1] = (byte)tabByte2[b[readOffset] & 0xFF];
++ b[i] = tabByte1[b[readOffset] & 0xFF];
++ b[i+1] = tabByte2[b[readOffset] & 0xFF];
+ readOffset++;
+ }
+ return (i - off);
@@ -0,0 +1,33 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/media/sound/WaveFileWriter.java
+--- a/src/share/classes/com/sun/media/sound/WaveFileWriter.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/media/sound/WaveFileWriter.java Mon Mar 12 23:16:12 2012 +0000
+@@ -248,17 +248,17 @@
+
+ if (maxLength>0) {
+ if( bytesRead < maxLength ) {
+- out.write( buffer, 0, (int)bytesRead );
++ out.write( buffer, 0, bytesRead );
+ bytesWritten += bytesRead;
+ maxLength -= bytesRead;
+ } else {
+- out.write( buffer, 0, (int)maxLength );
++ out.write( buffer, 0, maxLength );
+ bytesWritten += maxLength;
+ maxLength = 0;
+ break;
+ }
+ } else {
+- out.write( buffer, 0, (int)bytesRead );
++ out.write( buffer, 0, bytesRead );
+ bytesWritten += bytesRead;
+ }
+ }
+@@ -280,7 +280,7 @@
+ short channels = (short) audioFormat.getChannels();
+ short sampleSizeInBits = (short) audioFormat.getSampleSizeInBits();
+ int sampleRate = (int) audioFormat.getSampleRate();
+- int frameSizeInBytes = (int) audioFormat.getFrameSize();
++ int frameSizeInBytes = audioFormat.getFrameSize();
+ int frameRate = (int) audioFormat.getFrameRate();
+ int avgBytesPerSec = channels * sampleSizeInBits * sampleRate / 8;;
+ short blockAlign = (short) ((sampleSizeInBits / 8) * channels);
@@ -0,0 +1,12 @@
+diff -r 134d9f4f9498 src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java
+--- a/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java Mon Mar 12 11:30:28 2012 +0000
++++ b/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java Mon Mar 12 23:16:14 2012 +0000
+@@ -1469,7 +1469,7 @@
+ }
+ else
+ {
+- int hiByte = (int)(curChar >> 8);
++ int hiByte = curChar >> 8;
+ int i1 = hiByte >> 6;
+ long l1 = 1L << (hiByte & 077);
+ int i2 = (curChar & 0xff) >> 6;

0 comments on commit 78d1535

Please sign in to comment.