non mi da' errore solo se questo if lo metto in un punto diverso

ecco l'intero codice :

se l'if lo metto in un punto (colore verde) non mi da errore, se lo metto dove mi serve (colore rosso) mi da' errore...




public void otherDoStartTagOperations() throws JspException {

String str;
boolean ret;
TagSupport tag;
ResultSet rs = null;


tag = (TagSupport)this.getParent();
try{
rs = (ResultSet)tag.getClass().getField("rs").get(this. getParent());
}
catch (NoSuchFieldException e) {
throw new JspException(e.toString());
}
catch (IllegalAccessException e) {
throw new JspException(e.toString());
}


try {
ret = rs.isAfterLast();
}
catch (SQLException e) {
throw new JspException(e.toString());
}

if (!ret) {
try {
int format = DateFormat.MEDIUM;

if (getFormat().trim().toLowerCase().compareTo("short ") == 0 ) {format = DateFormat.SHORT;}
else if (getFormat().trim().toLowerCase().compareTo("mediu m") == 0 ) {format = DateFormat.MEDIUM;}
else if (getFormat().trim().toLowerCase().compareTo("long" ) == 0 ) {format = DateFormat.LONG;}
else if (getFormat().trim().toLowerCase().compareTo("full" ) == 0 ) {format = DateFormat.FULL;}
else {format = DateFormat.MEDIUM;}
/*
SHORT is completely numeric, such as 12.13.52 or 3:30pm
MEDIUM is longer, such as Jan 12, 1952
LONG is longer, such as January 12, 1952 or 3:30:32pm
FULL is pretty completely specified, such as Tuesday, April 12, 1952 AD or 3:30:42pm PST.
*/

DateFormat dtf= null;
Timestamp strd = rs.getTimestamp(getCampo());
if(((String)pageContext.getAttribute("localeT")).c ompareTo("it_IT") == 0) {
dtf = DateFormat.getDateInstance(format, Locale.ITALY);
} else if (((String)pageContext.getAttribute("localeT")).com pareTo("us_US") == 0) {
dtf = DateFormat.getDateInstance(format, Locale.US);
} else if (((String)pageContext.getAttribute("localeT")).com pareTo("de_DE") == 0) {
dtf = DateFormat.getDateInstance(format, Locale.GERMANY);
} else if (((String)pageContext.getAttribute("localeT")).com pareTo("fr_FR") == 0) {
dtf = DateFormat.getDateInstance(format, Locale.FRANCE);
}
else {
dtf = DateFormat.getDateInstance(format, Locale.ITALY);
}

str = dtf.format(strd);


// new 22 novembre 2002
//String strdata;
//String datamy;
//strdata = "01/01/1900";
//datamy = dtf.format(strdata);

//System.out.println(strd.toString().trim());
//System.out.println(strdata);

if(!(strd.toString().trim().equals(strdata)))
{

}

// end new

}
catch (SQLException e) {
throw new JspException(e.toString());
}
try {
if(str != null) {
// new 22 novembre 2002
String strdata;
//String datamy;
strdata = "01/01/1900";
//if(str.toString().trim().compareTo("01/01/1900") != 0)
if(!(strd.toString().trim().equals(strdata))){

{
// end new

pageContext.getOut().write("<SPAN CLASS=\"data\">");
if(getHref() != null) {
pageContext.getOut().write("<A " + getA_attributi() + " href=\"" + getHref() + "?recn=" + URLEncoder.encode(rs.getString("recn")) + "\">");
}
int len = str.length();
for (int indx = 0; indx < len; indx++) {
if( str.charAt(indx) == '\n') {
pageContext.getOut().write("
");
} else {
pageContext.getOut().write(str.charAt(indx));
}
}
if(getHref() != null) {
pageContext.getOut().write("</A>");
}
pageContext.getOut().write("</SPAN>");

// new 22 novembre 2002
}
else
{
pageContext.getOut().write("");
}
// end new


}


}
catch (IOException e) {
throw new JspException(e.toString());
}
catch (SQLException e) {
throw new JspException(e.toString());
}
}

} // fine otherdostarttag()