use of com.jsql.model.injection.strategy.StrategyInjectionError in project jsql-injection by ron190.
the class ManagerDatabase method initErrorMethods.
public void initErrorMethods(Vendor vendor) {
this.itemRadioStrategyError[0].removeAll();
Integer[] i = { 0 };
if (vendor != Vendor.AUTO && vendor.instance().getXmlModel().getStrategy().getError() != null) {
for (Method methodError : vendor.instance().getXmlModel().getStrategy().getError().getMethod()) {
JMenuItem itemRadioVendor = new JRadioButtonMenuItem(methodError.getName());
itemRadioVendor.setEnabled(false);
this.itemRadioStrategyError[0].add(itemRadioVendor);
this.groupStrategy.add(itemRadioVendor);
final int indexError = i[0];
itemRadioVendor.addActionListener(actionEvent -> {
ManagerDatabase.this.menuStrategy.setText(methodError.getName());
MediatorModel.model().setStrategy(StrategyInjection.ERROR);
((StrategyInjectionError) StrategyInjection.ERROR.instance()).setIndexMethod(indexError);
});
i[0]++;
}
}
}
use of com.jsql.model.injection.strategy.StrategyInjectionError in project jsql-injection by ron190.
the class AddressMenuBar method markError.
public void markError() {
StrategyInjectionError strategy = MediatorHelper.model().getMediatorStrategy().getError();
this.menuStrategy.setText(strategy.toString());
JMenu menuError = this.getMenuError();
int indexError = strategy.getIndexErrorStrategy();
String nameError = MediatorHelper.model().getMediatorVendor().getVendor().instance().getModelYaml().getStrategy().getError().getMethod().get(indexError).getName();
for (var i = 0; i < menuError.getItemCount(); i++) {
// Fix #44635: ArrayIndexOutOfBoundsException on getItem()
try {
if (menuError.getItem(i).getText().equals(nameError)) {
menuError.getItem(i).setSelected(true);
this.menuStrategy.setText(nameError);
break;
}
} catch (NullPointerException | ArrayIndexOutOfBoundsException e) {
LOGGER.log(LogLevel.CONSOLE_JAVA, e, e);
}
}
}
Aggregations