Java-API: byteCompressionType should be declared as primitive type byte (#7981)

Summary:
The variable `byteCompressionType` is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Byte'.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7981

Reviewed By: ajkr

Differential Revision: D26546600

Pulled By: jay-zhuang

fbshipit-source-id: 07b579cdfcfc2262a448ca3626e216416fd05892
main
stefan-zobel 4 years ago committed by Facebook GitHub Bot
parent 6fad38ebe8
commit cc34da75b5
  1. 2
      java/src/main/java/org/rocksdb/ColumnFamilyOptions.java
  2. 2
      java/src/main/java/org/rocksdb/Options.java

@ -339,7 +339,7 @@ public class ColumnFamilyOptions extends RocksObject
final byte[] byteCompressionTypes = final byte[] byteCompressionTypes =
compressionPerLevel(nativeHandle_); compressionPerLevel(nativeHandle_);
final List<CompressionType> compressionLevels = new ArrayList<>(); final List<CompressionType> compressionLevels = new ArrayList<>();
for (final Byte byteCompressionType : byteCompressionTypes) { for (final byte byteCompressionType : byteCompressionTypes) {
compressionLevels.add(CompressionType.getCompressionType( compressionLevels.add(CompressionType.getCompressionType(
byteCompressionType)); byteCompressionType));
} }

@ -1408,7 +1408,7 @@ public class Options extends RocksObject
final byte[] byteCompressionTypes = final byte[] byteCompressionTypes =
compressionPerLevel(nativeHandle_); compressionPerLevel(nativeHandle_);
final List<CompressionType> compressionLevels = new ArrayList<>(); final List<CompressionType> compressionLevels = new ArrayList<>();
for (final Byte byteCompressionType : byteCompressionTypes) { for (final byte byteCompressionType : byteCompressionTypes) {
compressionLevels.add(CompressionType.getCompressionType( compressionLevels.add(CompressionType.getCompressionType(
byteCompressionType)); byteCompressionType));
} }

Loading…
Cancel
Save