Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 750AB172CC for ; Wed, 24 Jun 2015 10:12:43 +0000 (UTC) Received: (qmail 3019 invoked by uid 500); 24 Jun 2015 10:12:42 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 2879 invoked by uid 500); 24 Jun 2015 10:12:42 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 2858 invoked by uid 99); 24 Jun 2015 10:12:42 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jun 2015 10:12:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id C37B3C006D for ; Wed, 24 Jun 2015 10:12:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.88 X-Spam-Level: ** X-Spam-Status: No, score=2.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id ESZgRfbpvECY for ; Wed, 24 Jun 2015 10:12:33 +0000 (UTC) Received: from mail-ig0-f182.google.com (mail-ig0-f182.google.com [209.85.213.182]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 0ECC020B6F for ; Wed, 24 Jun 2015 10:12:33 +0000 (UTC) Received: by igblr2 with SMTP id lr2so72180515igb.0 for ; Wed, 24 Jun 2015 03:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=VXlXWyCEyya+IHoemLbNmPUOBnpS4M4fSSDgh1r5eO8=; b=IhySMotC1l45Sv/rLbxcqYj/GHGAAD79mEbAsRshJ1GBHZsrFRUUjX9hK1ny762uMY Z4bd4P/zonxDqX0ndVxxdzoLDmZKaH5mRB6F9ZRAyBx44QUeoczHymkhoTEMSUPKGFdY 5YOOjWKKv3LajauuE4JnMUr5XGZeUAOHQMqkFefDW8w8JTBrc6r/ioJEdjVIeTRFOxch bHrIF5tWpIxo5IuLlZC4s4qOb/sLQS28FydCFvPbbQAc2aBbblJK8e1e55t+Bh/0b1Ga ExdTYAt30YnHSmag6cIAZGLivYAn8pxiScXiyECW6eJt0mWJymQKzmdqyZQ3HchpDzft ytYA== MIME-Version: 1.0 X-Received: by 10.107.15.153 with SMTP id 25mr51309919iop.44.1435140746065; Wed, 24 Jun 2015 03:12:26 -0700 (PDT) Received: by 10.64.111.196 with HTTP; Wed, 24 Jun 2015 03:12:25 -0700 (PDT) Received: by 10.64.111.196 with HTTP; Wed, 24 Jun 2015 03:12:25 -0700 (PDT) In-Reply-To: References: Date: Wed, 24 Jun 2015 06:12:25 -0400 Message-ID: Subject: Re: is BCEL the tool for me? From: Dave Newton To: Commons Users List Content-Type: multipart/alternative; boundary=001a113ee4fc5f3d9f051940be70 --001a113ee4fc5f3d9f051940be70 Content-Type: text/plain; charset=UTF-8 There are various shading tools that could help rather than manually mucking about with byte code. On Jun 24, 2015 5:45 AM, "Li Li" wrote: > I have to use another package name other than the original one because > the original package is loaded and not controlled by my code. > > > On Wed, Jun 24, 2015 at 5:37 PM, Benedikt Ritter > wrote: > > Hello Li Li > > > > 2015-06-24 11:21 GMT+02:00 Li Li : > > > >> Hi all, > >> I have a jar file and without the source code, I want to replace > >> a package and all classes of this package with my own. > >> e.g. There is a package > >> com.abc.tool > >> com.abc.tool.A.class > >> com.abc.tool.B.class > >> The com.abc.tool.A.class and com.abc.tool.B.class are used in many > >> other classes. > >> I want to use my own implementation, So I can create my > >> package(com.def.tool) and my A.java B.java which has exactly the same > >> method as com.abc.tool.A.class and com.abc.tool.B.class > >> com.def.tool > >> com.def.tool.A.class > >> com.def.tool.B.class > >> But other classes in this jar still use com.abc.tool.A.class and > >> com.abc.tool.B.class. I want to use a byte code library to modify the > >> jar so it can run and use my implementation. > >> Is BCEL suitable for this? Thank you > >> > > > > This sounds like a pretty complicated solution to your problem. Why don't > > you just replace the class files in the jar at build time? > > > > Regards, > > Benedikt > > > > > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > >> For additional commands, e-mail: user-help@commons.apache.org > >> > >> > > > > > > -- > > http://people.apache.org/~britter/ > > http://www.systemoutprintln.de/ > > http://twitter.com/BenediktRitter > > http://github.com/britter > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --001a113ee4fc5f3d9f051940be70--