Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typo: variable name and word error. #2910

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions boot/src/main/java/com/taobao/arthas/boot/Bootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,14 @@ public static void main(String[] args) throws ParserConfigurationException, SAXE
+ File.separator + bootstrap.getUseVersion() + File.separator + "arthas");
if (!specialVersionDir.exists()) {
// try to download arthas from remote server.
DownloadUtils.downArthasPackaging(bootstrap.getRepoMirror(), bootstrap.isuseHttp(),
DownloadUtils.downArthasPackaging(bootstrap.getRepoMirror(), bootstrap.isUseHttp(),
bootstrap.getUseVersion(), ARTHAS_LIB_DIR.getAbsolutePath());
}
verifyArthasHome(specialVersionDir.getAbsolutePath());
arthasHomeDir = specialVersionDir;
}

// Try set the directory where arthas-boot.jar is located to arhtas home
// Try set the directory where arthas-boot.jar is located to arthas home
if (arthasHomeDir == null) {
CodeSource codeSource = Bootstrap.class.getProtectionDomain().getCodeSource();
if (codeSource != null) {
Expand Down Expand Up @@ -470,16 +470,16 @@ public static void main(String[] args) throws ParserConfigurationException, SAXE
List<String> versionList = listNames(ARTHAS_LIB_DIR);
Collections.sort(versionList);

String localLastestVersion = null;
String localLatestVersion = null;
if (!versionList.isEmpty()) {
localLastestVersion = versionList.get(versionList.size() - 1);
localLatestVersion = versionList.get(versionList.size() - 1);
}

String remoteLastestVersion = DownloadUtils.readLatestReleaseVersion();
String remoteLatestVersion = DownloadUtils.readLatestReleaseVersion();

boolean needDownload = false;
if (localLastestVersion == null) {
if (remoteLastestVersion == null) {
if (localLatestVersion == null) {
if (remoteLatestVersion == null) {
// exit
AnsiLog.error("Can not find Arthas under local: {} and remote repo mirror: {}", ARTHAS_LIB_DIR,
bootstrap.getRepoMirror());
Expand All @@ -490,23 +490,23 @@ public static void main(String[] args) throws ParserConfigurationException, SAXE
needDownload = true;
}
} else {
if (remoteLastestVersion != null) {
if (localLastestVersion.compareTo(remoteLastestVersion) < 0) {
AnsiLog.info("local lastest version: {}, remote lastest version: {}, try to download from remote.",
localLastestVersion, remoteLastestVersion);
if (remoteLatestVersion != null) {
if (localLatestVersion.compareTo(remoteLatestVersion) < 0) {
AnsiLog.info("local latest version: {}, remote latest version: {}, try to download from remote.",
localLatestVersion, remoteLatestVersion);
needDownload = true;
}
}
}
if (needDownload) {
// try to download arthas from remote server.
DownloadUtils.downArthasPackaging(bootstrap.getRepoMirror(), bootstrap.isuseHttp(),
remoteLastestVersion, ARTHAS_LIB_DIR.getAbsolutePath());
localLastestVersion = remoteLastestVersion;
DownloadUtils.downArthasPackaging(bootstrap.getRepoMirror(), bootstrap.isUseHttp(),
remoteLatestVersion, ARTHAS_LIB_DIR.getAbsolutePath());
localLatestVersion = remoteLatestVersion;
}

// get the latest version
arthasHomeDir = new File(ARTHAS_LIB_DIR, localLastestVersion + File.separator + "arthas");
arthasHomeDir = new File(ARTHAS_LIB_DIR, localLatestVersion + File.separator + "arthas");
}

verifyArthasHome(arthasHomeDir.getAbsolutePath());
Expand Down Expand Up @@ -785,7 +785,7 @@ public String getRepoMirror() {
return repoMirror;
}

public boolean isuseHttp() {
public boolean isUseHttp() {
return useHttp;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void setClear(boolean clear) {
}

@Argument(index = 0, argName = "n", required = false)
@Description("how many history commnads to display")
@Description("how many history commands to display")
public void setNumber(int n) {
this.n = n;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public void process(CommandProcess process) {
try {
r.setDestination(Paths.get(getFilename()));
} catch (IOException e) {
process.end(-1, "Failed to stop" + r.getName() + ". Could not set destination for " + filename + "to file" + e.getMessage());
process.end(-1, "Failed to stop " + r.getName() + ". Could not set destination for " + filename + "to file" + e.getMessage());
}

r.stop();
Expand Down Expand Up @@ -353,7 +353,7 @@ public long parseSize(String s) throws Exception {
try {
return Long.parseLong(s);
} catch (Exception e) {
throw new NumberFormatException("'" + s + "' is not a valid size. Shoule be numeric value followed by a unit, i.e. 20M. Valid units k, M, G");
throw new NumberFormatException("'" + s + "' is not a valid size. Should be numeric value followed by a unit, i.e. 20M. Valid units k, M, G");
}
}
}
Expand Down