Skip to content

Commit

Permalink
Mass reformat ErrorProne sources.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 529106074
  • Loading branch information
graememorgan authored and Error Prone Team committed May 3, 2023
1 parent b91071e commit c76f797
Show file tree
Hide file tree
Showing 178 changed files with 631 additions and 287 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.google.errorprone.bugpatterns.android.testdata;

/** @author jasonlong@google.com (Jason Long) */
/**
* @author jasonlong@google.com (Jason Long)
*/
public class CustomFragmentNotInstantiableNegativeCases {
public static class NotAFragment1 {
public NotAFragment1(int x) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.google.errorprone.bugpatterns.android.testdata;

/** @author jasonlong@google.com (Jason Long) */
/**
* @author jasonlong@google.com (Jason Long)
*/
public class CustomFragmentNotInstantiablePositiveCases {
// BUG: Diagnostic contains: public
static class PrivateFragment extends CustomFragment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import android.app.Fragment;

/** @author avenet@google.com (Arnaud J. Venet) */
/**
* @author avenet@google.com (Arnaud J. Venet)
*/
public class FragmentNotInstantiableNegativeCases {
public static class NotAFragment1 {
public NotAFragment1(int x) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import android.app.Fragment;

/** @author avenet@google.com (Arnaud J. Venet) */
/**
* @author avenet@google.com (Arnaud J. Venet)
*/
public class FragmentNotInstantiablePositiveCases {
// BUG: Diagnostic contains: public
static class PrivateFragment extends Fragment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.google.errorprone.bugpatterns.android.testdata;

/** @author avenet@google.com (Arnaud J. Venet) */
/**
* @author avenet@google.com (Arnaud J. Venet)
*/
public class HardCodedSdCardPathNegativeCases {
static final String PATH1 = "/home/sdcard";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.google.errorprone.bugpatterns.android.testdata;

/** @author avenet@google.com (Arnaud J. Venet) */
/**
* @author avenet@google.com (Arnaud J. Venet)
*/
public class HardCodedSdCardPathPositiveCases {
// BUG: Diagnostic contains: Environment
static final String PATH1 = "/sdcard";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import android.os.Parcelable;
import android.os.Parcelable.ClassLoaderCreator;

/** @author bhagwani@google.com (Sumit Bhagwani) */
/**
* @author bhagwani@google.com (Sumit Bhagwani)
*/
public class ParcelableCreatorNegativeCases {

public abstract static class PublicAbstractParcelableClass implements Parcelable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
import android.os.Parcel;
import android.os.Parcelable;

/** @author bhagwani@google.com (Sumit Bhagwani) */
/**
* @author bhagwani@google.com (Sumit Bhagwani)
*/
public class ParcelableCreatorPositiveCases {

// BUG: Diagnostic contains: ParcelableCreator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import android.graphics.Rect;

/** @author avenet@google.com (Arnaud J. Venet) */
/**
* @author avenet@google.com (Arnaud J. Venet)
*/
public class RectIntersectReturnValueIgnoredNegativeCases {
boolean checkSimpleCall(Rect rect, int aLeft, int aTop, int aRight, int aBottom) {
return rect.intersect(aLeft, aTop, aRight, aBottom);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import android.graphics.Rect;

/** @author avenet@google.com (Arnaud J. Venet) */
/**
* @author avenet@google.com (Arnaud J. Venet)
*/
public class RectIntersectReturnValueIgnoredPositiveCases {
void checkSimpleCall(Rect rect, int aLeft, int aTop, int aRight, int aBottom) {
// BUG: Diagnostic contains: Return value of android.graphics.Rect.intersect() must be checked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import java.util.List;
import java.util.Map;

/** @author mariasam@google.com (Maria Sam) */
/**
* @author mariasam@google.com (Maria Sam)
*/
public class FloggerRedundantIsEnabledNegativeCases {

public void basicCase(FluentLogger logger) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import com.google.common.flogger.FluentLogger;

/** @author mariasam@google.com (Maria Sam) */
/**
* @author mariasam@google.com (Maria Sam)
*/
class FloggerRedundantIsEnabledPositiveCases {

public void basicCase(FluentLogger logger) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import com.google.inject.assistedinject.Assisted;
import com.google.inject.assistedinject.AssistedInject;

/** @author eaftan@google.com (Eddie Aftandilian) */
/**
* @author eaftan@google.com (Eddie Aftandilian)
*/
public class AssistedInjectScopingNegativeCases {

/** Class is not assisted and has no scoping annotation. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import com.google.inject.assistedinject.AssistedInject;
import com.google.inject.servlet.RequestScoped;

/** @author eaftan@google.com (Eddie Aftandilian) */
/**
* @author eaftan@google.com (Eddie Aftandilian)
*/
public class AssistedInjectScopingPositiveCases {

// BUG: Diagnostic contains: remove this line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
*/
public class AssistedParametersNegativeCases {

/**
* Class has constructor with two @Assisted parameters of different types.
*/
/** Class has constructor with two @Assisted parameters of different types. */
public class TestClass1 {
@Inject
public TestClass1(@Assisted int x, @Assisted String y, long z) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
*/
public class AssistedParametersPositiveCases {

/**
* Class has constructor with two @Assisted parameters of the same type.
*/
/** Class has constructor with two @Assisted parameters of the same type. */
public class TestClass1 {
@Inject
// BUG: Diagnostic contains: java.lang.String: x, y
Expand All @@ -42,18 +40,14 @@ public TestClass1(
@Assisted("baz") String z) {}
}

/**
* Class has constructor with two @Assisted parameters of the same type and same value.
*/
/** Class has constructor with two @Assisted parameters of the same type and same value. */
public class TestClass2 {
@Inject
// BUG: Diagnostic contains: int, @Assisted("foo"): x, y
public TestClass2(int n, @Assisted("foo") int x, @Assisted("foo") int y, String z) {}
}

/**
* Class has constructor with two @Assisted parameters of the same parameterized type.
*/
/** Class has constructor with two @Assisted parameters of the same parameterized type. */
public class TestClass3 {
private static final String FOO = "foo";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import com.google.inject.Inject;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class InjectOnFinalFieldNegativeCases {

/** Class has no final fields or @Inject annotations. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
import com.google.inject.Inject;
import javax.annotation.Nullable;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class InjectOnFinalFieldPositiveCases {
/** Class has a final injectable(com.google.inject.Inject) field. */
public class TestClass1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.google.errorprone.bugpatterns.inject.guice.testdata;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class OverridesGuiceInjectableMethodNegativeCases {

/** Class with a method foo() annotated with @com.google.inject.Inject. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
*/
public class OverridesGuiceInjectableMethodPositiveCases {

/**
* Class with a method foo() annotated with @com.google.inject.Inject.
*/
/** Class with a method foo() annotated with @com.google.inject.Inject. */
public class TestClass1 {
@com.google.inject.Inject
public void foo() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.google.errorprone.bugpatterns.inject.guice.testdata;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class OverridesJavaxInjectableMethodNegativeCases {
/** Class with a method foo() with no annotations. */
public class TestClass1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.google.errorprone.bugpatterns.inject.guice.testdata;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class OverridesJavaxInjectableMethodPositiveCases {

/** Class with foo() */
Expand All @@ -41,7 +43,7 @@ public class TestClass2 extends TestClass1 {
// BUG: Diagnostic contains: @Inject
public void foo() {}
}

/**
* Class with a method foo() that is not annotated, but overrides a method that in turn overrides
* a method that is annotated with @javax.inject.Inject.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import com.google.inject.assistedinject.AssistedInject;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class AssistedInjectAndInjectOnConstructorsNegativeCases {
/** Class has a single constructor with no annotation. */
public class TestClass1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import com.google.inject.assistedinject.AssistedInject;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class AssistedInjectAndInjectOnConstructorsPositiveCases {
/**
* Class has a constructor annotated with @javax.inject.Inject and another constructor annotated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import com.google.inject.assistedinject.AssistedInject;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class AssistedInjectAndInjectOnSameConstructorNegativeCases {
/** Class has a single constructor with no annotation. */
public class TestClass1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import com.google.inject.assistedinject.AssistedInject;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class AssistedInjectAndInjectOnSameConstructorPositiveCases {
/** Class has a constructor annotated with @javax.inject.Inject and @AssistedInject. */
public class TestClass1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
import com.google.inject.Provides;
import javax.inject.Singleton;

/** @author bhagwani@google.com (Sumit Bhagwani) */
/**
* @author bhagwani@google.com (Sumit Bhagwani)
*/
public class CloseableProvidesNegativeCases {

static class DoesNotImplementsClosable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import java.nio.charset.StandardCharsets;
import javax.inject.Singleton;

/** @author bhagwani@google.com (Sumit Bhagwani) */
/**
* @author bhagwani@google.com (Sumit Bhagwani)
*/
public class CloseableProvidesPositiveCases {

static class ImplementsClosable implements Closeable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
import java.lang.annotation.Target;
import javax.inject.Scope;

/** @author sgoldfeder@google.com(Steven Goldfeder) */
/**
* @author sgoldfeder@google.com(Steven Goldfeder)
*/
public class InvalidTargetingOnScopingAnnotationNegativeCases {

/** A scoping annotation with no specified target. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
import java.lang.annotation.Target;
import javax.inject.Scope;

/** @author sgoldfeder@google.com(Steven Goldfeder) */
/**
* @author sgoldfeder@google.com(Steven Goldfeder)
*/
public class InvalidTargetingOnScopingAnnotationPositiveCases {

/** Scoping excludes METHOD */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import javax.inject.Inject;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class JavaxInjectOnAbstractMethodNegativeCases {

/** Concrete class has no methods or annotations. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.google.errorprone.bugpatterns.inject.testdata;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class JavaxInjectOnAbstractMethodPositiveCases {

/** Abstract class has an injectable(javax.inject.Inject) abstract method. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import javax.inject.Inject;

/** @author sgoldfeder@google.com (Steven Goldfeder) */
/**
* @author sgoldfeder@google.com (Steven Goldfeder)
*/
public class JavaxInjectOnFinalFieldNegativeCases {

/** Class has no final fields or @Inject annotations. */
Expand Down

0 comments on commit c76f797

Please sign in to comment.