typo: ariable name and word error.

pull/2915/head
daguimu 4 months ago committed by hengyunabc
parent 2b6d331fa8
commit 66d671240f

@ -429,14 +429,14 @@ public class Bootstrap {
+ File.separator + bootstrap.getUseVersion() + File.separator + "arthas"); + File.separator + bootstrap.getUseVersion() + File.separator + "arthas");
if (!specialVersionDir.exists()) { if (!specialVersionDir.exists()) {
// try to download arthas from remote server. // 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()); bootstrap.getUseVersion(), ARTHAS_LIB_DIR.getAbsolutePath());
} }
verifyArthasHome(specialVersionDir.getAbsolutePath()); verifyArthasHome(specialVersionDir.getAbsolutePath());
arthasHomeDir = specialVersionDir; 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) { if (arthasHomeDir == null) {
CodeSource codeSource = Bootstrap.class.getProtectionDomain().getCodeSource(); CodeSource codeSource = Bootstrap.class.getProtectionDomain().getCodeSource();
if (codeSource != null) { if (codeSource != null) {
@ -470,16 +470,16 @@ public class Bootstrap {
List<String> versionList = listNames(ARTHAS_LIB_DIR); List<String> versionList = listNames(ARTHAS_LIB_DIR);
Collections.sort(versionList); Collections.sort(versionList);
String localLastestVersion = null; String localLatestVersion = null;
if (!versionList.isEmpty()) { 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; boolean needDownload = false;
if (localLastestVersion == null) { if (localLatestVersion == null) {
if (remoteLastestVersion == null) { if (remoteLatestVersion == null) {
// exit // exit
AnsiLog.error("Can not find Arthas under local: {} and remote repo mirror: {}", ARTHAS_LIB_DIR, AnsiLog.error("Can not find Arthas under local: {} and remote repo mirror: {}", ARTHAS_LIB_DIR,
bootstrap.getRepoMirror()); bootstrap.getRepoMirror());
@ -490,23 +490,23 @@ public class Bootstrap {
needDownload = true; needDownload = true;
} }
} else { } else {
if (remoteLastestVersion != null) { if (remoteLatestVersion != null) {
if (localLastestVersion.compareTo(remoteLastestVersion) < 0) { if (localLatestVersion.compareTo(remoteLatestVersion) < 0) {
AnsiLog.info("local lastest version: {}, remote lastest version: {}, try to download from remote.", AnsiLog.info("local latest version: {}, remote latest version: {}, try to download from remote.",
localLastestVersion, remoteLastestVersion); localLatestVersion, remoteLatestVersion);
needDownload = true; needDownload = true;
} }
} }
} }
if (needDownload) { if (needDownload) {
// try to download arthas from remote server. // try to download arthas from remote server.
DownloadUtils.downArthasPackaging(bootstrap.getRepoMirror(), bootstrap.isuseHttp(), DownloadUtils.downArthasPackaging(bootstrap.getRepoMirror(), bootstrap.isUseHttp(),
remoteLastestVersion, ARTHAS_LIB_DIR.getAbsolutePath()); remoteLatestVersion, ARTHAS_LIB_DIR.getAbsolutePath());
localLastestVersion = remoteLastestVersion; localLatestVersion = remoteLatestVersion;
} }
// get the latest version // 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()); verifyArthasHome(arthasHomeDir.getAbsolutePath());
@ -785,7 +785,7 @@ public class Bootstrap {
return repoMirror; return repoMirror;
} }
public boolean isuseHttp() { public boolean isUseHttp() {
return useHttp; return useHttp;
} }

@ -39,7 +39,7 @@ public class HistoryCommand extends AnnotatedCommand {
} }
@Argument(index = 0, argName = "n", required = false) @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) { public void setNumber(int n) {
this.n = n; this.n = n;
} }

@ -322,7 +322,7 @@ public class JFRCommand extends AnnotatedCommand {
try { try {
r.setDestination(Paths.get(getFilename())); r.setDestination(Paths.get(getFilename()));
} catch (IOException e) { } 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(); r.stop();
@ -353,7 +353,7 @@ public class JFRCommand extends AnnotatedCommand {
try { try {
return Long.parseLong(s); return Long.parseLong(s);
} catch (Exception e) { } 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");
} }
} }
} }

Loading…
Cancel
Save