update doc

This commit is contained in:
hengyunabc committed 2018-12-07 16:01:24 +08:00
1 parent 72e97ebc10
commit 9a7cef6f87
10 files changed
+142 -7

No files matched your search

+1 -1
View File
@@ -56,7 +56,7 @@ $ java -jar arthas-boot.jar -h
## Offline Help Documentation
Latest Version, Click To Download:[![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=doc&v=LATEST)
Latest Version, Click To Download:[![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://github.com/alibaba/arthas/releases/download/arthas-all-3.0.5/arthas-3.0.5-doc.zip)
## Uninstall
+31
View File
@@ -21,3 +21,34 @@ Reference: [Instrumentation#redefineClasses](https://docs.oracle.com/javase/8/do
redefine -p /tmp/Test.class
redefine -c 327a647b -p /tmp/Test.class /tmp/Test$Inner.class
```
### Restrictions of the redefine command
* New field/method is not allowed
* The function that is running, no exit can not take effect, such as the new `System.out.println` added below, only the `run()` function will take effect.
```java
public class MathGame {
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();
while (true) {
game.run();
TimeUnit.SECONDS.sleep(1);
// This doesn't work because the code keeps running in while
System.out.println("in loop");
}
}
public void run() throws InterruptedException {
// This works because the run() function ends completely every time
System.out.println("call run()");
try {
int number = random.nextInt();
List<Integer> primeFactors = primeFactors(number);
print(number, primeFactors);
} catch (Exception e) {
System.out.println(String.format("illegalArgumentCount:%3d, ", illegalArgumentCount) + e.getMessage());
}
}
```