Commit 8881dae8 authored by claes's avatar claes

Comment end was lost and int conversion resulted in exception

parent 7aac6112
/* /*
* Proview $Id: GeCFormat.java,v 1.6 2007-05-24 12:26:07 claes Exp $ * Proview $Id: GeCFormat.java,v 1.7 2008-03-14 08:33:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -126,8 +126,16 @@ public class GeCFormat { ...@@ -126,8 +126,16 @@ public class GeCFormat {
return format_type; return format_type;
} }
public StringBuffer format( float value, StringBuffer buff) { public StringBuffer format( float value, StringBuffer buff) {
if ( pfo != null) if ( pfo != null) {
return pfo.sprintf( value, buff); try {
return pfo.sprintf( value, buff);
}
catch ( IllegalArgumentException e) {
buff.setLength(0);
buff.append("format error");
return buff;
}
}
else else
return buff; return buff;
/* /*
...@@ -166,11 +174,19 @@ public class GeCFormat { ...@@ -166,11 +174,19 @@ public class GeCFormat {
} }
return buff; return buff;
} }
*/
} }
public StringBuffer format( int value, StringBuffer buff) { public StringBuffer format( int value, StringBuffer buff) {
if ( pfo != null) if ( pfo != null) {
return pfo.sprintf( value, buff); try {
return pfo.sprintf( value, buff);
}
catch ( IllegalArgumentException e) {
buff.setLength(0);
buff.append("format error");
return buff;
}
}
else else
return buff; return buff;
/* /*
...@@ -201,8 +217,16 @@ public class GeCFormat { ...@@ -201,8 +217,16 @@ public class GeCFormat {
public StringBuffer format( String value, StringBuffer buff) { public StringBuffer format( String value, StringBuffer buff) {
switch( format_type) { switch( format_type) {
case FRM_S: { case FRM_S: {
if ( pfo != null) if ( pfo != null) {
return pfo.sprintf( value, buff); try {
return pfo.sprintf( value, buff);
}
catch ( IllegalArgumentException e) {
buff.setLength(0);
buff.append("format error");
return buff;
}
}
else else
return buff; return buff;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment