summaryrefslogtreecommitdiff
path: root/Tools/Java
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/Java')
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java7
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java12
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java4
3 files changed, 18 insertions, 5 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
index b29bfe8a7e..e5cce71045 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
@@ -332,6 +332,13 @@ public class Tools {
String strTemp = "";
boolean isCopied = true;
+ if (arg0 == null) {
+ return "";
+ }
+ if (arg0.length() <= 0) {
+ return "";
+ }
+
//
// Convert string to array by " "
//
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java
index 4b4ea0daa2..d35bbafa59 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java
@@ -472,11 +472,13 @@ public class ModuleExterns extends IInternalFrame implements ItemListener {
// Save pcd and flash map information first
//
Externs ex = Externs.Factory.newInstance();
- if (this.externs.getPcdIsDriver() != null) {
- ex.setPcdIsDriver(this.externs.getPcdIsDriver());
- }
- if (this.externs.getTianoR8FlashMapH()) {
- ex.setTianoR8FlashMapH(this.externs.getTianoR8FlashMapH());
+ if (this.externs != null) {
+ if (this.externs.getPcdIsDriver() != null) {
+ ex.setPcdIsDriver(this.externs.getPcdIsDriver());
+ }
+ if (this.externs.getTianoR8FlashMapH()) {
+ ex.setTianoR8FlashMapH(this.externs.getTianoR8FlashMapH());
+ }
}
this.externs = ex;
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java
index 3a94511e1e..3aa9b4a297 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java
@@ -734,6 +734,10 @@ public class ExternsDlg extends IDialog implements ItemListener {
Log.wrn("Update Externs", "At least one of Constructor or Destructor should have a value");
return false;
}
+ if (isEmpty(this.jTextFieldConstructor.getText()) && !isEmpty(this.jTextFieldDestructor.getText())) {
+ Log.wrn("Update Externs", "You must define a Constructor at the same time when you declare a Destructor");
+ return false;
+ }
if (!isEmpty(this.jTextFieldConstructor.getText())) {
if (!DataValidation.isC_NameType(this.jTextFieldConstructor.getText())) {
Log.wrn("Update Externs", "Incorrect data type for Constructor");