javaQQ
August 31st, 2006, 01:19 PM
Is there anything in this block of code which would set a boolean to "true?"
// --------------------------------------- has the job been cancelled?
if( !cancel_datetime.equals( "11-11-9999" ) ) { // i.e.: the job has been cancelled
cancelled = true;
}
else
if( cancel_datetime.equals( "11-11-9999" ) ) { // i.e.: the job has NOT been cancelled
cancelled = false;
}
This is the context in which the block appears:
String _default_ = "11-11-9999";
...
boolean cancelled = false;
...
// --------------------------------------- has the job been cancelled?
if( !cancelDatetime.equals( "11-11-9999" ) ) { // i.e.: the job has been cancelled
cancelled = true;
}
else
if( cancelDatetime.equals( "11-11-9999" ) ) { // i.e.: the job has NOT been cancelled
cancelled = false;
}
...
if( cancelled = true ) {
System.out.println( "cancelled (1) = " + cancelled );
// Dialog box: the job has been cancelled
showADialog( frame, "cancelled" );
}
...
System.out.println( "cancelled (2) = " + cancelled );
If I run the application with the block commented-out, "cancelled" prints out to "false."
Include the block, "cancelled" prints out to "true."
An exact duplicate of the model works with other variables.
Many thanks in advance for a solution.
// --------------------------------------- has the job been cancelled?
if( !cancel_datetime.equals( "11-11-9999" ) ) { // i.e.: the job has been cancelled
cancelled = true;
}
else
if( cancel_datetime.equals( "11-11-9999" ) ) { // i.e.: the job has NOT been cancelled
cancelled = false;
}
This is the context in which the block appears:
String _default_ = "11-11-9999";
...
boolean cancelled = false;
...
// --------------------------------------- has the job been cancelled?
if( !cancelDatetime.equals( "11-11-9999" ) ) { // i.e.: the job has been cancelled
cancelled = true;
}
else
if( cancelDatetime.equals( "11-11-9999" ) ) { // i.e.: the job has NOT been cancelled
cancelled = false;
}
...
if( cancelled = true ) {
System.out.println( "cancelled (1) = " + cancelled );
// Dialog box: the job has been cancelled
showADialog( frame, "cancelled" );
}
...
System.out.println( "cancelled (2) = " + cancelled );
If I run the application with the block commented-out, "cancelled" prints out to "false."
Include the block, "cancelled" prints out to "true."
An exact duplicate of the model works with other variables.
Many thanks in advance for a solution.