Skip to content

Commit

Permalink
Fix class case exception when create new application insights, fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Flanker32 committed Apr 29, 2022
1 parent 3eb3f70 commit aadafdf
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ private ItemListener subscriptionListener() {
Subscription newSub = (Subscription) comboSub.getSelectedItem();
String prevResGrpVal = (String) comboGrp.getSelectedItem();
this.comboReg.setSubscription(newSub);
if (currentSub.equals(newSub)) {
if (Objects.equals(currentSub, newSub)) {
populateResourceGroupValues(currentSub.getId(), prevResGrpVal);
} else {
populateResourceGroupValues(currentSub.getId(), "");
populateResourceGroupValues(newSub.getId(), "");
}
currentSub = newSub;
};
Expand Down Expand Up @@ -140,7 +140,7 @@ protected JComponent createTitlePane() {
@Override
protected void doOKAction() {
final boolean grpNotSelected = Objects.isNull(comboGrp.getSelectedItem()) || ((String) comboGrp.getSelectedItem()).isEmpty();
final boolean regNotSelected = Objects.isNull(comboReg.getSelectedItem()) || ((String) comboReg.getSelectedItem()).isEmpty();
final boolean regNotSelected = Objects.isNull(comboReg.getSelectedItem());
final boolean subNotSelected = comboSub.getSelectedItem() == null;
if (txtName.getText().trim().isEmpty()
|| subNotSelected
Expand All @@ -156,16 +156,17 @@ protected void doOKAction() {
}
} else {
boolean isNewGroup = createNewBtn.isSelected();
Subscription subscription = comboSub.getValue();
String resourceGroup = isNewGroup ? textGrp.getText() : (String) comboGrp.getSelectedItem();
final AzureString title = AzureOperationBundle.title("ai.create_ai.ai|rg", txtName.getText(), resourceGroup);
AzureTaskManager.getInstance().runInBackground(new AzureTask(null, title, false, () -> {
try {
ApplicationInsight resource = AzureSDKManager.createInsightsResource(
currentSub,
subscription,
resourceGroup,
isNewGroup,
txtName.getText(),
(String) comboReg.getSelectedItem());
comboReg.getValue().getName());
resourceToAdd = new ApplicationInsightsResource(resource, currentSub, true);
if (onCreate != null) {
onCreate.run();
Expand Down

0 comments on commit aadafdf

Please sign in to comment.