Browse Source

REPORT-20323 sonar问题修复

research/11.0
Maksim 5 years ago
parent
commit
6e3d656b8c
  1. 6
      designer-realize/src/main/java/com/fr/design/actions/cell/style/AlignmentAction.java
  2. 3
      designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontSizeAction.java
  3. 6
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java
  4. 2
      designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java
  5. 5
      designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java
  6. 7
      designer-realize/src/main/java/com/fr/design/mainframe/AuthorityEditToolBarPane.java
  7. 2
      designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java
  8. 5
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  9. 3
      designer-realize/src/main/java/com/fr/design/mainframe/SheetAuthorityEditPane.java

6
designer-realize/src/main/java/com/fr/design/actions/cell/style/AlignmentAction.java

@ -110,8 +110,10 @@ public class AlignmentAction extends ButtonGroupAction implements StyleActionInt
group.setAllToolTips(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Left"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Center"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Right")});
}
for (int i = 0; i < 3; i++) {
group.getButton(i).setRoundBorder(true, UIConstants.ARC);
group.getButton(i).setBorderPainted(true);
if (group != null) {
group.getButton(i).setRoundBorder(true, UIConstants.ARC);
group.getButton(i).setBorderPainted(true);
}
}
return group;
}

3
designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontSizeAction.java

@ -15,6 +15,7 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.stable.AssistUtils;
/**
@ -51,7 +52,7 @@ public class ReportFontSizeAction extends AbstractStyleAction {
if (style.getFRFont().getSize() == defStyle.getFRFont().getSize()) {
style = StyleUtils.setReportFontSize(style, defStyle.getFRFont().getSize());
}
if (selectedFontSize == style.getFRFont().getSize()) {
if (AssistUtils.equals(selectedFontSize, style.getFRFont().getSize())){
return style;
}
style = StyleUtils.setReportFontSize(style, selectedFontSize);

6
designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java

@ -247,11 +247,7 @@ public class DSColumnAdvancedPane extends BasicPane {
this.sortOrderComboBox.setSortOrder(new SortOrder(sort));
String sortFormula = dSColumn.getSortFormula();
if (sortFormula != null && sortFormula.length() >= 1) {
sortFormulaTextField.setText(sortFormula);
} else {
sortFormulaTextField.setText(sortFormula);
}
sortFormulaTextField.setText(sortFormula);
}
public void update(CellElement cellElement) {

2
designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -263,7 +263,7 @@ public class SelectedDataColumnPane extends BasicPane {
SimpleDSColumn simpleDSColumn = updateColumnPane();
dsColumn.setDSName(Objects.requireNonNull(simpleDSColumn).getDsName());
dsColumn.setColumn(simpleDSColumn.getColumn());
dsColumn.setColumn(Objects.requireNonNull(simpleDSColumn).getColumn());
dsColumn.setParameters((ps != null && ps.length > 0) ? ps : null);
}

5
designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java

@ -140,10 +140,11 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
@Override
public void populateBean(Listener listener) {
this.listener = listener;
if (this.listener == null) {
if (listener == null){
this.listener = new Listener();
return;
}
this.listener = listener;
this.nameText.setText(listener.getEventName());
JavaScript js = listener.getAction();
for (int i = 0; i < this.cards.size(); i++) {

7
designer-realize/src/main/java/com/fr/design/mainframe/AuthorityEditToolBarPane.java

@ -13,6 +13,7 @@ import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.webattr.ToolBarButton;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
@ -204,7 +205,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void populateType() {
if (name.getText() == "") {
if (StringUtils.isEmpty(name.getText())) {
type.setText("");
} else {
type.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Toolbar_Button"));
@ -218,7 +219,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
names += "," + buttonlists.get(i).getNameOption().optionName();
}
}
if (names != "") {
if (StringUtils.isNotEmpty(names)) {
names = names.substring(1);
}
name.setText(names);
@ -226,7 +227,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void populateCheckPane() {
checkPane.removeAll();
if (name.getText() == "") {
if (StringUtils.isEmpty(name.getText())) {
return;
}
double f = TableLayout.FILL;

2
designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java

@ -157,7 +157,7 @@ public class FormatBrushAction extends ElementCaseAction {
}
Style style = cellElement.getStyle();
if (style == null) {
style = style.DEFAULT_STYLE;
style = Style.DEFAULT_STYLE;
}
referencedStyle[i][j] = style;

5
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -89,6 +89,7 @@ import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.poly.PolyWorkSheet;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.module.Module;
@ -469,7 +470,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
double creatorWidth = blockCreator.getEditorBounds().width;
double areaHeight = polyDezi.polyArea.getHeight();
double areaWidth = polyDezi.polyArea.getWidth();
if (creatorWidth == 0 || creatorHeight == 0) {
if(AssistUtils.equals(creatorWidth,0) || AssistUtils.equals(creatorHeight,0)){
return resolution;
}
double time = (areaHeight / creatorHeight) < (areaWidth / creatorWidth) ? (areaHeight / creatorHeight) : (areaWidth / creatorWidth);
@ -486,7 +487,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
int row = reportPane.getSelection().getSelectedRows()[0];
double rowLength = reportPane.getSelection().getSelectedRows().length;
double rowExtent = reportPane.getGrid().getVerticalExtent();
if (columnLength == 0 || rowLength == 0) {
if(AssistUtils.equals(columnLength,0) || AssistUtils.equals(rowLength,0)){
return resolution;
}
double time = (columnExtent / columnLength) < (rowExtent / rowLength) ? (columnExtent / columnLength) : (rowExtent / rowLength);

3
designer-realize/src/main/java/com/fr/design/mainframe/SheetAuthorityEditPane.java

@ -13,6 +13,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.main.impl.WorkBook;
import com.fr.privilege.finegrain.WorkSheetPrivilegeControl;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
@ -115,7 +116,7 @@ public class SheetAuthorityEditPane extends AuthorityEditPane {
populateName();
populateType();
checkPane.removeAll();
if (name.getText() == "") {
if (StringUtils.isEmpty(name.getText())){
return;
}
checkPane.add(populateCheckPane(), BorderLayout.CENTER);

Loading…
Cancel
Save