mirror of
https://github.com/eMoflon/TGG-3.0-Prototype.git
synced 2024-05-20 20:00:46 +00:00
implementing the search-based variant for our papers running example
This commit is contained in:
parent
725a162999
commit
ff2d608dd2
|
@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: Refactoring
|
||||
Bundle-SymbolicName: RefactoringAC
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Import-Package: refactoringcd.full.api
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||
Export-Package: .
|
||||
Require-Bundle: RefactoringCommon;bundle-version="1.0.0",
|
||||
RefactoringGTLFull;bundle-version="1.0.0",
|
||||
RefactoringCDGTLFull;bundle-version="1.0.0",
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.emoflon.ibex.gt.api.IBeXGtAPI;
|
|||
import org.emoflon.ibex.gt.engine.IBeXGTMatch;
|
||||
import org.emoflon.ibex.gt.engine.IBeXGTPattern;
|
||||
import org.emoflon.ibex.gt.engine.IBeXGTRule;
|
||||
import org.emoflon.refactoring.logging.LoggingConfig;
|
||||
import org.emoflon.logging.LoggingConfig;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -9,10 +9,10 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.emoflon.RankedRuleApplication;
|
||||
import org.emoflon.ibex.gt.engine.IBeXGTMatch;
|
||||
import org.emoflon.refactoring.RankedRuleApplication;
|
||||
import org.emoflon.refactoring.logging.Formatter;
|
||||
import org.emoflon.refactoring.logging.LoggingConfig;
|
||||
import org.emoflon.logging.Formatter;
|
||||
import org.emoflon.logging.LoggingConfig;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@ package org.emoflon.ac.run.classdiagram;
|
|||
|
||||
import org.emoflon.ac.run.classdiagram.config.ModelGeneratorUtil;
|
||||
import org.emoflon.ac.run.classdiagram.config.MoveFeatures;
|
||||
import org.emoflon.refactoring.logging.LoggingConfig;
|
||||
import org.emoflon.logging.LoggingConfig;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.emoflon.ac.run.classdiagram;
|
||||
|
||||
import org.emoflon.ac.run.classdiagram.config.MoveFeatures;
|
||||
import org.emoflon.refactoring.logging.LoggingConfig;
|
||||
import org.emoflon.logging.LoggingConfig;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.emoflon.ac.run.classdiagram.config;
|
||||
|
||||
import org.emoflon.refactoring.logging.LoggingConfig;
|
||||
import org.emoflon.logging.LoggingConfig;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -2,9 +2,9 @@ package org.emoflon.ac.run.softwareSystem;
|
|||
|
||||
import java.util.LinkedList;
|
||||
|
||||
import org.emoflon.refactoring.ac.RefactoringCase;
|
||||
import org.emoflon.refactoring.ac.analysis.ConstraintCounter;
|
||||
import org.emoflon.refactoring.ac.analysis.OverlapCreator;
|
||||
import org.emoflon.ac.RefactoringCase;
|
||||
import org.emoflon.ac.analysis.ConstraintCounter;
|
||||
import org.emoflon.ac.analysis.OverlapCreator;
|
||||
|
||||
import refactoring.full.api.FullHiPEGtApi;
|
||||
import softwareSystem.SoftwareSystemPackage;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.emoflon.ac.run.softwareSystem;
|
||||
|
||||
import org.emoflon.refactoring.logging.LoggingConfig;
|
||||
import org.emoflon.logging.LoggingConfig;
|
||||
|
||||
public class TestCreateImports {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.emoflon.ac.run.softwareSystem;
|
||||
|
||||
import org.emoflon.refactoring.logging.LoggingConfig;
|
||||
import org.emoflon.logging.LoggingConfig;
|
||||
|
||||
public class TestMoveComponents {
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ package org.emoflon.ac.run.softwareSystem;
|
|||
|
||||
import java.util.LinkedList;
|
||||
|
||||
import org.emoflon.refactoring.ac.RefactoringCase;
|
||||
import org.emoflon.refactoring.ac.analysis.ConstraintCounter;
|
||||
import org.emoflon.refactoring.ac.analysis.OverlapCreator;
|
||||
import org.emoflon.ac.RefactoringCase;
|
||||
import org.emoflon.ac.analysis.ConstraintCounter;
|
||||
import org.emoflon.ac.analysis.OverlapCreator;
|
||||
|
||||
import refactoring.full.api.FullHiPEGtApi;
|
||||
import softwareSystem.SoftwareSystemPackage;
|
||||
|
|
35
RefactoringCDGTLConstraint/.project
Normal file
35
RefactoringCDGTLConstraint/.project
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>RefactoringCDGTLConstraint</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.emoflon.ibex.gt.gtl.ui.nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -1,20 +1,19 @@
|
|||
Manifest-Version: 1.0
|
||||
Automatic-Module-Name: RefactoringGT
|
||||
Automatic-Module-Name: RefactoringCDGTLFull
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: RefactoringGT
|
||||
Bundle-Name: RefactoringCDGTLConstraints
|
||||
Bundle-Vendor: My Company
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-SymbolicName: RefactoringGT; singleton:=true
|
||||
Bundle-SymbolicName: RefactoringCDGTLConstraints;singleton:=true
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: org.apache.log4j,
|
||||
org.apache.commons.logging
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||
Require-Bundle: org.emoflon.ibex.common,
|
||||
org.emoflon.ibex.gt,
|
||||
org.emoflon.ibex.patternmodel,
|
||||
org.emoflon.ibex.gt.democles,
|
||||
org.emoflon.ibex.gt.gtmodel,
|
||||
org.emoflon.ibex.gt.hipe,
|
||||
SoftwareSystem;bundle-version="0.1.0"
|
||||
Export-Package: RefactoringGT.api,
|
||||
RefactoringGT.api.matches,
|
||||
RefactoringGT.api.rules
|
||||
ClassDiagram
|
||||
Export-Package: refactoringcd.constraints.api,
|
||||
refactoringcd.constraints.api.match,
|
||||
refactoringcd.constraints.api.pattern
|
|
@ -0,0 +1,53 @@
|
|||
package refactoringcd.constraints
|
||||
|
||||
import "http://www.eclipse.org/emf/2002/Ecore"
|
||||
import "platform:/resource/ClassDiagram/model/classDiagram.ecore"
|
||||
|
||||
|
||||
// Violation
|
||||
pattern externalMethodAttributeDependency {
|
||||
[=] fromClazz : Clazz {
|
||||
[=] -features-> method
|
||||
}
|
||||
|
||||
[=] toClazz : Clazz {
|
||||
[=] -features-> attribute
|
||||
}
|
||||
|
||||
[=] method : Method {
|
||||
[=] -dependencies->attribute
|
||||
}
|
||||
[=] attribute : Attribute
|
||||
};
|
||||
|
||||
pattern atLeastOneCommonAttributeDependency {
|
||||
[=] clazz : Clazz {
|
||||
[=] -features-> method
|
||||
}
|
||||
|
||||
[=] method : Method {
|
||||
}
|
||||
|
||||
[=] otherMethod : Method {
|
||||
}
|
||||
|
||||
enforce(atLeastOneCommonAttributeDependencySupport)
|
||||
[clazz=clazz, method=method, otherMethod=otherMethod]
|
||||
};
|
||||
|
||||
pattern atLeastOneCommonAttributeDependencySupport {
|
||||
[=] clazz : Clazz {
|
||||
[=] -features-> method
|
||||
[=] -features-> attribute
|
||||
}
|
||||
|
||||
[=] method : Method {
|
||||
[=] -dependencies->attribute
|
||||
}
|
||||
|
||||
[=] otherMethod : Method {
|
||||
[=] -dependencies->attribute
|
||||
}
|
||||
|
||||
[=] attribute : Attribute
|
||||
};
|
|
@ -13,8 +13,7 @@ Require-Bundle: org.emoflon.ibex.common,
|
|||
org.emoflon.ibex.gt,
|
||||
org.emoflon.ibex.gt.gtmodel,
|
||||
org.emoflon.ibex.gt.hipe,
|
||||
ClassDiagram;bundle-version="0.1.0",
|
||||
SoftwareSystem
|
||||
ClassDiagram
|
||||
Export-Package: refactoringcd.full.api,
|
||||
refactoringcd.full.api.match,
|
||||
refactoringcd.full.api.pattern,
|
||||
|
|
8
RefactoringCDGTLRules/.classpath
Normal file
8
RefactoringCDGTLRules/.classpath
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="src-gen"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
2
RefactoringCDGTLRules/.gitignore
vendored
Normal file
2
RefactoringCDGTLRules/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/bin/
|
||||
/src-gen/
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>RefactoringGT</name>
|
||||
<name>RefactoringCDGTLRules</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
|
@ -27,7 +27,7 @@
|
|||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.emoflon.ibex.gt.editor.ui.nature</nature>
|
||||
<nature>org.emoflon.ibex.gt.gtl.ui.nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
|
20
RefactoringCDGTLRules/META-INF/MANIFEST.MF
Normal file
20
RefactoringCDGTLRules/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,20 @@
|
|||
Manifest-Version: 1.0
|
||||
Automatic-Module-Name: RefactoringCDGTLFull
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: RefactoringCDGTLRules
|
||||
Bundle-Vendor: My Company
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-SymbolicName: RefactoringCDGTLRules;singleton:=true
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: org.apache.log4j,
|
||||
org.apache.commons.logging
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||
Require-Bundle: org.emoflon.ibex.common,
|
||||
org.emoflon.ibex.gt,
|
||||
org.emoflon.ibex.gt.gtmodel,
|
||||
org.emoflon.ibex.gt.hipe,
|
||||
ClassDiagram
|
||||
Export-Package: refactoringcd.rules.api,
|
||||
refactoringcd.rules.api.match,
|
||||
refactoringcd.rules.api.pattern,
|
||||
refactoringcd.rules.api.rule
|
4
RefactoringCDGTLRules/build.properties
Normal file
4
RefactoringCDGTLRules/build.properties
Normal file
|
@ -0,0 +1,4 @@
|
|||
source.. = src/,\
|
||||
src-gen/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
|
@ -0,0 +1,25 @@
|
|||
package refactoringcd.rules
|
||||
|
||||
import "http://www.eclipse.org/emf/2002/Ecore"
|
||||
import "platform:/resource/ClassDiagram/model/classDiagram.ecore"
|
||||
|
||||
rule moveMethod {
|
||||
[=] fromClazz : Clazz {
|
||||
[-] -features->method
|
||||
}
|
||||
[=] toClazz : Clazz {
|
||||
[+] -features->method
|
||||
}
|
||||
[=] method : Method
|
||||
};
|
||||
|
||||
|
||||
rule moveAttribute {
|
||||
[=] fromClazz : Clazz {
|
||||
[-] -features->attribute
|
||||
}
|
||||
[=] toClazz : Clazz {
|
||||
[+] -features->attribute
|
||||
}
|
||||
[=] attribute : Attribute
|
||||
};
|
|
@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: RefactoringCommon
|
||||
Bundle-SymbolicName: RefactoringCommon
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Export-Package: org.emoflon.refactoring,
|
||||
org.emoflon.refactoring.logging
|
||||
Export-Package: org.emoflon,
|
||||
org.emoflon.logging
|
||||
Require-Bundle: org.emoflon.ibex.gt;bundle-version="1.0.0";visibility:=reexport,
|
||||
SoftwareSystem;bundle-version="0.1.0";visibility:=reexport,
|
||||
org.emoflon.ibex.gt.hipe;bundle-version="1.0.0";visibility:=reexport,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.emoflon.refactoring;
|
||||
package org.emoflon;
|
||||
|
||||
import org.emoflon.ibex.gt.engine.IBeXGTMatch;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.emoflon.refactoring.logging;
|
||||
package org.emoflon.logging;
|
||||
|
||||
import org.emoflon.ibex.gt.engine.IBeXGTMatch;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.emoflon.refactoring.logging;
|
||||
package org.emoflon.logging;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="ASCII"?>
|
||||
<org.moflon.core.propertycontainer:MoflonPropertiesContainer xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:org.moflon.core.propertycontainer="platform:/plugin/org.moflon.core.propertycontainer/model/Propertycontainer.ecore" projectName="RefactoringGT">
|
||||
<genModelProps/>
|
||||
<codeGenerator generator="SMART_EMF"/>
|
||||
</org.moflon.core.propertycontainer:MoflonPropertiesContainer>
|
|
@ -1,44 +0,0 @@
|
|||
import "http://www.eclipse.org/emf/2002/Ecore"
|
||||
import "platform:/resource/SoftwareSystem/model/softwareSystem.ecore"
|
||||
|
||||
rule moveComponent() {
|
||||
formerSystem : System {
|
||||
-- -components->component
|
||||
}
|
||||
newSystem : System {
|
||||
++ -components->component
|
||||
}
|
||||
component : Component
|
||||
}
|
||||
|
||||
pattern breakImportIncoming() {
|
||||
component : Component
|
||||
|
||||
}
|
||||
|
||||
pattern support_breakImportIncoming() {
|
||||
system : System {
|
||||
-components->importedComponent
|
||||
}
|
||||
|
||||
component : Component {
|
||||
-imports->importedComponent
|
||||
}
|
||||
importedComponent : Component
|
||||
}
|
||||
|
||||
|
||||
pattern support_breakImportOutgoing() {
|
||||
system : System {
|
||||
-components->importingComponent
|
||||
}
|
||||
|
||||
importingComponent : Component {
|
||||
-imports->component
|
||||
}
|
||||
component : Component
|
||||
}
|
||||
|
||||
pattern repairingImportIncoming() {
|
||||
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package org.emoflon.run.search.softwareSystem;
|
||||
|
||||
import org.emoflon.refactoring.logging.LoggingConfig;
|
||||
import org.emoflon.logging.LoggingConfig;
|
||||
|
||||
public class TestCreateImports {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.emoflon.run.search.softwareSystem;
|
||||
|
||||
import org.emoflon.refactoring.logging.LoggingConfig;
|
||||
import org.emoflon.logging.LoggingConfig;
|
||||
|
||||
public class TestMoveComponents {
|
||||
|
||||
|
|
|
@ -7,11 +7,11 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.emoflon.RankedRuleApplication;
|
||||
import org.emoflon.ibex.gt.engine.IBeXGTMatch;
|
||||
import org.emoflon.ibex.gt.engine.IBeXGTRule;
|
||||
import org.emoflon.refactoring.RankedRuleApplication;
|
||||
import org.emoflon.refactoring.logging.Formatter;
|
||||
import org.emoflon.refactoring.logging.LoggingConfig;
|
||||
import org.emoflon.logging.Formatter;
|
||||
import org.emoflon.logging.LoggingConfig;
|
||||
import org.emoflon.search.matching.ConstraintCheckingInstance;
|
||||
import org.emoflon.search.matching.RuleMatchingInstance;
|
||||
import org.emoflon.search.matching.WeightedMatch;
|
||||
|
|
Loading…
Reference in a new issue