mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
Bug 491945 - Remove new String() literals
Occurrences of `new String("...")` have been replaced with a direct reference to the literal it was wrapping. Change-Id: Iefb49a009f210db59e5724e0a232dba2e13292b1 Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
This commit is contained in:
parent
809598db9d
commit
ca4e5b10ee
32 changed files with 295 additions and 295 deletions
|
@ -73,12 +73,12 @@ import org.eclipse.ui.wizards.datatransfer.ImportOperation;
|
|||
import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
|
||||
|
||||
public class ManagedBuildTestHelper {
|
||||
private static final String rcbsToolId = new String("org.eclipse.cdt.managedbuilder.ui.rcbs"); //$NON-NLS-1$
|
||||
private static final String rcbsToolName = new String("Resource Custom Build Step"); //$NON-NLS-1$
|
||||
private static final String rcbsToolInputTypeId = new String("org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype"); //$NON-NLS-1$
|
||||
private static final String rcbsToolInputTypeName = new String("Resource Custom Build Step Input Type"); //$NON-NLS-1$
|
||||
private static final String rcbsToolOutputTypeId = new String("org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype"); //$NON-NLS-1$
|
||||
private static final String rcbsToolOutputTypeName = new String("Resource Custom Build Step Output Type"); //$NON-NLS-1$
|
||||
private static final String rcbsToolId = "org.eclipse.cdt.managedbuilder.ui.rcbs"; //$NON-NLS-1$
|
||||
private static final String rcbsToolName = "Resource Custom Build Step"; //$NON-NLS-1$
|
||||
private static final String rcbsToolInputTypeId = "org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype"; //$NON-NLS-1$
|
||||
private static final String rcbsToolInputTypeName = "Resource Custom Build Step Input Type"; //$NON-NLS-1$
|
||||
private static final String rcbsToolOutputTypeId = "org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype"; //$NON-NLS-1$
|
||||
private static final String rcbsToolOutputTypeName = "Resource Custom Build Step Output Type"; //$NON-NLS-1$
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2011 Intel Corporation and others.
|
||||
* Copyright (c) 2004, 2016 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -60,7 +60,7 @@ public class BuildFileGenerator implements IManagedBuilderMakefileGenerator {
|
|||
*/
|
||||
@Override
|
||||
public String getMakefileName() {
|
||||
return new String("TestBuildFile.mak");
|
||||
return "TestBuildFile.mak";
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -66,11 +66,11 @@ public class ManagedBuildCommandLineGenerator implements
|
|||
// Config artifact name
|
||||
info.commandOutput = new String(((IToolChain)tool.getParent()).getParent().getArtifactName());
|
||||
// -Oh
|
||||
info.commandOutputFlag = new String("-0h");
|
||||
info.commandOutputFlag = "-0h";
|
||||
// ""
|
||||
info.commandOutputPrefix = new String("");
|
||||
info.commandOutputPrefix = "";
|
||||
// "This is a test command line"
|
||||
info.commandLine = new String("This is a test command line");
|
||||
info.commandLine = "This is a test command line";
|
||||
return info;
|
||||
}
|
||||
|
||||
|
|
|
@ -454,7 +454,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
|||
return builder.getArguments();
|
||||
}
|
||||
}
|
||||
return new String("-k"); //$NON-NLS-1$
|
||||
return "-k"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -469,7 +469,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
|||
return builder.getCommand();
|
||||
}
|
||||
}
|
||||
return new String("make"); //$NON-NLS-1$
|
||||
return "make"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -382,9 +382,9 @@ public class Target extends BuildObject implements ITarget {
|
|||
} else {
|
||||
// User forgot to specify it. Guess based on OS.
|
||||
if (Platform.getOS().equals(Platform.OS_WIN32)) {
|
||||
return new String("del"); //$NON-NLS-1$
|
||||
return "del"; //$NON-NLS-1$
|
||||
} else {
|
||||
return new String("rm"); //$NON-NLS-1$
|
||||
return "rm"; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -512,7 +512,7 @@ public class Target extends BuildObject implements ITarget {
|
|||
return parent.getMakeArguments();
|
||||
} else {
|
||||
// No parent and no user setting
|
||||
return new String(""); //$NON-NLS-1$
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
return makeArguments;
|
||||
|
@ -530,7 +530,7 @@ public class Target extends BuildObject implements ITarget {
|
|||
return parent.getMakeCommand();
|
||||
} else {
|
||||
// The user has forgotten to specify a command in the plugin manifest
|
||||
return new String("make"); //$NON-NLS-1$
|
||||
return "make"; //$NON-NLS-1$
|
||||
}
|
||||
} else {
|
||||
return makeCommand;
|
||||
|
@ -547,7 +547,7 @@ public class Target extends BuildObject implements ITarget {
|
|||
if (parent != null) {
|
||||
return parent.getName();
|
||||
} else {
|
||||
return new String(""); //$NON-NLS-1$
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
} else {
|
||||
return name;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2011 Texas Instruments Incorporated and others.
|
||||
* Copyright (c) 2005, 2016 Texas Instruments Incorporated and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -42,7 +42,7 @@ public class AlwaysPresentWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return new String("Always Present Page");
|
||||
return "Always Present Page";
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class AlwaysPresentWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return new String("This page is for testing, please ignore it.");
|
||||
return "This page is for testing, please ignore it.";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -102,7 +102,7 @@ public class AlwaysPresentWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return new String("Test Page");
|
||||
return "Test Page";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2011 Texas Instruments Incorporated and others.
|
||||
* Copyright (c) 2005, 2016 Texas Instruments Incorporated and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -34,7 +34,7 @@ public class NatureAWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return new String("Nature A Wizard Page");
|
||||
return "Nature A Wizard Page";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -68,13 +68,13 @@ public class NatureAWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return new String("My description");
|
||||
return "My description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage()
|
||||
{
|
||||
return new String("My error msg");
|
||||
return "My error msg";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,7 +93,7 @@ public class NatureAWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return new String("My Title");
|
||||
return "My Title";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2011 Texas Instruments Incorporated and others.
|
||||
* Copyright (c) 2005, 2016 Texas Instruments Incorporated and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -34,7 +34,7 @@ public class NatureBWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return new String("Nature B Wizard Page");
|
||||
return "Nature B Wizard Page";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -68,13 +68,13 @@ public class NatureBWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return new String("My description");
|
||||
return "My description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage()
|
||||
{
|
||||
return new String("My error msg");
|
||||
return "My error msg";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,7 +93,7 @@ public class NatureBWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return new String("My Title");
|
||||
return "My Title";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2011 Texas Instruments Incorporated and others.
|
||||
* Copyright (c) 2005, 2016 Texas Instruments Incorporated and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -34,7 +34,7 @@ public class ProjectTypeDWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return new String("Project Type D WizardPage");
|
||||
return "Project Type D WizardPage";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -68,13 +68,13 @@ public class ProjectTypeDWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return new String("My description");
|
||||
return "My description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage()
|
||||
{
|
||||
return new String("My error msg");
|
||||
return "My error msg";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,7 +93,7 @@ public class ProjectTypeDWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return new String("My Title");
|
||||
return "My Title";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2011 Texas Instruments Incorporated and others.
|
||||
* Copyright (c) 2005, 2016 Texas Instruments Incorporated and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -34,7 +34,7 @@ public class ProjectTypeEWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return new String("Project Type E WizardPage");
|
||||
return "Project Type E WizardPage";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -68,13 +68,13 @@ public class ProjectTypeEWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return new String("My description");
|
||||
return "My description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage()
|
||||
{
|
||||
return new String("My error msg");
|
||||
return "My error msg";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,7 +93,7 @@ public class ProjectTypeEWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return new String("My Title");
|
||||
return "My Title";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2011 Texas Instruments Incorporated and others.
|
||||
* Copyright (c) 2005, 2016 Texas Instruments Incorporated and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -34,7 +34,7 @@ public class ToolchainCWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return new String("Toolchain C Wizard Page");
|
||||
return "Toolchain C Wizard Page";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -68,13 +68,13 @@ public class ToolchainCWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return new String("My description");
|
||||
return "My description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage()
|
||||
{
|
||||
return new String("My error msg");
|
||||
return "My error msg";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,7 +93,7 @@ public class ToolchainCWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return new String("My Title");
|
||||
return "My Title";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2011 Texas Instruments Incorporated and others.
|
||||
* Copyright (c) 2005, 2016 Texas Instruments Incorporated and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -34,7 +34,7 @@ public class ToolchainCv20WizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return new String("Toolchain C v 2.0 Wizard Page");
|
||||
return "Toolchain C v 2.0 Wizard Page";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -68,13 +68,13 @@ public class ToolchainCv20WizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return new String("My description");
|
||||
return "My description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage()
|
||||
{
|
||||
return new String("My error msg");
|
||||
return "My error msg";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,7 +93,7 @@ public class ToolchainCv20WizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return new String("My Title");
|
||||
return "My Title";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2011 Texas Instruments Incorporated and others.
|
||||
* Copyright (c) 2005, 2016 Texas Instruments Incorporated and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -34,7 +34,7 @@ public class ToolchainFWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return new String("Toolchain F Wizard Page");
|
||||
return "Toolchain F Wizard Page";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -68,13 +68,13 @@ public class ToolchainFWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return new String("My description");
|
||||
return "My description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage()
|
||||
{
|
||||
return new String("My error msg");
|
||||
return "My error msg";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,7 +93,7 @@ public class ToolchainFWizardPage extends MBSCustomPage
|
|||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return new String("My Title");
|
||||
return "My Title";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -61,12 +61,12 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
|
|||
private static final String label1 = Messages.BuildStepsTab_0;
|
||||
private static final String label2 = Messages.BuildStepsTab_1;
|
||||
private static final String PATH_SEPERATOR = ";"; //$NON-NLS-1$
|
||||
private static final String rcbsToolId = new String("org.eclipse.cdt.managedbuilder.ui.rcbs"); //$NON-NLS-1$
|
||||
private static final String rcbsToolName = new String("Resource Custom Build Step"); //$NON-NLS-1$
|
||||
private static final String rcbsToolInputTypeId = new String("org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype"); //$NON-NLS-1$
|
||||
private static final String rcbsToolInputTypeName = new String("Resource Custom Build Step Input Type"); //$NON-NLS-1$
|
||||
private static final String rcbsToolOutputTypeId = new String("org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype"); //$NON-NLS-1$
|
||||
private static final String rcbsToolOutputTypeName = new String("Resource Custom Build Step Output Type"); //$NON-NLS-1$
|
||||
private static final String rcbsToolId = "org.eclipse.cdt.managedbuilder.ui.rcbs"; //$NON-NLS-1$
|
||||
private static final String rcbsToolName = "Resource Custom Build Step"; //$NON-NLS-1$
|
||||
private static final String rcbsToolInputTypeId = "org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype"; //$NON-NLS-1$
|
||||
private static final String rcbsToolInputTypeName = "Resource Custom Build Step Input Type"; //$NON-NLS-1$
|
||||
private static final String rcbsToolOutputTypeId = "org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype"; //$NON-NLS-1$
|
||||
private static final String rcbsToolOutputTypeName = "Resource Custom Build Step Output Type"; //$NON-NLS-1$
|
||||
|
||||
private enum FIELD {PRECMD, PREANN, PSTCMD, PSTANN}
|
||||
private Set<String> set1 = new TreeSet<String>();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2002, 2012 IBM Corporation and others.
|
||||
* Copyright (c) 2002, 2016 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -114,7 +114,7 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// tu ---> namespace: MyPackage
|
||||
List tuPackages = tu.getChildrenOfType(ICElement.C_NAMESPACE);
|
||||
INamespace namespace = (INamespace) tuPackages.get(0);
|
||||
assertEquals(namespace.getElementName(), new String("MyPackage"));
|
||||
assertEquals(namespace.getElementName(), "MyPackage");
|
||||
checkElementOffset(namespace);
|
||||
checkLineNumbers(namespace, 8, 130);
|
||||
checkClass(namespace);
|
||||
|
@ -161,7 +161,7 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
private void checkInclude(IParent tu) throws CModelException{
|
||||
List tuIncludes = tu.getChildrenOfType(ICElement.C_INCLUDE);
|
||||
IInclude inc1 = (IInclude) tuIncludes.get(0);
|
||||
assertEquals(inc1.getElementName(), new String("included.h"));
|
||||
assertEquals(inc1.getElementName(), "included.h");
|
||||
checkElementOffset(inc1);
|
||||
checkLineNumbers(inc1, 2, 2);
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
private void checkMacro(IParent tu) throws CModelException{
|
||||
List tuMacros = tu.getChildrenOfType(ICElement.C_MACRO);
|
||||
IMacro mac1 = (IMacro) tuMacros.get(0);
|
||||
assertEquals(mac1.getElementName(), new String("PRINT"));
|
||||
assertEquals(mac1.getElementName(), "PRINT");
|
||||
checkElementOffset(mac1);
|
||||
checkLineNumbers(mac1, 5, 5);
|
||||
}
|
||||
|
@ -178,16 +178,16 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// MyPackage ---> class: Hello
|
||||
List nsClasses = namespace.getChildrenOfType(ICElement.C_CLASS);
|
||||
IStructure classHello = (IStructure) nsClasses.get(0);
|
||||
assertEquals(classHello.getElementName(), new String("Hello"));
|
||||
assertEquals(classHello.getElementName(), "Hello");
|
||||
checkElementOffset(classHello);
|
||||
checkLineNumbers(classHello, 12, 53);
|
||||
|
||||
// Hello --> field: int x
|
||||
List helloFields = classHello.getChildrenOfType(ICElement.C_FIELD);
|
||||
IField intX = (IField) helloFields.get(0);
|
||||
assertEquals(intX.getElementName(), new String("x"));
|
||||
assertEquals(intX.getElementName(), "x");
|
||||
checkElementOffset(intX);
|
||||
assertEquals(intX.getTypeName(), new String("int"));
|
||||
assertEquals(intX.getTypeName(), "int");
|
||||
checkLineNumbers(intX, 17, 17);
|
||||
|
||||
ASTAccessVisibility xVisibility = intX.getVisibility();
|
||||
|
@ -197,16 +197,16 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// Hello ---> method: void setX(int X)
|
||||
List helloMethods = classHello.getChildrenOfType(ICElement.C_METHOD);
|
||||
IMethod setX = (IMethod) helloMethods.get(0);
|
||||
assertEquals(setX.getElementName(), new String("setX"));
|
||||
assertEquals(setX.getElementName(), "setX");
|
||||
checkElementOffset(setX);
|
||||
assertEquals(setX.getReturnType(), new String("void"));
|
||||
assertEquals(setX.getReturnType(), "void");
|
||||
checkLineNumbers(setX, 19, 22);
|
||||
int setXNumOfParam = setX.getNumberOfParameters();
|
||||
if(setXNumOfParam != 1)
|
||||
fail("setX should have one parameter!");
|
||||
String[] setXParamTypes = setX.getParameterTypes();
|
||||
String firstParamType = setXParamTypes[0];
|
||||
assertEquals(firstParamType, new String("int"));
|
||||
assertEquals(firstParamType, "int");
|
||||
// TODO : check for the inline here
|
||||
|
||||
checkNestedNamespace(classHello);
|
||||
|
@ -215,7 +215,7 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// Hello ---> namespace: MyNestedPackage
|
||||
List helloNamespaces = classHello.getChildrenOfType(ICElement.C_NAMESPACE);
|
||||
INamespace myNestedPackage = (INamespace) helloNamespaces.get(0);
|
||||
assertEquals(myNestedPackage.getElementName(), new String("MyNestedPackage"));
|
||||
assertEquals(myNestedPackage.getElementName(), "MyNestedPackage");
|
||||
checkElementOffset(myNestedPackage);
|
||||
checkLineNumbers(myNestedPackage, 25, 52);
|
||||
|
||||
|
@ -226,21 +226,21 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// MyNestedPackage ---> class: Y
|
||||
List nestedClasses = myNestedPackage.getChildrenOfType(ICElement.C_CLASS);
|
||||
IStructure classY = (IStructure) nestedClasses.get(0);
|
||||
assertEquals(classY.getElementName(), new String("Y"));
|
||||
assertEquals(classY.getElementName(), "Y");
|
||||
checkElementOffset(classY);
|
||||
checkLineNumbers(classY, 28, 35);
|
||||
|
||||
// Y ---> constructor: Y
|
||||
List yMethods = classY.getChildrenOfType(ICElement.C_METHOD_DECLARATION);
|
||||
IMethodDeclaration constructor = (IMethodDeclaration) yMethods.get(0);
|
||||
assertEquals(constructor.getElementName(), new String("Y"));
|
||||
assertEquals(constructor.getElementName(), "Y");
|
||||
checkElementOffset(constructor);
|
||||
assertTrue (constructor.isConstructor());
|
||||
checkLineNumbers(constructor, 32, 32);
|
||||
|
||||
// Y ---> destructor: ~Y
|
||||
IMethodDeclaration destructor = (IMethodDeclaration) yMethods.get(1);
|
||||
assertEquals(destructor.getElementName(), new String("~Y"));
|
||||
assertEquals(destructor.getElementName(), "~Y");
|
||||
checkElementOffset(destructor);
|
||||
assertTrue (destructor.isDestructor());
|
||||
checkLineNumbers(destructor, 34, 34);
|
||||
|
@ -252,7 +252,7 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// MyNestedPackage ---> class: X public Y
|
||||
List nestedClasses = myNestedPackage.getChildrenOfType(ICElement.C_CLASS);
|
||||
IStructure classX = (IStructure) nestedClasses.get(1);
|
||||
assertEquals(classX.getElementName(), new String("X"));
|
||||
assertEquals(classX.getElementName(), "X");
|
||||
checkElementOffset(classX);
|
||||
checkLineNumbers(classX, 38, 51);
|
||||
// TODO : Check for base classes here
|
||||
|
@ -260,9 +260,9 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// X --> field: B b
|
||||
List xFieldChildren = classX.getChildrenOfType(ICElement.C_FIELD);
|
||||
IField bB = (IField) xFieldChildren.get(0);
|
||||
assertEquals(bB.getElementName(), new String("b"));
|
||||
assertEquals(bB.getElementName(), "b");
|
||||
checkElementOffset(bB);
|
||||
assertEquals(bB.getTypeName(), new String("B"));
|
||||
assertEquals(bB.getTypeName(), "B");
|
||||
checkLineNumbers(bB, 42, 42);
|
||||
ASTAccessVisibility bVisibility = bB.getVisibility();
|
||||
if (bVisibility != ASTAccessVisibility.PRIVATE)
|
||||
|
@ -271,7 +271,7 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// X ---> constructor chain: X
|
||||
List xMethodChildren = classX.getChildrenOfType(ICElement.C_METHOD);
|
||||
IMethod xconstructor = (IMethod) xMethodChildren.get(0);
|
||||
assertEquals(xconstructor.getElementName(), new String("X"));
|
||||
assertEquals(xconstructor.getElementName(), "X");
|
||||
checkElementOffset(xconstructor);
|
||||
assertTrue (xconstructor.isConstructor());
|
||||
checkLineNumbers(xconstructor, 46, 48);
|
||||
|
@ -279,9 +279,9 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// X ---> method declaration: doNothing
|
||||
List xMethodDeclarations = classX.getChildrenOfType(ICElement.C_METHOD_DECLARATION);
|
||||
IMethodDeclaration xDoNothing = (IMethodDeclaration) xMethodDeclarations.get(0);
|
||||
assertEquals(xDoNothing.getElementName(), new String("doNothing"));
|
||||
assertEquals(xDoNothing.getElementName(), "doNothing");
|
||||
checkElementOffset(xDoNothing);
|
||||
assertEquals(xDoNothing.getReturnType(), new String("int"));
|
||||
assertEquals(xDoNothing.getReturnType(), "int");
|
||||
checkLineNumbers(xDoNothing, 50, 50);
|
||||
}
|
||||
|
||||
|
@ -289,44 +289,44 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// MyPackage ---> enum: Noname
|
||||
List nsEnums = namespace.getChildrenOfType(ICElement.C_ENUMERATION);
|
||||
IEnumeration enumaration = (IEnumeration) nsEnums.get(0);
|
||||
assertEquals(enumaration.getElementName(), new String(""));
|
||||
assertEquals(enumaration.getElementName(), "");
|
||||
checkElementOffset(enumaration);
|
||||
checkLineNumbers(enumaration, 57, 61);
|
||||
|
||||
// enum ---> enumerator: first = 1
|
||||
List enumEnumerators = enumaration.getChildrenOfType(ICElement.C_ENUMERATOR);
|
||||
IEnumerator first = (IEnumerator) enumEnumerators.get(0);
|
||||
assertEquals(first.getElementName(), new String("first"));
|
||||
assertEquals(first.getElementName(), "first");
|
||||
assertEquals("1", first.getConstantExpression());
|
||||
checkElementOffset(first);
|
||||
// enum ---> enumerator: second
|
||||
IEnumerator second = (IEnumerator) enumEnumerators.get(1);
|
||||
assertEquals(second.getElementName(), new String("second"));
|
||||
assertEquals(second.getElementName(), "second");
|
||||
checkElementOffset(second);
|
||||
// enum ---> enumerator: third
|
||||
IEnumerator third = (IEnumerator) enumEnumerators.get(2);
|
||||
checkElementOffset(third);
|
||||
assertEquals(third.getElementName(), new String("third"));
|
||||
assertEquals(third.getElementName(), "third");
|
||||
checkElementOffset(third);
|
||||
|
||||
// MyPackage ---> enum: MyEnum
|
||||
IEnumeration myEnum = (IEnumeration) nsEnums.get(1);
|
||||
assertEquals(myEnum.getElementName(), new String("MyEnum"));
|
||||
assertEquals(myEnum.getElementName(), "MyEnum");
|
||||
checkElementOffset(myEnum);
|
||||
checkLineNumbers(myEnum, 64, 67);
|
||||
|
||||
// enum ---> enumerator: first
|
||||
List myEnumEnumerators = myEnum.getChildrenOfType(ICElement.C_ENUMERATOR);
|
||||
IEnumerator f = (IEnumerator) myEnumEnumerators.get(0);
|
||||
assertEquals(f.getElementName(), new String("f"));
|
||||
assertEquals(f.getElementName(), "f");
|
||||
checkElementOffset(f);
|
||||
// enum ---> enumerator: second
|
||||
IEnumerator s = (IEnumerator) myEnumEnumerators.get(1);
|
||||
assertEquals(s.getElementName(), new String("s"));
|
||||
assertEquals(s.getElementName(), "s");
|
||||
checkElementOffset(s);
|
||||
// enum ---> enumerator: third
|
||||
IEnumerator t = (IEnumerator) myEnumEnumerators.get(2);
|
||||
assertEquals(t.getElementName(), new String("t"));
|
||||
assertEquals(t.getElementName(), "t");
|
||||
checkElementOffset(t);
|
||||
}
|
||||
|
||||
|
@ -334,28 +334,28 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// MyPackage ---> int v
|
||||
List nsVars = namespace.getChildrenOfType(ICElement.C_VARIABLE);
|
||||
IVariable var1 = (IVariable) nsVars.get(0);
|
||||
assertEquals(var1.getElementName(), new String("v"));
|
||||
assertEquals(var1.getElementName(), "v");
|
||||
checkElementOffset(var1);
|
||||
assertEquals(var1.getTypeName(), new String("int"));
|
||||
assertEquals(var1.getTypeName(), "int");
|
||||
checkLineNumbers(var1, 71, 71);
|
||||
|
||||
// MyPackage ---> unsigned long vuLong
|
||||
IVariable var2 = (IVariable) nsVars.get(1);
|
||||
assertEquals(var2.getElementName(), new String("vuLong"));
|
||||
assertEquals(var2.getElementName(), "vuLong");
|
||||
checkElementOffset(var2);
|
||||
assertEquals(var2.getTypeName(), new String("unsigned long"));
|
||||
assertEquals(var2.getTypeName(), "unsigned long");
|
||||
checkLineNumbers(var2, 73, 73);
|
||||
|
||||
// MyPackage ---> unsigned short vuShort
|
||||
IVariable var3 = (IVariable) nsVars.get(2);
|
||||
assertEquals(var3.getElementName(), new String("vuShort"));
|
||||
assertEquals(var3.getElementName(), "vuShort");
|
||||
checkElementOffset(var3);
|
||||
assertEquals(var3.getTypeName(), new String("unsigned short"));
|
||||
assertEquals(var3.getTypeName(), "unsigned short");
|
||||
checkLineNumbers(var3, 75, 75);
|
||||
|
||||
// MyPackage ---> function pointer: orig_malloc_hook
|
||||
IVariable vDecl2 = (IVariable) nsVars.get(3);
|
||||
assertEquals(vDecl2.getElementName(), new String("orig_malloc_hook"));
|
||||
assertEquals(vDecl2.getElementName(), "orig_malloc_hook");
|
||||
checkElementOffset(vDecl2);
|
||||
assertEquals(vDecl2.getTypeName(), new String ("void*(*)(const char*, int, int)"));
|
||||
checkLineNumbers(vDecl2, 81, 81);
|
||||
|
@ -365,9 +365,9 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// MyPackage ---> extern int evar
|
||||
List nsVarDecls = namespace.getChildrenOfType(ICElement.C_VARIABLE_DECLARATION);
|
||||
IVariableDeclaration vDecl1 = (IVariableDeclaration) nsVarDecls.get(0);
|
||||
assertEquals(vDecl1.getElementName(), new String("evar"));
|
||||
assertEquals(vDecl1.getElementName(), "evar");
|
||||
checkElementOffset(vDecl1);
|
||||
assertEquals(vDecl1.getTypeName(), new String("int"));
|
||||
assertEquals(vDecl1.getTypeName(), "int");
|
||||
checkLineNumbers(vDecl1, 79, 79);
|
||||
}
|
||||
|
||||
|
@ -376,30 +376,30 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
|
||||
// MyPackage ---> function: void foo()
|
||||
IFunctionDeclaration f1 = (IFunctionDeclaration) nsFunctionDeclarations.get(0);
|
||||
assertEquals(f1.getElementName(), new String("foo"));
|
||||
assertEquals(f1.getElementName(), "foo");
|
||||
checkElementOffset(f1);
|
||||
assertEquals(f1.getReturnType(), new String("void"));
|
||||
assertEquals(f1.getReturnType(), "void");
|
||||
checkLineNumbers(f1, 85, 85);
|
||||
|
||||
// MyPackage ---> function: char* foo(int&, char**)
|
||||
IFunctionDeclaration f2 = (IFunctionDeclaration) nsFunctionDeclarations.get(1);
|
||||
assertEquals(f2.getElementName(), new String("foo"));
|
||||
assertEquals(f2.getElementName(), "foo");
|
||||
checkElementOffset(f2);
|
||||
assertEquals(f2.getReturnType(), new String("char*"));
|
||||
assertEquals(f2.getReturnType(), "char*");
|
||||
checkLineNumbers(f2, 87, 88);
|
||||
int fooNumOfParam = f2.getNumberOfParameters();
|
||||
if(fooNumOfParam != 2)
|
||||
fail("foo should have two parameter!");
|
||||
String[] paramTypes = f2.getParameterTypes();
|
||||
assertEquals(paramTypes[0], new String("int&"));
|
||||
assertEquals(paramTypes[1], new String("char**"));
|
||||
assertEquals(paramTypes[0], "int&");
|
||||
assertEquals(paramTypes[1], "char**");
|
||||
|
||||
// MyPackage ---> function: void boo() {}
|
||||
List nsFunctions = namespace.getChildrenOfType(ICElement.C_FUNCTION);
|
||||
IFunction f3 = (IFunction) nsFunctions.get(0);
|
||||
assertEquals(f3.getElementName(), new String("boo"));
|
||||
assertEquals(f3.getElementName(), "boo");
|
||||
checkElementOffset(f3);
|
||||
assertEquals(f3.getReturnType(), new String("void"));
|
||||
assertEquals(f3.getReturnType(), "void");
|
||||
checkLineNumbers(f3, 90, 92);
|
||||
}
|
||||
|
||||
|
@ -412,9 +412,9 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
checkLineNumbers(struct1, 95, 97);
|
||||
List struct1Fields = struct1.getChildrenOfType(ICElement.C_FIELD);
|
||||
IField field1 = (IField) struct1Fields.get(0);
|
||||
assertEquals(field1.getElementName(), new String("sint"));
|
||||
assertEquals(field1.getElementName(), "sint");
|
||||
checkElementOffset(field1);
|
||||
assertEquals(field1.getTypeName(), new String("int"));
|
||||
assertEquals(field1.getTypeName(), "int");
|
||||
checkLineNumbers(field1, 96, 96);
|
||||
|
||||
if(field1.getVisibility() != ASTAccessVisibility.PUBLIC)
|
||||
|
@ -435,9 +435,9 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
checkLineNumbers(struct2, 101, 103);
|
||||
List struct2Fields = struct2.getChildrenOfType(ICElement.C_FIELD);
|
||||
IField field2 = (IField) struct2Fields.get(0);
|
||||
assertEquals(field2.getElementName(), new String("ss"));
|
||||
assertEquals(field2.getElementName(), "ss");
|
||||
checkElementOffset(field2);
|
||||
assertEquals(field2.getTypeName(), new String("int"));
|
||||
assertEquals(field2.getTypeName(), "int");
|
||||
checkLineNumbers(field2, 102, 102);
|
||||
if(field2.getVisibility() != ASTAccessVisibility.PUBLIC)
|
||||
fail("field visibility should be public!");
|
||||
|
@ -457,14 +457,14 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// union
|
||||
List nsUnions = namespace.getChildrenOfType(ICElement.C_UNION);
|
||||
IStructure u0 = (IStructure) nsUnions.get(0);
|
||||
assertEquals(u0.getElementName(), new String("U"));
|
||||
assertEquals(u0.getElementName(), "U");
|
||||
checkElementOffset(u0);
|
||||
checkLineNumbers(u0, 105, 107);
|
||||
List u0Fields = u0.getChildrenOfType(ICElement.C_FIELD);
|
||||
IField field3 = (IField) u0Fields.get(0);
|
||||
assertEquals(field3.getElementName(), new String("U1"));
|
||||
assertEquals(field3.getElementName(), "U1");
|
||||
checkElementOffset(field3);
|
||||
assertEquals(field3.getTypeName(), new String("int"));
|
||||
assertEquals(field3.getTypeName(), "int");
|
||||
checkLineNumbers(field3, 106, 106);
|
||||
if(field3.getVisibility() != ASTAccessVisibility.PUBLIC)
|
||||
fail("field visibility should be public!");
|
||||
|
@ -474,10 +474,10 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// template function
|
||||
List functionTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_FUNCTION_DECLARATION);
|
||||
IFunctionTemplateDeclaration ft = (IFunctionTemplateDeclaration)functionTemplates.get(0);
|
||||
assertEquals(ft.getElementName(), new String("aTemplatedFunction"));
|
||||
assertEquals(ft.getElementName(), "aTemplatedFunction");
|
||||
checkElementOffset(ft);
|
||||
ft.getTemplateSignature();
|
||||
assertEquals(ft.getTemplateSignature(), new String("aTemplatedFunction<A, B>(B) : A"));
|
||||
assertEquals(ft.getTemplateSignature(), "aTemplatedFunction<A, B>(B) : A");
|
||||
checkLineNumbers(ft, 112, 113);
|
||||
|
||||
// template method
|
||||
|
@ -486,26 +486,26 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
checkLineNumbers(enclosingClass, 115, 120);
|
||||
List methodTemplates = enclosingClass.getChildrenOfType(ICElement.C_TEMPLATE_METHOD_DECLARATION);
|
||||
IMethodTemplateDeclaration mt = (IMethodTemplateDeclaration)methodTemplates.get(0);
|
||||
assertEquals(mt.getElementName(), new String("aTemplatedMethod"));
|
||||
assertEquals(mt.getElementName(), "aTemplatedMethod");
|
||||
checkElementOffset(mt);
|
||||
assertEquals(mt.getTemplateSignature(), new String("aTemplatedMethod<A, B>(B) : A"));
|
||||
assertEquals(mt.getTemplateSignature(), "aTemplatedMethod<A, B>(B) : A");
|
||||
checkLineNumbers(mt, 118, 119 );
|
||||
assertEquals(mt.getVisibility(), ASTAccessVisibility.PUBLIC);
|
||||
|
||||
// template class
|
||||
List classTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_CLASS);
|
||||
IStructureTemplate ct = (IStructureTemplate)classTemplates.get(0);
|
||||
assertEquals(ct.getElementName(), new String("myarray"));
|
||||
assertEquals(ct.getElementName(), "myarray");
|
||||
checkElementOffset(ct);
|
||||
assertEquals(ct.getTemplateSignature(), new String("myarray<T, Tibor>"));
|
||||
assertEquals(ct.getTemplateSignature(), "myarray<T, Tibor>");
|
||||
checkLineNumbers(ct, 122, 123);
|
||||
|
||||
// template struct
|
||||
List structTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_STRUCT);
|
||||
IStructureTemplate st = (IStructureTemplate)structTemplates.get(0);
|
||||
assertEquals(st.getElementName(), new String("mystruct"));
|
||||
assertEquals(st.getElementName(), "mystruct");
|
||||
checkElementOffset(st);
|
||||
assertEquals(st.getTemplateSignature(), new String("mystruct<T, Tibor>"));
|
||||
assertEquals(st.getTemplateSignature(), "mystruct<T, Tibor>");
|
||||
checkLineNumbers(st, 125, 126);
|
||||
|
||||
// moved to failed tests
|
||||
|
@ -513,9 +513,9 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// template variable
|
||||
// ArrayList variableTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_VARIABLE);
|
||||
// VariableTemplate vt = (VariableTemplate)variableTemplates.get(0);
|
||||
// assertEquals(vt.getElementName(), new String("default_alloc_template<__threads,__inst>::_S_start_free"));
|
||||
// assertEquals(vt.getElementName(), "default_alloc_template<__threads,__inst>::_S_start_free");
|
||||
// checkElementOffset(mac1);
|
||||
// assertEquals(vt.getTemplateSignature(), new String("default_alloc_template<__threads,__inst>::_S_start_free<bool, int> : char*"));
|
||||
// assertEquals(vt.getTemplateSignature(), "default_alloc_template<__threads,__inst>::_S_start_free<bool, int> : char*");
|
||||
// checkLineNumbers(vt, 128, 129);
|
||||
}
|
||||
|
||||
|
@ -523,24 +523,24 @@ public class CModelElementsTests extends BaseTestCase {
|
|||
// array variable
|
||||
List variables = tu.getChildrenOfType(ICElement.C_VARIABLE);
|
||||
IVariable arrayVar = (IVariable) variables.get(0);
|
||||
assertEquals(arrayVar.getElementName(), new String("myArray"));
|
||||
assertEquals(arrayVar.getElementName(), "myArray");
|
||||
checkElementOffset(arrayVar);
|
||||
assertEquals(arrayVar.getTypeName(), new String("int[][]"));
|
||||
assertEquals(arrayVar.getTypeName(), "int[][]");
|
||||
checkLineNumbers(arrayVar, 133, 133);
|
||||
|
||||
// array parameter in function main
|
||||
List functions = tu.getChildrenOfType(ICElement.C_FUNCTION);
|
||||
IFunction mainFunction = (IFunction) functions.get(0);
|
||||
assertEquals(mainFunction.getElementName(), new String("main"));
|
||||
assertEquals(mainFunction.getElementName(), "main");
|
||||
checkElementOffset(mainFunction);
|
||||
assertEquals(mainFunction.getReturnType(), new String("int"));
|
||||
assertEquals(mainFunction.getReturnType(), "int");
|
||||
checkLineNumbers(mainFunction, 134, 136);
|
||||
int NumOfParam = mainFunction.getNumberOfParameters();
|
||||
if(NumOfParam != 2)
|
||||
fail("main should have two parameter!");
|
||||
String[] paramTypes = mainFunction.getParameterTypes();
|
||||
assertEquals(paramTypes[0], new String("int"));
|
||||
assertEquals(paramTypes[1], new String("char*[]"));
|
||||
assertEquals(paramTypes[0], "int");
|
||||
assertEquals(paramTypes[1], "char*[]");
|
||||
|
||||
}
|
||||
private void checkLineNumbers(ICElement element, int startLine, int endLine) throws CModelException {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2012 IBM Corporation and others.
|
||||
* Copyright (c) 2005, 2016 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -127,7 +127,7 @@ public class MacroTests extends IntegratedCModelTest {
|
|||
|
||||
}
|
||||
if (!missing.empty()) {
|
||||
String output=new String("Could not get elements: ");
|
||||
String output="Could not get elements: ";
|
||||
while (!missing.empty())
|
||||
output+=missing.pop() + " ";
|
||||
assertTrue(output, false);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2012 IBM Corporation and others.
|
||||
* Copyright (c) 2004, 2016 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -113,7 +113,7 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// tu ---> namespace: MyPackage
|
||||
List tuPackages = tu.getChildrenOfType(ICElement.C_NAMESPACE);
|
||||
INamespace namespace = (INamespace) tuPackages.get(0);
|
||||
assertEquals(namespace.getElementName(), new String("MyPackage")); //$NON-NLS-1$
|
||||
assertEquals(namespace.getElementName(), "MyPackage"); //$NON-NLS-1$
|
||||
checkElementOffset(namespace);
|
||||
checkLineNumbers(namespace, 8, 130);
|
||||
checkClass(namespace);
|
||||
|
@ -140,7 +140,7 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
private void checkInclude(IParent tu) throws CModelException{
|
||||
List tuIncludes = tu.getChildrenOfType(ICElement.C_INCLUDE);
|
||||
IInclude inc1 = (IInclude) tuIncludes.get(0);
|
||||
assertEquals(inc1.getElementName(), new String("included.h")); //$NON-NLS-1$
|
||||
assertEquals(inc1.getElementName(), "included.h"); //$NON-NLS-1$
|
||||
checkElementOffset(inc1);
|
||||
checkLineNumbers(inc1, 2, 2);
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
private void checkMacro(IParent tu) throws CModelException{
|
||||
List tuMacros = tu.getChildrenOfType(ICElement.C_MACRO);
|
||||
IMacro mac1 = (IMacro) tuMacros.get(0);
|
||||
assertEquals(mac1.getElementName(), new String("PRINT")); //$NON-NLS-1$
|
||||
assertEquals(mac1.getElementName(), "PRINT"); //$NON-NLS-1$
|
||||
checkElementOffset(mac1);
|
||||
checkLineNumbers(mac1, 5, 5);
|
||||
}
|
||||
|
@ -157,16 +157,16 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// MyPackage ---> class: Hello
|
||||
List nsClasses = namespace.getChildrenOfType(ICElement.C_CLASS);
|
||||
IStructure classHello = (IStructure) nsClasses.get(0);
|
||||
assertEquals(classHello.getElementName(), new String("Hello")); //$NON-NLS-1$
|
||||
assertEquals(classHello.getElementName(), "Hello"); //$NON-NLS-1$
|
||||
checkElementOffset(classHello);
|
||||
checkLineNumbers(classHello, 12, 53);
|
||||
|
||||
// Hello --> field: int x
|
||||
List helloFields = classHello.getChildrenOfType(ICElement.C_FIELD);
|
||||
IField intX = (IField) helloFields.get(0);
|
||||
assertEquals(intX.getElementName(), new String("x")); //$NON-NLS-1$
|
||||
assertEquals(intX.getElementName(), "x"); //$NON-NLS-1$
|
||||
checkElementOffset(intX);
|
||||
assertEquals(intX.getTypeName(), new String("int")); //$NON-NLS-1$
|
||||
assertEquals(intX.getTypeName(), "int"); //$NON-NLS-1$
|
||||
checkLineNumbers(intX, 17, 17);
|
||||
|
||||
ASTAccessVisibility xVisibility = intX.getVisibility();
|
||||
|
@ -176,16 +176,16 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// Hello ---> method: void setX(int X)
|
||||
List helloMethods = classHello.getChildrenOfType(ICElement.C_METHOD);
|
||||
IMethod setX = (IMethod) helloMethods.get(0);
|
||||
assertEquals(setX.getElementName(), new String("setX")); //$NON-NLS-1$
|
||||
assertEquals(setX.getElementName(), "setX"); //$NON-NLS-1$
|
||||
checkElementOffset(setX);
|
||||
assertEquals(setX.getReturnType(), new String("void")); //$NON-NLS-1$
|
||||
assertEquals(setX.getReturnType(), "void"); //$NON-NLS-1$
|
||||
checkLineNumbers(setX, 19, 22);
|
||||
int setXNumOfParam = setX.getNumberOfParameters();
|
||||
if(setXNumOfParam != 1)
|
||||
fail("setX should have one parameter!"); //$NON-NLS-1$
|
||||
String[] setXParamTypes = setX.getParameterTypes();
|
||||
String firstParamType = setXParamTypes[0];
|
||||
assertEquals(firstParamType, new String("int")); //$NON-NLS-1$
|
||||
assertEquals(firstParamType, "int"); //$NON-NLS-1$
|
||||
// TODO : check for the inline here
|
||||
|
||||
checkNestedNamespace(classHello);
|
||||
|
@ -194,7 +194,7 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// Hello ---> namespace: MyNestedPackage
|
||||
List helloNamespaces = classHello.getChildrenOfType(ICElement.C_NAMESPACE);
|
||||
INamespace myNestedPackage = (INamespace) helloNamespaces.get(0);
|
||||
assertEquals(myNestedPackage.getElementName(), new String("MyNestedPackage")); //$NON-NLS-1$
|
||||
assertEquals(myNestedPackage.getElementName(), "MyNestedPackage"); //$NON-NLS-1$
|
||||
checkElementOffset(myNestedPackage);
|
||||
checkLineNumbers(myNestedPackage, 25, 52);
|
||||
|
||||
|
@ -205,21 +205,21 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// MyNestedPackage ---> class: Y
|
||||
List nestedClasses = myNestedPackage.getChildrenOfType(ICElement.C_CLASS);
|
||||
IStructure classY = (IStructure) nestedClasses.get(0);
|
||||
assertEquals(classY.getElementName(), new String("Y")); //$NON-NLS-1$
|
||||
assertEquals(classY.getElementName(), "Y"); //$NON-NLS-1$
|
||||
checkElementOffset(classY);
|
||||
checkLineNumbers(classY, 28, 35);
|
||||
|
||||
// Y ---> constructor: Y
|
||||
List yMethods = classY.getChildrenOfType(ICElement.C_METHOD_DECLARATION);
|
||||
IMethodDeclaration constructor = (IMethodDeclaration) yMethods.get(0);
|
||||
assertEquals(constructor.getElementName(), new String("Y")); //$NON-NLS-1$
|
||||
assertEquals(constructor.getElementName(), "Y"); //$NON-NLS-1$
|
||||
checkElementOffset(constructor);
|
||||
assertTrue (constructor.isConstructor());
|
||||
checkLineNumbers(constructor, 32, 32);
|
||||
|
||||
// Y ---> destructor: ~Y
|
||||
IMethodDeclaration destructor = (IMethodDeclaration) yMethods.get(1);
|
||||
assertEquals(destructor.getElementName(), new String("~Y")); //$NON-NLS-1$
|
||||
assertEquals(destructor.getElementName(), "~Y"); //$NON-NLS-1$
|
||||
checkElementOffset(destructor);
|
||||
assertTrue (destructor.isDestructor());
|
||||
checkLineNumbers(destructor, 34, 34);
|
||||
|
@ -231,7 +231,7 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// MyNestedPackage ---> class: X public Y
|
||||
List nestedClasses = myNestedPackage.getChildrenOfType(ICElement.C_CLASS);
|
||||
IStructure classX = (IStructure) nestedClasses.get(1);
|
||||
assertEquals(classX.getElementName(), new String("X")); //$NON-NLS-1$
|
||||
assertEquals(classX.getElementName(), "X"); //$NON-NLS-1$
|
||||
checkElementOffset(classX);
|
||||
checkLineNumbers(classX, 38, 51);
|
||||
// TODO : Check for base classes here
|
||||
|
@ -239,9 +239,9 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// X --> field: B b
|
||||
List xFieldChildren = classX.getChildrenOfType(ICElement.C_FIELD);
|
||||
IField bB = (IField) xFieldChildren.get(0);
|
||||
assertEquals(bB.getElementName(), new String("b")); //$NON-NLS-1$
|
||||
assertEquals(bB.getElementName(), "b"); //$NON-NLS-1$
|
||||
checkElementOffset(bB);
|
||||
assertEquals(bB.getTypeName(), new String("B")); //$NON-NLS-1$
|
||||
assertEquals(bB.getTypeName(), "B"); //$NON-NLS-1$
|
||||
checkLineNumbers(bB, 42, 42);
|
||||
ASTAccessVisibility bVisibility = bB.getVisibility();
|
||||
if (bVisibility != ASTAccessVisibility.PRIVATE)
|
||||
|
@ -250,7 +250,7 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// X ---> constructor chain: X
|
||||
List xMethodChildren = classX.getChildrenOfType(ICElement.C_METHOD);
|
||||
IMethod xconstructor = (IMethod) xMethodChildren.get(0);
|
||||
assertEquals(xconstructor.getElementName(), new String("X")); //$NON-NLS-1$
|
||||
assertEquals(xconstructor.getElementName(), "X"); //$NON-NLS-1$
|
||||
checkElementOffset(xconstructor);
|
||||
assertTrue (xconstructor.isConstructor());
|
||||
checkLineNumbers(xconstructor, 46, 48);
|
||||
|
@ -258,9 +258,9 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// X ---> method declaration: doNothing
|
||||
List xMethodDeclarations = classX.getChildrenOfType(ICElement.C_METHOD_DECLARATION);
|
||||
IMethodDeclaration xDoNothing = (IMethodDeclaration) xMethodDeclarations.get(0);
|
||||
assertEquals(xDoNothing.getElementName(), new String("doNothing")); //$NON-NLS-1$
|
||||
assertEquals(xDoNothing.getElementName(), "doNothing"); //$NON-NLS-1$
|
||||
checkElementOffset(xDoNothing);
|
||||
assertEquals(xDoNothing.getReturnType(), new String("int")); //$NON-NLS-1$
|
||||
assertEquals(xDoNothing.getReturnType(), "int"); //$NON-NLS-1$
|
||||
checkLineNumbers(xDoNothing, 50, 50);
|
||||
}
|
||||
|
||||
|
@ -268,44 +268,44 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// MyPackage ---> enum: Noname
|
||||
List nsEnums = namespace.getChildrenOfType(ICElement.C_ENUMERATION);
|
||||
IEnumeration enumarate = (IEnumeration) nsEnums.get(0);
|
||||
assertEquals(enumarate.getElementName(), new String("")); //$NON-NLS-1$
|
||||
assertEquals(enumarate.getElementName(), ""); //$NON-NLS-1$
|
||||
checkElementOffset(enumarate);
|
||||
checkLineNumbers(enumarate, 57, 61);
|
||||
|
||||
// enum ---> enumerator: first = 1
|
||||
List enumEnumerators = enumarate.getChildrenOfType(ICElement.C_ENUMERATOR);
|
||||
IEnumerator first = (IEnumerator) enumEnumerators.get(0);
|
||||
assertEquals(first.getElementName(), new String("first")); //$NON-NLS-1$
|
||||
assertEquals(first.getElementName(), "first"); //$NON-NLS-1$
|
||||
assertEquals("1", first.getConstantExpression()); //$NON-NLS-1$
|
||||
checkElementOffset(first);
|
||||
// enum ---> enumerator: second
|
||||
IEnumerator second = (IEnumerator) enumEnumerators.get(1);
|
||||
assertEquals(second.getElementName(), new String("second")); //$NON-NLS-1$
|
||||
assertEquals(second.getElementName(), "second"); //$NON-NLS-1$
|
||||
checkElementOffset(second);
|
||||
// enum ---> enumerator: third
|
||||
IEnumerator third = (IEnumerator) enumEnumerators.get(2);
|
||||
checkElementOffset(third);
|
||||
assertEquals(third.getElementName(), new String("third")); //$NON-NLS-1$
|
||||
assertEquals(third.getElementName(), "third"); //$NON-NLS-1$
|
||||
checkElementOffset(third);
|
||||
|
||||
// MyPackage ---> enum: MyEnum
|
||||
IEnumeration myEnum = (IEnumeration) nsEnums.get(1);
|
||||
assertEquals(myEnum.getElementName(), new String("MyEnum")); //$NON-NLS-1$
|
||||
assertEquals(myEnum.getElementName(), "MyEnum"); //$NON-NLS-1$
|
||||
checkElementOffset(myEnum);
|
||||
checkLineNumbers(myEnum, 64, 67);
|
||||
|
||||
// enum ---> enumerator: first
|
||||
List myEnumEnumerators = myEnum.getChildrenOfType(ICElement.C_ENUMERATOR);
|
||||
IEnumerator f = (IEnumerator) myEnumEnumerators.get(0);
|
||||
assertEquals(f.getElementName(), new String("f")); //$NON-NLS-1$
|
||||
assertEquals(f.getElementName(), "f"); //$NON-NLS-1$
|
||||
checkElementOffset(f);
|
||||
// enum ---> enumerator: second
|
||||
IEnumerator s = (IEnumerator) myEnumEnumerators.get(1);
|
||||
assertEquals(s.getElementName(), new String("s")); //$NON-NLS-1$
|
||||
assertEquals(s.getElementName(), "s"); //$NON-NLS-1$
|
||||
checkElementOffset(s);
|
||||
// enum ---> enumerator: third
|
||||
IEnumerator t = (IEnumerator) myEnumEnumerators.get(2);
|
||||
assertEquals(t.getElementName(), new String("t")); //$NON-NLS-1$
|
||||
assertEquals(t.getElementName(), "t"); //$NON-NLS-1$
|
||||
checkElementOffset(t);
|
||||
}
|
||||
|
||||
|
@ -313,28 +313,28 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// MyPackage ---> int v
|
||||
List nsVars = namespace.getChildrenOfType(ICElement.C_VARIABLE);
|
||||
IVariable var1 = (IVariable) nsVars.get(0);
|
||||
assertEquals(var1.getElementName(), new String("v")); //$NON-NLS-1$
|
||||
assertEquals(var1.getElementName(), "v"); //$NON-NLS-1$
|
||||
checkElementOffset(var1);
|
||||
assertEquals(var1.getTypeName(), new String("int")); //$NON-NLS-1$
|
||||
assertEquals(var1.getTypeName(), "int"); //$NON-NLS-1$
|
||||
checkLineNumbers(var1, 71, 71);
|
||||
|
||||
// MyPackage ---> unsigned long vuLong
|
||||
IVariable var2 = (IVariable) nsVars.get(1);
|
||||
assertEquals(var2.getElementName(), new String("vuLong")); //$NON-NLS-1$
|
||||
assertEquals(var2.getElementName(), "vuLong"); //$NON-NLS-1$
|
||||
checkElementOffset(var2);
|
||||
assertEquals(var2.getTypeName(), new String("unsigned long")); //$NON-NLS-1$
|
||||
assertEquals(var2.getTypeName(), "unsigned long"); //$NON-NLS-1$
|
||||
checkLineNumbers(var2, 73, 73);
|
||||
|
||||
// MyPackage ---> unsigned short vuShort
|
||||
IVariable var3 = (IVariable) nsVars.get(2);
|
||||
assertEquals(var3.getElementName(), new String("vuShort")); //$NON-NLS-1$
|
||||
assertEquals(var3.getElementName(), "vuShort"); //$NON-NLS-1$
|
||||
checkElementOffset(var3);
|
||||
assertEquals(var3.getTypeName(), new String("unsigned short")); //$NON-NLS-1$
|
||||
assertEquals(var3.getTypeName(), "unsigned short"); //$NON-NLS-1$
|
||||
checkLineNumbers(var3, 75, 75);
|
||||
|
||||
// MyPackage ---> function pointer: orig_malloc_hook
|
||||
IVariable vDecl2 = (IVariable) nsVars.get(3);
|
||||
assertEquals(vDecl2.getElementName(), new String("orig_malloc_hook")); //$NON-NLS-1$
|
||||
assertEquals(vDecl2.getElementName(), "orig_malloc_hook"); //$NON-NLS-1$
|
||||
checkElementOffset(vDecl2);
|
||||
assertEquals(vDecl2.getTypeName(), new String ("void*(*)(const char*, int, int)")); //$NON-NLS-1$
|
||||
checkLineNumbers(vDecl2, 81, 81);
|
||||
|
@ -345,9 +345,9 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// MyPackage ---> extern int evar
|
||||
List nsVarDecls = namespace.getChildrenOfType(ICElement.C_VARIABLE_DECLARATION);
|
||||
IVariableDeclaration vDecl1 = (IVariableDeclaration) nsVarDecls.get(0);
|
||||
assertEquals(vDecl1.getElementName(), new String("evar")); //$NON-NLS-1$
|
||||
assertEquals(vDecl1.getElementName(), "evar"); //$NON-NLS-1$
|
||||
checkElementOffset(vDecl1);
|
||||
assertEquals(vDecl1.getTypeName(), new String("int")); //$NON-NLS-1$
|
||||
assertEquals(vDecl1.getTypeName(), "int"); //$NON-NLS-1$
|
||||
checkLineNumbers(vDecl1, 79, 79);
|
||||
}
|
||||
|
||||
|
@ -356,30 +356,30 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
|
||||
// MyPackage ---> function: void foo()
|
||||
IFunctionDeclaration f1 = (IFunctionDeclaration) nsFunctionDeclarations.get(0);
|
||||
assertEquals(f1.getElementName(), new String("foo")); //$NON-NLS-1$
|
||||
assertEquals(f1.getElementName(), "foo"); //$NON-NLS-1$
|
||||
checkElementOffset(f1);
|
||||
assertEquals(f1.getReturnType(), new String("void")); //$NON-NLS-1$
|
||||
assertEquals(f1.getReturnType(), "void"); //$NON-NLS-1$
|
||||
checkLineNumbers(f1, 85, 85);
|
||||
|
||||
// MyPackage ---> function: char* foo(int&, char**)
|
||||
IFunctionDeclaration f2 = (IFunctionDeclaration) nsFunctionDeclarations.get(1);
|
||||
assertEquals(f2.getElementName(), new String("foo")); //$NON-NLS-1$
|
||||
assertEquals(f2.getElementName(), "foo"); //$NON-NLS-1$
|
||||
checkElementOffset(f2);
|
||||
assertEquals(f2.getReturnType(), new String("char*")); //$NON-NLS-1$
|
||||
assertEquals(f2.getReturnType(), "char*"); //$NON-NLS-1$
|
||||
checkLineNumbers(f2, 87, 88);
|
||||
int fooNumOfParam = f2.getNumberOfParameters();
|
||||
if(fooNumOfParam != 2)
|
||||
fail("foo should have two parameter!"); //$NON-NLS-1$
|
||||
String[] paramTypes = f2.getParameterTypes();
|
||||
assertEquals(paramTypes[0], new String("int&")); //$NON-NLS-1$
|
||||
assertEquals(paramTypes[1], new String("char**")); //$NON-NLS-1$
|
||||
assertEquals(paramTypes[0], "int&"); //$NON-NLS-1$
|
||||
assertEquals(paramTypes[1], "char**"); //$NON-NLS-1$
|
||||
|
||||
// MyPackage ---> function: void boo() {}
|
||||
List nsFunctions = namespace.getChildrenOfType(ICElement.C_FUNCTION);
|
||||
IFunction f3 = (IFunction) nsFunctions.get(0);
|
||||
assertEquals(f3.getElementName(), new String("boo")); //$NON-NLS-1$
|
||||
assertEquals(f3.getElementName(), "boo"); //$NON-NLS-1$
|
||||
checkElementOffset(f3);
|
||||
assertEquals(f3.getReturnType(), new String("void")); //$NON-NLS-1$
|
||||
assertEquals(f3.getReturnType(), "void"); //$NON-NLS-1$
|
||||
checkLineNumbers(f3, 90, 92);
|
||||
}
|
||||
|
||||
|
@ -392,9 +392,9 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
checkLineNumbers(struct1, 95, 97);
|
||||
List struct1Fields = struct1.getChildrenOfType(ICElement.C_FIELD);
|
||||
IField field1 = (IField) struct1Fields.get(0);
|
||||
assertEquals(field1.getElementName(), new String("sint")); //$NON-NLS-1$
|
||||
assertEquals(field1.getElementName(), "sint"); //$NON-NLS-1$
|
||||
checkElementOffset(field1);
|
||||
assertEquals(field1.getTypeName(), new String("int")); //$NON-NLS-1$
|
||||
assertEquals(field1.getTypeName(), "int"); //$NON-NLS-1$
|
||||
checkLineNumbers(field1, 96, 96);
|
||||
|
||||
if(field1.getVisibility() != ASTAccessVisibility.PUBLIC)
|
||||
|
@ -415,9 +415,9 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
checkLineNumbers(struct2, 101, 103);
|
||||
List struct2Fields = struct2.getChildrenOfType(ICElement.C_FIELD);
|
||||
IField field2 = (IField) struct2Fields.get(0);
|
||||
assertEquals(field2.getElementName(), new String("ss")); //$NON-NLS-1$
|
||||
assertEquals(field2.getElementName(), "ss"); //$NON-NLS-1$
|
||||
checkElementOffset(field2);
|
||||
assertEquals(field2.getTypeName(), new String("int")); //$NON-NLS-1$
|
||||
assertEquals(field2.getTypeName(), "int"); //$NON-NLS-1$
|
||||
checkLineNumbers(field2, 102, 102);
|
||||
if(field2.getVisibility() != ASTAccessVisibility.PUBLIC)
|
||||
fail("field visibility should be public!"); //$NON-NLS-1$
|
||||
|
@ -437,14 +437,14 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// union
|
||||
List nsUnions = namespace.getChildrenOfType(ICElement.C_UNION);
|
||||
IStructure u0 = (IStructure) nsUnions.get(0);
|
||||
assertEquals(u0.getElementName(), new String("U")); //$NON-NLS-1$
|
||||
assertEquals(u0.getElementName(), "U"); //$NON-NLS-1$
|
||||
checkElementOffset(u0);
|
||||
checkLineNumbers(u0, 105, 107);
|
||||
List u0Fields = u0.getChildrenOfType(ICElement.C_FIELD);
|
||||
IField field3 = (IField) u0Fields.get(0);
|
||||
assertEquals(field3.getElementName(), new String("U1")); //$NON-NLS-1$
|
||||
assertEquals(field3.getElementName(), "U1"); //$NON-NLS-1$
|
||||
checkElementOffset(field3);
|
||||
assertEquals(field3.getTypeName(), new String("int")); //$NON-NLS-1$
|
||||
assertEquals(field3.getTypeName(), "int"); //$NON-NLS-1$
|
||||
checkLineNumbers(field3, 106, 106);
|
||||
if(field3.getVisibility() != ASTAccessVisibility.PUBLIC)
|
||||
fail("field visibility should be public!"); //$NON-NLS-1$
|
||||
|
@ -454,10 +454,10 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// template function
|
||||
List functionTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_FUNCTION_DECLARATION);
|
||||
IFunctionTemplateDeclaration ft = (IFunctionTemplateDeclaration)functionTemplates.get(0);
|
||||
assertEquals(ft.getElementName(), new String("aTemplatedFunction")); //$NON-NLS-1$
|
||||
assertEquals(ft.getElementName(), "aTemplatedFunction"); //$NON-NLS-1$
|
||||
checkElementOffset(ft);
|
||||
ft.getTemplateSignature();
|
||||
assertEquals(ft.getTemplateSignature(), new String("aTemplatedFunction<A, B>(B) : A")); //$NON-NLS-1$
|
||||
assertEquals(ft.getTemplateSignature(), "aTemplatedFunction<A, B>(B) : A"); //$NON-NLS-1$
|
||||
checkLineNumbers(ft, 112, 113);
|
||||
|
||||
// template method
|
||||
|
@ -466,26 +466,26 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
checkLineNumbers(enclosingClass, 115, 120);
|
||||
List methodTemplates = enclosingClass.getChildrenOfType(ICElement.C_TEMPLATE_METHOD_DECLARATION);
|
||||
IMethodTemplateDeclaration mt = (IMethodTemplateDeclaration)methodTemplates.get(0);
|
||||
assertEquals(mt.getElementName(), new String("aTemplatedMethod")); //$NON-NLS-1$
|
||||
assertEquals(mt.getElementName(), "aTemplatedMethod"); //$NON-NLS-1$
|
||||
checkElementOffset(mt);
|
||||
assertEquals(mt.getTemplateSignature(), new String("aTemplatedMethod<A, B>(B) : A")); //$NON-NLS-1$
|
||||
assertEquals(mt.getTemplateSignature(), "aTemplatedMethod<A, B>(B) : A"); //$NON-NLS-1$
|
||||
checkLineNumbers(mt, 118, 119 );
|
||||
assertEquals(mt.getVisibility(), ASTAccessVisibility.PUBLIC);
|
||||
|
||||
// template class
|
||||
List classTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_CLASS);
|
||||
IStructureTemplate ct = (IStructureTemplate)classTemplates.get(0);
|
||||
assertEquals(ct.getElementName(), new String("myarray")); //$NON-NLS-1$
|
||||
assertEquals(ct.getElementName(), "myarray"); //$NON-NLS-1$
|
||||
checkElementOffset(ct);
|
||||
assertEquals(ct.getTemplateSignature(), new String("myarray<T, Tibor>")); //$NON-NLS-1$
|
||||
assertEquals(ct.getTemplateSignature(), "myarray<T, Tibor>"); //$NON-NLS-1$
|
||||
checkLineNumbers(ct, 122, 123);
|
||||
|
||||
// template struct
|
||||
List structTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_STRUCT);
|
||||
IStructureTemplate st = (IStructureTemplate)structTemplates.get(0);
|
||||
assertEquals(st.getElementName(), new String("mystruct")); //$NON-NLS-1$
|
||||
assertEquals(st.getElementName(), "mystruct"); //$NON-NLS-1$
|
||||
checkElementOffset(st);
|
||||
assertEquals(st.getTemplateSignature(), new String("mystruct<T, Tibor>")); //$NON-NLS-1$
|
||||
assertEquals(st.getTemplateSignature(), "mystruct<T, Tibor>"); //$NON-NLS-1$
|
||||
checkLineNumbers(st, 125, 126);
|
||||
|
||||
// moved to failed tests
|
||||
|
@ -493,9 +493,9 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// template variable
|
||||
// ArrayList variableTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_VARIABLE);
|
||||
// VariableTemplate vt = (VariableTemplate)variableTemplates.get(0);
|
||||
// assertEquals(vt.getElementName(), new String("default_alloc_template<__threads,__inst>::_S_start_free"));
|
||||
// assertEquals(vt.getElementName(), "default_alloc_template<__threads,__inst>::_S_start_free");
|
||||
// checkElementOffset((CElement)mac1);
|
||||
// assertEquals(vt.getTemplateSignature(), new String("default_alloc_template<__threads,__inst>::_S_start_free<bool, int> : char*"));
|
||||
// assertEquals(vt.getTemplateSignature(), "default_alloc_template<__threads,__inst>::_S_start_free<bool, int> : char*");
|
||||
// checkLineNumbers((CElement)vt, 128, 129);
|
||||
}
|
||||
|
||||
|
@ -503,24 +503,24 @@ public class StructuralCModelElementsTests extends BaseTestCase {
|
|||
// array variable
|
||||
List variables = tu.getChildrenOfType(ICElement.C_VARIABLE);
|
||||
IVariable arrayVar = (IVariable) variables.get(0);
|
||||
assertEquals(arrayVar.getElementName(), new String("myArray")); //$NON-NLS-1$
|
||||
assertEquals(arrayVar.getElementName(), "myArray"); //$NON-NLS-1$
|
||||
checkElementOffset(arrayVar);
|
||||
assertEquals(arrayVar.getTypeName(), new String("int[][]")); //$NON-NLS-1$
|
||||
assertEquals(arrayVar.getTypeName(), "int[][]"); //$NON-NLS-1$
|
||||
checkLineNumbers(arrayVar, 133, 133);
|
||||
|
||||
// array parameter in function main
|
||||
List functions = tu.getChildrenOfType(ICElement.C_FUNCTION);
|
||||
IFunction mainFunction = (IFunction) functions.get(0);
|
||||
assertEquals(mainFunction.getElementName(), new String("main")); //$NON-NLS-1$
|
||||
assertEquals(mainFunction.getElementName(), "main"); //$NON-NLS-1$
|
||||
checkElementOffset(mainFunction);
|
||||
assertEquals(mainFunction.getReturnType(), new String("int")); //$NON-NLS-1$
|
||||
assertEquals(mainFunction.getReturnType(), "int"); //$NON-NLS-1$
|
||||
checkLineNumbers(mainFunction, 134, 136);
|
||||
int NumOfParam = mainFunction.getNumberOfParameters();
|
||||
if(NumOfParam != 2)
|
||||
fail("main should have two parameter!"); //$NON-NLS-1$
|
||||
String[] paramTypes = mainFunction.getParameterTypes();
|
||||
assertEquals(paramTypes[0], new String("int")); //$NON-NLS-1$
|
||||
assertEquals(paramTypes[1], new String("char*[]")); //$NON-NLS-1$
|
||||
assertEquals(paramTypes[0], "int"); //$NON-NLS-1$
|
||||
assertEquals(paramTypes[1], "char*[]"); //$NON-NLS-1$
|
||||
|
||||
}
|
||||
private void checkLineNumbers(ICElement element, int startLine, int endLine) throws CModelException {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2013 IBM Corporation and others.
|
||||
* Copyright (c) 2005, 2016 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -99,8 +99,8 @@ public class AST2KnRTests extends AST2TestBase {
|
|||
assertEquals(decls[0], ((IASTStandardFunctionDeclarator) f1.getDeclarators()[0]).getParameters()[0].getDeclarator().getName());
|
||||
assertEquals(decls[1], ((IASTSimpleDeclaration) ((ICASTKnRFunctionDeclarator) f2.getDeclarator()).getParameterDeclarations()[0]).getDeclarators()[0].getName());
|
||||
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("f").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) f2.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("x").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "f".toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) f2.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "x".toCharArray())); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void testSimpleKRCTest2() throws Exception {
|
||||
|
@ -130,8 +130,8 @@ public class AST2KnRTests extends AST2TestBase {
|
|||
assertEquals(decls.length, 1);
|
||||
assertEquals(decls[0], ((IASTSimpleDeclaration) ((ICASTKnRFunctionDeclarator) f2.getDeclarator()).getParameterDeclarations()[0]).getDeclarators()[0].getName());
|
||||
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("f").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) f2.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("x").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "f".toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) f2.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "x".toCharArray())); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void testSimpleKRCTest3() throws Exception {
|
||||
|
@ -198,9 +198,9 @@ public class AST2KnRTests extends AST2TestBase {
|
|||
assertEquals(decls.length, 1);
|
||||
assertEquals(decls[0], x1.getName());
|
||||
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("isroot").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) isroot_def.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("x").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) isroot_def.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("y").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "isroot".toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) isroot_def.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "x".toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) isroot_def.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "y".toCharArray())); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void testKRCWithTypes() throws Exception {
|
||||
|
@ -252,9 +252,9 @@ public class AST2KnRTests extends AST2TestBase {
|
|||
assertEquals(decls.length, 1);
|
||||
assertEquals(decls[0], x2);
|
||||
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("c").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("isroot").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) isroot_def.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("x").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "c".toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "isroot".toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) isroot_def.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "x".toCharArray())); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void testKRCProblem1() throws Exception {
|
||||
|
@ -497,10 +497,10 @@ public class AST2KnRTests extends AST2TestBase {
|
|||
assertEquals(decls.length, 1);
|
||||
assertEquals(decls[0], x2);
|
||||
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_TAG, new String("A_struct").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("A").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("f").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) f_def.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, new String("x").toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_TAG, "A_struct".toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "A".toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) tu.getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "f".toCharArray())); //$NON-NLS-1$
|
||||
assertNotNull(((CScope) ((IASTCompoundStatement) f_def.getBody()).getScope()).getBinding(CScope.NAMESPACE_TYPE_OTHER, "x".toCharArray())); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void testKRC_monop_cards2() throws Exception {
|
||||
|
|
|
@ -315,29 +315,29 @@ public class AST2Tests extends AST2TestBase {
|
|||
|
||||
// // test clearBindings
|
||||
// assertNotNull(((ICScope) tu.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("x").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "x".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNotNull(((ICScope) tu.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("f").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "f".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNotNull(((ICScope) body_f.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("z").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "z".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNotNull(((ICScope) body_f.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("y").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "y".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// CVisitor.clearBindings(tu);
|
||||
// assertNull(((ICScope) tu.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("x").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "x".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNull(((ICScope) tu.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("f").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "f".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNull(((ICScope) body_f.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("z").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "z".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNull(((ICScope) body_f.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("y").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "y".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
|
||||
tu = validateCopy(tu);
|
||||
|
@ -883,29 +883,29 @@ public class AST2Tests extends AST2TestBase {
|
|||
assertEquals(decls[0], declaration2.getDeclarators()[0].getName());
|
||||
|
||||
// assertNotNull(((ICScope) tu.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_TAG, new String("x").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_TAG, "x".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNotNull(((ICScope) tu.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("f").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "f".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNotNull(((ICScope) compound.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("x").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "x".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNotNull(((ICScope) compound.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("i").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "i".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// CVisitor.clearBindings(tu);
|
||||
// assertNull(((ICScope) tu.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_TAG, new String("x").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_TAG, "x".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNull(((ICScope) tu.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("f").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "f".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNull(((ICScope) compound.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("x").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "x".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
// assertNull(((ICScope) compound.getScope()).getBinding(
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, new String("i").toCharArray()));
|
||||
// ICScope.NAMESPACE_TYPE_OTHER, "i".toCharArray()));
|
||||
// //$NON-NLS-1$
|
||||
|
||||
tu = validateCopy(tu);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005 IBM Corporation and others.
|
||||
* Copyright (c) 2005, 2016 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -87,7 +87,7 @@ public class ExpectedStrings {
|
|||
}
|
||||
public String getMissingString() {
|
||||
int x;
|
||||
String missing = new String("Missing elements: ");
|
||||
String missing = "Missing elements: ";
|
||||
for (x=0;x<expStrings.length;x++) {
|
||||
if (foundStrings[x]==false)
|
||||
missing+=expStrings[x];
|
||||
|
@ -96,7 +96,7 @@ public class ExpectedStrings {
|
|||
return(missing);
|
||||
}
|
||||
public String getExtraString() {
|
||||
String extra= new String("Extra elements: ");
|
||||
String extra= "Extra elements: ";
|
||||
while (!extraStrings.empty()) {
|
||||
extra+=extraStrings.pop();
|
||||
extra+=" ";
|
||||
|
|
|
@ -159,7 +159,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
|||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return new String("Lock container"); //$NON-NLS-1$
|
||||
return "Lock container"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||
* Copyright (c) 2000, 2016 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -333,7 +333,7 @@ public class ElfHelper {
|
|||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
return new String(""); //$NON-NLS-1$
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public Sizes getSizes() throws IOException {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2009 QNX Software Systems and others.
|
||||
* Copyright (c) 2000, 2016 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -288,7 +288,7 @@ public class MachOHelper {
|
|||
// }
|
||||
|
||||
public String getQnxUsage() throws IOException {
|
||||
return new String(""); //$NON-NLS-1$
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public Sizes getSizes() throws IOException {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2009 QNX Software Systems and others.
|
||||
* Copyright (c) 2000, 2016 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -286,7 +286,7 @@ public class MachOHelper64 {
|
|||
// }
|
||||
|
||||
public String getQnxUsage() throws IOException {
|
||||
return new String(""); //$NON-NLS-1$
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public Sizes getSizes() throws IOException {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005 IBM Corporation and others.
|
||||
* Copyright (c) 2005, 2016 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -87,7 +87,7 @@ public class ExpectedStrings {
|
|||
}
|
||||
public String getMissingString() {
|
||||
int x;
|
||||
String missing = new String("Missing elements: ");
|
||||
String missing = "Missing elements: ";
|
||||
for (x=0;x<expStrings.length;x++) {
|
||||
if (foundStrings[x]==false)
|
||||
missing+=expStrings[x];
|
||||
|
@ -96,7 +96,7 @@ public class ExpectedStrings {
|
|||
return(missing);
|
||||
}
|
||||
public String getExtraString() {
|
||||
String extra= new String("Extra elements: ");
|
||||
String extra= "Extra elements: ";
|
||||
while (!extraStrings.empty()) {
|
||||
extra+=extraStrings.pop();
|
||||
extra+=" ";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2012 IBM Corporation and others.
|
||||
* Copyright (c) 2000, 2016 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -48,76 +48,76 @@ public class CBreakIteratorTest extends BreakIteratorTest {
|
|||
}
|
||||
|
||||
public void testNextLn() {
|
||||
String s= new String("word \n" +
|
||||
" word2");
|
||||
String s= "word \n" +
|
||||
" word2";
|
||||
assertNextPositions(s, new int[] { 4, 5, 6, 8, 13 });
|
||||
}
|
||||
|
||||
public void testMultiNextLn() {
|
||||
String s= new String("word \n" +
|
||||
String s= "word \n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" word2");
|
||||
" word2";
|
||||
assertNextPositions(s, new int[] { 4, 5, 6, 7, 8, 10, 15 });
|
||||
}
|
||||
|
||||
public void testMultiNextLn2() {
|
||||
String s= new String("word \r\n" +
|
||||
String s= "word \r\n" +
|
||||
"\r\n" +
|
||||
"\r\n" +
|
||||
" word2");
|
||||
" word2";
|
||||
assertNextPositions(s, new int[] { 4, 5, 7, 9, 11, 13, 18 });
|
||||
}
|
||||
|
||||
public void testNextCamelCaseWord() {
|
||||
String s= new String(" _isURLConnection_pool ");
|
||||
String s= " _isURLConnection_pool ";
|
||||
assertNextPositions(s, new int[] { 3, 4, 6, 9, 20, 24, 27 });
|
||||
}
|
||||
|
||||
public void testPrevious1() {
|
||||
String s= new String("word word");
|
||||
String s= "word word";
|
||||
assertPreviousPositions(s, new int[] { 0, 4, 5 });
|
||||
}
|
||||
|
||||
public void testPrevious2() {
|
||||
String s= new String("wordWord word");
|
||||
String s= "wordWord word";
|
||||
assertPreviousPositions(s, new int[] { 0, 4, 8, 9 });
|
||||
}
|
||||
|
||||
public void testPreviousSpace() {
|
||||
String s= new String(" word ");
|
||||
String s= " word ";
|
||||
assertPreviousPositions(s, new int[] { 1, 5 });
|
||||
}
|
||||
|
||||
public void testPreviousParen() {
|
||||
String s= new String("word(params)");
|
||||
String s= "word(params)";
|
||||
assertPreviousPositions(s, new int[] { 0, 4, 5, 11 });
|
||||
}
|
||||
|
||||
public void testPreviousLn() {
|
||||
String s= new String("word \n" +
|
||||
" word2");
|
||||
String s= "word \n" +
|
||||
" word2";
|
||||
assertPreviousPositions(s, new int[] { 0, 4, 5, 6, 8 });
|
||||
}
|
||||
|
||||
public void testMultiPreviousLn() {
|
||||
String s= new String("word \n" +
|
||||
String s= "word \n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" word2");
|
||||
" word2";
|
||||
assertPreviousPositions(s, new int[] { 0, 4, 5, 6, 7, 8, 10 });
|
||||
}
|
||||
|
||||
public void testMultiPreviousLn2() {
|
||||
String s= new String("word \r\n" +
|
||||
String s= "word \r\n" +
|
||||
"\r\n" +
|
||||
"\r\n" +
|
||||
" word2");
|
||||
" word2";
|
||||
assertPreviousPositions(s, new int[] { 0, 4, 5, 7, 9, 11, 13 });
|
||||
}
|
||||
|
||||
public void testPreviousCamelCaseWord() {
|
||||
String s= new String(" _isURLConnection_pool ");
|
||||
String s= " _isURLConnection_pool ";
|
||||
assertPreviousPositions(s, new int[] { 0, 3, 4, 6, 9, 20, 24 });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2012 IBM Corporation and others.
|
||||
* Copyright (c) 2000, 2016 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -48,76 +48,76 @@ public class CWordIteratorTest extends BreakIteratorTest {
|
|||
}
|
||||
|
||||
public void testNextLn() {
|
||||
String s= new String("word \n" +
|
||||
" word2");
|
||||
String s= "word \n" +
|
||||
" word2";
|
||||
assertNextPositions(s, new int[] { 5, 6, 8, 13 });
|
||||
}
|
||||
|
||||
public void testMultiNextLn() {
|
||||
String s= new String("word \n" +
|
||||
String s= "word \n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" word2");
|
||||
" word2";
|
||||
assertNextPositions(s, new int[] { 5, 6, 7, 8, 10, 15 });
|
||||
}
|
||||
|
||||
public void testMultiNextLn2() {
|
||||
String s= new String("word \r\n" +
|
||||
String s= "word \r\n" +
|
||||
"\r\n" +
|
||||
"\r\n" +
|
||||
" word2");
|
||||
" word2";
|
||||
assertNextPositions(s, new int[] { 5, 7, 9, 11, 13, 18 });
|
||||
}
|
||||
|
||||
public void testNextCamelCaseWord() {
|
||||
String s= new String(" _isURLConnection_pool ");
|
||||
String s= " _isURLConnection_pool ";
|
||||
assertNextPositions(s, new int[] { 3, 4, 6, 9, 20, 27 });
|
||||
}
|
||||
|
||||
public void testPrevious1() {
|
||||
String s= new String("word word");
|
||||
String s= "word word";
|
||||
assertPreviousPositions(s, new int[] { 0, 5 });
|
||||
}
|
||||
|
||||
public void testPrevious2() {
|
||||
String s= new String("wordWord word");
|
||||
String s= "wordWord word";
|
||||
assertPreviousPositions(s, new int[] { 0, 4, 9 });
|
||||
}
|
||||
|
||||
public void testPreviousSpace() {
|
||||
String s= new String(" word ");
|
||||
String s= " word ";
|
||||
assertPreviousPositions(s, new int[] { 1 });
|
||||
}
|
||||
|
||||
public void testPreviousParen() {
|
||||
String s= new String("word(params)");
|
||||
String s= "word(params)";
|
||||
assertPreviousPositions(s, new int[] { 0, 4, 5, 11 });
|
||||
}
|
||||
|
||||
public void testPreviousLn() {
|
||||
String s= new String("word \n" +
|
||||
" word2");
|
||||
String s= "word \n" +
|
||||
" word2";
|
||||
assertPreviousPositions(s, new int[] { 0, 5, 6, 8 });
|
||||
}
|
||||
|
||||
public void testMultiPreviousLn() {
|
||||
String s= new String("word \n" +
|
||||
String s= "word \n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" word2");
|
||||
" word2";
|
||||
assertPreviousPositions(s, new int[] { 0, 5, 6, 7, 8, 10 });
|
||||
}
|
||||
|
||||
public void testMultiPreviousLn2() {
|
||||
String s= new String("word \r\n" +
|
||||
String s= "word \r\n" +
|
||||
"\r\n" +
|
||||
"\r\n" +
|
||||
" word2");
|
||||
" word2";
|
||||
assertPreviousPositions(s, new int[] { 0, 5, 7, 9, 11, 13 });
|
||||
}
|
||||
|
||||
public void testPreviousCamelCaseWord() {
|
||||
String s= new String(" _isURLConnection_pool ");
|
||||
String s= " _isURLConnection_pool ";
|
||||
assertPreviousPositions(s, new int[] { 0, 3, 4, 6, 9, 20 });
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Symbian Software Limited and others.
|
||||
* Copyright (c) 2007, 2016 Symbian Software Limited and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -17,9 +17,9 @@ package org.eclipse.cdt.ui.templateengine.uitree;
|
|||
*/
|
||||
public class IPatternMatchingTable {
|
||||
|
||||
public static final String TEXT = new String("Text"); //$NON-NLS-1$
|
||||
public static final String FREETEXT = new String("FreeText"); //$NON-NLS-1$
|
||||
public static final String FILENAME = new String("FileName"); //$NON-NLS-1$
|
||||
public static final String TEXT = "Text"; //$NON-NLS-1$
|
||||
public static final String FREETEXT = "FreeText"; //$NON-NLS-1$
|
||||
public static final String FILENAME = "FileName"; //$NON-NLS-1$
|
||||
public static final String TEXTPATTERNVALUE = "[A-Za-z0-9\\!\\?\\.: ]*"; //$NON-NLS-1$
|
||||
public static final String FREETEXTPATTERNVALUE = "[A-Za-z0-9() \\.\\s]*"; //$NON-NLS-1$
|
||||
public static final String FILEPATTERNVALUE = "([A-Za-z][:])?[[\\|\\\\|/]?[_!@#\\$%\\^()\\-+{}\\[\\]=;',A-Za-z0-9\\. ]*]*"; //$NON-NLS-1$
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010, 2012 Ericsson and others.
|
||||
* Copyright (c) 2010, 2016 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -119,7 +119,7 @@ public class CollectAction extends AbstractTracepointAction {
|
|||
|
||||
@Override
|
||||
public String getMemento() {
|
||||
String collectData = new String(""); //$NON-NLS-1$
|
||||
String collectData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010, 2012 Ericsson and others.
|
||||
* Copyright (c) 2010, 2016 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -57,7 +57,7 @@ public class EvaluateAction extends AbstractTracepointAction {
|
|||
|
||||
@Override
|
||||
public String getMemento() {
|
||||
String collectData = new String(""); //$NON-NLS-1$
|
||||
String collectData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010, 2011 Ericsson and others.
|
||||
* Copyright (c) 2010, 2016 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -141,7 +141,7 @@ public class TracepointActionManager {
|
|||
}
|
||||
|
||||
public void saveActionData() {
|
||||
String actionData = new String(""); //$NON-NLS-1$
|
||||
String actionData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010, 2012 Ericsson and others.
|
||||
* Copyright (c) 2010, 2016 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -93,7 +93,7 @@ public class WhileSteppingAction extends AbstractTracepointAction {
|
|||
|
||||
@Override
|
||||
public String getMemento() {
|
||||
String collectData = new String(""); //$NON-NLS-1$
|
||||
String collectData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue