[Soot-list] Dependency Injection - from annotation to static field reference
Bernhard Berger
berber at tzi.de
Fri Feb 15 04:18:40 EST 2013
Hi,
the modifications are made during wjpp. Therefore, it is executed before cg construction. This works for servlets and struts actions (not tested Mac-Andrés WS code since I've don't analyze WS-code at the moment).
Perhaps, the error can be found somewhere else in the generated code. Marc-André, can you create a minimal example and post the created jimple files?
Regards,
Bernhard
Am 15.02.2013 um 09:56 schrieb Eric Bodden <eric.bodden at ec-spride.de>:
> Hello.
>
> So you are saying that the points-to sets of $r1 and
> SimpleServletEchoCases.serviceEndpoint don't intersect?
>
> Just to make sure... you _are_ executing the points-to analysis after
> your modifications, aren't you?
>
> Eric
>
> On 15 February 2013 01:37, Marc-Andre Laverdiere-Papineau
> <marc-andre.laverdiere-papineau at polymtl.ca> wrote:
>> Hello,
>>
>> I am working on a code transformation that is currently not working. My
>> code is supposed to transform a reference to a Web Service endpoint to a
>> static reference generated a priori.
>>
>> However, Spark (with default options) is not connecting the dots
>> properly, so I have a missing edge in the call graph. I also
>> double-checked the points-to-sets and there is no intersection between
>> the static field's and the local variable's.
>>
>> There is the small chunk of code that shows the transformation:
>>
>> AssignStmt newStmt = Jimple.v().newAssignStmt(assigned,
>> Jimple.v().newStaticFieldRef(targetField.makeRef()));
>> substitutions.add(new Pair<Unit, Unit>(u, newStmt));
>> ...
>> for (Pair<Unit, Unit> p : substitutions) {
>> units.swapWith(p.getO1(), p.getO2());
>> }
>>
>> The generated Jimple looks like this (I simplified the types for
>> readability):
>> public void <init>()
>> {
>> SimpleServletEchoCases r0;
>> EchoServiceImplService $r1;
>> IEchoService $r2;
>>
>> r0 := @this: SimpleServletEchoCases;
>> specialinvoke r0.<java.lang.Object: void <init>()>();
>> $r1 = <SimpleServletEchoCases: EchoServiceImplService
>> serviceEndpoint>;
>> $r2 = <WSCaller: EchoServiceImpl wsEchoServiceImpl>;
>> <SimpleServletEchoCases: IEchoService service> = $r2;
>> return;
>> }
>>
>> I probably did something silly - can anyone spot the mistake?
>>
>> --
>> Marc-André Laverdière-Papineau
>> Doctorant - PhD Candidate
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>
>
> --
> Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
> Head of Secure Software Engineering Group at EC SPRIDE
> Tel: +49 6151 16-75422 Fax: +49 6151 16-72051
> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
More information about the Soot-list
mailing list