Skip to content

Commit

Permalink
fix alibaba#3215 bug by improve code quality for client. (alibaba#6050)
Browse files Browse the repository at this point in the history
* fix alibaba#3215 bug by improve code quality for client.

* Fix line indent.

Co-authored-by: jiele.cao <[email protected]>
  • Loading branch information
caojiele and iamtianxuan authored Jun 15, 2021
1 parent 6ca9c25 commit 4df0cd0
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

package com.alibaba.nacos.config.server.utils;
package com.alibaba.nacos.client.utils;

import org.apache.commons.lang3.StringUtils;
import com.alibaba.nacos.common.utils.StringUtils;

import java.io.File;

/**
* App util.
* appName util.
*
* @author Nacos
*/
Expand All @@ -45,8 +45,10 @@ public class AppNameUtils {

private static final String SERVER_UNKNOWN = "unknown server";

private static final String DEFAULT_APP_NAME = "unknown";

public static String getAppName() {
String appName = null;
String appName;

appName = getAppNameByProjectName();
if (appName != null) {
Expand All @@ -58,7 +60,7 @@ public static String getAppName() {
return appName;
}

return "unknown";
return DEFAULT_APP_NAME;
}

private static String getAppNameByProjectName() {
Expand All @@ -83,7 +85,7 @@ private static String getAppNameByServerHome() {
}

private static String getServerType() {
String serverType = null;
String serverType;
if (System.getProperty(PARAM_MARKING_JBOSS) != null) {
serverType = SERVER_JBOSS;
} else if (System.getProperty(PARAM_MARKING_JETTY) != null) {
Expand Down

0 comments on commit 4df0cd0

Please sign in to comment.