Fix one checkstyle and one compile error caused by the last commit

This commit is contained in:
Norman Maurer 2013-01-11 07:45:22 +01:00
parent 75b2dd592a
commit e564157381
2 changed files with 3 additions and 3 deletions

View File

@ -16,6 +16,7 @@
package io.netty.buffer; package io.netty.buffer;
import io.netty.util.internal.PlatformDependent;
import sun.misc.Unsafe; import sun.misc.Unsafe;
import java.io.IOException; import java.io.IOException;
@ -57,7 +58,7 @@ final class PooledUnsafeDirectByteBuf extends PooledByteBuf<ByteBuffer> {
if (addressField.getLong(directBuf) == 0) { if (addressField.getLong(directBuf) == 0) {
throw new Error("direct buffer address must be non-zero"); throw new Error("direct buffer address must be non-zero");
} }
UnpooledDirectByteBuf.freeDirect(directBuf); PlatformDependent.freeDirectBuffer(directBuf);
} catch (Throwable t) { } catch (Throwable t) {
throw new Error(t); throw new Error(t);
} }
@ -120,7 +121,7 @@ final class PooledUnsafeDirectByteBuf extends PooledByteBuf<ByteBuffer> {
public int getUnsignedMedium(int index) { public int getUnsignedMedium(int index) {
checkIndex(index, 3); checkIndex(index, 3);
long addr = addr(index); long addr = addr(index);
return (UNSAFE.getByte(addr) & 0xff) << 16 |(UNSAFE.getByte(addr + 1) & 0xff) << 8 | return (UNSAFE.getByte(addr) & 0xff) << 16 | (UNSAFE.getByte(addr + 1) & 0xff) << 8 |
UNSAFE.getByte(addr + 2) & 0xff; UNSAFE.getByte(addr + 2) & 0xff;
} }

View File

@ -96,7 +96,6 @@ final class PlatformDependent0 {
return UNSAFE.objectFieldOffset(field); return UNSAFE.objectFieldOffset(field);
} }
private PlatformDependent0() { private PlatformDependent0() {
} }
} }