Package milk.jpatch.attribs

Examples of milk.jpatch.attribs.AttributesPatch


        // A bit awkward, but the goal is to apply attribute patches even
        // to replaced methods to avoid some bugs with invalid pc counts.
        // Especially important is that a CodePatch is always applied.
        Attribute[] attribs = ret.getAttributes();
        // It should never happen that the map used in generation is accessed.
        AttributesPatch ap = AttributesPatch.generate(new Attribute[0],
                attribs, null);
        List<Attribute> attribL = ap.patch(new ArrayList<Attribute>(
                Arrays.asList(attribs)), map);
        ret = map.applyTo(ret);
        ret.setAttributes(attribL.toArray(new Attribute[attribL.size()]));
        return ret;
    }
View Full Code Here


            sigPatch = null;
        AccessFlagsPatch flagsPatch = AccessFlagsPatch.generate(
                old.getAccessFlags(),
                new_.getAccessFlags(),
                AccessFlagsPatch.AccessLevel.FIELD);
        AttributesPatch attribsPatch = AttributesPatch.generate(
                old.getAttributes(),
                new_.getAttributes(),
                map);
       
        return new FieldModif(name, sigPatch, flagsPatch, attribsPatch);
View Full Code Here

     * @param map The cpool map.
     * @return The patch.
     */
    public static CodePatch generate(Code old, Code new_, CPoolMap map){
        // AttributesPatch
        AttributesPatch attribPatch = AttributesPatch.generate(
                old == null ? new Attribute[0] : old.getAttributes(),
                new_.getAttributes(), map);
       
        // TODO: better code patches.
        if(old == null)
View Full Code Here

            retPatch = null;
        AccessFlagsPatch flagsPatch = AccessFlagsPatch.generate(
                old.getAccessFlags(),
                new_.getAccessFlags(),
                AccessFlagsPatch.AccessLevel.METHOD);
        AttributesPatch attribsPatch = AttributesPatch.generate(
                old.getAttributes(),
                new_.getAttributes(),
                map);
       
        return new MethodModif(identifier, retPatch, flagsPatch, attribsPatch);
View Full Code Here

TOP

Related Classes of milk.jpatch.attribs.AttributesPatch

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.