Merge branch 'master' of https://github.com/spring-projects/spring-loaded
This commit is contained in:
@@ -41,8 +41,8 @@ task wrapper(type: Wrapper) {
|
||||
dependencies {
|
||||
tools 'com.googlecode.jarjar:jarjar:1.3'
|
||||
|
||||
compile 'org.ow2.asm:asm:5.0.2'
|
||||
compile 'org.ow2.asm:asm-tree:5.0.2'
|
||||
compile 'org.ow2.asm:asm:5.2'
|
||||
compile 'org.ow2.asm:asm-tree:5.2'
|
||||
|
||||
testCompile 'junit:junit:4.11'
|
||||
|
||||
|
||||
@@ -206,7 +206,6 @@ public class ClassRenamer {
|
||||
|
||||
@Override
|
||||
public void visitLdcInsn(Object obj) {
|
||||
// System.out.println("Possibly remapping "+obj);
|
||||
if (obj instanceof Type) {
|
||||
Type t = (Type) obj;
|
||||
String s = t.getInternalName();
|
||||
@@ -272,9 +271,6 @@ public class ClassRenamer {
|
||||
String owner = oldHandle.getOwner();
|
||||
String name = oldHandle.getName();
|
||||
String desc = oldHandle.getDesc();
|
||||
// System.out.println("handle: owner: "+owner);
|
||||
// System.out.println("handle: name: "+name);
|
||||
// System.out.println("handle: desc: "+desc);
|
||||
owner = renameRetargetIfNecessary(owner);
|
||||
desc = renameRetargetIfNecessary(desc);
|
||||
Handle newHandle = new Handle(tag, owner, name, desc);
|
||||
|
||||
@@ -30,6 +30,10 @@ import org.objectweb.asm.Opcodes;
|
||||
*/
|
||||
public interface Constants extends Opcodes {
|
||||
|
||||
public static final int preInvokeSpecial = 0;
|
||||
|
||||
public static final int postInvokeSpecial = 1;
|
||||
|
||||
public static final Integer DEFAULT_INT = Integer.valueOf(0);
|
||||
|
||||
public static final Byte DEFAULT_BYTE = Byte.valueOf((byte) 0);
|
||||
|
||||
@@ -25,10 +25,6 @@ import org.objectweb.asm.MethodVisitor;
|
||||
*/
|
||||
class ConstructorCopier extends MethodVisitor implements Constants {
|
||||
|
||||
private final static int preInvokeSpecial = 0;
|
||||
|
||||
private final static int postInvokeSpecial = 1;
|
||||
|
||||
// It is important to know when an INVOKESPECIAL is hit, whether it is our actual one that delegates to the super or just
|
||||
// one being invoked due to some early object construction prior to the real INVOKESPECIAL running. By tracking
|
||||
// how many unitialized objects there are (count the NEWs) and how many INVOKESPECIALs have occurred, it is possible
|
||||
|
||||
@@ -450,7 +450,6 @@ public class ReloadableType {
|
||||
} catch(Exception e3) {
|
||||
//this better not blow up in my face
|
||||
}
|
||||
// ReflectionUtils.clearCache();
|
||||
|
||||
typeRegistry.fireReloadEvent(this, versionsuffix);
|
||||
|
||||
|
||||
@@ -1016,7 +1016,7 @@ public class Utils implements Opcodes, Constants {
|
||||
public boolean isDoubleSlot() {
|
||||
if (kind == Kind.PRIMITIVE) {
|
||||
char ch = descriptor.charAt(0);
|
||||
return ch == 'J' || ch == 'L';
|
||||
return ch == 'J' || ch == 'D';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.springsource.loaded.agent;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public interface FileSystemWatcherInterface {
|
||||
/**
|
||||
* Shutdown the thread.
|
||||
*/
|
||||
public void shutdown();
|
||||
|
||||
/**
|
||||
* Add a new file to the list of those being monitored. If the file is something that can be watched, then this
|
||||
* method will cause the thread to start (if it hasn't already been started).
|
||||
*
|
||||
* @param fileToMonitor the file to start monitor
|
||||
*/
|
||||
public void register(File fileToMonitor);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package org.springsource.loaded.agent;
|
||||
|
||||
public class MacOsFileSystemWatcher {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package org.springsource.loaded.agent;
|
||||
|
||||
public class PollingFileSystemWatcher {
|
||||
}
|
||||
@@ -35,7 +35,7 @@ import org.springsource.loaded.ReloadableType;
|
||||
import org.springsource.loaded.agent.FileSystemWatcher;
|
||||
|
||||
|
||||
public class FileSystemWatcherTests {
|
||||
public class PollingFileSystemWatcherTests {
|
||||
|
||||
/**
|
||||
* Create a folder, watch it then put a couple of files in and check they are detected
|
||||
@@ -564,6 +564,13 @@ public class ReloadableTypeTests extends SpringLoadedTests {
|
||||
assertFalse(rt.isDoubleSlot());
|
||||
assertFalse(rt.isVoid());
|
||||
|
||||
rt = ReturnType.getReturnType("D");
|
||||
assertEquals(ReturnType.Kind.PRIMITIVE, rt.kind);
|
||||
assertEquals("D", rt.descriptor);
|
||||
assertTrue(rt.isPrimitive());
|
||||
assertTrue(rt.isDoubleSlot());
|
||||
assertFalse(rt.isVoid());
|
||||
|
||||
rt = ReturnType.getReturnType("[Ljava/lang/String;");
|
||||
assertEquals(ReturnType.Kind.ARRAY, rt.kind);
|
||||
assertEquals("[Ljava/lang/String;", rt.descriptor);
|
||||
|
||||
Reference in New Issue
Block a user