From 995bf5a09e40cd80e1b245f3d3f1221cc1421476 Mon Sep 17 00:00:00 2001 From: Jeff Bahr Date: Sat, 23 Mar 2024 16:07:04 -0700 Subject: [PATCH] Migrate google java format from 1.7 -> 1.21.0 (#122) Summary: X-link: https://github.com/facebookexternal/OculusManufacturing/pull/524 X-link: https://github.com/facebookexternal/fbpay/pull/3 X-link: https://github.com/facebook/screenshot-tests-for-android/pull/324 X-link: https://github.com/pytorch/executorch/pull/1771 X-link: https://github.com/facebook/igl/pull/68 X-link: https://github.com/facebook/mariana-trench/pull/153 X-link: https://github.com/facebook/fresco/pull/2757 X-link: https://github.com/facebook/litho/pull/974 X-link: https://github.com/facebook/react-native/pull/42754 X-link: https://github.com/facebook/hhvm/pull/9431 X-link: https://github.com/WhatsApp/eqwalizer/pull/52 X-link: https://github.com/facebookincubator/spectrum/pull/1858 X-link: https://github.com/fbsamples/metapay/pull/1 X-link: https://github.com/facebookincubator/fbjni/pull/95 X-link: https://github.com/facebookincubator/Battery-Metrics/pull/30 X-link: https://github.com/facebook/ktfmt/pull/440 X-link: https://github.com/facebook/flipper/pull/5456 X-link: https://github.com/facebook/hermes/pull/1290 X-link: https://github.com/facebook/TextLayoutBuilder/pull/35 Pull Request resolved: https://github.com/facebook/SoLoader/pull/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 --- java/com/facebook/soloader/NativeDeps.java | 6 ++++-- java/com/facebook/soloader/SoSource.java | 4 +++- java/com/facebook/soloader/SysUtil.java | 3 ++- java/com/facebook/soloader/SystemLoadLibraryWrapper.java | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/java/com/facebook/soloader/NativeDeps.java b/java/com/facebook/soloader/NativeDeps.java index 71ad7e0..5028763 100644 --- a/java/com/facebook/soloader/NativeDeps.java +++ b/java/com/facebook/soloader/NativeDeps.java @@ -152,7 +152,8 @@ public void run() { sWaitForDepsFileLock.writeLock().unlock(); sUseDepsFileAsync = false; } - }; + } + ; }; new Thread(runnable, "soloader-nativedeps-init").start(); @@ -183,7 +184,8 @@ private static boolean useDepsFileFromApkSync(final Context context, boolean ext if (!success) { LogUtil.w( LOG_TAG, - "Failed to extract native deps from APK, falling back to using MinElf to get library dependencies."); + "Failed to extract native deps from APK, falling back to using MinElf to get library" + + " dependencies."); } return success; diff --git a/java/com/facebook/soloader/SoSource.java b/java/com/facebook/soloader/SoSource.java index cba1e0f..e419bc4 100644 --- a/java/com/facebook/soloader/SoSource.java +++ b/java/com/facebook/soloader/SoSource.java @@ -146,7 +146,9 @@ public String[] getSoSourceAbis() { return SysUtil.getSupportedAbis(); } - /** @return the name of this SoSource for logging purposes */ + /** + * @return the name of this SoSource for logging purposes + */ public abstract String getName(); /** diff --git a/java/com/facebook/soloader/SysUtil.java b/java/com/facebook/soloader/SysUtil.java index 9d2d0f2..a63a030 100644 --- a/java/com/facebook/soloader/SysUtil.java +++ b/java/com/facebook/soloader/SysUtil.java @@ -179,7 +179,8 @@ public static String[] getSupportedAbis() { LogUtil.e( TAG, String.format( - "Could not read /proc/self/exe. Falling back to default ABI list: %s. errno: %d Err msg: %s", + "Could not read /proc/self/exe. Falling back to default ABI list: %s. errno: %d Err" + + " msg: %s", Arrays.toString(supportedAbis), e.errno, e.getMessage())); return Build.SUPPORTED_ABIS; } diff --git a/java/com/facebook/soloader/SystemLoadLibraryWrapper.java b/java/com/facebook/soloader/SystemLoadLibraryWrapper.java index f48f2f3..aae72b6 100644 --- a/java/com/facebook/soloader/SystemLoadLibraryWrapper.java +++ b/java/com/facebook/soloader/SystemLoadLibraryWrapper.java @@ -16,7 +16,9 @@ package com.facebook.soloader; -/** @see SoLoader#setSystemLoadLibraryWrapper */ +/** + * @see SoLoader#setSystemLoadLibraryWrapper + */ public interface SystemLoadLibraryWrapper { void loadLibrary(String libName); }