Browse Source

Error assigning char data to a byte (Blackdown JDK 1.2.2). Fixed by

casting the char to a byte.
Submitted by: Daniel Rall <dlr@finemaltcoding.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267603 13f79535-47bb-0310-9956-ffa450edef68
master
Sam Ruby 25 years ago
parent
commit
ab202c98ab
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      src/main/org/apache/tools/ant/taskdefs/FixCRLF.java

+ 7
- 7
src/main/org/apache/tools/ant/taskdefs/FixCRLF.java View File

@@ -284,14 +284,14 @@ try {
switch (indata[k]) { switch (indata[k]) {
case ' ': case ' ':
// advance column // advance column
if (addtab == 0) outdata[o++]=indata[k];
if (addtab == 0) outdata[o++]=(byte)' ';
col++; col++;
break; break;


case '\t': case '\t':
if (addtab == 0) { if (addtab == 0) {
// treat like any other character // treat like any other character
outdata[o++]=indata[k];
outdata[o++]=(byte)'\t';
col++; col++;
} else { } else {
// advance column to next tab stop // advance column to next tab stop
@@ -302,15 +302,15 @@ try {
case '\r': case '\r':
if (addcr == 0) { if (addcr == 0) {
// treat like any other character // treat like any other character
outdata[o++]=indata[k];
outdata[o++]=(byte)'\r';
col++; col++;
} }
break; break;


case '\n': case '\n':
// start a new line (optional CR followed by LF) // start a new line (optional CR followed by LF)
if (addcr == +1) outdata[o++]='\r';
outdata[o++]='\n';
if (addcr == +1) outdata[o++]=(byte)'\r';
outdata[o++]=(byte)'\n';
line=o; line=o;
col=0; col=0;
break; break;
@@ -324,14 +324,14 @@ try {
// add tabs until this column would be passed // add tabs until this column would be passed
// note: the start of line is adjusted to match // note: the start of line is adjusted to match
while ((diff|7)<col) { while ((diff|7)<col) {
outdata[o++]='\t';
outdata[o++]=(byte)'\t';
line-=7-(diff&7); line-=7-(diff&7);
diff=o-line; diff=o-line;
}; };
}; };


// space out to desired column // space out to desired column
while (o<line+col) outdata[o++]=' ';
while (o<line+col) outdata[o++]=(byte)' ';


// append desired character // append desired character
outdata[o++]=indata[k]; outdata[o++]=indata[k];


Loading…
Cancel
Save