Commit 3352503f authored by balaskoa's avatar balaskoa
Browse files

Merge github.com:eclipse/titan.EclipsePlug-ins

parents cbf4d125 a33af5c7
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Titanium.Refactoring</name>
<name>Titanium_Refactoring_feature</name>
<comment></comment>
<projects>
</projects>
......
......@@ -14,7 +14,7 @@
provider-name="Eclipse Titan Project">
<description url="https://projects.eclipse.org/projects/tools.titan/downloads">
CRL 113 200/6 R5B (6.5.pl1) version of the Titanium plug-in.
CRL 113 200/6 R5B (6.5.pl1) version of the Titanium Refactoring plug-in.
</description>
<copyright>
......
......@@ -74,12 +74,14 @@
<property name="regressiontests.name" value="org.eclipse.titan.regressiontests"/>
<property name="titanium.name" value="org.eclipse.titanium"/>
<property name="titanium.regressiontests.name" value="org.eclipse.titanium.regressiontests"/>
<property name="titanium.refactoring.name" value="org.eclipse.titanium.refactoring"/>
<property name="designer.feature.name" value="TITAN_Designer_feature"/>
<property name="executor.feature.name" value="TITAN_Executor_feature"/>
<property name="logviewer.feature.name" value="TITAN_Log_Viewer_Feature"/>
<property name="titan_external_dependency.feature.name" value="Titan_external_dependencies_feature"/>
<property name="titanium.feature.name" value="Titanium_Feature"/>
<property name="titanium_external_dependency.feature.name" value="Titanium_external_dependencies_feature"/>
<property name="titanium.refactoring.feature.name" value="Titanium_Refactoring_Feature"/>
<property name="compiler.location" location="/home/titanrt/jenkins/titan_compiler_git/"/>
<property name="tpd.xsd" location="${compiler.location}/etc/xsd/TPD.xsd"/>
......@@ -87,6 +89,7 @@
<property name="usrguide.compiler.dir" location="${compiler.location}/usrguide"/>
<property name="usrguide.eclipse.dir" location="${base.dir}/../"/>
<property name="usrguide.eclipse.titanium.dir" location="${base.dir}/../org.eclipse.titanium/docs/"/>
<property name="usrguide.eclipse.titanium.refactoring.dir" location="${base.dir}/../org.eclipse.titanium.refactoring/docs/"/>
<property name="doc2pdf.jar" location="${lib.dir}/doc2pdf.jar"/>
<property environment="env"/>
......
......@@ -36,6 +36,10 @@
<pathelement location="${build.dir}/${titanium.name}/bin"/>
</path>
<path id="titanium.refactoring.classpath">
<pathelement location="${build.dir}/${titanium.refactoring.name}/bin"/>
</path>
<path id="junit.classpath">
<pathelement location="${lib.dir}/org.junit_4.11.0.v201303080030/junit.jar"/>
</path>
......
......@@ -81,6 +81,10 @@
<build.plugin name="${titanium.regressiontests.name}"/>
</target>
<target name="titanium.refactoring.plugin" depends="init, common.plugin, designer.plugin">
<build.plugin name="${titanium.refactoring.name}"/>
</target>
<!-- Macro which builds a feature -->
<macrodef name="build.feature">
<attribute name="dir"/>
......@@ -210,6 +214,10 @@
name="Titanium"
updatesite.name="@{updatesite.name}"
updatesite.url="@{updatesite.url}"/>
<build.feature dir="Titanium_Refactoring_feature"
name="Titanium.Refactoring"
updatesite.name="@{updatesite.name}"
updatesite.url="@{updatesite.url}"/>
<build.external_feature dir="Titan_external_dependencies_feature"
name="Titan_external_dependencies"
updatesite.name="@{updatesite.name}"
......@@ -411,7 +419,7 @@
</macrodef>
<target name="updatesite.release"
depends="common.plugin, runtime, designer.plugin, executor.plugin, help.plugin, logviewer.plugin, debug.plugin, regressiontests.plugin, titanium.plugin, titanium.regressiontests.plugin">
depends="common.plugin, runtime, designer.plugin, executor.plugin, help.plugin, logviewer.plugin, debug.plugin, regressiontests.plugin, titanium.plugin, titanium.regressiontests.plugin, titanium.refactoring.plugin">
<build.updatesite
site.name="${updatesite.release.name}"
location="${updatesite.release.location}"
......@@ -420,7 +428,7 @@
</target>
<target name="updatesite.FOA"
depends="common.plugin, runtime, designer.plugin, executor.plugin, help.plugin, logviewer.plugin, debug.plugin, regressiontests.plugin, titanium.plugin, titanium.regressiontests.plugin">
depends="common.plugin, runtime, designer.plugin, executor.plugin, help.plugin, logviewer.plugin, debug.plugin, regressiontests.plugin, titanium.plugin, titanium.regressiontests.plugin, titanium.refactoring.plugin">
<build.updatesite
site.name="${updatesite.FOA.name}"
location="${updatesite.FOA.location}"
......@@ -428,7 +436,7 @@
</target>
<target name="updatesite.experimental"
depends="common.plugin, runtime, designer.plugin, executor.plugin, help.plugin, logviewer.plugin, debug.plugin, regressiontests.plugin, titanium.plugin, titanium.regressiontests.plugin">
depends="common.plugin, runtime, designer.plugin, executor.plugin, help.plugin, logviewer.plugin, debug.plugin, regressiontests.plugin, titanium.plugin, titanium.regressiontests.plugin, titanium.refactoring.plugin">
<build.updatesite
site.name="${updatesite.experimental.name}"
location="${updatesite.experimental.location}"
......@@ -436,7 +444,7 @@
</target>
<target name="updatesite.testing"
depends="common.plugin, runtime, designer.plugin, executor.plugin, help.plugin, logviewer.plugin, debug.plugin, regressiontests.plugin, titanium.plugin, titanium.regressiontests.plugin">
depends="common.plugin, runtime, designer.plugin, executor.plugin, help.plugin, logviewer.plugin, debug.plugin, regressiontests.plugin, titanium.plugin, titanium.regressiontests.plugin, titanium.refactoring.plugin">
<build.updatesite
site.name="${updatesite.testing.name}"
location="${updatesite.testing.location}"
......@@ -444,7 +452,7 @@
</target>
<target name="zip"
depends="common.plugin, runtime, designer.plugin, executor.plugin, help.plugin, logviewer.plugin, debug.plugin, regressiontests.plugin, titanium.plugin, titanium.regressiontests.plugin">
depends="common.plugin, runtime, designer.plugin, executor.plugin, help.plugin, logviewer.plugin, debug.plugin, regressiontests.plugin, titanium.plugin, titanium.regressiontests.plugin, titanium.refactoring.plugin">
<build.updatesite
site.name="${updatesite.release.name}"
location="${result.dir}/zip/${version.qualifier}/"
......@@ -468,6 +476,7 @@
<clean.plugin name="${regressiontests.name}"/>
<clean.plugin name="${titanium.name}"/>
<clean.plugin name="${titanium.regressiontests.name}"/>
<clean.plugin name="${titanium.refactoring.name}"/>
<delete dir="${result.dir}" failonerror="false"/>
</target>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Copyright (c) 2000-2019 Ericsson Telecom AB
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
-->
<project basedir="." default="build" name="org.eclipse.titanium.refactoring">
<import file="build_import.xml" />
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy includeemptydirs="false" todir="bin">
<fileset dir=".">
<include name="toc.xml"/>
<include name="*.jar"/>
<include name="docs/**"/>
<include name="resources/**"/>
</fileset>
</copy>
</target>
<target depends="init" name="build">
<echo message="${ant.project.name}: ${ant.file}"/>
<pathconvert property="PDE.classpathProp" refid="PDE.classpath"/>
<echo message="${ant.project.name}: PDE class path: ${PDE.classpathProp}"/>
<javac debug="${javac.debug}" debuglevel="${javac.debuglevel}"
destdir="bin" source="1.8" target="1.8" failonerror="true">
<src path="src"/>
<classpath>
<path refid="PDE.classpath"/>
<path refid="common.classpath"/>
<path refid="designer.classpath"/>
</classpath>
</javac>
</target>
<target name="build.jars" depends="build">
<copy file="plugin.xml" todir="bin" />
<mkdir dir="${result.dir}/plugins"/>
<update.manifest file="${build.dir}/${titanium.refactoring.name}/META-INF/MANIFEST.MF"/>
<jar destfile="${result.dir}/plugins/org.eclipse.titanium.refactoring_${version.qualifier}.jar"
manifest="${build.dir}/${titanium.refactoring.name}/META-INF/MANIFEST.MF">
<fileset dir="bin" />
</jar>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.titan.codegenerator</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>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
......@@ -30,14 +30,14 @@ import org.w3c.dom.NodeList;
public final class TITANFlagsOptionsData {
public static final String SEMANTIC_CHECK_ONLY_PROPERTY = "semanticCheckOnly";
public static final String DISABLE_ATTRIBUTE_VALIDATION_PROPERTY = "disableAttributeValidation";
public static final String DISABLE_BER_PROPERTY = "disableBER";
public static final String DISABLE_RAW_PROPERTY = "disableRAW";
public static final String DISABLE_TEXT_PROPERTY = "disableTEXT";
public static final String DISABLE_XER_PROPERTY = "disableXER";
public static final String DISABLE_JSON_PROPERTY = "disableJSON";
public static final String DISABLE_OER_PROPERTY = "disableOER";
public static final String FORCE_XER_IN_ASN1_PROPERTY = "forceXERinASN.1";
public static final String DEFAULT_AS_OMIT_PROPERTY = "defaultasOmit";
public static final String FORCE_OLD_FUNC_OUT_PAR_PROPERTY = "forceOldFuncOutParHandling";
......@@ -54,10 +54,10 @@ public final class TITANFlagsOptionsData {
public static final String ACTIVATE_DEBUGGER_PROPERTY = "activateDebugger";
public static final String ENABLE_LEGACY_ENCODING_PROPERTY ="enableLegacyEncoding";
public static final String DISABLE_USER_INFORMATION_PROPERTY ="disableUserInformation";
public static final String ENABLE_REALTIME = "enableRealtimeTesting";
public static final String FORCE_GEN_SEOF = "forceGenSeof";
public static final String DISABLE_SUBTYPE_CHECKING_PROPERTY = "disableSubtypeChecking";
//The order of items of the next array defines the order of items in the tpd file within the "MakefileSettings".
......@@ -96,7 +96,7 @@ public final class TITANFlagsOptionsData {
temp = project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER,
TITANFlagsOptionsData.SEMANTIC_CHECK_ONLY_PROPERTY));
builder.append("true".equals(temp) ? "s" : "");
temp = project.getPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER,
TITANFlagsOptionsData.DISABLE_BER_PROPERTY));
builder.append("true".equals(temp) ? "b" : "");
......
......@@ -460,7 +460,8 @@ public class TitanUniversalCharString extends Base_Type {
}
for (int i = 0; i < otherValue.val_ptr.size(); ++i) {
if (otherValue.val_ptr.get(i).getUc_plane() != 0 || otherValue.val_ptr.get(i).getUc_row() != 0 || otherValue.val_ptr.get(i).getUc_group() != 0 || otherValue.val_ptr.get(i).getUc_cell() != cstr.charAt(i)){
final TitanUniversalChar temp = otherValue.val_ptr.get(i);
if (temp.getUc_plane() != 0 || temp.getUc_row() != 0 || temp.getUc_group() != 0 || temp.getUc_cell() != cstr.charAt(i)){
return false;
}
}
......@@ -526,8 +527,9 @@ public class TitanUniversalCharString extends Base_Type {
}
for (int i = 0; i < val_ptr.size(); ++i) {
if (val_ptr.get(i).getUc_group() != 0 || val_ptr.get(i).getUc_plane() != 0 || val_ptr.get(i).getUc_row() != 0
|| val_ptr.get(i).getUc_cell() != otherValue.get_value().charAt(i)) {
final TitanUniversalChar temp = val_ptr.get(i);
if (temp.getUc_group() != 0 || temp.getUc_plane() != 0 || temp.getUc_row() != 0
|| temp.getUc_cell() != otherValue.get_value().charAt(i)) {
return false;
}
}
......@@ -555,7 +557,8 @@ public class TitanUniversalCharString extends Base_Type {
return false;
}
return val_ptr.get(0).getUc_plane() == 0 && val_ptr.get(0).getUc_row() == 0 && val_ptr.get(0).getUc_group() == 0 && val_ptr.get(0).getUc_cell() == otherValue.get_char();
final TitanUniversalChar temp = val_ptr.get(0);
return temp.getUc_plane() == 0 && temp.getUc_row() == 0 && temp.getUc_group() == 0 && temp.getUc_cell() == otherValue.get_char();
}
@Override
......@@ -610,8 +613,9 @@ public class TitanUniversalCharString extends Base_Type {
return false;
}
for (int i = 0; i < val_ptr.size(); ++i) {
if (val_ptr.get(i).getUc_group() != 0 || val_ptr.get(i).getUc_plane() != 0 || val_ptr.get(i).getUc_row() != 0
|| val_ptr.get(i).getUc_cell() != otherValue.charAt(i)) {
final TitanUniversalChar temp = val_ptr.get(i);
if (temp.getUc_group() != 0 || temp.getUc_plane() != 0 || temp.getUc_row() != 0
|| temp.getUc_cell() != otherValue.charAt(i)) {
return false;
}
}
......@@ -1567,9 +1571,10 @@ public class TitanUniversalCharString extends Base_Type {
return false;
}
for (int i = 0; i < rightValue.val_ptr.size(); ++i) {
if (rightValue.val_ptr.get(i).getUc_group() != 0 || rightValue.val_ptr.get(i).getUc_plane() != 0
|| rightValue.val_ptr.get(i).getUc_row() != 0
|| rightValue.val_ptr.get(i).getUc_cell() != otherValue.charAt(i)) {
final TitanUniversalChar temp = rightValue.val_ptr.get(i);
if (temp.getUc_group() != 0 || temp.getUc_plane() != 0
|| temp.getUc_row() != 0
|| temp.getUc_cell() != otherValue.charAt(i)) {
return false;
}
}
......@@ -1986,10 +1991,11 @@ public class TitanUniversalCharString extends Base_Type {
// put_s avoids the check for boundness in put_cs
} else {
for (int i = 0; i < val_ptr.size(); i++) {
final char g = val_ptr.get(i).getUc_group();
final char p = val_ptr.get(i).getUc_plane();
final char r = val_ptr.get(i).getUc_row();
final char c = val_ptr.get(i).getUc_cell();
final TitanUniversalChar temp = val_ptr.get(i);
final char g = temp.getUc_group();
final char p = temp.getUc_plane();
final char r = temp.getUc_row();
final char c = temp.getUc_cell();
if (g == 0x00 && p <= 0x1F) {
if (p == 0x00) {
if (r == 0x00 && c <= 0x7F) {
......@@ -2064,10 +2070,11 @@ public class TitanUniversalCharString extends Base_Type {
}
} else {
for (int i = 0; i < val_ptr.size(); i++) {
final char g = val_ptr.get(i).getUc_group();
final char p = val_ptr.get(i).getUc_plane();
final char r = val_ptr.get(i).getUc_row();
final char c = val_ptr.get(i).getUc_cell();
final TitanUniversalChar temp_char = val_ptr.get(i);
final char g = temp_char.getUc_group();
final char p = temp_char.getUc_plane();
final char r = temp_char.getUc_row();
final char c = temp_char.getUc_cell();
if (g != 0 || (0x10 < p)) {
TTCN_EncDec_ErrorContext.error(error_type.ET_DEC_UCSTR, "Any UCS code (0x%02X%02X%02X%02X) to be encoded into UTF-16 shall not be greater than 0x10FFFF", g, p, r, c);
} else if (0x00 == g && 0x00 ==p && 0xD8 <= r && 0xDF >= r) {
......@@ -2141,10 +2148,11 @@ public class TitanUniversalCharString extends Base_Type {
}
} else {
for (int i = 0; i < val_ptr.size(); i++) {
final char g = val_ptr.get(i).getUc_group();
final char p = val_ptr.get(i).getUc_plane();
final char r = val_ptr.get(i).getUc_row();
final char c = val_ptr.get(i).getUc_cell();
final TitanUniversalChar temp = val_ptr.get(i);
final char g = temp.getUc_group();
final char p = temp.getUc_plane();
final char r = temp.getUc_row();
final char c = temp.getUc_cell();
int DW = g << 8 | p;
DW <<= 8;
DW |= r;
......
......@@ -185,7 +185,7 @@ public class Utils {
}
final Map<IProject, List<IFile>> affectedProjects = new HashMap<IProject, List<IFile>>();
for (Object o : affectedObjects) {
for (final Object o : affectedObjects) {
if (o instanceof IFile) {
final IFile f = (IFile) o;
final IProject pr = f.getProject();
......@@ -203,11 +203,11 @@ public class Utils {
"An affected object is not an IFile " + o);
}
}
for (Map.Entry<IProject, List<IFile>> e : affectedProjects.entrySet()) {
for (final Map.Entry<IProject, List<IFile>> e : affectedProjects.entrySet()) {
final IProject pr = e.getKey();
final List<IFile> fs = e.getValue();
final ProjectSourceParser psp = GlobalParser.getProjectSourceParser(pr);
for (IFile f : fs) {
for (final IFile f : fs) {
psp.reportOutdating(f);
}
psp.analyzeAll();
......@@ -270,7 +270,7 @@ public class Utils {
}
monitor.beginTask(name, toUpdate.size());
// update AST for each project
for (IProject proj : toUpdate) {
for (final IProject proj : toUpdate) {
monitor.subTask("Waiting for semantic analysis on project " + proj.getName());
final ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(proj);
final WorkspaceJob job = projectSourceParser.analyzeAll();
......
......@@ -227,7 +227,7 @@ class DependencyCollector {
while (!(allDefs.containsAll(prevDefs))) {
currDefs = new HashSet<Assignment>();
allDefs.addAll(prevDefs);
for (Assignment d: prevDefs) {
for (final Assignment d: prevDefs) {
final DependencyFinderVisitor vis = new DependencyFinderVisitor(currDefs, imports, asnFiles);
d.accept(vis);
}
......@@ -366,13 +366,13 @@ class DependencyCollector {
* */
private static void filterImportDefinitions(final Set<IResource> allFiles, final List<ImportModule> importDefs) {
final List<Identifier> allFileIds = new ArrayList<Identifier>(allFiles.size());
for (IResource r: allFiles) {
for (final IResource r: allFiles) {
if (!(r instanceof IFile)) {
continue;
}
final IFile f = (IFile)r;
IProject sourceProject = f.getProject();
final IProject sourceProject = f.getProject();
final ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(sourceProject);
final Module m = projectSourceParser.containedModule(f);
allFileIds.add(m.getIdentifier());
......@@ -393,13 +393,13 @@ class DependencyCollector {
* */
private static void filterFriendDefinitions(final Set<IResource> allFiles, final List<FriendModule> friendDefs) {
final List<Identifier> allFileIds = new ArrayList<Identifier>(allFiles.size());
for (IResource r: allFiles) {
for (final IResource r: allFiles) {
if (!(r instanceof IFile)) {
continue;
}
final IFile f = (IFile)r;
IProject sourceProject = f.getProject();
final IProject sourceProject = f.getProject();
final ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(sourceProject);
final Module m = projectSourceParser.containedModule(f);
allFileIds.add(m.getIdentifier());
......
......@@ -51,8 +51,6 @@ public class ExtractDefinitionAction extends AbstractHandler {
return null;
}
final TextSelection textSelection = (TextSelection)sel;
//getting selected def
final ExtractDefinitionRefactoring refactoring = new ExtractDefinitionRefactoring();
final Definition selectedDef = refactoring.getSelection();
......@@ -64,7 +62,7 @@ public class ExtractDefinitionAction extends AbstractHandler {
}
final ExtractDefinitionWizard wiz = new ExtractDefinitionWizard(selectedDef.getIdentifier().getName());
//
final TextSelection textSelection = (TextSelection)sel;
final StructuredSelection ssel = new StructuredSelection(textSelection);
wiz.init(PlatformUI.getWorkbench(), ssel);
final WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wiz);
......
......@@ -225,7 +225,7 @@ public class ExtractDefinitionRefactoring {
}
//create all folders from project level towards file level
for (IFolder f: folders) {
for (final IFolder f: folders) {
if (!f.exists()) {
f.create(true, true, new NullProgressMonitor());
}
......
......@@ -204,13 +204,13 @@ class ChangeCreator {
return;
}
final StringBuilder builder = new StringBuilder();
boolean isFirst = true;
final Long maxIndex = getIndexUpperBound(sequenceOf_Value);
if (maxIndex == null) {
return;
}
final StringBuilder builder = new StringBuilder();
boolean isFirst = true;
for (long i = 0; i < maxIndex; ++i) {
final long realIndex = i + 1;
final IValue indexedValueByRealIndex = sequenceOf_Value.getValues().getIndexedValueByRealIndex((int) realIndex);
......
......@@ -43,9 +43,6 @@ public class ExtractToFunctionAction extends AbstractHandler {
return null;
}
final IFile selectedFile = refactoring.getSelectedFile();
final ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(selectedFile.getProject());
Activator.getDefault().pauseHandlingResourceChanges();
//find params & create function from string builders
......@@ -76,6 +73,8 @@ public class ExtractToFunctionAction extends AbstractHandler {
}
//report outdating
final IFile selectedFile = refactoring.getSelectedFile();
final ProjectSourceParser projectSourceParser = GlobalParser.getProjectSourceParser(selectedFile.getProject());
projectSourceParser.reportOutdating(selectedFile);
projectSourceParser.analyzeAll();
......
......@@ -193,15 +193,7 @@ public class ExtractToFunctionRefactoring extends Refactoring {
@Override
public IStatus runInWorkspace(final IProgressMonitor monitor) throws CoreException {
final StatementList selectedStatements = selectionFinder.getSelectedStatements();
final Module selectedModule = getSelectedModule();
final IFile selectedFile = getSelectedFile();
final Reference runsOnRef = selectionFinder.getRunsOnRef();
final Type returnType = selectionFinder.getReturnType();
final ReturnCertainty retCertainty = selectionFinder.getReturnCertainty();
parentFunc = selectionFinder.getParentFunc();
if (parentFunc == null) {
ErrorReporter.logError("ExtractToFunctionRefactoring.createFunction(): Could not find the enclosing function of the selection! ");
return Status.CANCEL_STATUS;
......@@ -211,6 +203,8 @@ public class ExtractToFunctionRefactoring extends Refactoring {
return Status.CANCEL_STATUS;
}
final StatementList selectedStatements = selectionFinder.getSelectedStatements();
final Module selectedModule = getSelectedModule();
if (selectedStatements == null || selectedStatements.isEmpty() || selectedModule == null) {
ErrorReporter.logError("ExtractToFunctionRefactoring.createFunction(): No or invalid selection! ");
return Status.CANCEL_STATUS;
......@@ -225,6 +219,10 @@ public class ExtractToFunctionRefactoring extends Refactoring {
return Status.CANCEL_STATUS;
}
//create new function text
final IFile selectedFile = getSelectedFile();
final Reference runsOnRef = selectionFinder.getRunsOnRef();
final Type returnType = selectionFinder.getReturnType();
final ReturnCertainty retCertainty = selectionFinder.getReturnCertainty();
functionCreator = new FunctionCreator(selectedStatements, selectedFile, newFuncName,
params, runsOnRef, returnType, retCertainty);
......@@ -255,7 +253,7 @@ public class ExtractToFunctionRefactoring extends Refactoring {
}
final StringBuilder ret = new StringBuilder();
for (StringBuilder sb: functionText) {
for (final StringBuilder sb: functionText) {
ret.append(sb);
}
functionTextReady = ret.toString();
......@@ -274,7 +272,7 @@ public class ExtractToFunctionRefactoring extends Refactoring {
}
final StringBuilder ret = new StringBuilder();
for (StringBuilder sb: functionCallText) {
for (final StringBuilder sb: functionCallText) {
ret.append(sb);
}
functionCallTextReady = ret.toString();
......
......@@ -154,10 +154,11 @@ public class ExtractToFunctionWizardParamsPage extends UserInputWizardPage {
@Override
protected void setValue(final Object element, final Object value) {
final ParamTableItem pti = (ParamTableItem) element;
if (!(value instanceof String)) {
return;
}
final ParamTableItem pti = (ParamTableItem) element;
pti.setName((String) value);