“f1e553354186c44508565ad89d4b526bdb3a705a”上不存在“paddle/fluid/operators/net_op_test.cc”
提交 8b13914c 编写于 作者: I igerasim

8074657: Missing space on a boundary of concatenated strings

Summary: Added missing spaces, fixed indentation, replaced StringBuffer with StringBuilder
Reviewed-by: martin, rriggs
上级 370fb4a4
/* /*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -66,7 +66,7 @@ public class SerialBlob implements Blob, Serializable, Cloneable { ...@@ -66,7 +66,7 @@ public class SerialBlob implements Blob, Serializable, Cloneable {
* value of this <code>SerialBlob</code> object. * value of this <code>SerialBlob</code> object.
* @serial * @serial
*/ */
private byte buf[]; private byte[] buf;
/** /**
* The internal representation of the <code>Blob</code> object on which this * The internal representation of the <code>Blob</code> object on which this
...@@ -102,7 +102,8 @@ public class SerialBlob implements Blob, Serializable, Cloneable { ...@@ -102,7 +102,8 @@ public class SerialBlob implements Blob, Serializable, Cloneable {
* @throws SerialException if an error occurs during serialization * @throws SerialException if an error occurs during serialization
* @throws SQLException if a SQL errors occurs * @throws SQLException if a SQL errors occurs
*/ */
public SerialBlob(byte[] b) throws SerialException, SQLException { public SerialBlob(byte[] b)
throws SerialException, SQLException {
len = b.length; len = b.length;
buf = new byte[(int)len]; buf = new byte[(int)len];
...@@ -132,19 +133,17 @@ public class SerialBlob implements Blob, Serializable, Cloneable { ...@@ -132,19 +133,17 @@ public class SerialBlob implements Blob, Serializable, Cloneable {
* to this constructor is a <code>null</code>. * to this constructor is a <code>null</code>.
* @see java.sql.Blob * @see java.sql.Blob
*/ */
public SerialBlob (Blob blob) throws SerialException, SQLException { public SerialBlob (Blob blob)
throws SerialException, SQLException {
if (blob == null) { if (blob == null) {
throw new SQLException("Cannot instantiate a SerialBlob " + throw new SQLException(
"object with a null Blob object"); "Cannot instantiate a SerialBlob object with a null Blob object");
} }
len = blob.length(); len = blob.length();
buf = blob.getBytes(1, (int)len ); buf = blob.getBytes(1, (int)len );
this.blob = blob; this.blob = blob;
//if ( len < 10240000)
// len = 10240000;
origLen = len; origLen = len;
} }
...@@ -246,6 +245,7 @@ public class SerialBlob implements Blob, Serializable, Cloneable { ...@@ -246,6 +245,7 @@ public class SerialBlob implements Blob, Serializable, Cloneable {
*/ */
public long position(byte[] pattern, long start) public long position(byte[] pattern, long start)
throws SerialException, SQLException { throws SerialException, SQLException {
isValid(); isValid();
if (start < 1 || start > len) { if (start < 1 || start > len) {
return -1; return -1;
...@@ -317,7 +317,7 @@ public class SerialBlob implements Blob, Serializable, Cloneable { ...@@ -317,7 +317,7 @@ public class SerialBlob implements Blob, Serializable, Cloneable {
*/ */
public int setBytes(long pos, byte[] bytes) public int setBytes(long pos, byte[] bytes)
throws SerialException, SQLException { throws SerialException, SQLException {
return (setBytes(pos, bytes, 0, bytes.length)); return setBytes(pos, bytes, 0, bytes.length);
} }
/** /**
...@@ -403,6 +403,7 @@ public class SerialBlob implements Blob, Serializable, Cloneable { ...@@ -403,6 +403,7 @@ public class SerialBlob implements Blob, Serializable, Cloneable {
*/ */
public java.io.OutputStream setBinaryStream(long pos) public java.io.OutputStream setBinaryStream(long pos)
throws SerialException, SQLException { throws SerialException, SQLException {
isValid(); isValid();
if (this.blob != null) { if (this.blob != null) {
return this.blob.setBinaryStream(pos); return this.blob.setBinaryStream(pos);
...@@ -425,11 +426,10 @@ public class SerialBlob implements Blob, Serializable, Cloneable { ...@@ -425,11 +426,10 @@ public class SerialBlob implements Blob, Serializable, Cloneable {
* if {@code free} had previously been called on this object * if {@code free} had previously been called on this object
*/ */
public void truncate(long length) throws SerialException { public void truncate(long length) throws SerialException {
isValid(); isValid();
if (length > len) { if (length > len) {
throw new SerialException throw new SerialException(
("Length more than what can be truncated"); "Length more than what can be truncated");
} else if((int)length == 0) { } else if((int)length == 0) {
buf = new byte[0]; buf = new byte[0];
len = length; len = length;
...@@ -466,8 +466,8 @@ public class SerialBlob implements Blob, Serializable, Cloneable { ...@@ -466,8 +466,8 @@ public class SerialBlob implements Blob, Serializable, Cloneable {
throw new SerialException("Invalid position in BLOB object set"); throw new SerialException("Invalid position in BLOB object set");
} }
if (length < 1 || length > len - pos + 1) { if (length < 1 || length > len - pos + 1) {
throw new SerialException("length is < 1 or pos + length >" throw new SerialException(
+ "total number of bytes"); "length is < 1 or pos + length > total number of bytes");
} }
return new ByteArrayInputStream(buf, (int) pos - 1, (int) length); return new ByteArrayInputStream(buf, (int) pos - 1, (int) length);
} }
...@@ -543,7 +543,6 @@ public class SerialBlob implements Blob, Serializable, Cloneable { ...@@ -543,7 +543,6 @@ public class SerialBlob implements Blob, Serializable, Cloneable {
// this shouldn't happen, since we are Cloneable // this shouldn't happen, since we are Cloneable
throw new InternalError(); throw new InternalError();
} }
} }
/** /**
...@@ -590,8 +589,8 @@ public class SerialBlob implements Blob, Serializable, Cloneable { ...@@ -590,8 +589,8 @@ public class SerialBlob implements Blob, Serializable, Cloneable {
*/ */
private void isValid() throws SerialException { private void isValid() throws SerialException {
if (buf == null) { if (buf == null) {
throw new SerialException("Error: You cannot call a method on a " throw new SerialException("Error: You cannot call a method on a " +
+ "SerialBlob instance once free() has been called."); "SerialBlob instance once free() has been called.");
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册