Skip to content

Commit 78dfdca

Browse files
Merge pull request #6652 from microsoft/miller/endgame-fixes
fix miscellaneous bugs
2 parents 59d7a68 + 8d5b60a commit 78dfdca

File tree

4 files changed

+12
-7
lines changed
  • PluginsAndFeatures
    • azure-toolkit-for-eclipse
    • azure-toolkit-for-intellij/azure-intellij-resource-connector-lib/src/main/java/com/microsoft/azure/toolkit/intellij/connector

4 files changed

+12
-7
lines changed

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.appservice/src/com/microsoft/azure/toolkit/eclipse/webapp/handlers/WebAppLogStreamingHandler.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
import com.microsoft.azure.toolkit.lib.common.task.AzureTask;
1616
import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager;
1717
import com.microsoft.azure.toolkit.lib.common.bundle.AzureString;
18+
19+
import java.util.Optional;
20+
1821
import com.microsoft.azure.toolkit.eclipse.common.logstream.EclipseAzureLogStreamingManager;
1922

2023
import reactor.core.publisher.Flux;
@@ -30,10 +33,8 @@ public static void stopLogStreaming(final WebAppBase<?, ?, ?> webApp) {
3033

3134
public static void startLogStreaming(final WebAppBase<?, ?, ?> webApp) {
3235
if (!isLogStreamingEnabled(webApp)) {
33-
final boolean enableLogging = AzureTaskManager.getInstance()
34-
.runAndWaitAsObservable(new AzureTask<>(() -> AzureMessager.getMessager()
35-
.confirm(AzureString.format(ENABLE_FILE_LOGGING, webApp.name()), ENABLE_LOGGING)))
36-
.toBlocking().single();
36+
final boolean enableLogging = AzureMessager.getMessager()
37+
.confirm(AzureString.format(ENABLE_FILE_LOGGING, webApp.name()), ENABLE_LOGGING);
3738
if (enableLogging) {
3839
enableLogStreaming(webApp);
3940
} else {
@@ -49,7 +50,7 @@ public static void startLogStreaming(final WebAppBase<?, ?, ?> webApp) {
4950
}
5051

5152
private static boolean isLogStreamingEnabled(WebAppBase<?, ?, ?> webApp) {
52-
return webApp.getDiagnosticConfig().isEnableWebServerLogging();
53+
return Optional.ofNullable(webApp.getDiagnosticConfig()).map(DiagnosticConfig::isEnableWebServerLogging).orElse(false);
5354
}
5455

5556
private static void enableLogStreaming(WebAppBase<?, ?, ?> webApp) {

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.azureexplorer/src/com/microsoft/azure/toolkit/eclipse/explorer/AzureTreeNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ private void applyActionGroupToMenu(@Nonnull IActionGroup actionGroup, @Nonnull
162162
private <T> Action toEclipseAction(com.microsoft.azure.toolkit.lib.common.action.Action<T> action,
163163
@Nullable T source) {
164164
final Label view = Optional.ofNullable(action).map(act -> act.getView(source)).orElse(null);
165-
if (view == null) {
165+
if (view == null || StringUtils.isBlank(view.getLabel())) {
166166
return null;
167167
}
168168
final ImageDescriptor imageDescriptor = StringUtils.isEmpty(view.getIconPath()) ? null

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.springcloud/src/main/java/com/microsoft/azure/toolkit/eclipse/springcloud/component/SpringCloudAppConfigPanel.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ private void setupUI() {
240240
this.useJava8.setSelection(true);
241241

242242
this.useJava11 = new Button(grpConfiguration, SWT.RADIO);
243-
this.useJava11.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
244243
this.useJava11.setText("Java 11");
245244

246245
this.useJava17 = new Button(grpConfiguration, SWT.RADIO);

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-resource-connector-lib/src/main/java/com/microsoft/azure/toolkit/intellij/connector/AzureServiceResource.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.intellij.openapi.project.Project;
1111
import com.microsoft.azure.toolkit.ide.common.action.ResourceCommonActionsContributor;
1212
import com.microsoft.azure.toolkit.lib.common.action.AzureActionManager;
13+
import com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException;
1314
import com.microsoft.azure.toolkit.lib.common.model.AzResourceBase;
1415
import lombok.EqualsAndHashCode;
1516
import lombok.Getter;
@@ -54,6 +55,10 @@ public synchronized T getData() {
5455

5556
@Override
5657
public Map<String, String> initEnv(Project project) {
58+
final T resource = this.getData();
59+
if (!resource.exists()) {
60+
throw new AzureToolkitRuntimeException(String.format("'%s' doesn't exist.", resource));
61+
}
5762
return this.definition.initEnv(this, project);
5863
}
5964

0 commit comments

Comments
 (0)