You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by le...@apache.org on 2010/04/07 01:57:22 UTC
svn commit: r931374 -
/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
Author: lektran
Date: Tue Apr 6 23:57:22 2010
New Revision: 931374
URL: http://svn.apache.org/viewvc?rev=931374&view=rev
Log:
A few basic code cleanups, nothing functional:
- Static field wasn't being accessed in a static way
- Removed a bunch of unnecessary casts
- Removed a redundant null check
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=931374&r1=931373&r2=931374&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Tue Apr 6 23:57:22 2010
@@ -799,7 +799,7 @@ public class ModelForm extends ModelWidg
//if pagination is disabled, update the defualt view size
if (!getPaginate(context)) {
- setDefaultViewSize(this.MAX_PAGE_SIZE);
+ setDefaultViewSize(ModelForm.MAX_PAGE_SIZE);
}
// Populate the viewSize and viewIndex so they are available for use during form actions
@@ -856,11 +856,11 @@ public class ModelForm extends ModelWidg
// Check to see if there is a field, same name and same use-when (could come from extended form)
for (int j = 0; j < tempFieldList.size(); j++) {
- ModelFormField modelFormField = (ModelFormField) tempFieldList.get(j);
+ ModelFormField modelFormField = tempFieldList.get(j);
if (this.useWhenFields.contains(modelFormField.getName())) {
boolean shouldUse1 = modelFormField.shouldUse(context);
for (int i = j+1; i < tempFieldList.size(); i++) {
- ModelFormField curField = (ModelFormField) tempFieldList.get(i);
+ ModelFormField curField = tempFieldList.get(i);
if (curField.getName() != null && curField.getName().equals(modelFormField.getName())) {
boolean shouldUse2 = curField.shouldUse(context);
if (shouldUse1 == shouldUse2) {
@@ -934,7 +934,7 @@ public class ModelForm extends ModelWidg
// at least two loops left
lastFormField = currentFormField;
currentFormField = nextFormField;
- nextFormField = (ModelFormField) fieldIter.next();
+ nextFormField = fieldIter.next();
} else if (nextFormField != null) {
// okay, just one loop left
lastFormField = currentFormField;
@@ -970,7 +970,7 @@ public class ModelForm extends ModelWidg
}
}
- if (currentFieldGroup != null && (lastFieldGroup == null || !lastFieldGroupName.equals(currentFieldGroupName))) {
+ if (lastFieldGroup == null || !lastFieldGroupName.equals(currentFieldGroupName)) {
currentFieldGroup.renderStartString(writer, context, formStringRenderer);
lastFieldGroup = currentFieldGroup;
}
@@ -1453,11 +1453,11 @@ public class ModelForm extends ModelWidg
List<ModelFormField> tempFieldList = FastList.newInstance();
tempFieldList.addAll(this.fieldList);
for (int j = 0; j < tempFieldList.size(); j++) {
- ModelFormField modelFormField = (ModelFormField) tempFieldList.get(j);
+ ModelFormField modelFormField = tempFieldList.get(j);
if (!modelFormField.isUseWhenEmpty()) {
boolean shouldUse1 = modelFormField.shouldUse(localContext);
for (int i = j+1; i < tempFieldList.size(); i++) {
- ModelFormField curField = (ModelFormField) tempFieldList.get(i);
+ ModelFormField curField = tempFieldList.get(i);
if (curField.getName() != null && curField.getName().equals(modelFormField.getName())) {
boolean shouldUse2 = curField.shouldUse(localContext);
if (shouldUse1 == shouldUse2) {