Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions flutter-idea/src/io/flutter/run/daemon/FlutterApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
import org.jetbrains.annotations.Nullable;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicReference;
Expand Down Expand Up @@ -748,14 +748,14 @@ public void onAppDebugPort(@NotNull DaemonEvent.AppDebugPort debugInfo) {
String uri = debugInfo.baseUri;
if (uri != null) {
if (uri.startsWith("file:")) {
// Convert the file: url to a path.
// Convert the file: uri to a path.
try {
uri = new URL(uri).getPath();
uri = (new URI(uri).getPath());
if (uri.endsWith(File.separator)) {
uri = uri.substring(0, uri.length() - 1);
}
}
catch (MalformedURLException e) {
catch (URISyntaxException e) {
// ignore
}
}
Expand Down
11 changes: 6 additions & 5 deletions flutter-idea/src/io/flutter/utils/UrlUtils.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.flutter.utils;

import java.net.MalformedURLException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;

public class UrlUtils {
public static String generateHtmlFragmentWithHrefTags(String input) {
Expand All @@ -11,9 +11,10 @@ public static String generateHtmlFragmentWithHrefTags(String input) {
builder.append(" ");
}
try {
URL url = new URL(token);
builder.append("<a href=\"").append(url).append("\">").append(url).append("</a>");
} catch(MalformedURLException e) {
final URI uri = new URI(token);
builder.append("<a href=\"").append(uri).append("\">").append(uri).append("</a>");
}
catch (URISyntaxException e) {
builder.append(token);
}
}
Expand Down
Loading