<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Replacement classes</title><link>https://sourceforge.net/p/p2abench/wiki/Replacement%2520classes/</link><description>Recent changes to Replacement classes</description><atom:link href="https://sourceforge.net/p/p2abench/wiki/Replacement%20classes/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 01 May 2013 13:39:41 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/p2abench/wiki/Replacement%20classes/feed" rel="self" type="application/rss+xml"/><item><title>Replacement classes modified by Tobias Gutzmann</title><link>https://sourceforge.net/p/p2abench/wiki/Replacement%2520classes/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -2,7 +2,7 @@

 The project consists of two parts, the *bytecode transformation tool* and the actual *replacement classes*. First, run the bytecode transformation tool on the project to be analyzed, and then use the transformed classes together with the replacement classes.

-The code can be found [here](http://sourceforge.net/p/p2abench/code/HEAD/tree/trunk/CollectionReplacement/), and binaries downloaded here(TODO)
+The code can be found [here](http://sourceforge.net/p/p2abench/code/HEAD/tree/trunk/CollectionReplacement/), and binaries downloaded [here](http://sourceforge.net/projects/p2abench/files/collection%20replacement/)

 The bytecode transformation tool
 --------------------------------
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tobias Gutzmann</dc:creator><pubDate>Wed, 01 May 2013 13:39:41 -0000</pubDate><guid>https://sourceforge.net402fc62b21fb9ceae9a066e3e3977646e12571ac</guid></item><item><title>Replacement classes modified by Tobias Gutzmann</title><link>https://sourceforge.net/p/p2abench/wiki/Replacement%2520classes/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Collection classes for use with points-to analysis. The implementation described in the paper &lt;a class="" href="http://ieeexplore.ieee.org/xpl/articleDetails.jsp?reload=true&amp;amp;tp=&amp;amp;arnumber=6392097&amp;amp;contentType=Conference+Publications&amp;amp;sortType%3Dasc_p_Sequence%26filter%3DAND%28p_IS_Number%3A6392095%29"&gt;Collection Classes for Points-to Analysis&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The project consists of two parts, the &lt;em&gt;bytecode transformation tool&lt;/em&gt; and the actual &lt;em&gt;replacement classes&lt;/em&gt;. First, run the bytecode transformation tool on the project to be analyzed, and then use the transformed classes together with the replacement classes.&lt;/p&gt;
&lt;p&gt;The code can be found &lt;a class="" href="http://sourceforge.net/p/p2abench/code/HEAD/tree/trunk/CollectionReplacement/"&gt;here&lt;/a&gt;, and binaries downloaded here(TODO)&lt;/p&gt;
&lt;h2 id="the-bytecode-transformation-tool"&gt;The bytecode transformation tool&lt;/h2&gt;
&lt;p&gt;Usage is as follows:&lt;/p&gt;
&lt;p&gt;Run fixBytecode.FixBytecode .../jre/lib/rt.jar  .../jre/lib/jce.jar .../myProject/MyProject.jar .../myProject/lib/aLib.jar ...&lt;/p&gt;
&lt;p&gt;FixBytecode puts a transformed library, where _mod is added prior to .jar, in the current directory. Use these libraries together with the replacement colleciton classes (see below) to run your subsequent points-to analysis.&lt;/p&gt;
&lt;p&gt;In order to map back method signatures (if required), you can use &lt;em&gt;changedMethods.xml&lt;/em&gt;, which is generated by FixBytecode.&lt;/p&gt;
&lt;p&gt;Possible warnings printed by FixBytecode:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;Warning&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;possible&lt;/span&gt; &lt;span class="n"&gt;elementData&lt;/span&gt; &lt;span class="n"&gt;problem&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;X&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;m&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;A class overwriting Vector accesses the field elementData directly; this may be problematic. When transforming rt.jar, this will show up a lot for classes com.sun.jmx.snmp.SnmpVarBindList and com.sun.jmx.snmp.agent.SnmpMibOid$NonSyncVector&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;Warning&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;possible&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="n"&gt;problem&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;X&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;m&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;An &lt;em&gt;instanceof&lt;/em&gt; operation for a type &lt;em&gt;Set, Map.Entry,&lt;/em&gt; or &lt;em&gt;Iterator&lt;/em&gt; is found. This may be critical for some optimizations in points-to analysis (cf. above mentioned papaer). Usually, these pop up a lot for &lt;em&gt;equals()&lt;/em&gt; methods, where they shouldn't cause any problem.&lt;/p&gt;
&lt;h2 id="the-replacement-collection-classes"&gt;The replacement collection classes&lt;/h2&gt;
&lt;p&gt;Add the transformed .jar files together with the replacement classes in your analysis. Note that the replacement classes must be in the classpath &lt;em&gt;before&lt;/em&gt; the transformed rt.jar.&lt;/p&gt;
&lt;p&gt;You can peek at the implementation of the replacement classes &lt;a class="" href="http://sourceforge.net/p/p2abench/code/HEAD/tree/trunk/CollectionReplacement/src/java/util"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tobias Gutzmann</dc:creator><pubDate>Wed, 01 May 2013 09:42:42 -0000</pubDate><guid>https://sourceforge.netd78ae654eb6953813816e0788f2e6ec809d78f6a</guid></item></channel></rss>