diff options
Diffstat (limited to 'src/share/demo')
5 files changed, 13 insertions, 13 deletions
diff --git a/src/share/demo/management/MemoryMonitor/MemoryMonitor.java b/src/share/demo/management/MemoryMonitor/MemoryMonitor.java index 717e34b13c..ca6ab6e410 100644 --- a/src/share/demo/management/MemoryMonitor/MemoryMonitor.java +++ b/src/share/demo/management/MemoryMonitor/MemoryMonitor.java @@ -213,10 +213,10 @@ public class MemoryMonitor extends JPanel { // Calculate remaining size float ssH = ascent + descent; - float remainingHeight = (float) (y2 - (ssH*2) - 0.5f); + float remainingHeight = y2 - (ssH*2) - 0.5f; float blockHeight = remainingHeight/10; float blockWidth = 20.0f; - float remainingWidth = (float) (x2 - blockWidth - 10); + float remainingWidth = x2 - blockWidth - 10; // .. Memory Free .. big.setColor(mfColor); @@ -224,7 +224,7 @@ public class MemoryMonitor extends JPanel { int i = 0; for ( ; i < MemUsage ; i++) { mfRect.setRect(x1+5,(float) y1+ssH+i*blockHeight, - blockWidth,(float) blockHeight-1); + blockWidth, blockHeight-1); big.fill(mfRect); } @@ -232,13 +232,13 @@ public class MemoryMonitor extends JPanel { big.setColor(Color.green); for ( ; i < 10; i++) { muRect.setRect(x1+5,(float) y1 + ssH+i*blockHeight, - blockWidth,(float) blockHeight-1); + blockWidth, blockHeight-1); big.fill(muRect); } // .. Draw History Graph .. if (remainingWidth <= 30) remainingWidth = (float)30; - if (remainingHeight <= ssH) remainingHeight = (float)ssH; + if (remainingHeight <= ssH) remainingHeight = ssH; big.setColor(graphColor); int graphX = x1+30; int graphY = y1 + (int) ssH; @@ -347,8 +347,8 @@ public class MemoryMonitor extends JPanel { big = bimg.createGraphics(); big.setFont(font); FontMetrics fm = big.getFontMetrics(font); - ascent = (int) fm.getAscent(); - descent = (int) fm.getDescent(); + ascent = fm.getAscent(); + descent = fm.getDescent(); } repaint(); try { diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java index 996f7cc0ef..5f79218631 100644 --- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java +++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java @@ -61,7 +61,7 @@ public class ZipFileStore extends FileStore { private final ZipFileSystem zfs; ZipFileStore(ZipPath zpath) { - this.zfs = (ZipFileSystem)zpath.getFileSystem(); + this.zfs = zpath.getFileSystem(); } @Override diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java index d09da8e6dd..d68388a97f 100644 --- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java +++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java @@ -1609,7 +1609,7 @@ public class ZipFileSystem extends FileSystem { synchronized (inflaters) { int size = inflaters.size(); if (size > 0) { - Inflater inf = (Inflater)inflaters.remove(size - 1); + Inflater inf = inflaters.remove(size - 1); return inf; } else { return new Inflater(true); @@ -1638,7 +1638,7 @@ public class ZipFileSystem extends FileSystem { synchronized (deflaters) { int size = deflaters.size(); if (size > 0) { - Deflater def = (Deflater)deflaters.remove(size - 1); + Deflater def = deflaters.remove(size - 1); return def; } else { return new Deflater(Deflater.DEFAULT_COMPRESSION, true); diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java index 49d9ee7b90..49bb826e00 100644 --- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java +++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java @@ -211,7 +211,7 @@ public class ZipFileSystemProvider extends FileSystemProvider { public <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options) { - return (V)ZipFileAttributeView.get(toZipPath(path), type); + return ZipFileAttributeView.get(toZipPath(path), type); } @Override diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java index 71274e2a11..a869d3af50 100644 --- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java +++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java @@ -78,12 +78,12 @@ public class ZipInfo { // twice long len = LOCHDR + CENNAM(cen, pos) + CENEXT(cen, pos) + CENHDR; if (zfs.readFullyAt(buf, 0, len, locoff(cen, pos)) != len) - zfs.zerror("read loc header failed"); + ZipFileSystem.zerror("read loc header failed"); if (LOCEXT(buf) > CENEXT(cen, pos) + CENHDR) { // have to read the second time; len = LOCHDR + LOCNAM(buf) + LOCEXT(buf); if (zfs.readFullyAt(buf, 0, len, locoff(cen, pos)) != len) - zfs.zerror("read loc header failed"); + ZipFileSystem.zerror("read loc header failed"); } printLOC(buf); pos += CENHDR + CENNAM(cen, pos) + CENEXT(cen, pos) + CENCOM(cen, pos); |