Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Migrate google java format from 1.7 -> 1.21.0 (#1858)
Browse files Browse the repository at this point in the history
Summary:
X-link: facebookexternal/OculusManufacturing#524

X-link: facebookexternal/fbpay#3

X-link: facebook/screenshot-tests-for-android#324

X-link: pytorch/executorch#1771

X-link: facebook/igl#68

X-link: facebook/mariana-trench#153

X-link: facebook/fresco#2757

X-link: facebook/litho#974

X-link: facebook/react-native#42754

X-link: facebook/hhvm#9431

X-link: WhatsApp/eqwalizer#52

Pull Request resolved: #1858

X-link: fbsamples/metapay#1

X-link: facebookincubator/fbjni#95

X-link: facebookincubator/Battery-Metrics#30

X-link: facebook/ktfmt#440

X-link: facebook/flipper#5456

X-link: facebook/hermes#1290

X-link: facebook/TextLayoutBuilder#35

X-link: facebook/SoLoader#122

allow-large-files

This diff migrates google java format form 1.7 to 1.21.0. This update will allow for new language features from java 17 and 21. This diff also formats all necessary files.

 Changelog:
    [Internal][Changed] - Updated format from google-java-format 1.7 -> 1.21.0

Reviewed By: IanChilds

Differential Revision: D52786052

fbshipit-source-id: b675ae215084f340b93dfe628e329e696ca0616e
  • Loading branch information
j-bahr authored and facebook-github-bot committed Mar 23, 2024
1 parent 2c7d127 commit d5a6428
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

public class DefaultPlugins {

private DefaultPlugins() {};
private DefaultPlugins() {}
;

public static SpectrumPlugin[] get() {
return new SpectrumPlugin[] {
Expand Down
12 changes: 9 additions & 3 deletions android/src/main/java/com/facebook/spectrum/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ public static Configuration makeForImageContainingGraphics() {
.build();
}

/** @return A new builder to be used for creating {@link Configuration} objects. */
/**
* @return A new builder to be used for creating {@link Configuration} objects.
*/
public static Builder Builder() {
return new Builder();
}
Expand Down Expand Up @@ -346,7 +348,9 @@ public enum ImageHint {
this.value = value;
}

/** @return matching {@link ImageHint} for the given values. Throws otherwise */
/**
* @return matching {@link ImageHint} for the given values. Throws otherwise
*/
@DoNotStrip
static ImageHint from(final int value) {
for (ImageHint imageHint : ImageHint.values()) {
Expand Down Expand Up @@ -376,7 +380,9 @@ public enum SamplingMethod {
this.value = value;
}

/** @return matching {@link SamplingMethod} for the given values. Throws otherwise */
/**
* @return matching {@link SamplingMethod} for the given values. Throws otherwise
*/
@DoNotStrip
static SamplingMethod from(final int value) {
for (SamplingMethod samplingMethod : SamplingMethod.values()) {
Expand Down
4 changes: 3 additions & 1 deletion android/src/main/java/com/facebook/spectrum/ISpectrum.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
*/
public interface ISpectrum {

/** @return true iff the native code loaded and initialized properly. */
/**
* @return true iff the native code loaded and initialized properly.
*/
boolean isAvailable();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public SpectrumResult execute(final SpectrumHybrid spectrumHybrid) throws Spectr
}

class Helper {
private Helper() {};
private Helper() {}
;

static void closeQuietly(@Nullable final Closeable closeable) {
if (closeable == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public static ImagePixelSpecification from(final Bitmap.Config bitmapConfig) {
}
}

/** @return matching {@link ImagePixelSpecification} for the given values. Throws otherwise */
/**
* @return matching {@link ImagePixelSpecification} for the given values. Throws otherwise
*/
@DoNotStrip
static ImagePixelSpecification from(
final ColorModel colorModel,
Expand Down Expand Up @@ -116,7 +118,9 @@ enum ComponentsOrder {
this.value = value;
}

/** @return matching {@link ComponentsOrder} for the given values. Throws otherwise */
/**
* @return matching {@link ComponentsOrder} for the given values. Throws otherwise
*/
@DoNotStrip
static ComponentsOrder from(final int value) {
for (ComponentsOrder componentsOrder : ComponentsOrder.values()) {
Expand Down Expand Up @@ -171,7 +175,9 @@ enum ColorModel {
this.supportsExtraAlphaChannel = supportsExtraAlphaChannel;
}

/** @return matching {@link ColorModel} for the given values. Throws otherwise */
/**
* @return matching {@link ColorModel} for the given values. Throws otherwise
*/
@DoNotStrip
static ColorModel from(
final String identifier,
Expand All @@ -187,6 +193,7 @@ static ColorModel from(
throw new IllegalArgumentException("Unsupported PixelColorModel");
}
}

/** The alpha info specifies the behaviour of the optional alpha channel */
@DoNotStrip
@Immutable
Expand Down Expand Up @@ -231,7 +238,9 @@ enum AlphaInfo {
this.value = value;
}

/** @return matching {@link AlphaInfo} for the given values. Throws otherwise */
/**
* @return matching {@link AlphaInfo} for the given values. Throws otherwise
*/
@DoNotStrip
static AlphaInfo from(final int value) {
for (AlphaInfo alphaInfo : AlphaInfo.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class Options {

/** Options in the configuration object will override default and app-wide settings. */
@DoNotStrip @Nullable public final Configuration configuration;

/**
* If set, will dictate the pixel specification images should be converted to before being passed
* to the compressor. An exception will be thrown if the pixel specification doesn't fit the image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public enum Mode {
this.value = value;
}

/** @return matching {@link Mode} for the given values. Throws otherwise */
/**
* @return matching {@link Mode} for the given values. Throws otherwise
*/
@DoNotStrip
static Mode from(final int value) {
for (Mode mode : Mode.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ public enum Mode {
this.value = value;
}

/** @return matching {@link Mode} for the given values. Throws otherwise */
/**
* @return matching {@link Mode} for the given values. Throws otherwise
*/
@DoNotStrip
static Mode from(final int value) {
for (Mode mode : Mode.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private Destructor() {

/** A list to keep all active Destructors in memory confined to the Destructor thread. */
private static DestructorList sDestructorList;

/** A thread safe stack where new Destructors are placed before being add to sDestructorList. */
private static DestructorStack sDestructorStack;

Expand Down

0 comments on commit d5a6428

Please sign in to comment.