Skip to content

Code cleanup, redundant if statements Java inspection #7686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 8, 2024
Merged
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
4 changes: 1 addition & 3 deletions flutter-idea/src/io/flutter/FlutterUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ private static boolean isInTestOrSourceRoot(@Nullable Module module, @NotNull Da
}
if (foundSourceRoot) {
// The file is in a sources root but not marked as tests.
if (file.getName().endsWith(("_test.dart")) && FlutterSettings.getInstance().isAllowTestsInSourcesRoot()) {
return true;
}
return file.getName().endsWith(("_test.dart")) && FlutterSettings.getInstance().isAllowTestsInSourcesRoot();
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,7 @@ public void paint(@NotNull Editor editor, @NotNull RangeHighlighter highlighter,
final Point end = editor.visualPositionToXY(endPosition);
double splitY = -1;
int maxY = end.y;
boolean includeLastLine = false;
if (endPosition.line == editor.offsetToVisualPosition(doc.getTextLength()).line) {
includeLastLine = true;
}
boolean includeLastLine = endPosition.line == editor.offsetToVisualPosition(doc.getTextLength()).line;

int endLine = doc.getLineNumber(endOffset);
if (childLines != null && !childLines.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected boolean process(@NotNull JsonArray array) {
final JsonElement params = getValue(element, "params");
if (params != null) {
final JsonElement uri = getValue(params, "observatoryUri");
if (uri != null) return true;
return uri != null;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,7 @@ public boolean isModified() {
return true;
}

if (settings.isEnableJcefBrowser() != myEnableJcefBrowserCheckBox.isSelected()) {
return true;
}

return false;
return settings.isEnableJcefBrowser() != myEnableJcefBrowserCheckBox.isSelected();
}

@Override
Expand Down
7 changes: 1 addition & 6 deletions flutter-idea/src/io/flutter/vmService/VMServiceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,7 @@ public void onError(RPCError error) {

@Override
public void received(JsonObject object) {
if (object == null) {
ret.complete(null);
}
else {
ret.complete(object);
}
ret.complete(object);
}
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@ public ExtractWidgetFeedback() {

@Override
public boolean equals(Object obj) {
if (obj instanceof ExtractWidgetFeedback other) {
return
true;
}
return false;
return
obj instanceof ExtractWidgetFeedback other;
}

public static ExtractWidgetFeedback fromJson(JsonObject jsonObject) {
Expand Down