Package org.fakereplace.client

Examples of org.fakereplace.client.ClassData


            if (file.isDirectory()) {
                handleClassesDirectory(base, file, classes);
            } else if (file.getName().endsWith(".class")) {
                final String relFile = file.getAbsolutePath().substring(base.getAbsolutePath().length() + 1);
                final String className = relFile.substring(0, relFile.length() - ".class".length()).replace("/", ".");
                classes.put(className, new ClassData(className, file.lastModified(), new ContentSource() {
                    @Override
                    public byte[] getData() throws IOException {
                        return Util.getBytesFromFile(file);
                    }
                }));
View Full Code Here


                    String newName = nameReplacements.get(oldName);
                    nc.replaceClassName(oldName, newName);
                }
                nc.setName(o.getName());
                final byte[] data = nc.toBytecode();
                classes.put(o.getName(), new ClassData(o.getName(), new Date().getTime(), new ContentSource() {
                    @Override
                    public byte[] getData() throws IOException {
                        return data;
                    }
                }));
            }
            for (Class<?> o : addedClasses) {
                CtClass nc = pool.get(o.getName());

                if (nc.isFrozen()) {
                    nc.defrost();
                }

                for (String newName : nameReplacements.keySet()) {
                    String oldName = nameReplacements.get(newName);
                    nc.replaceClassName(newName, oldName);
                }
                final byte[] data = nc.toBytecode();
                classes.put(o.getName(), new ClassData(o.getName(), new Date().getTime(), new ContentSource() {
                    @Override
                    public byte[] getData() throws IOException {
                        return data;
                    }
                }));
View Full Code Here

TOP

Related Classes of org.fakereplace.client.ClassData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.