Skip to content

Commit

Permalink
Migrate google-java-format to JSpecify
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 609528187
  • Loading branch information
cushon authored and google-java-format Team committed Feb 23, 2024
1 parent e946e82 commit 0cb5462
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

<!-- Compile-time dependencies -->
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.google.common.collect.TreeRangeSet;
import java.nio.file.Path;
import java.util.concurrent.Callable;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Encapsulates information about a file to be formatted, including which parts of the file to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
import java.util.regex.Pattern;
import java.util.stream.Stream;
import javax.lang.model.element.Name;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* An AST visitor that builds a stream of {@link Op}s to format from the given {@link
Expand Down Expand Up @@ -287,7 +287,7 @@ private static ImmutableSetMultimap<String, String> typeAnnotations() {
ImmutableList.of(
"org.jspecify.annotations.NonNull",
"org.jspecify.annotations.Nullable",
"org.jspecify.nullness.Nullable",
"org.jspecify.annotations.Nullable",
"org.checkerframework.checker.nullness.qual.NonNull",
"org.checkerframework.checker.nullness.qual.Nullable")) {
String simpleName = annotation.substring(annotation.lastIndexOf('.') + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.util.List;
import java.util.Objects;
import java.util.Set;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/** A wrapper around javac's lexer. */
final class JavacTokens {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import javax.tools.JavaFileObject;
import javax.tools.SimpleJavaFileObject;
import javax.tools.StandardLocation;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/** Wraps string literals that exceed the column limit. */
public final class StringWrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import javax.tools.FileObject;
import javax.tools.JavaFileManager;
import javax.tools.JavaFileObject;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* A decorating {@link Filer} implementation which formats Java source files with a {@link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import javax.tools.Diagnostic;
import javax.tools.ForwardingJavaFileObject;
import javax.tools.JavaFileObject;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/** A {@link JavaFileObject} decorator which {@linkplain Formatter formats} source code. */
final class FormattingJavaFileObject extends ForwardingJavaFileObject<JavaFileObject> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

class TypeAnnotations {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

class TypeAnnotations {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.Nullable;

class GoogleJavaFormatConfigurable extends BaseConfigurable implements SearchableConfigurable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.project.Project;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.Nullable;

@State(
name = "GoogleJavaFormatSettings",
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<java.version>1.8</java.version>
<guava.version>32.1.3-jre</guava.version>
<truth.version>1.4.0</truth.version>
<checker.version>3.21.2</checker.version>
<jspecify.version>0.3.0</jspecify.version>
<errorprone.version>2.16</errorprone.version>
<auto-value.version>1.9</auto-value.version>
<auto-service.version>1.0.1</auto-service.version>
Expand All @@ -107,9 +107,9 @@

<!-- Compile-time dependencies -->
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>${checker.version}</version>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>${jspecify.version}</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
Expand Down

0 comments on commit 0cb5462

Please sign in to comment.