Ver código fonte

fix missing space in string literal (LGTM)

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1859596 13f79535-47bb-0310-9956-ffa450edef68
pull/139/head
Alain Béarez 5 anos atrás
pai
commit
c3e549cc08
1 arquivos alterados com 6 adições e 6 exclusões
  1. 6
    6
      src/java/org/apache/poi/hpsf/CodePageString.java

+ 6
- 6
src/java/org/apache/poi/hpsf/CodePageString.java Ver arquivo

// CodePage property has any other value, it MUST be a null-terminated array of 8-bit characters // CodePage property has any other value, it MUST be a null-terminated array of 8-bit characters
// from the code page identified by the CodePage property, followed by zero padding to a // from the code page identified by the CodePage property, followed by zero padding to a
// multiple of 4 bytes. The string represented by this field MAY contain embedded or additional // multiple of 4 bytes. The string represented by this field MAY contain embedded or additional
// trailing null characters and an OLEPS implementation MUST be able to handle such strings.
// trailing null characters and an OLEPS implementation MUST be able to handle such strings.
lei.readFully(_value); lei.readFully(_value);
if (_value[size - 1] != 0 ) { if (_value[size - 1] != 0 ) {
// TODO Some files, such as TestVisioWithCodepage.vsd, are currently // TODO Some files, such as TestVisioWithCodepage.vsd, are currently
int cp = ( codepage == -1 ) ? Property.DEFAULT_CODEPAGE : codepage; int cp = ( codepage == -1 ) ? Property.DEFAULT_CODEPAGE : codepage;
String result = CodePageUtil.getStringFromCodePage(_value, cp); String result = CodePageUtil.getStringFromCodePage(_value, cp);


final int terminator = result.indexOf( '\0' ); final int terminator = result.indexOf( '\0' );
if ( terminator == -1 ) { if ( terminator == -1 ) {
String msg =
"String terminator (\\0) for CodePageString property value not found." +
String msg =
"String terminator (\\0) for CodePageString property value not found. " +
"Continue without trimming and hope for the best."; "Continue without trimming and hope for the best.";
LOG.log(POILogger.WARN, msg); LOG.log(POILogger.WARN, msg);
return result; return result;
} }
if ( terminator != result.length() - 1 ) { if ( terminator != result.length() - 1 ) {
String msg =
String msg =
"String terminator (\\0) for CodePageString property value occured before the end of string. "+ "String terminator (\\0) for CodePageString property value occured before the end of string. "+
"Trimming and hope for the best."; "Trimming and hope for the best.";
LOG.log(POILogger.WARN, msg ); LOG.log(POILogger.WARN, msg );

Carregando…
Cancelar
Salvar