Skip to content

Commit

Permalink
Migrate google java format from 1.7 -> 1.21.0
Browse files Browse the repository at this point in the history
Summary:
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

X-link: facebookincubator/spectrum#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

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
  • Loading branch information
j-bahr authored and facebook-github-bot committed Mar 20, 2024
1 parent 03124ba commit 8ce9263
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public static RecordBuilder snapActivity(Activity activity) {
return ScreenshotImpl.getInstance().snapActivity(activity);
}

/** @return The largest amount of pixels we'll capture, otherwise an exception will be thrown. */
/**
* @return The largest amount of pixels we'll capture, otherwise an exception will be thrown.
*/
public static long getMaxPixels() {
return ScreenshotImpl.getMaxPixels();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public String getDescription() {
return mDescription;
}

/** @inherit */
/**
* @inherit
*/
@Override
public RecordBuilderImpl setDescription(String description) {
mDescription = description;
Expand All @@ -68,7 +70,9 @@ public String getName() {
return mName;
}

/** @inherit */
/**
* @inherit
*/
@Override
public RecordBuilderImpl setName(String name) {
CharsetEncoder charsetEncoder = Charset.forName("latin-1").newEncoder();
Expand Down Expand Up @@ -112,20 +116,26 @@ public RecordBuilderImpl setTestClass(String testClass) {
return this;
}

/** @inherit */
/**
* @inherit
*/
@Override
public Bitmap getBitmap() {
return mScreenshotImpl.getBitmap(this);
}

/** @inherit */
/**
* @inherit
*/
@Override
public RecordBuilderImpl setMaxPixels(long maxPixels) {
mMaxPixels = maxPixels;
return this;
}

/** @return The maximum number of pixels that is expected to be produced by this screenshot */
/**
* @return The maximum number of pixels that is expected to be produced by this screenshot
*/
public long getMaxPixels() {
return mMaxPixels;
}
Expand All @@ -148,7 +158,9 @@ RecordBuilderImpl setError(String error) {
return this;
}

/** @inherit */
/**
* @inherit
*/
@Override
public void record() {
mScreenshotImpl.record(this);
Expand Down Expand Up @@ -207,7 +219,9 @@ public RecordBuilderImpl setGroup(String groupName) {
return this;
}

/** @inherit */
/**
* @inherit
*/
@Override
public RecordBuilderImpl setIncludeAccessibilityInfo(boolean includeAccessibilityInfo) {
mIncludeAccessibilityInfo = includeAccessibilityInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ private File getSdcardDir(String type) {
private void setWorldWriteable(File dir) {
// Context.MODE_WORLD_WRITEABLE has been deprecated, so let's
// manually set this
dir.setWritable(/* writeable = */ true, /* ownerOnly = */ false);
dir.setWritable(/* writeable= */ true, /* ownerOnly= */ false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class ScreenshotImpl {
private static final int METADATA_VERSION = 1;

private static ScreenshotImpl sInstance;

/** The album of all the screenshots taken in this run. */
private final Album mAlbum;

Expand Down Expand Up @@ -351,7 +352,9 @@ public void run() {
return ret[0];
}

/** @return The largest amount of pixels we'll capture, otherwise an exception will be thrown. */
/**
* @return The largest amount of pixels we'll capture, otherwise an exception will be thrown.
*/
public static long getMaxPixels() {
return RecordBuilderImpl.DEFAULT_MAX_PIXELS;
}
Expand Down

0 comments on commit 8ce9263

Please sign in to comment.