Commit bce75956 authored by Kristof Szabados's avatar Kristof Szabados
Browse files

append char as char


Signed-off-by: Kristof Szabados's avatarkristof <Kristof.Szabados@ericsson.com>
parent d78c0207
......@@ -121,7 +121,7 @@ public final class ErrorReporter {
public static String stackTraceToString(final StackTraceElement[] elements) {
final StringBuilder builder = new StringBuilder();
for (final StackTraceElement element : elements) {
builder.append(element).append("\n");
builder.append(element).append('\n');
}
return builder.toString();
}
......
......@@ -245,7 +245,7 @@ public final class ParserLogger {
final int tokenType = expectedTokens.get( i );
sb.append( getTokenName( tokenType, aTokenNameResolver ) );
}
sb.append("]");
sb.append(']');
if ( e instanceof NoViableAltException ) {
final NoViableAltException nvae = (NoViableAltException)e;
sb.append( ", start token: " + getTokenInfo( nvae.getStartToken(), aTokenNameResolver ) );
......@@ -293,7 +293,7 @@ public final class ParserLogger {
try {
sb.append( getEscapedTokenText( aTokens.get( i ) ) );
} catch ( IndexOutOfBoundsException e ) {
sb.append("_");
sb.append('_');
}
}
return sb.toString();
......@@ -345,9 +345,9 @@ public final class ParserLogger {
sb.append( tokenName );
sb.append( ": " );
sb.append( "'" );
sb.append( '\'' );
sb.append( getEscapedTokenText( aToken ) );
sb.append( "'" );
sb.append( '\'' );
sb.append( ", @" + aToken.getTokenIndex() );
sb.append( ", " + aToken.getLine() + ":" + aToken.getCharPositionInLine() );
......@@ -546,9 +546,9 @@ public final class ParserLogger {
final String className = aSte.getClassName();
final String shortClassName = className.substring( className.lastIndexOf('.') + 1 );
aSb.append( shortClassName );
aSb.append( "." );
aSb.append( '.' );
aSb.append( aSte.getMethodName() );
aSb.append( ":" );
aSb.append( ':' );
aSb.append( aSte.getLineNumber() );
}
......
......@@ -269,7 +269,7 @@ public final class Value_Assignment extends ASN1Assignment {
source.append( "final " );
String typeGeneratedName = type.getGenNameValue( aData, source, getMyScope() );
source.append( typeGeneratedName );
source.append( " " );
source.append( ' ' );
source.append( genName );
source.append( " = new " );
source.append( typeGeneratedName );
......
......@@ -344,7 +344,7 @@ public abstract class Assignment extends ASTNode implements IOutlineElement, ILo
// TODO also check for the special module once ASN.1 is needed
if(!myModule.equals(scope.getModuleScope())) {
//TODO properly prefix the setting with the module's Java reference
returnValue.append(myModule.getName()).append(".");
returnValue.append(myModule.getName()).append('.');
}
if (prefix != null) {
......
......@@ -141,7 +141,7 @@ public abstract class Setting extends ASTNode implements ISetting {
if(!myModule.equals(scope.getModuleScope()) && !SpecialASN1Module.isSpecAsss(myModule)) {
//TODO properly prefix the setting with the module's Java reference
returnValue.append(myModule.getName()).append(".");
returnValue.append(myModule.getName()).append('.');
}
returnValue.append( getGenNameOwn());
......
......@@ -930,13 +930,13 @@ public final class Def_Function extends Definition implements IParameterisedAssi
//TODO fatal error
}
source.append( " " );
source.append( ' ' );
// function name
source.append( genName );
// arguments
source.append( "(" );
source.append( '(' );
if ( formalParList != null ) {
formalParList.generateCode( aData, source );
}
......
......@@ -400,7 +400,7 @@ public final class Def_ModulePar extends Definition {
source.append( "final " );
String typeGeneratedName = type.getGenNameValue( aData, source, getMyScope() );
source.append( typeGeneratedName );
source.append( " " );
source.append( ' ' );
source.append( genName );
source.append( " = new " );
source.append( typeGeneratedName );
......
......@@ -576,7 +576,7 @@ public final class Def_Testcase extends Definition implements IParameterisedAssi
source.append( genName );
// arguments
source.append( "(" );
source.append( '(' );
if ( formalParList != null && formalParList.getNofParameters() > 0) {
formalParList.generateCode( aData, source );
source.append(", ");
......
......@@ -660,7 +660,7 @@ public final class For_Loop_Definitions extends Assignments implements ILocateab
if ( definitions != null ) {
for ( Definition definition : definitions ) {
definition.generateCodeString( aData, source );
source.append( "\n" );
source.append( '\n' );
}
}
}
......
......@@ -1019,7 +1019,7 @@ public final class FormalParameter extends Definition {
//TODO fatal error
}
source.append( " " );
source.append( ' ' );
// parameter name
source.append( getGenName() );
......
......@@ -1150,7 +1150,7 @@ public class FormalParameterList extends TTCN3Scope implements ILocateableNode,
if ( size == 0 ) {
return;
}
source.append( " " );
source.append( ' ' );
for ( int i = 0; i < size; i++ ) {
final FormalParameter parameter = parameters.get( i );
if ( i > 0 ) {
......@@ -1158,7 +1158,7 @@ public class FormalParameterList extends TTCN3Scope implements ILocateableNode,
}
parameter.generateCodeString( aData, source );
}
source.append( " " );
source.append( ' ' );
}
/** Generates the Java equivalent of the formal parameter list.
......
......@@ -1308,7 +1308,7 @@ public abstract class TTCN3Template extends GovernedSimple implements IReference
*/
public void generateCodeInit( final JavaGenData aData, final StringBuilder source, final String name ) {
//default implementation
source.append( "\t" );
source.append( '\t' );
source.append( "//TODO: " );
source.append( getClass().getSimpleName() );
source.append( ".generateCodeInit() is not implemented!\n" );
......@@ -1327,7 +1327,7 @@ public abstract class TTCN3Template extends GovernedSimple implements IReference
* */
public void reArrangeInitCode(final JavaGenData aData, final StringBuilder source, final Module usageModule) {
// default implementation
source.append("\t");
source.append('\t');
source.append("//TODO: ");
source.append(getClass().getSimpleName());
source.append(".reArrangeInitCode() is not implemented!\n");
......
......@@ -638,7 +638,7 @@ public class UnionGenerator {
source.append("}\n");
source.append("}\n");
source.append("\n");
source.append('\n');
source.append("\t@Override\n");
source.append( MessageFormat.format( "\tpublic TitanBoolean match(final Base_Type otherValue, final boolean legacy) '{'\n", genName ) );
source.append( MessageFormat.format( "\tif (otherValue instanceof {0}) '{'\n", genName) );
......
......@@ -1582,7 +1582,7 @@ public abstract class Type extends Governor implements IType, IIncrementallyUpda
*/
public void generateCode( final JavaGenData aData, final StringBuilder source ) {
//default implementation
source.append( "\t" );
source.append( '\t' );
source.append( "//TODO: " );
source.append( getClass().getSimpleName() );
source.append( ".generateCode() is not implemented!\n" );
......@@ -1621,7 +1621,7 @@ public abstract class Type extends Governor implements IType, IIncrementallyUpda
*/
public String getGenNameValue(final JavaGenData aData, final StringBuilder source, final Scope scope) {
//TODO: default implementation, should be replace with fatal_error once finished
source.append( "\t" );
source.append( '\t' );
source.append( "//TODO: " );
source.append( getClass().getSimpleName() );
source.append( ".getGenNameValue() might not be implemented yet!\n" );
......
......@@ -103,13 +103,13 @@ public class ProjectSourceCompiler {
contentBuilder.append("unknown");
}
//TODO date will need to be simplified to have optimize build time
// aSb.append(") on ").append(new Date()).append("\n");
// aSb.append(") on ").append(new Date()).append('\n');
contentBuilder.append(")\n");
contentBuilder.append("\n" );
contentBuilder.append( "// ").append(GeneralConstants.COPYRIGHT_STRING).append("\n" );
contentBuilder.append("\n" );
contentBuilder.append('\n' );
contentBuilder.append( "// ").append(GeneralConstants.COPYRIGHT_STRING).append('\n' );
contentBuilder.append('\n' );
contentBuilder.append( "// Do not edit this file unless you know what you are doing.\n" );
contentBuilder.append("\n" );
contentBuilder.append('\n' );
contentBuilder.append( "package " );
contentBuilder.append( PACKAGE_GENERATED_ROOT );
contentBuilder.append( ";\n\n" );
......@@ -213,13 +213,13 @@ public class ProjectSourceCompiler {
aSb.append("unknown");
}
//TODO date will need to be simplified to have optimize build time
// aSb.append(") on ").append(new Date()).append("\n");
// aSb.append(") on ").append(new Date()).append('\n');
aSb.append(")\n");
aSb.append("\n" );
aSb.append( "// ").append(GeneralConstants.COPYRIGHT_STRING).append("\n" );
aSb.append("\n" );
aSb.append('\n' );
aSb.append( "// ").append(GeneralConstants.COPYRIGHT_STRING).append('\n' );
aSb.append('\n' );
aSb.append( "// Do not edit this file unless you know what you are doing.\n" );
aSb.append("\n" );
aSb.append('\n' );
aSb.append( "package " );
aSb.append( PACKAGE_GENERATED_ROOT );
aSb.append( ";\n\n" );
......@@ -239,7 +239,7 @@ public class ProjectSourceCompiler {
for ( String importName : aData.getImports() ) {
writeImport( aSb, importName );
}
aSb.append( "\n" );
aSb.append( '\n' );
}
/**
......@@ -253,18 +253,18 @@ public class ProjectSourceCompiler {
*/
private static void writeFooter( final JavaGenData aData) {
StringBuilder aSb = aData.getSrc();
aSb.append("\n" );
aSb.append("public void pre_init_module()").append("\n" );
aSb.append("{").append("\n" );
aSb.append('\n' );
aSb.append("public void pre_init_module()").append('\n' );
aSb.append("{").append('\n' );
aSb.append(aData.getPreInit());
aSb.append("").append("\n" );
aSb.append("}").append("\n" );
aSb.append("").append('\n' );
aSb.append("}").append('\n' );
aSb.append("public void post_init_module()").append("\n" );
aSb.append("{").append("\n" );
aSb.append("public void post_init_module()").append('\n' );
aSb.append("{").append('\n' );
aSb.append(aData.getPostInit());
aSb.append("").append("\n" );
aSb.append("}").append("\n" );
aSb.append("").append('\n' );
aSb.append("}").append('\n' );
aSb.append("public boolean init_comp_type(final String component_type, final boolean init_base_comps)\n");
aSb.append("{\n");
......
......@@ -602,7 +602,7 @@ public final class InternalMakefileGenerator {
if (referencingProjects != null && referencingProjects.length > 0) {
builder.append(" The project `").append(reachableProject.getName()).append("' is referenced directly by");
for (IProject referencingProject : referencingProjects) {
builder.append(" `").append(referencingProject.getName()).append("'");
builder.append(" `").append(referencingProject.getName()).append('\'');
}
}
ErrorReporter.logError(builder.toString());
......@@ -909,12 +909,12 @@ public final class InternalMakefileGenerator {
contents.append("ARFLAGS = \n\n");
contents.append("# Flags for the TTCN-3 and ASN.1 compiler:\n");
contents.append("# ").append(TITANFlagsOptionsData.getTITANFlagComments(project, useRuntime2)).append("\n");
contents.append("# ").append(TITANFlagsOptionsData.getTITANFlagComments(project, useRuntime2)).append('\n');
contents.append("COMPILER_FLAGS = ").append(TITANFlagsOptionsData.getTITANFlags(project, useRuntime2)).append("\n\n");
contents.append("# Execution mode: ");
contents.append(useRuntime2 ? "function" : "load").append(" test runtime in ");
contents.append(singleMode ? "single" : "parallel").append(" mode");
contents.append(dynamicLinking ? " with dynamic linking" : "").append("\n");
contents.append(dynamicLinking ? " with dynamic linking" : "").append('\n');
contents.append("TTCN3_LIB = ttcn3");
if (useRuntime2) {
contents.append("-rt2");
......@@ -2008,19 +2008,19 @@ public final class InternalMakefileGenerator {
for (ModuleStruct module : ttcn3Modules) {
String dirName = module.getDirectory();
if (dirName != null && dir.getDirectoryName().equals(dirName)) {
contents.append(' ').append(dir.name()).append("/").append(module.getFileName());
contents.append(' ').append(dir.name()).append('/').append(module.getFileName());
}
}
for (ModuleStruct module : ttcnppModules) {
String dirName = module.getDirectory();
if (dirName != null && dir.getDirectoryName().equals(dirName)) {
contents.append(' ').append(dir.name()).append("/").append(module.getFileName());
contents.append(' ').append(dir.name()).append('/').append(module.getFileName());
}
}
for (ModuleStruct module : asn1modules) {
String dirName = module.getDirectory();
if (dirName != null && dir.getDirectoryName().equals(dirName)) {
contents.append(' ').append(dir.name()).append("/").append(module.getFileName());
contents.append(' ').append(dir.name()).append('/').append(module.getFileName());
}
}
} else {
......
......@@ -47,7 +47,7 @@ public final class IndentationSupport {
} else if (PreferenceConstantValues.TAB_POLICY_2.equals(tabPolicy)) {
final StringBuilder sb = new StringBuilder(8);
for (int i = 0; i < indentSize; i++) {
sb.append(" ");
sb.append(' ');
}
indentationString = sb.toString();
} else {
......
......@@ -40,7 +40,7 @@ public final class LoggerTreeLabelProvider extends LabelProvider {
String pluginPath = lte.getLsh().componentPlugin(lte.getComponentName(), lte.getPluginName()).getPluginPath();
if (pluginPath != null && !"".equals(pluginPath)) {
StringBuffer sb = new StringBuffer();
sb.append(lte.getPluginName()).append(" (").append(pluginPath).append(")");
sb.append(lte.getPluginName()).append(" (").append(pluginPath).append(')');
return sb.toString();
}
......
......@@ -285,7 +285,7 @@ public final class LoggingTreeSubPage {
final StringBuilder pluginBuilder = new StringBuilder();
pluginBuilder.append(pluginName);
if (path != null && path.length() != 0) {
pluginBuilder.append(" := \"").append(path).append("\"");
pluginBuilder.append(" := \"").append(path).append('\"');
}
/*
......@@ -305,7 +305,7 @@ public final class LoggingTreeSubPage {
entry.setLoggerPluginsRoot( loggerPluginsRoot );
final StringBuilder builder = new StringBuilder();
builder.append("\n").append(componentName).append(".LoggerPlugins := ");
builder.append('\n').append(componentName).append(".LoggerPlugins := ");
ConfigTreeNodeUtilities.addChild( loggerPluginsRoot, new AddedParseTree( builder.toString() ) );
ConfigTreeNodeUtilities.addChild( loggerPluginsRoot, new AddedParseTree("{") );
......
......@@ -712,7 +712,7 @@ public abstract class BaseExecutor {
}
} catch (CoreException e) {
filesThatCanNotBeDeleted.append(resource.getName());
filesThatCanNotBeDeleted.append("\n");
filesThatCanNotBeDeleted.append('\n');
}
}
folder.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment