15b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com/* 25b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * [The "BSD licence"] 300fc68adf2e39aeb9fed35293f2576bbe729ec4bJesusFreke@JesusFreke.com * Copyright (c) 2010 Ben Gruver (JesusFreke) 45b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * All rights reserved. 55b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * 65b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * Redistribution and use in source and binary forms, with or without 75b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * modification, are permitted provided that the following conditions 85b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * are met: 95b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * 1. Redistributions of source code must retain the above copyright 105b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * notice, this list of conditions and the following disclaimer. 115b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * 2. Redistributions in binary form must reproduce the above copyright 125b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * notice, this list of conditions and the following disclaimer in the 135b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * documentation and/or other materials provided with the distribution. 145b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * 3. The name of the author may not be used to endorse or promote products 155b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * derived from this software without specific prior written permission. 165b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * 175b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 185b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 195b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 205b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 215b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 225b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 235b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 245b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 255b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 265b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 275b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com */ 285b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com 29c65a8d8b5f2091a6bd835617262840a3f52c5c00JesusFreke@JesusFreke.compackage org.jf.baksmali.Adaptors; 305b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com 314b72225e9d81201838f387171a68a832486903f9JesusFreke@JesusFreke.comimport org.jf.util.IndentingWriter; 326eae34831fee1f116f3a453bdc5e143d68e05e03JesusFreke@JesusFreke.com 336eae34831fee1f116f3a453bdc5e143d68e05e03JesusFreke@JesusFreke.comimport java.io.IOException; 34c65a8d8b5f2091a6bd835617262840a3f52c5c00JesusFreke@JesusFreke.com 35c65a8d8b5f2091a6bd835617262840a3f52c5c00JesusFreke@JesusFreke.compublic class CommentedOutMethodItem extends MethodItem { 36c65a8d8b5f2091a6bd835617262840a3f52c5c00JesusFreke@JesusFreke.com private final MethodItem commentedOutMethodItem; 37c65a8d8b5f2091a6bd835617262840a3f52c5c00JesusFreke@JesusFreke.com 386eae34831fee1f116f3a453bdc5e143d68e05e03JesusFreke@JesusFreke.com public CommentedOutMethodItem(MethodItem commentedOutMethodItem) { 3916a911620ccf7b530b873fb71cf13e8dcb88ad28JesusFreke@JesusFreke.com super(commentedOutMethodItem.getCodeAddress()); 40c65a8d8b5f2091a6bd835617262840a3f52c5c00JesusFreke@JesusFreke.com this.commentedOutMethodItem = commentedOutMethodItem; 41c65a8d8b5f2091a6bd835617262840a3f52c5c00JesusFreke@JesusFreke.com } 425b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com 43da69b22d6fe70d082b18858aea0d15ec383f1865JesusFreke@JesusFreke.com public double getSortOrder() { 44da69b22d6fe70d082b18858aea0d15ec383f1865JesusFreke@JesusFreke.com return commentedOutMethodItem.getSortOrder() + .001; 455b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com } 465b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com 470b2f7d6a57e90424b3ee455c041aab3996c05f2cJesusFreke@JesusFreke.com public boolean writeTo(IndentingWriter writer) throws IOException { 486eae34831fee1f116f3a453bdc5e143d68e05e03JesusFreke@JesusFreke.com writer.write('#'); 496eae34831fee1f116f3a453bdc5e143d68e05e03JesusFreke@JesusFreke.com commentedOutMethodItem.writeTo(writer); 506eae34831fee1f116f3a453bdc5e143d68e05e03JesusFreke@JesusFreke.com return true; 515b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com } 525b89857df3124851183c75a134f10b6ba41512a9JesusFreke@JesusFreke.com} 53