Skip to content

[CQ] cleanup unnecessary imports, @Nullable annotations #7992

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Apr 4, 2025
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
3 changes: 0 additions & 3 deletions flutter-idea/src/io/flutter/dart/DartPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
import com.intellij.execution.configurations.ConfigurationType;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Version;
import com.jetbrains.lang.dart.analyzer.DartAnalysisServerService;
import com.jetbrains.lang.dart.ide.actions.DartPubActionBase;
import com.jetbrains.lang.dart.sdk.DartSdk;
import com.jetbrains.lang.dart.sdk.DartSdkLibUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Objects;

/**
* Provides access to the Dart Plugin for IntelliJ.
*/
Expand Down
6 changes: 3 additions & 3 deletions flutter-idea/src/io/flutter/dart/DartSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ boolean equate(@NotNull Pattern first, @NotNull String second) {
});
}

private static <T> DartCallExpression findEnclosingFunctionCall(
private static <T> @Nullable DartCallExpression findEnclosingFunctionCall(
@NotNull PsiElement elt, @NotNull T functionDescriptor, @NotNull Equator<T, String> equator) {
while (elt != null) {
if (elt instanceof DartCallExpression call) {
Expand Down Expand Up @@ -109,7 +109,7 @@ public static DartReferenceExpression findEnclosingReferenceExpression(@NotNull
/**
* Gets an argument to a function call, provided that the expression has the given type.
* <p>
* Returns null if the argument doesn't exist or it's not the given type.
* Returns null if the argument doesn't exist, or it's not the given type.
*/
@Nullable
public static <E extends DartExpression> E getArgument(@NotNull DartCallExpression call, int index, @NotNull Class<E> expectedClass) {
Expand Down Expand Up @@ -178,7 +178,7 @@ public static String unquote(@NotNull DartStringLiteralExpression lit) {
// We expect a quote, string part, quote.
if (lit.getFirstChild() == null) return null;
final PsiElement second = lit.getFirstChild().getNextSibling();
if (second.getNextSibling() != lit.getLastChild()) return null; // not three items
if (second != null && (second.getNextSibling() != lit.getLastChild())) return null; // not three items
if (!(second instanceof LeafPsiElement leaf)) return null;

if (leaf.getElementType() != DartTokenTypes.REGULAR_STRING_PART) return null;
Expand Down
2 changes: 1 addition & 1 deletion flutter-idea/src/io/flutter/run/SdkAttachConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

public class SdkAttachConfig extends SdkRunConfig {

public PubRoot pubRoot;
public @Nullable PubRoot pubRoot;

public SdkAttachConfig(SdkRunConfig config) {
//noinspection ConstantConditions
Expand Down