Bug fixes

This commit is contained in:
Eugene Livis 2019-08-19 16:46:34 -04:00
parent 9cc641deee
commit 17580c484d
4 changed files with 11 additions and 6 deletions

View File

@ -38,7 +38,6 @@ class ReportWizardFileOptionsPanel implements WizardDescriptor.FinishablePanel<W
private final JButton finishButton;
ReportWizardFileOptionsPanel(FileReportSettings fileReportSettings) {
wiz.putProperty("fileReportSettings", fileReportSettings);
finishButton = new JButton(
NbBundle.getMessage(this.getClass(), "ReportWizardFileOptionsPanel.finishButton.text"));
finishButton.setEnabled(false);

View File

@ -76,7 +76,7 @@ final class ReportWizardIterator implements WizardDescriptor.Iterator<WizardDesc
firstPanel = new ReportWizardPanel1(null);
tableConfigPanel = new ReportWizardPanel2(useCaseSpecificData, null);
fileConfigPanel = new ReportWizardFileOptionsPanel(null);
portableCaseConfigPanel = new ReportWizardPortableCaseOptionsPanel(null);
portableCaseConfigPanel = new ReportWizardPortableCaseOptionsPanel(null);
}
allConfigPanels = new WizardDescriptor.Panel[]{firstPanel, tableConfigPanel, fileConfigPanel, portableCaseConfigPanel};

View File

@ -34,9 +34,8 @@ class ReportWizardPanel2 implements WizardDescriptor.Panel<WizardDescriptor> {
private WizardDescriptor wiz;
private final boolean useCaseSpecificData;
ReportWizardPanel2(boolean useCaseSpecificData, TableReportSettings tableResportSettings) {
ReportWizardPanel2(boolean useCaseSpecificData, TableReportSettings tableReportSettings) {
this.useCaseSpecificData = useCaseSpecificData;
wiz.putProperty("tableReportSettings", tableResportSettings);
finishButton = new JButton(NbBundle.getMessage(this.getClass(), "ReportWizardPanel2.finishButton.text"));
nextButton = new JButton(NbBundle.getMessage(this.getClass(), "ReportWizardPanel2.nextButton.text"));
nextButton.setEnabled(true);

View File

@ -104,8 +104,8 @@ final class ReportingConfigLoader {
throw new ReportConfigException("Unable to read module configurations map " + filePath, ex);
}
if (moduleConfigs == null) {
throw new ReportConfigException("Failed to read module configurations map " + filePath);
if (moduleConfigs == null || moduleConfigs.isEmpty()) {
return config;
}
// read each ReportModuleSettings object individually
@ -138,6 +138,10 @@ final class ReportingConfigLoader {
*/
static synchronized void saveConfig(ReportingConfig reportConfig) throws ReportConfigException {
if (reportConfig == null) {
throw new ReportConfigException("Reporting configuration is NULL");
}
// construct the configuration directory path
Path pathToConfigDir = Paths.get(ReportingConfigLoader.REPORT_CONFIG_FOLDER_PATH, reportConfig.getName());
@ -177,6 +181,9 @@ final class ReportingConfigLoader {
party report module settings. If we were to serialize the entire ReportingConfig
object, then a single error while reading in a 3rd party report module
would prevent us from reading the entire reporting configuration.*/
if (reportConfig.getModuleConfigs() == null) {
return;
}
for (ReportModuleConfig moduleConfig : reportConfig.getModuleConfigs().values()) {
ReportModuleSettings settings = moduleConfig.getModuleSettings();
filePath = pathToConfigDir.toString() + File.separator + moduleConfig.getModuleClassName() + REPORT_SETTINGS_FILE_EXTENSION;