Skip to content

Commit

Permalink
Merge branch 'mazter' of github.com:SpartanRefactoring/Main into mazter
Browse files Browse the repository at this point in the history
  • Loading branch information
SharonKL committed Jul 1, 2017
2 parents 436bd00 + 74730e9 commit d4bf5dd
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import il.org.spartan.Leonidas.auxilary_layer.Existence;
import il.org.spartan.Leonidas.plugin.GUI.LeonidasIcon;
import il.org.spartan.Leonidas.plugin.Toolbox;
import il.org.spartan.Leonidas.plugin.UserControlled;
import il.org.spartan.Leonidas.plugin.UserControlledTipper;
import il.org.spartan.Leonidas.plugin.UserControlled;
import il.org.spartan.Leonidas.plugin.leonidas.BasicBlocks.GenericEncapsulator;
import il.org.spartan.Leonidas.plugin.leonidas.BasicBlocks.UserControlled;
import il.org.spartan.Leonidas.plugin.tippers.LeonidasTipper;
import il.org.spartan.Leonidas.plugin.tippers.leonidas.LeonidasTipperDefinition;
import il.org.spartan.Leonidas.plugin.tipping.Tipper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.intellij.openapi.components.Storage;
import com.intellij.util.xmlb.XmlSerializerUtil;
import il.org.spartan.Leonidas.plugin.Toolbox;
import il.org.spartan.Leonidas.plugin.UserControlled;
import il.org.spartan.Leonidas.plugin.leonidas.BasicBlocks.UserControlled;
import il.org.spartan.Leonidas.plugin.tippers.LeonidasTipper;
import il.org.spartan.Leonidas.plugin.tipping.Tipper;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import il.org.spartan.Leonidas.auxilary_layer.Utils;
import il.org.spartan.Leonidas.auxilary_layer.az;
import il.org.spartan.Leonidas.auxilary_layer.iz;
import il.org.spartan.Leonidas.plugin.UserControlled;
import il.org.spartan.Leonidas.plugin.leonidas.Matcher;
import il.org.spartan.Leonidas.plugin.leonidas.MatchingResult;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethod;
import il.org.spartan.Leonidas.auxilary_layer.*;
import il.org.spartan.Leonidas.plugin.UserControlled;
import il.org.spartan.Leonidas.plugin.leonidas.Matcher;
import il.org.spartan.Leonidas.plugin.leonidas.MatchingResult;
import il.org.spartan.Leonidas.plugin.leonidas.Pruning;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import il.org.spartan.Leonidas.auxilary_layer.Existence;
import il.org.spartan.Leonidas.auxilary_layer.az;
import il.org.spartan.Leonidas.auxilary_layer.haz;
import il.org.spartan.Leonidas.plugin.UserControlled;
import il.org.spartan.Leonidas.plugin.leonidas.MatchingResult;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package il.org.spartan.Leonidas.plugin.leonidas.BasicBlocks;

import com.intellij.psi.PsiElement;
import il.org.spartan.Leonidas.plugin.UserControlled;

/**
* A base class for all basic blocks represented by their name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiIdentifier;
import il.org.spartan.Leonidas.auxilary_layer.*;
import il.org.spartan.Leonidas.plugin.UserControlled;
import il.org.spartan.Leonidas.plugin.leonidas.Matcher;
import il.org.spartan.Leonidas.plugin.leonidas.MatchingResult;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package il.org.spartan.Leonidas.plugin;
package il.org.spartan.Leonidas.plugin.leonidas.BasicBlocks;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand All @@ -10,5 +10,6 @@
@Retention(RetentionPolicy.RUNTIME)
public @interface UserControlled {
String name();

String templatePart();
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package il.org.spartan.Leonidas.plugin.leonidas.BasicBlocks;

import com.intellij.psi.JavaPsiFacade;
import com.intellij.psi.PsiElement;
import il.org.spartan.Leonidas.auxilary_layer.Utils;
import il.org.spartan.Leonidas.auxilary_layer.az;
import il.org.spartan.Leonidas.auxilary_layer.iz;
import il.org.spartan.Leonidas.plugin.UserControlled;
import il.org.spartan.Leonidas.plugin.leonidas.Matcher;
import il.org.spartan.Leonidas.plugin.leonidas.MatchingResult;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void replacingRules() {
@Override
public Map<String, String> getExamples() {
return new ExampleMapFactory()
//.put("void foo(int x){}", "void foo(int cent){}")
.put("void foo(int x){}", "void foo(int cent){}")
.put("void foo(int x){\n\tSystem.out.println(x);\n}", "void foo(int cent){\n\tSystem.out.println(cent);\n}")
.put("private static void foo(int x){\n\tSystem.out.println(x);\n}", "private static void foo(int cent){\n\tSystem.out.println(cent);\n}")
.put("private static void foo(int cent){\n\tSystem.out.println(\"\");\n}", null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package il.org.spartan.Leonidas.plugin.tippers.leonidas;
package il.org.spartan.Leonidas.plugin.tippers.leonidas.UnderConstruction;

import il.org.spartan.Leonidas.auxilary_layer.ExampleMapFactory;
import il.org.spartan.Leonidas.plugin.tippers.leonidas.LeonidasTipperDefinition;
import il.org.spartan.Leonidas.plugin.tippers.leonidas.LeonidasTipperDefinition.TipperUnderConstruction;
import il.org.spartan.Leonidas.plugin.tippers.leonidas.LeonidasTipperDefinition.UnderConstructionReason;

import java.util.Map;

Expand All @@ -13,6 +16,7 @@
* @author Oren Afek, Michal Cohen
* @since 20/06/17
*/
@TipperUnderConstruction(UnderConstructionReason.INCOMPLETE)
public class InlineOncedReferencedVariable implements LeonidasTipperDefinition {

@Override
Expand Down Expand Up @@ -54,7 +58,7 @@ public void replacingRules() {
@Override
public Map<String, String> getExamples() {
return new ExampleMapFactory()
// .put("int x = 3;\nf(9,x);", "f(9,3);")
.put("int x = 3;\nf(9,x);", "f(9,3);")
.put("int x = 3;\nx++;\nf(9,x);", null)
// .put("int y = 2;\nfor (int i = a; ; ) ;\na = y * 2;", "for (int i = a; ; ) ;\na = 2 * 2;")
.put("int y = 2;\nfor (int i = a; ; ) ;\ny = y * 2;", null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package il.org.spartan.Leonidas.plugin.tippers.leonidas;
package il.org.spartan.Leonidas.plugin.tippers.leonidas.UnderConstruction;

import il.org.spartan.Leonidas.plugin.tippers.leonidas.LeonidasTipperDefinition;
import il.org.spartan.Leonidas.plugin.tippers.leonidas.LeonidasTipperDefinition.TipperUnderConstruction;

import static il.org.spartan.Leonidas.plugin.leonidas.BasicBlocks.GenericPsiElementStub.anyNumberOf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import il.org.spartan.Leonidas.PsiTypeHelper;
import il.org.spartan.Leonidas.plugin.Toolbox;
import il.org.spartan.Leonidas.plugin.tippers.leonidas.LeonidasTipperDefinition;
import il.org.spartan.Leonidas.plugin.tippers.leonidas.LeonidasTipperDefinition.TipperUnderConstruction;
import il.org.spartan.Leonidas.plugin.tippers.leonidas.LeonidasTipperDefinition.UnderConstructionReason;
import il.org.spartan.Leonidas.plugin.tipping.Tipper;
import org.junit.Test;

Expand All @@ -13,6 +15,7 @@
* @author @roey maor
* @since 23-06-2017.
*/
@TipperUnderConstruction(UnderConstructionReason.INCOMPLETE)
public class TestAllTippers extends PsiTypeHelper {


Expand All @@ -22,9 +25,9 @@ public void testTippers(){
List<LeonidasTipperDefinition> leonidasTippers = t.getAllTipperInstances();
List<Tipper> ot = t.getAllTippers();
for( LeonidasTipperDefinition lt : leonidasTippers)
if (!lt.getClass().isAnnotationPresent(LeonidasTipperDefinition.TipperUnderConstruction.class))
if (!lt.getClass().isAnnotationPresent(TipperUnderConstruction.class))
try {
(new TipperTest(lt, this, true, false)).check();
(new TipperTest(lt, this, false, false)).check();
} catch (Exception e) {
System.out.println(lt.getClass().getName() + " throws exception");
e.printStackTrace();
Expand Down

0 comments on commit d4bf5dd

Please sign in to comment.