Old post. I know but I found a solution to this:
http://www.sqlparser.com/retrieve-refactor-table-column-name.php
Old post. I know but I found a solution to this:
http://www.sqlparser.com/retrieve-refactor-table-column-name.php
Now you can see why people hate JDBC and how ORMs got such an early start in Java.
setExamBillingTrigger(true); setExamBillingTrigger(false);
LOL! I didn't notice that one.
Good advice from Yoda. Check this code I found when refactoring some related area of our app. The developer clearly does not know what to do about exceptions. This method seems to be initializing the object and returning true or false (for no particular reason). I love how he happily continues on even if an exception occurs. Also note the use of a default exception handler which does nothing except hide the exceptions. The saddest part of course is the calling code handles the exceptions so he shouldn't be trying anything here at all.
private boolean setCurrentFeesAndOldAndNewExamTriggers() {
try {
newStatusValue = (ExamStatusValue) ExamStatusFactory.getInstance()
.getValueObject(newExamValue.getExamStatusNo());
} catch (BadDataException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
return true;
}
try {
oldStatusValue = (ExamStatusValue) ExamStatusFactory.getInstance()
.getValueObject(oldExamValue.getExamStatusNo());
} catch (BadDataException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
return true;
}
//If no change done or type, for some reason is higher than what we
// currently handle, return.
SystemPropertyUtil propertyUtil = SystemPropertyUtil.getInstance();
sendSupplyFees = WhenToSendBilling.get(String.valueOf(
propertyUtil.getWhenToSendSupplyFees()));
sendTechnicalFees = WhenToSendBilling.get(String.valueOf(
propertyUtil.getWhenToSendTechnicalFees()));
sendProfessionalFees = WhenToSendBilling.get(String.valueOf(
propertyUtil.getWhenToSendProfessionalFees()));if (sendTechnicalFees == WhenToSendBilling.Never
&& sendSupplyFees == WhenToSendBilling.Never
&& sendProfessionalFees == WhenToSendBilling.Never) {
return true;
}correctionsToExamTriggerCreditsAndNewCharges
= propertyUtil.isCorrectionsToExamWillTriggerCreditsAndNewCharges();
autoApproveIfPassesValidation
= propertyUtil.isAutoApproveIfPassesValidation();
if (formerBillingMethod.isExportingNoTypeOfFee() && newBillingMethod.isExportingNoTypeOfFee()) {
//Assuming that the billing method is updatable only within
// EXAM_EDIT_UPDATE originating action.
return true;
}endExamStatus = 0;
try {
endExamStatus = Integer.parseInt(SystemPropertyUtil.getInstance().getEndExamStatus());
} catch (NumberFormatException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
return true;
}try {
neverRequiresInterpretationExamStatusNo = SystemPropertyUtil.
getInstance().getExamStatusNoForNeverRequiresInterpretation();
} catch (NumberFormatException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
return true;
}currentBillingFeesInterface = new BillingFeesInfo(newExamValue.getExamId(),
contextInfo);setExamBillingTrigger(true);
setExamBillingTrigger(false);
return false;
}
Thanks for the link!
Yeah, unfortunately the original developers were M$ kool-ade drinkers. There are many IE bits in the app. Every version I push to get the UI rewritten but so far we haven't had a client push for it. Though we have lost a few prospects because they were using Linux/Mac machines.
The pain continues.
if(window.opener.RefreshListByInsurer){
window.opener.execScript(window.opener.RefreshListByInsurer(nNo,cMask));
}
Why is he executing this function thru execScript?
it should be:
if(window.opener.RefreshListByInsurer){
window.opener.RefreshListByInsurer(nNo,cMask);
}
I hate JavaScript with a passion.
While reviewing some old JavaScript code in our application, I came across this pain.
function selectCompany(companyName,nNo,cMask) {
companyName = unescape(companyName);
if (window.opener){
jStr1 = "window.opener.document.all.IcompanyName.value = trimString(unescape(companyName))"
jStr2 = "window.opener.document.all.IcompanyNo.value = nNo"
jStr3 = "window.opener.document.all.PolicyNumber.mask = cMask"
jStr5 = "window.opener.document.all.PolicyNumber.title = cMask"
jStr4 = "window.opener.document.all.IcompanyName.reset()"
eval(jStr1)
eval(jStr2)
try {eval(jStr3)}catch(e){}
try {eval(jStr4)}catch(e){}
try {eval(jStr5)}catch(e){}
if(window.opener.RefreshListByInsurer){
window.opener.execScript(window.opener.RefreshListByInsurer(nNo,cMask));
}
}
window.close()
}
For some reason the developer (and I use that term very loosely) has decided that he has to EVAL each line of code. Some in a try/catch with nothing in the catch. I guess he never heard of using an IF to check if the object in question exists first.
This is where my gray hair comes from. :(