| 1 | package com.jsql.view.swing.panel.address; | |
| 2 | ||
| 3 | import com.jsql.model.injection.strategy.AbstractStrategy; | |
| 4 | import com.jsql.model.injection.strategy.StrategyError; | |
| 5 | import com.jsql.model.injection.engine.model.Engine; | |
| 6 | import com.jsql.model.injection.engine.model.yaml.Method; | |
| 7 | import com.jsql.util.CookiesUtil; | |
| 8 | import com.jsql.util.I18nUtil; | |
| 9 | import com.jsql.util.LogLevelUtil; | |
| 10 | import com.jsql.util.ParameterUtil; | |
| 11 | import com.jsql.view.swing.panel.PanelAddressBar; | |
| 12 | import com.jsql.view.swing.text.JToolTipI18n; | |
| 13 | import com.jsql.view.swing.util.I18nViewUtil; | |
| 14 | import com.jsql.view.swing.util.MediatorHelper; | |
| 15 | import com.jsql.view.swing.util.UiUtil; | |
| 16 | import org.apache.commons.lang3.StringUtils; | |
| 17 | import org.apache.logging.log4j.LogManager; | |
| 18 | import org.apache.logging.log4j.Logger; | |
| 19 | ||
| 20 | import javax.swing.*; | |
| 21 | import java.awt.*; | |
| 22 | import java.awt.event.MouseAdapter; | |
| 23 | import java.awt.event.MouseEvent; | |
| 24 | import java.net.MalformedURLException; | |
| 25 | import java.net.URI; | |
| 26 | import java.net.URISyntaxException; | |
| 27 | import java.util.AbstractMap; | |
| 28 | import java.util.Arrays; | |
| 29 | import java.util.Locale; | |
| 30 | import java.util.concurrent.atomic.AtomicReference; | |
| 31 | import java.util.regex.Pattern; | |
| 32 | import java.util.stream.Stream; | |
| 33 | import java.util.stream.StreamSupport; | |
| 34 | ||
| 35 | public class PanelTrailingAddress extends JPanel { | |
| 36 | ||
| 37 | private static final Logger LOGGER = LogManager.getRootLogger(); | |
| 38 | ||
| 39 | public static final String MENU_STRATEGY = "menuStrategy"; | |
| 40 | public static final String ITEM_RADIO_STRATEGY_ERROR = "itemRadioStrategyError"; | |
| 41 | public static final String MENU_VENDOR = "menuVendor"; | |
| 42 | public static final String ITEM_RADIO_VENDOR = "itemRadioVendor"; | |
| 43 | public static final String PARAM_AUTO = "Param auto"; | |
| 44 | ||
| 45 | private JMenu itemRadioStrategyError; | |
| 46 | ||
| 47 | private final JLabel labelTarget = new JLabel(UiUtil.TARGET.getIcon(), SwingConstants.LEFT); | |
| 48 | private final JLabel labelEngine = new JLabel(UiUtil.ARROW_DOWN.getIcon(), SwingConstants.LEFT); | |
| 49 | private final JLabel labelStrategy = new JLabel(UiUtil.ARROW_DOWN.getIcon(), SwingConstants.LEFT); | |
| 50 | private final JPopupMenu popupMenuTargets = new JPopupMenu(); | |
| 51 | private ButtonGroup groupRadio = new ButtonGroup(); | |
| 52 | private final JPopupMenu popupMenuEngines = new JPopupMenu(); | |
| 53 | private final JPopupMenu popupMenuStrategies = new JPopupMenu(); | |
| 54 | ||
| 55 | private final ButtonGroup groupStrategy = new ButtonGroup(); | |
| 56 | public static final String PREFIX_NAME_ERROR = "itemRadioError"; | |
| 57 | private static final String I18N_TOOLTIP_STRATEGY = "STRATEGY_%s_TOOLTIP"; | |
| 58 | ||
| 59 | /** | |
| 60 | * Loader displayed during injection. | |
| 61 | */ | |
| 62 | private final JProgressBar loader; | |
| 63 | ||
| 64 | /** | |
| 65 | * Connection button. | |
| 66 | */ | |
| 67 | public final ButtonStart buttonStart = new ButtonStart(); | |
| 68 | | |
| 69 | public PanelTrailingAddress(PanelAddressBar panelAddressBar) { | |
| 70 |
1
1. <init> : removed call to com/jsql/view/swing/panel/address/ButtonStart::addActionListener → NO_COVERAGE |
this.buttonStart.addActionListener(new ActionStart(panelAddressBar)); |
| 71 |
1
1. <init> : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress::setOpaque → NO_COVERAGE |
this.setOpaque(false); |
| 72 |
1
1. <init> : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress::setBorder → NO_COVERAGE |
this.setBorder(null); |
| 73 |
1
1. <init> : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelStrategy.setText("Strategy auto"); |
| 74 |
1
1. <init> : removed call to javax/swing/JLabel::setName → NO_COVERAGE |
this.labelStrategy.setName(PanelTrailingAddress.MENU_STRATEGY); |
| 75 | ||
| 76 | for (final AbstractStrategy strategy: MediatorHelper.model().getMediatorStrategy().getStrategies()) { | |
| 77 | var nameStrategy = strategy.getName().toUpperCase(Locale.ROOT); | |
| 78 | JMenuItem itemRadioStrategy; | |
| 79 |
1
1. <init> : negated conditional → NO_COVERAGE |
if (strategy == MediatorHelper.model().getMediatorStrategy().getError()) { |
| 80 | itemRadioStrategy = new JMenu(strategy.toString()); | |
| 81 | this.itemRadioStrategyError = (JMenu) itemRadioStrategy; | |
| 82 |
1
1. <init> : removed call to java/awt/Component::setName → NO_COVERAGE |
itemRadioStrategy.getComponent().setName(PanelTrailingAddress.ITEM_RADIO_STRATEGY_ERROR); |
| 83 | } else { | |
| 84 | var atomicTooltip = new AtomicReference<>(new JToolTipI18n( | |
| 85 | I18nUtil.valueByKey(String.format(PanelTrailingAddress.I18N_TOOLTIP_STRATEGY, nameStrategy)) | |
| 86 | )); | |
| 87 | itemRadioStrategy = new JRadioButtonMenuItem(strategy.toString()) { | |
| 88 | @Override | |
| 89 | public JToolTip createToolTip() { | |
| 90 |
1
1. createToolTip : removed call to java/util/concurrent/atomic/AtomicReference::set → NO_COVERAGE |
atomicTooltip.set(new JToolTipI18n( |
| 91 | I18nUtil.valueByKey( | |
| 92 | String.format(PanelTrailingAddress.I18N_TOOLTIP_STRATEGY, nameStrategy) | |
| 93 | ) | |
| 94 | )); | |
| 95 |
1
1. createToolTip : replaced return value with null for com/jsql/view/swing/panel/address/PanelTrailingAddress$1::createToolTip → NO_COVERAGE |
return atomicTooltip.get(); |
| 96 | } | |
| 97 | }; | |
| 98 |
1
1. <init> : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey( |
| 99 | String.format(PanelTrailingAddress.I18N_TOOLTIP_STRATEGY, nameStrategy), | |
| 100 | atomicTooltip.get() | |
| 101 | ); | |
| 102 |
1
1. <init> : removed call to java/awt/Component::setName → NO_COVERAGE |
itemRadioStrategy.getComponent().setName("itemRadioStrategy" + strategy); |
| 103 |
1
1. <init> : removed call to javax/swing/JMenuItem::addActionListener → NO_COVERAGE |
itemRadioStrategy.addActionListener(actionEvent -> { |
| 104 |
1
1. lambda$new$0 : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelStrategy.setText(strategy.toString()); |
| 105 |
1
1. lambda$new$0 : removed call to com/jsql/model/injection/strategy/MediatorStrategy::setStrategy → NO_COVERAGE |
MediatorHelper.model().getMediatorStrategy().setStrategy(strategy); |
| 106 | }); | |
| 107 |
1
1. <init> : removed call to javax/swing/ButtonGroup::add → NO_COVERAGE |
this.groupStrategy.add(itemRadioStrategy); |
| 108 | } | |
| 109 | ||
| 110 | this.popupMenuStrategies.add(itemRadioStrategy); | |
| 111 |
1
1. <init> : removed call to javax/swing/JMenuItem::setToolTipText → NO_COVERAGE |
itemRadioStrategy.setToolTipText( |
| 112 | I18nUtil.valueByKey(String.format(PanelTrailingAddress.I18N_TOOLTIP_STRATEGY, nameStrategy)) | |
| 113 | ); | |
| 114 |
1
1. <init> : removed call to javax/swing/JMenuItem::setEnabled → NO_COVERAGE |
itemRadioStrategy.setEnabled(false); |
| 115 | } | |
| 116 | ||
| 117 |
1
1. <init> : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelEngine.setText(MediatorHelper.model().getMediatorEngine().getAuto().toString()); |
| 118 |
1
1. <init> : removed call to javax/swing/JLabel::setName → NO_COVERAGE |
this.labelEngine.setName(PanelTrailingAddress.MENU_VENDOR); |
| 119 |
1
1. <init> : removed call to javax/swing/JPopupMenu::setLayout → NO_COVERAGE |
this.popupMenuEngines.setLayout(UiUtil.getColumnLayout(MediatorHelper.model().getMediatorEngine().getEngines().size())); |
| 120 | var groupEngine = new ButtonGroup(); | |
| 121 | for (final Engine engine : MediatorHelper.model().getMediatorEngine().getEngines()) { | |
| 122 |
1
1. <init> : negated conditional → NO_COVERAGE |
JMenuItem itemRadioEngine = new JRadioButtonMenuItem(engine.toString(), engine == MediatorHelper.model().getMediatorEngine().getAuto()); |
| 123 |
1
1. <init> : removed call to javax/swing/JMenuItem::setName → NO_COVERAGE |
itemRadioEngine.setName(PanelTrailingAddress.ITEM_RADIO_VENDOR + engine); |
| 124 |
1
1. <init> : removed call to javax/swing/JMenuItem::addActionListener → NO_COVERAGE |
itemRadioEngine.addActionListener(actionEvent -> { |
| 125 |
1
1. lambda$new$1 : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelEngine.setText(engine.toString()); |
| 126 |
1
1. lambda$new$1 : removed call to com/jsql/model/injection/engine/MediatorEngine::setEngineByUser → NO_COVERAGE |
MediatorHelper.model().getMediatorEngine().setEngineByUser(engine); |
| 127 | }); | |
| 128 | this.popupMenuEngines.add(itemRadioEngine); | |
| 129 |
1
1. <init> : removed call to javax/swing/ButtonGroup::add → NO_COVERAGE |
groupEngine.add(itemRadioEngine); |
| 130 | } | |
| 131 | ||
| 132 | this.loader = new JProgressBar(); | |
| 133 | var dimension = UIManager.getDimension("ProgressBar.horizontalSize"); | |
| 134 |
1
1. <init> : removed call to javax/swing/JProgressBar::setPreferredSize → NO_COVERAGE |
this.loader.setPreferredSize(new Dimension(32, dimension.height)); |
| 135 |
1
1. <init> : removed call to javax/swing/JProgressBar::setIndeterminate → NO_COVERAGE |
this.loader.setIndeterminate(true); |
| 136 | this.add(this.loader); | |
| 137 | ||
| 138 |
1
1. <init> : removed call to javax/swing/JLabel::addMouseListener → NO_COVERAGE |
this.labelEngine.addMouseListener(new MouseAdapter() { |
| 139 | @Override | |
| 140 | public void mousePressed(MouseEvent e) { | |
| 141 | Arrays.stream(PanelTrailingAddress.this.popupMenuEngines.getComponents()) | |
| 142 | .map(JComponent.class::cast) | |
| 143 |
1
1. mousePressed : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(JComponent::updateUI); // required: incorrect when dark/light mode switch |
| 144 |
1
1. mousePressed : removed call to javax/swing/JPopupMenu::updateUI → NO_COVERAGE |
PanelTrailingAddress.this.popupMenuEngines.updateUI(); // required: incorrect when dark/light mode switch |
| 145 |
1
1. mousePressed : removed call to javax/swing/SwingUtilities::invokeLater → NO_COVERAGE |
SwingUtilities.invokeLater(() -> { // reduce flickering on linux |
| 146 |
3
1. lambda$mousePressed$0 : removed call to javax/swing/JPopupMenu::show → NO_COVERAGE 2. lambda$mousePressed$0 : Replaced integer addition with subtraction → NO_COVERAGE 3. lambda$mousePressed$0 : Replaced integer addition with subtraction → NO_COVERAGE |
PanelTrailingAddress.this.popupMenuEngines.show(e.getComponent(), e.getComponent().getX(),5 + e.getComponent().getY() + e.getComponent().getHeight()); |
| 147 |
3
1. lambda$mousePressed$0 : Replaced integer addition with subtraction → NO_COVERAGE 2. lambda$mousePressed$0 : removed call to javax/swing/JPopupMenu::setLocation → NO_COVERAGE 3. lambda$mousePressed$0 : Replaced integer addition with subtraction → NO_COVERAGE |
PanelTrailingAddress.this.popupMenuEngines.setLocation(e.getComponent().getLocationOnScreen().x,5 + e.getComponent().getLocationOnScreen().y + e.getComponent().getHeight()); |
| 148 | }); | |
| 149 | } | |
| 150 | }); | |
| 151 |
1
1. <init> : removed call to javax/swing/JLabel::addMouseListener → NO_COVERAGE |
this.labelStrategy.addMouseListener(new MouseAdapter() { |
| 152 | @Override | |
| 153 | public void mousePressed(MouseEvent e) { | |
| 154 | Arrays.stream(PanelTrailingAddress.this.popupMenuStrategies.getComponents()) | |
| 155 | .map(JComponent.class::cast) | |
| 156 |
1
1. mousePressed : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(JComponent::updateUI); // required: incorrect when dark/light mode switch |
| 157 |
2
1. mousePressed : changed conditional boundary → NO_COVERAGE 2. mousePressed : negated conditional → NO_COVERAGE |
for (var i = 0 ; i < PanelTrailingAddress.this.getMenuError().getItemCount() ; i++) { |
| 158 |
1
1. mousePressed : removed call to javax/swing/JMenuItem::updateUI → NO_COVERAGE |
PanelTrailingAddress.this.getMenuError().getItem(i).updateUI(); // required: incorrect when dark/light mode switch |
| 159 | } | |
| 160 |
1
1. mousePressed : removed call to javax/swing/JPopupMenu::updateUI → NO_COVERAGE |
PanelTrailingAddress.this.popupMenuStrategies.updateUI(); // required: incorrect when dark/light mode switch |
| 161 |
1
1. mousePressed : removed call to javax/swing/SwingUtilities::invokeLater → NO_COVERAGE |
SwingUtilities.invokeLater(() -> { // reduce flickering on linux |
| 162 |
3
1. lambda$mousePressed$0 : Replaced integer addition with subtraction → NO_COVERAGE 2. lambda$mousePressed$0 : Replaced integer addition with subtraction → NO_COVERAGE 3. lambda$mousePressed$0 : removed call to javax/swing/JPopupMenu::show → NO_COVERAGE |
PanelTrailingAddress.this.popupMenuStrategies.show(e.getComponent(), e.getComponent().getX(),5 + e.getComponent().getY() + e.getComponent().getHeight()); |
| 163 |
3
1. lambda$mousePressed$0 : removed call to javax/swing/JPopupMenu::setLocation → NO_COVERAGE 2. lambda$mousePressed$0 : Replaced integer addition with subtraction → NO_COVERAGE 3. lambda$mousePressed$0 : Replaced integer addition with subtraction → NO_COVERAGE |
PanelTrailingAddress.this.popupMenuStrategies.setLocation(e.getComponent().getLocationOnScreen().x,5 + e.getComponent().getLocationOnScreen().y + e.getComponent().getHeight()); |
| 164 | }); | |
| 165 | } | |
| 166 | }); | |
| 167 | ||
| 168 |
1
1. <init> : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelTarget.setText(PanelTrailingAddress.PARAM_AUTO); |
| 169 |
1
1. <init> : removed call to javax/swing/JLabel::addMouseListener → NO_COVERAGE |
this.labelTarget.addMouseListener(new TargetMouseAdapter(panelAddressBar)); |
| 170 | ||
| 171 | this.add(this.labelTarget); | |
| 172 | this.add(this.labelEngine); | |
| 173 | this.add(this.labelStrategy); | |
| 174 | this.add(this.buttonStart); | |
| 175 |
1
1. <init> : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress::setCursor → NO_COVERAGE |
this.setCursor(Cursor.getDefaultCursor()); |
| 176 |
1
1. <init> : removed call to javax/swing/JProgressBar::setVisible → NO_COVERAGE |
this.loader.setVisible(false); |
| 177 | } | |
| 178 | ||
| 179 | public void endPreparation() { | |
| 180 |
1
1. endPreparation : removed call to com/jsql/view/swing/panel/address/ButtonStart::setToolTipText → NO_COVERAGE |
this.buttonStart.setToolTipText(I18nUtil.valueByKey("BUTTON_START_TOOLTIP")); |
| 181 |
1
1. endPreparation : removed call to com/jsql/view/swing/panel/address/ButtonStart::setInjectionReady → NO_COVERAGE |
this.buttonStart.setInjectionReady(); |
| 182 |
1
1. endPreparation : removed call to javax/swing/JProgressBar::setVisible → NO_COVERAGE |
this.loader.setVisible(false); |
| 183 | } | |
| 184 | | |
| 185 | public void reset() { | |
| 186 |
1
1. reset : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelStrategy.setText("Strategy auto"); |
| 187 |
1
1. reset : negated conditional → NO_COVERAGE |
if (MediatorHelper.model().getMediatorEngine().getEngineByUser() == MediatorHelper.model().getMediatorEngine().getAuto()) { |
| 188 |
1
1. reset : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelEngine.setText(MediatorHelper.model().getMediatorEngine().getAuto().toString()); |
| 189 | } | |
| 190 | Arrays.stream(this.popupMenuStrategies.getComponents()) | |
| 191 |
2
1. lambda$reset$2 : removed call to java/awt/Component::setEnabled → NO_COVERAGE 2. reset : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(component -> component.setEnabled(false)); |
| 192 |
1
1. reset : removed call to javax/swing/JMenu::removeAll → NO_COVERAGE |
this.getMenuError().removeAll(); |
| 193 | ||
| 194 |
1
1. reset : removed call to javax/swing/ButtonGroup::clearSelection → NO_COVERAGE |
this.groupStrategy.clearSelection(); |
| 195 |
1
1. lambda$reset$3 : replaced return value with null for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$reset$3 → NO_COVERAGE |
Iterable<AbstractButton> iterable = () -> this.groupStrategy.getElements().asIterator(); |
| 196 | StreamSupport.stream(iterable.spliterator(), false) | |
| 197 |
2
1. lambda$reset$4 : replaced boolean return with false for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$reset$4 → NO_COVERAGE 2. lambda$reset$4 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$reset$4 → NO_COVERAGE |
.filter(abstractButton -> abstractButton.getName().startsWith(PanelTrailingAddress.PREFIX_NAME_ERROR)) |
| 198 |
1
1. reset : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(this.groupStrategy::remove); |
| 199 | } | |
| 200 | | |
| 201 | public void setEngine(Engine engine) { | |
| 202 |
1
1. setEngine : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelEngine.setText(engine.toString()); |
| 203 |
1
1. setEngine : removed call to javax/swing/JMenu::removeAll → NO_COVERAGE |
this.itemRadioStrategyError.removeAll(); |
| 204 | var indexError = 0; | |
| 205 | if ( | |
| 206 |
1
1. setEngine : negated conditional → NO_COVERAGE |
engine != MediatorHelper.model().getMediatorEngine().getAuto() |
| 207 |
1
1. setEngine : negated conditional → NO_COVERAGE |
&& engine.instance().getModelYaml().getStrategy().getError() != null |
| 208 | ) { | |
| 209 | for (Method methodError: engine.instance().getModelYaml().getStrategy().getError().getMethod()) { | |
| 210 | JMenuItem itemRadioError = new JRadioButtonMenuItem(methodError.getName()); | |
| 211 |
1
1. setEngine : removed call to javax/swing/JMenuItem::setEnabled → NO_COVERAGE |
itemRadioError.setEnabled(false); |
| 212 |
1
1. setEngine : removed call to javax/swing/JMenuItem::setName → NO_COVERAGE |
itemRadioError.setName(PanelTrailingAddress.PREFIX_NAME_ERROR + methodError.getName()); |
| 213 | this.itemRadioStrategyError.add(itemRadioError); | |
| 214 |
1
1. setEngine : removed call to javax/swing/ButtonGroup::add → NO_COVERAGE |
this.groupStrategy.add(itemRadioError); |
| 215 | int indexErrorFinal = indexError; | |
| 216 |
1
1. setEngine : removed call to javax/swing/JMenuItem::addActionListener → NO_COVERAGE |
itemRadioError.addActionListener(actionEvent -> { |
| 217 |
1
1. lambda$setEngine$5 : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelStrategy.setText(methodError.getName()); |
| 218 |
1
1. lambda$setEngine$5 : removed call to com/jsql/model/injection/strategy/MediatorStrategy::setStrategy → NO_COVERAGE |
MediatorHelper.model().getMediatorStrategy().setStrategy(MediatorHelper.model().getMediatorStrategy().getError()); |
| 219 |
1
1. lambda$setEngine$5 : removed call to com/jsql/model/injection/strategy/StrategyError::setIndexErrorStrategy → NO_COVERAGE |
MediatorHelper.model().getMediatorStrategy().getError().setIndexErrorStrategy(indexErrorFinal); |
| 220 | }); | |
| 221 |
1
1. setEngine : Changed increment from 1 to -1 → NO_COVERAGE |
indexError++; |
| 222 | } | |
| 223 | } | |
| 224 | } | |
| 225 | | |
| 226 | public void activateStrategy(AbstractStrategy strategy) { | |
| 227 |
1
1. activateStrategy : negated conditional → NO_COVERAGE |
if (strategy instanceof StrategyError strategyError) { |
| 228 |
1
1. activateStrategy : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelStrategy.setText(strategyError.toString()); |
| 229 | int indexError = strategyError.getIndexErrorStrategy(); | |
| 230 | String nameError = MediatorHelper.model().getMediatorEngine().getEngine().instance().getModelYaml().getStrategy().getError().getMethod().get( | |
| 231 | indexError | |
| 232 | ).getName(); | |
| 233 | ||
| 234 | Arrays.stream(this.getMenuError().getMenuComponents()) | |
| 235 | .map(JRadioButtonMenuItem.class::cast) | |
| 236 |
2
1. lambda$activateStrategy$6 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$activateStrategy$6 → NO_COVERAGE 2. lambda$activateStrategy$6 : replaced boolean return with false for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$activateStrategy$6 → NO_COVERAGE |
.filter(component -> component.getText().equals(nameError)) |
| 237 |
1
1. activateStrategy : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(jRadioButtonMenuItem -> { |
| 238 |
1
1. lambda$activateStrategy$7 : removed call to javax/swing/JRadioButtonMenuItem::setSelected → NO_COVERAGE |
jRadioButtonMenuItem.setSelected(true); |
| 239 |
1
1. lambda$activateStrategy$7 : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelStrategy.setText(nameError); |
| 240 | }); | |
| 241 | } else { | |
| 242 |
1
1. activateStrategy : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
this.labelStrategy.setText(strategy.toString()); |
| 243 | Arrays.stream(this.popupMenuStrategies.getComponents()) | |
| 244 | .map(JMenuItem.class::cast) | |
| 245 |
2
1. lambda$activateStrategy$8 : replaced boolean return with false for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$activateStrategy$8 → NO_COVERAGE 2. lambda$activateStrategy$8 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$activateStrategy$8 → NO_COVERAGE |
.filter(jMenuItem -> jMenuItem.getText().equals(strategy.toString())) |
| 246 |
2
1. lambda$activateStrategy$9 : removed call to javax/swing/JMenuItem::setSelected → NO_COVERAGE 2. activateStrategy : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(jMenuItem -> jMenuItem.setSelected(true)); |
| 247 | } | |
| 248 | } | |
| 249 | ||
| 250 | public void markInvulnerable(AbstractStrategy strategy) { | |
| 251 | Arrays.stream(this.popupMenuStrategies.getComponents()) | |
| 252 | .map(JMenuItem.class::cast) | |
| 253 |
2
1. lambda$markInvulnerable$10 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markInvulnerable$10 → NO_COVERAGE 2. lambda$markInvulnerable$10 : replaced boolean return with false for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markInvulnerable$10 → NO_COVERAGE |
.filter(jMenuItem -> jMenuItem.getText().equals(strategy.toString())) |
| 254 |
2
1. markInvulnerable : removed call to java/util/stream/Stream::forEach → NO_COVERAGE 2. lambda$markInvulnerable$11 : removed call to javax/swing/JMenuItem::setEnabled → NO_COVERAGE |
.forEach(jMenuItem -> jMenuItem.setEnabled(false)); |
| 255 | } | |
| 256 | | |
| 257 | public void markInvulnerable(int indexMethodError, AbstractStrategy strategy) { | |
| 258 | Arrays.stream(this.popupMenuStrategies.getSubElements()) | |
| 259 | .map(JMenuItem.class::cast) | |
| 260 |
2
1. lambda$markInvulnerable$12 : replaced boolean return with false for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markInvulnerable$12 → NO_COVERAGE 2. lambda$markInvulnerable$12 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markInvulnerable$12 → NO_COVERAGE |
.filter(jMenuItem -> jMenuItem.getText().equals(strategy.toString())) |
| 261 | .map(JMenu.class::cast) | |
| 262 | .filter(jMenuItem -> { | |
| 263 | var isNotNull = true; | |
| 264 | // Fix #36975: ArrayIndexOutOfBoundsException on getItem() | |
| 265 | // Fix #40352: NullPointerException on ? | |
| 266 | // Fix #95855: NPE on setEnabled() | |
| 267 | try { | |
| 268 |
1
1. lambda$markInvulnerable$13 : negated conditional → NO_COVERAGE |
isNotNull = jMenuItem.getItem(indexMethodError) != null; |
| 269 | } catch (ArrayIndexOutOfBoundsException e) { | |
| 270 | LOGGER.log(LogLevelUtil.CONSOLE_JAVA, e, e); | |
| 271 |
1
1. lambda$markInvulnerable$13 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markInvulnerable$13 → NO_COVERAGE |
return false; |
| 272 | } | |
| 273 |
2
1. lambda$markInvulnerable$13 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markInvulnerable$13 → NO_COVERAGE 2. lambda$markInvulnerable$13 : replaced boolean return with false for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markInvulnerable$13 → NO_COVERAGE |
return isNotNull; |
| 274 | }) | |
| 275 |
2
1. lambda$markInvulnerable$14 : removed call to javax/swing/JMenuItem::setEnabled → NO_COVERAGE 2. markInvulnerable : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(jMenuItem -> jMenuItem.getItem(indexMethodError).setEnabled(false)); |
| 276 | } | |
| 277 | ||
| 278 | private JMenu getMenuError() { | |
| 279 | var nameError = MediatorHelper.model().getMediatorStrategy().getError().getName(); | |
| 280 |
1
1. getMenuError : replaced return value with null for com/jsql/view/swing/panel/address/PanelTrailingAddress::getMenuError → NO_COVERAGE |
return (JMenu) Arrays.stream(this.popupMenuStrategies.getComponents()) |
| 281 | .map(JMenuItem.class::cast) | |
| 282 |
2
1. lambda$getMenuError$15 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$getMenuError$15 → NO_COVERAGE 2. lambda$getMenuError$15 : replaced boolean return with false for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$getMenuError$15 → NO_COVERAGE |
.filter(jMenuItem -> jMenuItem.getText().equalsIgnoreCase(nameError)) |
| 283 | .findFirst() | |
| 284 | .orElse(new JMenuItem("Mock")); | |
| 285 | } | |
| 286 | ||
| 287 | public void markVulnerable(AbstractStrategy strategy) { | |
| 288 | Arrays.stream(this.popupMenuStrategies.getComponents()) | |
| 289 | .map(JMenuItem.class::cast) | |
| 290 |
2
1. lambda$markVulnerable$16 : replaced boolean return with false for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markVulnerable$16 → NO_COVERAGE 2. lambda$markVulnerable$16 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markVulnerable$16 → NO_COVERAGE |
.filter(jMenuItem -> jMenuItem.getText().equals(strategy.toString())) |
| 291 |
2
1. lambda$markVulnerable$17 : removed call to javax/swing/JMenuItem::setEnabled → NO_COVERAGE 2. markVulnerable : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(jMenuItem -> jMenuItem.setEnabled(true)); |
| 292 | } | |
| 293 | ||
| 294 | public void markVulnerable(int indexMethodError, AbstractStrategy strategy) { | |
| 295 | // Fix #46578: ArrayIndexOutOfBoundsException on getItem() | |
| 296 | try { | |
| 297 | Arrays.stream(this.popupMenuStrategies.getComponents()) | |
| 298 | .map(JMenuItem.class::cast) | |
| 299 |
2
1. lambda$markVulnerable$18 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markVulnerable$18 → NO_COVERAGE 2. lambda$markVulnerable$18 : replaced boolean return with false for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markVulnerable$18 → NO_COVERAGE |
.filter(jMenuItem -> jMenuItem.getText().equals(strategy.toString())) |
| 300 | .map(JMenu.class::cast) | |
| 301 |
2
1. lambda$markVulnerable$19 : negated conditional → NO_COVERAGE 2. lambda$markVulnerable$19 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress::lambda$markVulnerable$19 → NO_COVERAGE |
.filter(jMenuItem -> jMenuItem.getItem(indexMethodError) != null) |
| 302 |
1
1. markVulnerable : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(jMenuItem -> { |
| 303 |
1
1. lambda$markVulnerable$20 : removed call to javax/swing/JMenu::setEnabled → NO_COVERAGE |
jMenuItem.setEnabled(true); |
| 304 |
1
1. lambda$markVulnerable$20 : removed call to javax/swing/JMenuItem::setEnabled → NO_COVERAGE |
jMenuItem.getItem(indexMethodError).setEnabled(true); |
| 305 | }); | |
| 306 | } catch (ArrayIndexOutOfBoundsException e) { | |
| 307 | LOGGER.log(LogLevelUtil.CONSOLE_JAVA, e, e); | |
| 308 | } | |
| 309 | } | |
| 310 | ||
| 311 | private class TargetMouseAdapter extends MouseAdapter { | |
| 312 | ||
| 313 | private final PanelAddressBar panelAddressBar; | |
| 314 | ||
| 315 | public TargetMouseAdapter(PanelAddressBar panelAddressBar) { | |
| 316 | this.panelAddressBar = panelAddressBar; | |
| 317 | } | |
| 318 | ||
| 319 | @Override | |
| 320 | public void mousePressed(MouseEvent event) { | |
| 321 |
1
1. mousePressed : removed call to javax/swing/JPopupMenu::removeAll → NO_COVERAGE |
PanelTrailingAddress.this.popupMenuTargets.removeAll(); |
| 322 | JRadioButtonMenuItem menuParamAuto = new JRadioButtonMenuItem(PanelTrailingAddress.PARAM_AUTO); | |
| 323 |
1
1. mousePressed : removed call to javax/swing/JRadioButtonMenuItem::setActionCommand → NO_COVERAGE |
menuParamAuto.setActionCommand(PanelTrailingAddress.PARAM_AUTO); // mock required when adding star: @ParameterUtil.controlInput |
| 324 |
1
1. mousePressed : removed call to javax/swing/JRadioButtonMenuItem::addActionListener → NO_COVERAGE |
menuParamAuto.addActionListener(actionEvent -> |
| 325 |
1
1. lambda$mousePressed$0 : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
PanelTrailingAddress.this.labelTarget.setText(menuParamAuto.getText()) |
| 326 | ); | |
| 327 | PanelTrailingAddress.this.popupMenuTargets.add(menuParamAuto); | |
| 328 | ||
| 329 | var rawQuery = this.panelAddressBar.getTextFieldAddress().getText().trim(); | |
| 330 | var rawRequest = this.panelAddressBar.getTextFieldRequest().getText().trim(); | |
| 331 | var rawHeader = this.panelAddressBar.getTextFieldHeader().getText().trim(); | |
| 332 | ||
| 333 | var selection = PanelTrailingAddress.this.groupRadio.getSelection(); | |
| 334 | String selectionCommand; // effectively final | |
| 335 |
1
1. mousePressed : negated conditional → NO_COVERAGE |
if (selection != null) { |
| 336 | selectionCommand = selection.getActionCommand(); | |
| 337 | } else { | |
| 338 | selectionCommand = StringUtils.EMPTY; | |
| 339 | } | |
| 340 | PanelTrailingAddress.this.groupRadio = new ButtonGroup(); | |
| 341 |
1
1. mousePressed : removed call to javax/swing/ButtonGroup::add → NO_COVERAGE |
PanelTrailingAddress.this.groupRadio.add(menuParamAuto); |
| 342 | JMenu menuQuery = new JMenu("Query"); | |
| 343 |
1
1. mousePressed : negated conditional → NO_COVERAGE |
if (!rawQuery.isEmpty()) { |
| 344 | try { | |
| 345 |
1
1. mousePressed : negated conditional → NO_COVERAGE |
rawQuery = !rawQuery.matches("(?i)^\\w+://.*") ? "http://"+ rawQuery : rawQuery; |
| 346 | var url = new URI(rawQuery).toURL(); | |
| 347 |
1
1. mousePressed : negated conditional → NO_COVERAGE |
if (url.getQuery() != null) { |
| 348 |
1
1. mousePressed : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress$TargetMouseAdapter::buildMenu → NO_COVERAGE |
this.buildMenu(url.getQuery(), ParameterUtil.PREFIX_COMMAND_QUERY, selectionCommand, menuQuery); |
| 349 | } | |
| 350 | } catch (IllegalArgumentException | MalformedURLException | URISyntaxException e) { | |
| 351 | LOGGER.log(LogLevelUtil.CONSOLE_ERROR, "Incorrect URL: {}", e.getMessage()); | |
| 352 | return; | |
| 353 | } | |
| 354 | } | |
| 355 | ||
| 356 | JMenu menuRequest = new JMenu("Request"); | |
| 357 |
1
1. mousePressed : negated conditional → NO_COVERAGE |
if (!rawRequest.isEmpty()) { |
| 358 |
1
1. mousePressed : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress$TargetMouseAdapter::buildMenu → NO_COVERAGE |
this.buildMenu(rawRequest, ParameterUtil.PREFIX_COMMAND_REQUEST, selectionCommand, menuRequest); |
| 359 | } | |
| 360 | ||
| 361 | JMenu menuHeader = new JMenu("Header"); | |
| 362 |
1
1. mousePressed : negated conditional → NO_COVERAGE |
if (!rawHeader.isEmpty()) { |
| 363 |
1
1. mousePressed : removed call to com/jsql/view/swing/panel/address/PanelTrailingAddress$TargetMouseAdapter::buildMenuHeader → NO_COVERAGE |
this.buildMenuHeader(rawHeader, selectionCommand, menuHeader); |
| 364 | } | |
| 365 | ||
| 366 | Arrays.stream(PanelTrailingAddress.this.popupMenuTargets.getComponents()) | |
| 367 | .map(JComponent.class::cast) | |
| 368 |
2
1. mousePressed : removed call to java/util/stream/Stream::forEach → NO_COVERAGE 2. lambda$mousePressed$1 : removed call to javax/swing/JComponent::setEnabled → NO_COVERAGE |
.forEach(c -> c.setEnabled(false)); |
| 369 |
1
1. mousePressed : removed call to javax/swing/JRadioButtonMenuItem::setEnabled → NO_COVERAGE |
menuParamAuto.setEnabled(true); |
| 370 |
1
1. mousePressed : negated conditional → NO_COVERAGE |
if (PanelTrailingAddress.this.groupRadio.getSelection() == null) { |
| 371 |
1
1. mousePressed : removed call to javax/swing/JRadioButtonMenuItem::setSelected → NO_COVERAGE |
menuParamAuto.setSelected(true); |
| 372 |
1
1. mousePressed : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
PanelTrailingAddress.this.labelTarget.setText(menuParamAuto.getText()); |
| 373 | } | |
| 374 |
3
1. mousePressed : negated conditional → NO_COVERAGE 2. mousePressed : changed conditional boundary → NO_COVERAGE 3. mousePressed : removed call to javax/swing/JMenu::setEnabled → NO_COVERAGE |
menuQuery.setEnabled(menuQuery.getMenuComponentCount() > 0); |
| 375 |
3
1. mousePressed : negated conditional → NO_COVERAGE 2. mousePressed : changed conditional boundary → NO_COVERAGE 3. mousePressed : removed call to javax/swing/JMenu::setEnabled → NO_COVERAGE |
menuRequest.setEnabled(menuRequest.getMenuComponentCount() > 0); |
| 376 |
3
1. mousePressed : changed conditional boundary → NO_COVERAGE 2. mousePressed : negated conditional → NO_COVERAGE 3. mousePressed : removed call to javax/swing/JMenu::setEnabled → NO_COVERAGE |
menuHeader.setEnabled(menuHeader.getMenuComponentCount() > 0); |
| 377 | ||
| 378 | if ( | |
| 379 |
2
1. mousePressed : changed conditional boundary → NO_COVERAGE 2. mousePressed : negated conditional → NO_COVERAGE |
menuQuery.getMenuComponentCount() > 0 |
| 380 |
2
1. mousePressed : negated conditional → NO_COVERAGE 2. mousePressed : changed conditional boundary → NO_COVERAGE |
|| menuRequest.getMenuComponentCount() > 0 |
| 381 |
2
1. mousePressed : negated conditional → NO_COVERAGE 2. mousePressed : changed conditional boundary → NO_COVERAGE |
|| menuHeader.getMenuComponentCount() > 0 |
| 382 | ) { | |
| 383 | Arrays.stream(PanelTrailingAddress.this.popupMenuTargets.getComponents()) | |
| 384 | .map(JComponent.class::cast) | |
| 385 |
1
1. mousePressed : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(JComponent::updateUI); // required: incorrect when dark/light mode switch |
| 386 |
1
1. mousePressed : removed call to javax/swing/JPopupMenu::updateUI → NO_COVERAGE |
PanelTrailingAddress.this.popupMenuTargets.updateUI(); // required: incorrect when dark/light mode switch |
| 387 |
1
1. mousePressed : removed call to javax/swing/SwingUtilities::invokeLater → NO_COVERAGE |
SwingUtilities.invokeLater(() -> { // reduce flickering on linux |
| 388 |
3
1. lambda$mousePressed$2 : removed call to javax/swing/JPopupMenu::show → NO_COVERAGE 2. lambda$mousePressed$2 : Replaced integer addition with subtraction → NO_COVERAGE 3. lambda$mousePressed$2 : Replaced integer addition with subtraction → NO_COVERAGE |
PanelTrailingAddress.this.popupMenuTargets.show(event.getComponent(), event.getComponent().getX(), 5 + event.getComponent().getY() + event.getComponent().getHeight()); |
| 389 |
3
1. lambda$mousePressed$2 : removed call to javax/swing/JPopupMenu::setLocation → NO_COVERAGE 2. lambda$mousePressed$2 : Replaced integer addition with subtraction → NO_COVERAGE 3. lambda$mousePressed$2 : Replaced integer addition with subtraction → NO_COVERAGE |
PanelTrailingAddress.this.popupMenuTargets.setLocation(event.getComponent().getLocationOnScreen().x, 5 + event.getComponent().getLocationOnScreen().y + event.getComponent().getHeight()); |
| 390 | }); | |
| 391 | } else { | |
| 392 | LOGGER.log(LogLevelUtil.CONSOLE_ERROR, "Missing parameter to inject"); | |
| 393 | } | |
| 394 | } | |
| 395 | ||
| 396 | private void buildMenuHeader(String rawHeader, String selectionCommand, JMenu menuHeader) { | |
| 397 | var listHeaders = Pattern.compile("\\\\r\\\\n") | |
| 398 | .splitAsStream(rawHeader) | |
| 399 |
1
1. lambda$buildMenuHeader$3 : replaced return value with null for com/jsql/view/swing/panel/address/PanelTrailingAddress$TargetMouseAdapter::lambda$buildMenuHeader$3 → NO_COVERAGE |
.map(keyValue -> Arrays.copyOf(keyValue.split(":"), 2)) |
| 400 |
1
1. lambda$buildMenuHeader$4 : replaced return value with null for com/jsql/view/swing/panel/address/PanelTrailingAddress$TargetMouseAdapter::lambda$buildMenuHeader$4 → NO_COVERAGE |
.map(keyValue -> new AbstractMap.SimpleEntry<>( |
| 401 | keyValue[0], | |
| 402 |
1
1. lambda$buildMenuHeader$4 : negated conditional → NO_COVERAGE |
keyValue[1] == null ? StringUtils.EMPTY : keyValue[1] |
| 403 | )) | |
| 404 | .toList(); | |
| 405 |
1
1. buildMenuHeader : removed call to java/util/List::forEach → NO_COVERAGE |
listHeaders.forEach(entry -> { |
| 406 | JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(entry.getKey()); | |
| 407 |
1
1. lambda$buildMenuHeader$6 : removed call to javax/swing/JRadioButtonMenuItem::setSelected → NO_COVERAGE |
menuItem.setSelected((ParameterUtil.PREFIX_COMMAND_HEADER + entry.getKey()).equals(selectionCommand)); |
| 408 |
1
1. lambda$buildMenuHeader$6 : removed call to javax/swing/JRadioButtonMenuItem::setActionCommand → NO_COVERAGE |
menuItem.setActionCommand(ParameterUtil.PREFIX_COMMAND_HEADER + entry.getKey()); |
| 409 |
1
1. lambda$buildMenuHeader$6 : removed call to javax/swing/JRadioButtonMenuItem::addActionListener → NO_COVERAGE |
menuItem.addActionListener(actionEvent -> |
| 410 |
1
1. lambda$buildMenuHeader$5 : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
PanelTrailingAddress.this.labelTarget.setText(entry.getKey()) |
| 411 | ); | |
| 412 |
1
1. lambda$buildMenuHeader$6 : removed call to javax/swing/ButtonGroup::add → NO_COVERAGE |
groupRadio.add(menuItem); |
| 413 | menuHeader.add(menuItem); | |
| 414 | }); | |
| 415 |
3
1. lambda$buildMenuHeader$7 : replaced boolean return with false for com/jsql/view/swing/panel/address/PanelTrailingAddress$TargetMouseAdapter::lambda$buildMenuHeader$7 → NO_COVERAGE 2. buildMenuHeader : negated conditional → NO_COVERAGE 3. lambda$buildMenuHeader$7 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress$TargetMouseAdapter::lambda$buildMenuHeader$7 → NO_COVERAGE |
if (listHeaders.stream().anyMatch(s -> CookiesUtil.COOKIE.equalsIgnoreCase(s.getKey()))) { |
| 416 | var cookies = listHeaders.stream() | |
| 417 |
2
1. lambda$buildMenuHeader$8 : replaced boolean return with false for com/jsql/view/swing/panel/address/PanelTrailingAddress$TargetMouseAdapter::lambda$buildMenuHeader$8 → NO_COVERAGE 2. lambda$buildMenuHeader$8 : replaced boolean return with true for com/jsql/view/swing/panel/address/PanelTrailingAddress$TargetMouseAdapter::lambda$buildMenuHeader$8 → NO_COVERAGE |
.filter(s -> CookiesUtil.COOKIE.equalsIgnoreCase(s.getKey())) |
| 418 | .findFirst() | |
| 419 | .orElse(new AbstractMap.SimpleEntry<>(CookiesUtil.COOKIE, "")); | |
| 420 |
1
1. buildMenuHeader : negated conditional → NO_COVERAGE |
if (!cookies.getValue().trim().isEmpty()) { |
| 421 | JMenu menuCookie = new JMenu(CookiesUtil.COOKIE); | |
| 422 | String[] cookieValues = StringUtils.split(cookies.getValue(), ";"); | |
| 423 |
1
1. buildMenuHeader : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
Stream.of(cookieValues).forEach(cookie -> { |
| 424 | String[] cookieEntry = StringUtils.split(cookie, "="); | |
| 425 | JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(cookieEntry[0].trim()); | |
| 426 |
1
1. lambda$buildMenuHeader$10 : removed call to javax/swing/JRadioButtonMenuItem::setSelected → NO_COVERAGE |
menuItem.setSelected((ParameterUtil.PREFIX_COMMAND_COOKIE + cookieEntry[0].trim()).equals(selectionCommand)); |
| 427 |
1
1. lambda$buildMenuHeader$10 : removed call to javax/swing/JRadioButtonMenuItem::setActionCommand → NO_COVERAGE |
menuItem.setActionCommand(ParameterUtil.PREFIX_COMMAND_COOKIE + cookieEntry[0].trim()); |
| 428 |
1
1. lambda$buildMenuHeader$10 : removed call to javax/swing/JRadioButtonMenuItem::addActionListener → NO_COVERAGE |
menuItem.addActionListener(actionEvent -> |
| 429 |
1
1. lambda$buildMenuHeader$9 : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
PanelTrailingAddress.this.labelTarget.setText(cookieEntry[0].trim()) |
| 430 | ); | |
| 431 |
1
1. lambda$buildMenuHeader$10 : removed call to javax/swing/ButtonGroup::add → NO_COVERAGE |
groupRadio.add(menuItem); |
| 432 | menuCookie.add(menuItem); | |
| 433 | }); | |
| 434 |
1
1. buildMenuHeader : removed call to javax/swing/JMenu::addSeparator → NO_COVERAGE |
menuHeader.addSeparator(); |
| 435 | menuHeader.add(menuCookie); | |
| 436 | } | |
| 437 | } | |
| 438 | PanelTrailingAddress.this.popupMenuTargets.add(menuHeader); | |
| 439 | } | |
| 440 | ||
| 441 | private void buildMenu(String rawParams, String prefixCommand, String selectionCommand, JMenu menu) { | |
| 442 | Pattern.compile("&").splitAsStream(rawParams) | |
| 443 |
1
1. lambda$buildMenu$11 : replaced return value with null for com/jsql/view/swing/panel/address/PanelTrailingAddress$TargetMouseAdapter::lambda$buildMenu$11 → NO_COVERAGE |
.map(keyValue -> Arrays.copyOf(keyValue.split("="), 2)) |
| 444 |
1
1. lambda$buildMenu$12 : replaced return value with null for com/jsql/view/swing/panel/address/PanelTrailingAddress$TargetMouseAdapter::lambda$buildMenu$12 → NO_COVERAGE |
.map(keyValue -> new AbstractMap.SimpleEntry<>( |
| 445 | keyValue[0], | |
| 446 |
1
1. lambda$buildMenu$12 : negated conditional → NO_COVERAGE |
keyValue[1] == null ? StringUtils.EMPTY : keyValue[1] |
| 447 | )) | |
| 448 |
1
1. buildMenu : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(entry -> { |
| 449 | JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(entry.getKey()); | |
| 450 |
1
1. lambda$buildMenu$14 : removed call to javax/swing/JRadioButtonMenuItem::setSelected → NO_COVERAGE |
menuItem.setSelected((prefixCommand + entry.getKey()).equals(selectionCommand)); |
| 451 |
1
1. lambda$buildMenu$14 : removed call to javax/swing/JRadioButtonMenuItem::setActionCommand → NO_COVERAGE |
menuItem.setActionCommand(prefixCommand + entry.getKey()); |
| 452 |
1
1. lambda$buildMenu$14 : removed call to javax/swing/JRadioButtonMenuItem::addActionListener → NO_COVERAGE |
menuItem.addActionListener(actionEvent -> |
| 453 |
1
1. lambda$buildMenu$13 : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
PanelTrailingAddress.this.labelTarget.setText(entry.getKey()) |
| 454 | ); | |
| 455 |
1
1. lambda$buildMenu$14 : removed call to javax/swing/ButtonGroup::add → NO_COVERAGE |
PanelTrailingAddress.this.groupRadio.add(menuItem); |
| 456 | menu.add(menuItem); | |
| 457 | }); | |
| 458 | PanelTrailingAddress.this.popupMenuTargets.add(menu); | |
| 459 | } | |
| 460 | } | |
| 461 | | |
| 462 | ||
| 463 | // Getter and setter | |
| 464 | ||
| 465 | public JComponent getLoader() { | |
| 466 |
1
1. getLoader : replaced return value with null for com/jsql/view/swing/panel/address/PanelTrailingAddress::getLoader → NO_COVERAGE |
return this.loader; |
| 467 | } | |
| 468 | ||
| 469 | public ButtonStart getButtonStart() { | |
| 470 |
1
1. getButtonStart : replaced return value with null for com/jsql/view/swing/panel/address/PanelTrailingAddress::getButtonStart → NO_COVERAGE |
return this.buttonStart; |
| 471 | } | |
| 472 | ||
| 473 | public ButtonGroup getGroupRadio() { | |
| 474 |
1
1. getGroupRadio : replaced return value with null for com/jsql/view/swing/panel/address/PanelTrailingAddress::getGroupRadio → NO_COVERAGE |
return this.groupRadio; |
| 475 | } | |
| 476 | } | |
Mutations | ||
| 70 |
1.1 |
|
| 71 |
1.1 |
|
| 72 |
1.1 |
|
| 73 |
1.1 |
|
| 74 |
1.1 |
|
| 79 |
1.1 |
|
| 82 |
1.1 |
|
| 90 |
1.1 |
|
| 95 |
1.1 |
|
| 98 |
1.1 |
|
| 102 |
1.1 |
|
| 103 |
1.1 |
|
| 104 |
1.1 |
|
| 105 |
1.1 |
|
| 107 |
1.1 |
|
| 111 |
1.1 |
|
| 114 |
1.1 |
|
| 117 |
1.1 |
|
| 118 |
1.1 |
|
| 119 |
1.1 |
|
| 122 |
1.1 |
|
| 123 |
1.1 |
|
| 124 |
1.1 |
|
| 125 |
1.1 |
|
| 126 |
1.1 |
|
| 129 |
1.1 |
|
| 134 |
1.1 |
|
| 135 |
1.1 |
|
| 138 |
1.1 |
|
| 143 |
1.1 |
|
| 144 |
1.1 |
|
| 145 |
1.1 |
|
| 146 |
1.1 2.2 3.3 |
|
| 147 |
1.1 2.2 3.3 |
|
| 151 |
1.1 |
|
| 156 |
1.1 |
|
| 157 |
1.1 2.2 |
|
| 158 |
1.1 |
|
| 160 |
1.1 |
|
| 161 |
1.1 |
|
| 162 |
1.1 2.2 3.3 |
|
| 163 |
1.1 2.2 3.3 |
|
| 168 |
1.1 |
|
| 169 |
1.1 |
|
| 175 |
1.1 |
|
| 176 |
1.1 |
|
| 180 |
1.1 |
|
| 181 |
1.1 |
|
| 182 |
1.1 |
|
| 186 |
1.1 |
|
| 187 |
1.1 |
|
| 188 |
1.1 |
|
| 191 |
1.1 2.2 |
|
| 192 |
1.1 |
|
| 194 |
1.1 |
|
| 195 |
1.1 |
|
| 197 |
1.1 2.2 |
|
| 198 |
1.1 |
|
| 202 |
1.1 |
|
| 203 |
1.1 |
|
| 206 |
1.1 |
|
| 207 |
1.1 |
|
| 211 |
1.1 |
|
| 212 |
1.1 |
|
| 214 |
1.1 |
|
| 216 |
1.1 |
|
| 217 |
1.1 |
|
| 218 |
1.1 |
|
| 219 |
1.1 |
|
| 221 |
1.1 |
|
| 227 |
1.1 |
|
| 228 |
1.1 |
|
| 236 |
1.1 2.2 |
|
| 237 |
1.1 |
|
| 238 |
1.1 |
|
| 239 |
1.1 |
|
| 242 |
1.1 |
|
| 245 |
1.1 2.2 |
|
| 246 |
1.1 2.2 |
|
| 253 |
1.1 2.2 |
|
| 254 |
1.1 2.2 |
|
| 260 |
1.1 2.2 |
|
| 268 |
1.1 |
|
| 271 |
1.1 |
|
| 273 |
1.1 2.2 |
|
| 275 |
1.1 2.2 |
|
| 280 |
1.1 |
|
| 282 |
1.1 2.2 |
|
| 290 |
1.1 2.2 |
|
| 291 |
1.1 2.2 |
|
| 299 |
1.1 2.2 |
|
| 301 |
1.1 2.2 |
|
| 302 |
1.1 |
|
| 303 |
1.1 |
|
| 304 |
1.1 |
|
| 321 |
1.1 |
|
| 323 |
1.1 |
|
| 324 |
1.1 |
|
| 325 |
1.1 |
|
| 335 |
1.1 |
|
| 341 |
1.1 |
|
| 343 |
1.1 |
|
| 345 |
1.1 |
|
| 347 |
1.1 |
|
| 348 |
1.1 |
|
| 357 |
1.1 |
|
| 358 |
1.1 |
|
| 362 |
1.1 |
|
| 363 |
1.1 |
|
| 368 |
1.1 2.2 |
|
| 369 |
1.1 |
|
| 370 |
1.1 |
|
| 371 |
1.1 |
|
| 372 |
1.1 |
|
| 374 |
1.1 2.2 3.3 |
|
| 375 |
1.1 2.2 3.3 |
|
| 376 |
1.1 2.2 3.3 |
|
| 379 |
1.1 2.2 |
|
| 380 |
1.1 2.2 |
|
| 381 |
1.1 2.2 |
|
| 385 |
1.1 |
|
| 386 |
1.1 |
|
| 387 |
1.1 |
|
| 388 |
1.1 2.2 3.3 |
|
| 389 |
1.1 2.2 3.3 |
|
| 399 |
1.1 |
|
| 400 |
1.1 |
|
| 402 |
1.1 |
|
| 405 |
1.1 |
|
| 407 |
1.1 |
|
| 408 |
1.1 |
|
| 409 |
1.1 |
|
| 410 |
1.1 |
|
| 412 |
1.1 |
|
| 415 |
1.1 2.2 3.3 |
|
| 417 |
1.1 2.2 |
|
| 420 |
1.1 |
|
| 423 |
1.1 |
|
| 426 |
1.1 |
|
| 427 |
1.1 |
|
| 428 |
1.1 |
|
| 429 |
1.1 |
|
| 431 |
1.1 |
|
| 434 |
1.1 |
|
| 443 |
1.1 |
|
| 444 |
1.1 |
|
| 446 |
1.1 |
|
| 448 |
1.1 |
|
| 450 |
1.1 |
|
| 451 |
1.1 |
|
| 452 |
1.1 |
|
| 453 |
1.1 |
|
| 455 |
1.1 |
|
| 466 |
1.1 |
|
| 470 |
1.1 |
|
| 474 |
1.1 |