Skip to content

Commit

Permalink
Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
RetGal committed Nov 3, 2023
1 parent ff0c34b commit 85abe12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/mpo/dayon/assistant/gui/Assistant.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public void actionPerformed(ActionEvent ev) {
frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try {
publicIp = UPnP.getExternalIP();
if (isValidPublicIp()) {
if (isInvalidPublicIp()) {
final URL url = new URL(WHATSMYIP_SERVER_URL);
try (final BufferedReader lines = new BufferedReader(new InputStreamReader(url.openStream()))) {
publicIp = lines.readLine();
Expand Down Expand Up @@ -265,8 +265,8 @@ public void actionPerformed(ActionEvent ev) {
choices.setLocation(choicesLocation.x - xOffset, choicesLocation.y + yOffset);
}

private boolean isValidPublicIp() {
return ! (publicIp == null || publicIp.startsWith("192.168") || publicIp.startsWith("10."));
private boolean isInvalidPublicIp() {
return publicIp == null || publicIp.startsWith("192.168") || publicIp.startsWith("10.");
}
};
ip.putValue("DISPLAY_NAME", "127.0.0.1"); // always a selection
Expand Down

0 comments on commit 85abe12

Please sign in to comment.