File tree Expand file tree Collapse file tree 3 files changed +25
-17
lines changed
regen-example/src/main/java/regen/test/project
spooned/regen/test/project
src/main/java/repair/regen/processor/refinement_checker Expand file tree Collapse file tree 3 files changed +25
-17
lines changed Original file line number Diff line number Diff line change 11package regen .test .project ;
22
3+ import repair .regen .specification .Refinement ;
4+
35class SimpleTest {
46 public static void main (String [] args ) {
57
6- AccountClient ac = new AccountClient ();
7- Account a = new Account ();
8- a .add (100 );
9- a .withdraw (100 );
10- a .withdraw (1 );
11-
8+ // AccountClient ac = new AccountClient();
9+ // Account a = new Account();
10+ // a.add(100);
11+ // a.withdraw(100);
12+ // a.withdraw(1);
13+
14+ @ Refinement ("x > 0 &&"
15+ + "x < 100" )
16+ int x = 10 ;
1217// Account b = new Account();
1318// a.add(10);
1419// ac.transfer(a, b, 5);
Original file line number Diff line number Diff line change 33
44class SimpleTest {
55 public static void main (java .lang .String [] args ) {
6- regen .test .project .AccountClient ac = new regen .test .project .AccountClient ();
7- regen .test .project .Account a = new regen .test .project .Account ();
8- a .add (100 );
9- a .withdraw (100 );
10- a .withdraw (1 );
6+ // AccountClient ac = new AccountClient();
7+ // Account a = new Account();
8+ // a.add(100);
9+ // a.withdraw(100);
10+ // a.withdraw(1);
11+ @ repair .regen .specification .Refinement ("x > 0 &&" + "x < 100" )
12+ int x = 10 ;
1113 // Account b = new Account();
1214 // a.add(10);
1315 // ac.transfer(a, b, 5);
Original file line number Diff line number Diff line change @@ -78,16 +78,17 @@ public Optional<Constraint> getRefinementFromAnnotation(CtElement element) throw
7878 for (CtAnnotation <? extends Annotation > ann : element .getAnnotations ()) {
7979 String an = ann .getActualAnnotation ().annotationType ().getCanonicalName ();
8080 if (an .contentEquals ("repair.regen.specification.Refinement" )) {
81- CtLiteral <String > s = (CtLiteral <String >) ann .getAllValues ().get ("value" );
82- ref = Optional .of (s .getValue ());
81+ String st = TypeCheckingUtils .getStringFromAnnotation (ann .getValue ("value" ));
82+ //CtLiteral<String> s = (CtLiteral<String>) ann.getAllValues().get("value");
83+ ref = Optional .of (st );
8384
8485 } else if (an .contentEquals ("repair.regen.specification.RefinementPredicate" )) {
85- CtLiteral < String > s = ( CtLiteral < String >) ann .getAllValues (). get ( "value" );
86- getGhostFunction (s . getValue () , element );
86+ String st = TypeCheckingUtils . getStringFromAnnotation ( ann .getValue ( "value" ) );
87+ getGhostFunction (st , element );
8788
8889 } else if (an .contentEquals ("repair.regen.specification.RefinementAlias" )) {
89- CtLiteral < String > s = ( CtLiteral < String >) ann .getAllValues (). get ( "value" );
90- handleAlias (s . getValue () , element );
90+ String st = TypeCheckingUtils . getStringFromAnnotation ( ann .getValue ( "value" ) );
91+ handleAlias (st , element );
9192
9293 }
9394
You can’t perform that action at this time.
0 commit comments