From 79ad4369adbb747a84ee27cd714e5e44f5e98b2a Mon Sep 17 00:00:00 2001 From: FilippoR Date: Thu, 9 Jun 2022 13:00:55 +0200 Subject: [PATCH] make dto final --- .../plugins/v7/DtoToMessageConverter.java | 8 +- .../plugins/v7/MessageToDtoConverter.java | 67 +++++---- .../eclipse/java/plugins/dto/Attachment.java | 18 +-- .../eclipse/java/plugins/dto/Duration.java | 4 +- .../eclipse/java/plugins/dto/Envelope.java | 34 ++--- .../java/plugins/dto/GherkinDocument.java | 128 +++++++++--------- .../eclipse/java/plugins/dto/Hook.java | 8 +- .../eclipse/java/plugins/dto/Location.java | 4 +- .../eclipse/java/plugins/dto/Meta.java | 32 ++--- .../java/plugins/dto/ParameterType.java | 10 +- .../eclipse/java/plugins/dto/ParseError.java | 4 +- .../eclipse/java/plugins/dto/Pickle.java | 32 ++--- .../eclipse/java/plugins/dto/Source.java | 6 +- .../java/plugins/dto/SourceReference.java | 8 +- .../java/plugins/dto/StepDefinition.java | 6 +- .../eclipse/java/plugins/dto/TestCase.java | 6 +- .../java/plugins/dto/TestCaseFinished.java | 6 +- .../java/plugins/dto/TestCaseStarted.java | 8 +- .../java/plugins/dto/TestRunFinished.java | 6 +- .../java/plugins/dto/TestRunStarted.java | 2 +- .../java/plugins/dto/TestStepFinished.java | 14 +- .../java/plugins/dto/TestStepStarted.java | 6 +- .../eclipse/java/plugins/dto/Timestamp.java | 4 +- .../plugins/dto/UndefinedParameterType.java | 4 +- 24 files changed, 221 insertions(+), 204 deletions(-) diff --git a/io.cucumber.eclipse.java.plugins.v7/src/io/cucumber/eclipse/java/plugins/v7/DtoToMessageConverter.java b/io.cucumber.eclipse.java.plugins.v7/src/io/cucumber/eclipse/java/plugins/v7/DtoToMessageConverter.java index 613ecaf8..9db84d84 100644 --- a/io.cucumber.eclipse.java.plugins.v7/src/io/cucumber/eclipse/java/plugins/v7/DtoToMessageConverter.java +++ b/io.cucumber.eclipse.java.plugins.v7/src/io/cucumber/eclipse/java/plugins/v7/DtoToMessageConverter.java @@ -41,6 +41,7 @@ import io.cucumber.messages.types.RuleChild; import io.cucumber.messages.types.Scenario; import io.cucumber.messages.types.Source; +import io.cucumber.messages.types.SourceMediaType; import io.cucumber.messages.types.SourceReference; import io.cucumber.messages.types.Step; import io.cucumber.messages.types.StepDefinition; @@ -310,10 +311,15 @@ public static Attachment convert(io.cucumber.eclipse.java.plugins.dto.Attachment return null; return new Attachment(d.body, AttachmentContentEncoding.fromValue(d.contentEncoding), - d.fileName, d.mediaType, convert(d.source), + d.fileName, d.mediaType, convert1(d.source), d.testCaseStartedId, d.testStepId, d.url); } + private static Source convert1(io.cucumber.eclipse.java.plugins.dto.SourceReference d) { + // TODO Auto-generated method stub + return new Source(d.uri, d.javaMethod.methodName, null); + } + public static Comment convert(io.cucumber.eclipse.java.plugins.dto.GherkinDocument.Comment d) { if (d == null) return null; diff --git a/io.cucumber.eclipse.java.plugins.v7/src/io/cucumber/eclipse/java/plugins/v7/MessageToDtoConverter.java b/io.cucumber.eclipse.java.plugins.v7/src/io/cucumber/eclipse/java/plugins/v7/MessageToDtoConverter.java index 56cd4bac..e17e4811 100644 --- a/io.cucumber.eclipse.java.plugins.v7/src/io/cucumber/eclipse/java/plugins/v7/MessageToDtoConverter.java +++ b/io.cucumber.eclipse.java.plugins.v7/src/io/cucumber/eclipse/java/plugins/v7/MessageToDtoConverter.java @@ -66,8 +66,7 @@ public class MessageToDtoConverter { public static Envelope convert(io.cucumber.messages.types.Envelope d) { if (d == null) return null; - return new Envelope( - d.getAttachment().map(MessageToDtoConverter::convert).orElse(null), + return new Envelope(d.getAttachment().map(MessageToDtoConverter::convert).orElse(null), d.getGherkinDocument().map(MessageToDtoConverter::convert).orElse(null), d.getHook().map(MessageToDtoConverter::convert).orElse(null), d.getMeta().map(MessageToDtoConverter::convert).orElse(null), @@ -212,7 +211,8 @@ public static Source convert(io.cucumber.messages.types.Source d) { public static Pickle convert(io.cucumber.messages.types.Pickle d) { if (d == null) return null; - return new Pickle(d.getId(), d.getUri(), d.getName(), d.getLanguage(), convertList(d.getSteps(), MessageToDtoConverter::convert), + return new Pickle(d.getId(), d.getUri(), d.getName(), d.getLanguage(), + convertList(d.getSteps(), MessageToDtoConverter::convert), convertList(d.getTags(), MessageToDtoConverter::convert), d.getAstNodeIds()); } @@ -225,7 +225,8 @@ public static PickleTag convert(io.cucumber.messages.types.PickleTag d) { public static PickleStep convert(io.cucumber.messages.types.PickleStep d) { if (d == null) return null; - return new PickleStep(convert(d.getArgument().orElse(null)), d.getAstNodeIds(), d.getId(),/*d.getType().map(PickleStepType::value).orElse(null)*/null, d.getText()); + return new PickleStep(convert(d.getArgument().orElse(null)), d.getAstNodeIds(), d.getId(), + /* d.getType().map(PickleStepType::value).orElse(null) */null, d.getText()); } public static PickleStepArgument convert(io.cucumber.messages.types.PickleStepArgument d) { @@ -267,21 +268,22 @@ public static ParseError convert(io.cucumber.messages.types.ParseError d) { public static ParameterType convert(io.cucumber.messages.types.ParameterType d) { if (d == null) return null; - return new ParameterType(d.getName(), d.getRegularExpressions(), d.getPreferForRegularExpressionMatch(), d.getUseForSnippets(), - d.getId()); + return new ParameterType(d.getName(), d.getRegularExpressions(), d.getPreferForRegularExpressionMatch(), + d.getUseForSnippets(), d.getId()); } public static Meta convert(io.cucumber.messages.types.Meta d) { if (d == null) return null; - return new Meta(d.getProtocolVersion(), convert(d.getImplementation()), convert(d.getRuntime()), convert(d.getOs()), convert(d.getCpu()), - convert(d.getCi().orElse(null))); + return new Meta(d.getProtocolVersion(), convert(d.getImplementation()), convert(d.getRuntime()), + convert(d.getOs()), convert(d.getCpu()), convert(d.getCi().orElse(null))); } public static Ci convert(io.cucumber.messages.types.Ci d) { if (d == null) return null; - return new Ci(d.getName(), d.getUrl().orElse(null), d.getBuildNumber().orElse(null), convert(d.getGit().orElse(null))); + return new Ci(d.getName(), d.getUrl().orElse(null), d.getBuildNumber().orElse(null), + convert(d.getGit().orElse(null))); } public static Git convert(io.cucumber.messages.types.Git d) { @@ -299,13 +301,15 @@ public static Product convert(io.cucumber.messages.types.Product d) { public static Hook convert(io.cucumber.messages.types.Hook d) { if (d == null) return null; - return new Hook(d.getId(), d.getName().orElse(null), convert(d.getSourceReference()), d.getTagExpression().orElse(null)); + return new Hook(d.getId(), d.getName().orElse(null), convert(d.getSourceReference()), + d.getTagExpression().orElse(null)); } public static SourceReference convert(io.cucumber.messages.types.SourceReference d) { if (d == null) return null; - return new SourceReference(d.getUri().orElse(null), convert(d.getJavaMethod().orElse(null)), convert(d.getJavaStackTraceElement().orElse(null)), convert(d.getLocation().orElse(null))); + return new SourceReference(d.getUri().orElse(null), convert(d.getJavaMethod().orElse(null)), + convert(d.getJavaStackTraceElement().orElse(null)), convert(d.getLocation().orElse(null))); } public static JavaMethod convert(io.cucumber.messages.types.JavaMethod d) { @@ -323,8 +327,15 @@ public static JavaStackTraceElement convert(io.cucumber.messages.types.JavaStack public static Attachment convert(io.cucumber.messages.types.Attachment d) { if (d == null) return null; - return new Attachment(d.getBody(), d.getContentEncoding().value(), d.getFileName().orElse(null), d.getMediaType(), convert(d.getSource().orElse(null)), - d.getTestCaseStartedId().orElse(null), d.getTestStepId().orElse(null), d.getUrl().orElse(null)); + return new Attachment(d.getBody(), d.getContentEncoding().value(), d.getFileName().orElse(null), + d.getMediaType(), convert1(d.getSource().orElse(null)), d.getTestCaseStartedId().orElse(null), + d.getTestStepId().orElse(null), d.getUrl().orElse(null)); + } + + private static SourceReference convert1(io.cucumber.messages.types.Source d) { + if (d == null) + return null; + return new SourceReference(d.getUri(), null, null, null); } public static Comment convert(io.cucumber.messages.types.Comment d) { @@ -336,8 +347,8 @@ public static Comment convert(io.cucumber.messages.types.Comment d) { public static Feature convert(io.cucumber.messages.types.Feature d) { if (d == null) return null; - return new Feature(convert(d.getLocation()), - convertList(d.getTags(), MessageToDtoConverter::convert), d.getLanguage(), d.getKeyword(), d.getName(), d.getDescription(), + return new Feature(convert(d.getLocation()), convertList(d.getTags(), MessageToDtoConverter::convert), + d.getLanguage(), d.getKeyword(), d.getName(), d.getDescription(), convertList(d.getChildren(), MessageToDtoConverter::convert)); } @@ -357,8 +368,8 @@ public static FeatureChild convert(io.cucumber.messages.types.FeatureChild d) { public static Scenario convert(io.cucumber.messages.types.Scenario d) { if (d == null) return null; - return new Scenario(convert(d.getLocation()), - convertList(d.getTags(), MessageToDtoConverter::convert), d.getKeyword(), d.getName(), d.getDescription(), + return new Scenario(convert(d.getLocation()), convertList(d.getTags(), MessageToDtoConverter::convert), + d.getKeyword(), d.getName(), d.getDescription(), convertList(d.getSteps(), MessageToDtoConverter::convert), convertList(d.getExamples(), MessageToDtoConverter::convert), d.getId()); } @@ -366,16 +377,16 @@ public static Scenario convert(io.cucumber.messages.types.Scenario d) { public static Examples convert(io.cucumber.messages.types.Examples d) { if (d == null) return null; - return new Examples(convert(d.getLocation()), - convertList(d.getTags(), MessageToDtoConverter::convert), d.getKeyword(), d.getName(), d.getDescription(), - convert(d.getTableHeader().orElse(null)), convertList(d.getTableBody(), MessageToDtoConverter::convert), d.getId()); + return new Examples(convert(d.getLocation()), convertList(d.getTags(), MessageToDtoConverter::convert), + d.getKeyword(), d.getName(), d.getDescription(), convert(d.getTableHeader().orElse(null)), + convertList(d.getTableBody(), MessageToDtoConverter::convert), d.getId()); } public static Rule convert(io.cucumber.messages.types.Rule d) { if (d == null) return null; - return new Rule(convert(d.getLocation()), - convertList(d.getTags(), MessageToDtoConverter::convert), d.getKeyword(), d.getName(), d.getDescription(), + return new Rule(convert(d.getLocation()), convertList(d.getTags(), MessageToDtoConverter::convert), + d.getKeyword(), d.getName(), d.getDescription(), convertList(d.getChildren(), MessageToDtoConverter::convert), d.getId()); } @@ -396,8 +407,9 @@ public static Background convert(io.cucumber.messages.types.Background d) { public static Step convert(io.cucumber.messages.types.Step d) { if (d == null) return null; - return new Step(convert(d.getLocation()), d.getKeyword(),/*d.getKeywordType().map(t->t.value()).orElse(null)*/null, d.getText(), convert(d.getDocString().orElse(null)), - convert(d.getDataTable().orElse(null)), d.getId()); + return new Step(convert(d.getLocation()), d.getKeyword(), + /* d.getKeywordType().map(t->t.value()).orElse(null) */null, d.getText(), + convert(d.getDocString().orElse(null)), convert(d.getDataTable().orElse(null)), d.getId()); } public static DocString convert(io.cucumber.messages.types.DocString d) { @@ -409,15 +421,14 @@ public static DocString convert(io.cucumber.messages.types.DocString d) { public static DataTable convert(io.cucumber.messages.types.DataTable d) { if (d == null) return null; - return new DataTable(convert(d.getLocation()), - convertList(d.getRows(), MessageToDtoConverter::convert)); + return new DataTable(convert(d.getLocation()), convertList(d.getRows(), MessageToDtoConverter::convert)); } public static TableRow convert(io.cucumber.messages.types.TableRow d) { if (d == null) return null; - return new TableRow(convert(d.getLocation()), - convertList(d.getCells(), MessageToDtoConverter::convert), d.getId()); + return new TableRow(convert(d.getLocation()), convertList(d.getCells(), MessageToDtoConverter::convert), + d.getId()); } public static TableCell convert(io.cucumber.messages.types.TableCell d) { diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Attachment.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Attachment.java index 773073f0..1291ed26 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Attachment.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Attachment.java @@ -4,16 +4,16 @@ public class Attachment implements Serializable{ - public String body; - public String contentEncoding; - public String fileName; - public String mediaType; - public Source source; - public String testCaseStartedId; - public String testStepId; - public String url; + public final String body; + public final String contentEncoding; + public final String fileName; + public final String mediaType; + public final SourceReference source; + public final String testCaseStartedId; + public final String testStepId; + public final String url; public Attachment(String body, String contentEncoding, String fileName, String mediaType, - Source source, String testCaseStartedId, String testStepId, String url) { + SourceReference source, String testCaseStartedId, String testStepId, String url) { this.body = body; this.contentEncoding = contentEncoding; this.fileName = fileName; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Duration.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Duration.java index 40f5a96c..83de970a 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Duration.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Duration.java @@ -3,8 +3,8 @@ import java.io.Serializable; public class Duration implements Serializable{ - public Long seconds; - public Long nanos; + public final Long seconds; + public final Long nanos; public Duration(Long seconds, Long nanos) { this.seconds = seconds; this.nanos = nanos; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Envelope.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Envelope.java index b88d954c..773ed6ba 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Envelope.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Envelope.java @@ -3,23 +3,23 @@ import java.io.Serializable; public final class Envelope implements Serializable{ - public Attachment attachment; - public GherkinDocument gherkinDocument; - public Hook hook; - public Meta meta; - public ParameterType parameterType; - public ParseError parseError; - public Pickle pickle; - public Source source; - public StepDefinition stepDefinition; - public TestCase testCase; - public TestCaseFinished testCaseFinished; - public TestCaseStarted testCaseStarted; - public TestRunFinished testRunFinished; - public TestRunStarted testRunStarted; - public TestStepFinished testStepFinished; - public TestStepStarted testStepStarted; - public UndefinedParameterType undefinedParameterType; + public final Attachment attachment; + public final GherkinDocument gherkinDocument; + public final Hook hook; + public final Meta meta; + public final ParameterType parameterType; + public final ParseError parseError; + public final Pickle pickle; + public final Source source; + public final StepDefinition stepDefinition; + public final TestCase testCase; + public final TestCaseFinished testCaseFinished; + public final TestCaseStarted testCaseStarted; + public final TestRunFinished testRunFinished; + public final TestRunStarted testRunStarted; + public final TestStepFinished testStepFinished; + public final TestStepStarted testStepStarted; + public final UndefinedParameterType undefinedParameterType; public Envelope(Attachment attachment, GherkinDocument gherkinDocument, Hook hook, Meta meta, ParameterType parameterType, ParseError parseError, Pickle pickle, Source source, diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/GherkinDocument.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/GherkinDocument.java index 76c23680..c8c02fda 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/GherkinDocument.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/GherkinDocument.java @@ -9,13 +9,13 @@ public class GherkinDocument implements Serializable { public java.util.List comments; public static class Feature implements Serializable { - public Location location; - public java.util.List tags; - public String language; - public String keyword; - public String name; - public String description; - public java.util.List children; + public final Location location; + public final java.util.List tags; + public final String language; + public final String keyword; + public final String name; + public final String description; + public final java.util.List children; public Feature(Location location, List tags, String language, String keyword, String name, String description, List children) { this.location = location; @@ -29,9 +29,9 @@ public Feature(Location location, List tags, String language, String keywor } public static class Tag implements Serializable { - public Location location; - public String name; - public String id; + public final Location location; + public final String name; + public final String id; public Tag(Location location, String name, String id) { this.location = location; this.name = name; @@ -40,9 +40,9 @@ public Tag(Location location, String name, String id) { } public static class FeatureChild implements Serializable { - public Rule rule; - public Background background; - public Scenario scenario; + public final Rule rule; + public final Background background; + public final Scenario scenario; public FeatureChild(Rule rule, Background background, Scenario scenario) { this.rule = rule; this.background = background; @@ -51,13 +51,13 @@ public FeatureChild(Rule rule, Background background, Scenario scenario) { } public static class Rule implements Serializable { - public Location location; - public java.util.List tags; - public String keyword; - public String name; - public String description; - public java.util.List children; - public String id; + public final Location location; + public final java.util.List tags; + public final String keyword; + public final String name; + public final String description; + public final java.util.List children; + public final String id; public Rule(Location location, List tags, String keyword, String name, String description, List children, String id) { this.location = location; @@ -73,8 +73,8 @@ public Rule(Location location, List tags, String keyword, String name, Stri } public static class RuleChild implements Serializable { - public Background background; - public Scenario scenario; + public final Background background; + public final Scenario scenario; public RuleChild(Background background, Scenario scenario) { this.background = background; this.scenario = scenario; @@ -83,12 +83,12 @@ public RuleChild(Background background, Scenario scenario) { } public static class Background implements Serializable { - public Location location; - public String keyword; - public String name; - public String description; - public java.util.List steps; - public String id; + public final Location location; + public final String keyword; + public final String name; + public final String description; + public final java.util.List steps; + public final String id; public Background(Location location, String keyword, String name, String description, List steps, String id) { this.location = location; @@ -101,13 +101,13 @@ public Background(Location location, String keyword, String name, String descrip } public static class Step implements Serializable { - public Location location; - public String keyword; - public String text; - public DocString docString; - public DataTable dataTable; - public String id; - public String keywordType; + public final Location location; + public final String keyword; + public final String text; + public final DocString docString; + public final DataTable dataTable; + public final String id; + public final String keywordType; public Step(Location location, String keyword,String keywordType, String text, DocString docString, DataTable dataTable, String id) { this.location = location; @@ -122,8 +122,8 @@ public Step(Location location, String keyword,String keywordType, String text, D } public static class Comment implements Serializable { - public Location location; - public String text; + public final Location location; + public final String text; public Comment(Location location, String text) { this.location = location; this.text = text; @@ -131,8 +131,8 @@ public Comment(Location location, String text) { } public static class DataTable implements Serializable { - public Location location; - public java.util.List rows; + public final Location location; + public final java.util.List rows; public DataTable(Location location, List rows) { this.location = location; this.rows = rows; @@ -140,9 +140,9 @@ public DataTable(Location location, List rows) { } public static class TableRow implements Serializable { - public Location location; - public java.util.List cells; - public String id; + public final Location location; + public final java.util.List cells; + public final String id; public TableRow(Location location, List cells, String id) { this.location = location; this.cells = cells; @@ -151,8 +151,8 @@ public TableRow(Location location, List cells, String id) { } public static class TableCell implements Serializable { - public Location location; - public String value; + public final Location location; + public final String value; public TableCell(Location location, String value) { this.location = location; this.value = value; @@ -160,10 +160,10 @@ public TableCell(Location location, String value) { } public static class DocString implements Serializable { - public Location location; - public String mediaType; - public String content; - public String delimiter; + public final Location location; + public final String mediaType; + public final String content; + public final String delimiter; public DocString(Location location, String mediaType, String content, String delimiter) { this.location = location; this.mediaType = mediaType; @@ -173,14 +173,14 @@ public DocString(Location location, String mediaType, String content, String del } public static class Scenario implements Serializable { - public Location location; - public java.util.List tags; - public String keyword; - public String name; - public String description; - public java.util.List steps; - public java.util.List examples; - public String id; + public final Location location; + public final java.util.List tags; + public final String keyword; + public final String name; + public final String description; + public final java.util.List steps; + public final java.util.List examples; + public final String id; public Scenario(Location location, List tags, String keyword, String name, String description, List steps, List examples, String id) { this.location = location; @@ -195,14 +195,14 @@ public Scenario(Location location, List tags, String keyword, String name, } public static class Examples implements Serializable { - public Location location; - public java.util.List tags; - public String keyword; - public String name; - public String description; - public TableRow tableHeader; - public java.util.List tableBody; - public String id; + public final Location location; + public final java.util.List tags; + public final String keyword; + public final String name; + public final String description; + public final TableRow tableHeader; + public final java.util.List tableBody; + public final String id; public Examples(Location location, List tags, String keyword, String name, String description, TableRow tableHeader, List tableBody, String id) { this.location = location; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Hook.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Hook.java index eabff0ba..e925ed3e 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Hook.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Hook.java @@ -3,10 +3,10 @@ import java.io.Serializable; public class Hook implements Serializable{ - public String id; - public String name; - public SourceReference sourceReference; - public String tagExpression; + public final String id; + public final String name; + public final SourceReference sourceReference; + public final String tagExpression; public Hook(String id, String name, SourceReference sourceReference, String tagExpression) { this.id = id; this.name = name; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Location.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Location.java index dc2f19b1..ba496210 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Location.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Location.java @@ -3,8 +3,8 @@ import java.io.Serializable; public class Location implements Serializable { - public Long line; - public Long column; + public final Long line; + public final Long column; public Location(Long line, Long column) { this.line = line; this.column = column; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Meta.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Meta.java index 9626195e..040f992a 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Meta.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Meta.java @@ -3,18 +3,18 @@ import java.io.Serializable; public class Meta implements Serializable{ - public String protocolVersion; - public Product implementation; - public Product runtime; - public Product os; - public Product cpu; - public Ci ci; + public final String protocolVersion; + public final Product implementation; + public final Product runtime; + public final Product os; + public final Product cpu; + public final Ci ci; public static class Ci implements Serializable{ - public String name; - public String url; - public String buildNumber; - public Git git; + public final String name; + public final String url; + public final String buildNumber; + public final Git git; public Ci(String name, String url, String buildNumber, Git git) { this.name = name; this.url = url; @@ -24,10 +24,10 @@ public Ci(String name, String url, String buildNumber, Git git) { } public static class Git implements Serializable{ - public String remote; - public String revision; - public String branch; - public String tag; + public final String remote; + public final String revision; + public final String branch; + public final String tag; public Git(String remote, String revision, String branch, String tag) { this.remote = remote; this.revision = revision; @@ -37,8 +37,8 @@ public Git(String remote, String revision, String branch, String tag) { } public static class Product implements Serializable{ - public String name; - public String version; + public final String name; + public final String version; public Product(String name, String version) { this.name = name; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/ParameterType.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/ParameterType.java index c0bb2a69..f4718337 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/ParameterType.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/ParameterType.java @@ -5,11 +5,11 @@ public class ParameterType implements Serializable{ - public String name; - public java.util.List regularExpressions; - public Boolean preferForRegularExpressionMatch; - public Boolean useForSnippets; - public String id; + public final String name; + public final java.util.List regularExpressions; + public final Boolean preferForRegularExpressionMatch; + public final Boolean useForSnippets; + public final String id; public ParameterType(String name, List regularExpressions, Boolean preferForRegularExpressionMatch, Boolean useForSnippets, String id) { this.name = name; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/ParseError.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/ParseError.java index 6c71f74c..9e475306 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/ParseError.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/ParseError.java @@ -3,8 +3,8 @@ import java.io.Serializable; public class ParseError implements Serializable { - public SourceReference source; - public String message; + public final SourceReference source; + public final String message; public ParseError(SourceReference source, String message) { this.source = source; this.message = message; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Pickle.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Pickle.java index b1dd0274..ad2e3fef 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Pickle.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Pickle.java @@ -5,13 +5,13 @@ public class Pickle implements Serializable{ - public String id; - public String uri; - public String name; - public String language; - public java.util.List steps; - public java.util.List tags; - public java.util.List astNodeIds; + public final String id; + public final String uri; + public final String name; + public final String language; + public final java.util.List steps; + public final java.util.List tags; + public final java.util.List astNodeIds; public static class PickleStep implements Serializable{ @@ -30,8 +30,8 @@ public PickleStep(PickleStepArgument argument, List astNodeIds, String i } public static class PickleStepArgument implements Serializable { - public PickleDocString docString; - public PickleTable dataTable; + public final PickleDocString docString; + public final PickleTable dataTable; public PickleStepArgument(PickleDocString docString, PickleTable dataTable) { this.docString = docString; this.dataTable = dataTable; @@ -39,8 +39,8 @@ public PickleStepArgument(PickleDocString docString, PickleTable dataTable) { } public static class PickleDocString implements Serializable{ - public String mediaType; - public String content; + public final String mediaType; + public final String content; public PickleDocString(String mediaType, String content) { this.mediaType = mediaType; this.content = content; @@ -48,7 +48,7 @@ public PickleDocString(String mediaType, String content) { } public static class PickleTable implements Serializable{ - public java.util.List rows; + public final java.util.List rows; public PickleTable(List rows) { this.rows = rows; @@ -56,7 +56,7 @@ public PickleTable(List rows) { } public static class PickleTableRow implements Serializable { - public java.util.List cells; + public final java.util.List cells; public PickleTableRow(List cells) { this.cells = cells; @@ -64,7 +64,7 @@ public PickleTableRow(List cells) { } public static class PickleTableCell implements Serializable{ - public String value; + public final String value; public PickleTableCell(String value) { this.value = value; @@ -72,8 +72,8 @@ public PickleTableCell(String value) { } public static class PickleTag implements Serializable{ - public String name; - public String astNodeId; + public final String name; + public final String astNodeId; public PickleTag(String name, String astNodeId) { this.name = name; this.astNodeId = astNodeId; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Source.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Source.java index 34c09ffa..3c697e0a 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Source.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Source.java @@ -4,9 +4,9 @@ public class Source implements Serializable { - public String uri; - public String data; - public String mediaType; + public final String uri; + public final String data; + public final String mediaType; public Source(String uri, String data, String mediaType) { this.uri = uri; this.data = data; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/SourceReference.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/SourceReference.java index 05d1c250..7a857872 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/SourceReference.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/SourceReference.java @@ -4,10 +4,10 @@ import java.util.List; public class SourceReference implements Serializable{ - public String uri; - public JavaMethod javaMethod; - public JavaStackTraceElement javaStackTraceElement; - public Location location; + public final String uri; + public final JavaMethod javaMethod; + public final JavaStackTraceElement javaStackTraceElement; + public final Location location; public static class JavaMethod implements Serializable{ public String className; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/StepDefinition.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/StepDefinition.java index 60e9fe2e..a0fead73 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/StepDefinition.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/StepDefinition.java @@ -4,9 +4,9 @@ public class StepDefinition implements Serializable{ - public String id; - public StepDefinitionPattern pattern; - public SourceReference sourceReference; + public final String id; + public final StepDefinitionPattern pattern; + public final SourceReference sourceReference; public static class StepDefinitionPattern implements Serializable{ public String source; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCase.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCase.java index 25cdf20f..ac8a2237 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCase.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCase.java @@ -5,9 +5,9 @@ public class TestCase implements Serializable{ - public String id; - public String pickleId; - public java.util.List testSteps; + public final String id; + public final String pickleId; + public final java.util.List testSteps; public static class TestStep implements Serializable { public String hookId; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCaseFinished.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCaseFinished.java index bf648cca..d29f60c1 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCaseFinished.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCaseFinished.java @@ -4,9 +4,9 @@ public class TestCaseFinished implements Serializable { - public String testCaseStartedId; - public Timestamp timestamp; - public Boolean willBeRetried; + public final String testCaseStartedId; + public final Timestamp timestamp; + public final Boolean willBeRetried; public TestCaseFinished(String testCaseStartedId, Timestamp timestamp, Boolean willBeRetried) { this.testCaseStartedId = testCaseStartedId; this.timestamp = timestamp; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCaseStarted.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCaseStarted.java index 382c01a1..62c00e37 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCaseStarted.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestCaseStarted.java @@ -3,10 +3,10 @@ import java.io.Serializable; public class TestCaseStarted implements Serializable{ - public Long attempt; - public String id; - public String testCaseId; - public Timestamp timestamp; + public final Long attempt; + public final String id; + public final String testCaseId; + public final Timestamp timestamp; public TestCaseStarted(Long attempt, String id, String testCaseId, Timestamp timestamp) { this.attempt = attempt; this.id = id; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestRunFinished.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestRunFinished.java index 87ef8bdd..8172651e 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestRunFinished.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestRunFinished.java @@ -4,9 +4,9 @@ public class TestRunFinished implements Serializable { - public String message; - public Boolean success; - public Timestamp timestamp; + public final String message; + public final Boolean success; + public final Timestamp timestamp; public TestRunFinished(String message, Boolean success, Timestamp timestamp) { this.message = message; this.success = success; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestRunStarted.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestRunStarted.java index e4609b82..9a54abc4 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestRunStarted.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestRunStarted.java @@ -4,7 +4,7 @@ public class TestRunStarted implements Serializable { - public Timestamp timestamp; + public final Timestamp timestamp; public TestRunStarted(Timestamp timestamp) { this.timestamp = timestamp; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestStepFinished.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestStepFinished.java index 4f39bf24..85fddb4a 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestStepFinished.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestStepFinished.java @@ -5,15 +5,15 @@ public class TestStepFinished implements Serializable { - public String testCaseStartedId; - public String testStepId; - public TestStepResult testStepResult; - public Timestamp timestamp; + public final String testCaseStartedId; + public final String testStepId; + public final TestStepResult testStepResult; + public final Timestamp timestamp; public static class TestStepResult implements Serializable { - public Duration duration; - public String message; - public String status; + public final Duration duration; + public final String message; + public final String status; public TestStepResult(Duration duration, String message, String status) { this.duration = duration; this.message = message; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestStepStarted.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestStepStarted.java index 166a642f..b0cca429 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestStepStarted.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/TestStepStarted.java @@ -4,9 +4,9 @@ public class TestStepStarted implements Serializable{ - public String testCaseStartedId; - public String testStepId; - public Timestamp timestamp; + public final String testCaseStartedId; + public final String testStepId; + public final Timestamp timestamp; public TestStepStarted(String testCaseStartedId, String testStepId, Timestamp timestamp) { this.testCaseStartedId = testCaseStartedId; this.testStepId = testStepId; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Timestamp.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Timestamp.java index 9c7a6a14..27c5e36a 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Timestamp.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/Timestamp.java @@ -3,8 +3,8 @@ import java.io.Serializable; public class Timestamp implements Serializable { - public Long seconds; - public Long nanos; + public final Long seconds; + public final Long nanos; public Timestamp(Long seconds, Long nanos) { this.seconds = seconds; this.nanos = nanos; diff --git a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/UndefinedParameterType.java b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/UndefinedParameterType.java index 97fa720d..77fcea6d 100644 --- a/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/UndefinedParameterType.java +++ b/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/dto/UndefinedParameterType.java @@ -4,8 +4,8 @@ public class UndefinedParameterType implements Serializable{ - public String expression; - public String name; + public final String expression; + public final String name; public UndefinedParameterType(String expression, String name) { this.expression = expression;