From 54e38bc6c94f307f4e65a5a4dc62594a19ca6e6f Mon Sep 17 00:00:00 2001 From: longwei Date: Thu, 16 Mar 2023 18:50:52 +0800 Subject: [PATCH] fix codex Signed-off-by: longwei Change-Id: Idc98608e7c62cec922ad9e037882fe92e822e7c8 --- adapter/ohos/CompressVerify.java | 2 +- adapter/ohos/HapVerify.java | 6 +++--- adapter/ohos/ModuleJsonUtil.java | 6 ++++-- adapter/ohos/PackFormatter.java | 23 +++++++++++++++++++++-- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/adapter/ohos/CompressVerify.java b/adapter/ohos/CompressVerify.java index 947ac8b8..3a708fe4 100644 --- a/adapter/ohos/CompressVerify.java +++ b/adapter/ohos/CompressVerify.java @@ -378,7 +378,7 @@ public class CompressVerify { return false; } if (!utility.getPackResPath().isEmpty() && !isPathValid(utility.getPackResPath(), TYPE_FILE, PACK_RES)) { - LOG.error("CompressVerify::isArgsValidInAppMode pack-res-path is invalid." ); + LOG.error("CompressVerify::isArgsValidInAppMode pack-res-path is invalid."); return false; } diff --git a/adapter/ohos/HapVerify.java b/adapter/ohos/HapVerify.java index 21d2d897..b44c275e 100644 --- a/adapter/ohos/HapVerify.java +++ b/adapter/ohos/HapVerify.java @@ -277,7 +277,7 @@ class HapVerify { hapVerifyInfos.get(j).getModuleName() + ") have the same ability name."); LOG.warning("Module: " + hapVerifyInfos.get(i).getModuleName() + " has ability " + hapVerifyInfos.get(i).getAbilityNames() + "."); - LOG.warning( "Module: " + hapVerifyInfos.get(j).getModuleName() + " has ability " + LOG.warning("Module: " + hapVerifyInfos.get(j).getModuleName() + " has ability " + hapVerifyInfos.get(j).getAbilityNames() + "."); LOG.warning("Solution: Make sure ability name is valid and unique."); LOG.warning("Reference: " + REFERENCE_LINK + "."); @@ -326,7 +326,7 @@ class HapVerify { + entryHapVerifyInfos.get(i).getDistroFilter().dump() + "."); } if (!EMPTY_STRING.equals(entryHapVerifyInfos.get(j).getDistroFilter().dump())) { - LOG.error( entryHapVerifyInfos.get(j).getModuleName() + " " + LOG.error(entryHapVerifyInfos.get(j).getModuleName() + " " + entryHapVerifyInfos.get(j).getDistroFilter().dump() + "."); } LOG.error("Solution: Make sure entry name is valid and unique."); @@ -490,7 +490,7 @@ class HapVerify { } List entryHaps = deviceHap.get(device); if (!checkFeatureDistroFilter(featureHap, entryHaps)) { - LOG.warning( featureHap.getModuleName() + + LOG.warning(featureHap.getModuleName() + " distroFilter has not covered by entry."); if (!EMPTY_STRING.equals(featureHap.getDistroFilter().dump())) { LOG.warning("Warning: " + featureHap.getModuleName() + " has " + diff --git a/adapter/ohos/ModuleJsonUtil.java b/adapter/ohos/ModuleJsonUtil.java index 515c1050..b6a83ef0 100644 --- a/adapter/ohos/ModuleJsonUtil.java +++ b/adapter/ohos/ModuleJsonUtil.java @@ -702,7 +702,8 @@ class ModuleJsonUtil { JSONArray srcModules = srcSummaryObj.getJSONArray(MODULES); if (finalModules == null || srcModules == null) { LOG.error("ModuleJsonUtil:mergeTwoPackInfoObjByPackagePair input json file has empty module."); - throw new BundleException("ModuleJsonUtil:mergeTwoPackInfoObjByPackagePair input json file has empty module."); + throw new + BundleException("ModuleJsonUtil:mergeTwoPackInfoObjByPackagePair input json file has empty module."); } boolean findModule = false; for (int index = 0; index < srcModules.size(); ++index) { @@ -724,7 +725,8 @@ class ModuleJsonUtil { JSONArray finalPackages = finalPackObj.getJSONArray(PACKAGES); JSONArray srcPackages = srcPackObj.getJSONArray(PACKAGES); if (finalPackages == null || srcPackages == null) { - String errMsg = "ModuleJsonUtil:mergeTwoPackInfoObjByPackagePair failed: pack.info do not contain packages."; + String errMsg = + "ModuleJsonUtil:mergeTwoPackInfoObjByPackagePair failed: pack.info do not contain packages."; LOG.error(errMsg); throw new BundleException(errMsg); } diff --git a/adapter/ohos/PackFormatter.java b/adapter/ohos/PackFormatter.java index f92f28a7..52c78b9a 100644 --- a/adapter/ohos/PackFormatter.java +++ b/adapter/ohos/PackFormatter.java @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package ohos; import java.text.DateFormat; @@ -6,13 +21,17 @@ import java.util.Date; import java.util.logging.Formatter; import java.util.logging.LogRecord; +/** + * pack log format. + * + */ public class PackFormatter extends Formatter { private static final int LOG_MAX_LIMIT = 1000; - private static final DateFormat df = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss.SSS"); + private static final DateFormat DF = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss.SSS"); @Override public String format(LogRecord record) { StringBuilder builder = new StringBuilder(LOG_MAX_LIMIT); - builder.append(df.format(new Date(record.getMillis()))).append(" - " ); + builder.append(DF.format(new Date(record.getMillis()))).append(" - "); builder.append(formatMessage(record)); builder.append("\n"); return builder.toString(); -- Gitee