Skip to content

Commit

Permalink
Migrate google java format from 1.7 -> 1.19.2
Browse files Browse the repository at this point in the history
Summary:
X-link: facebook/SoLoader#122

This diff migrates google java format form 1.7 to 1.19.2. 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.19.2

Reviewed By: IanChilds

Differential Revision: D52786052
  • Loading branch information
Jeff Bahr authored and facebook-github-bot committed Jan 31, 2024
1 parent 2c7d127 commit 043a291
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 043a291

Please sign in to comment.