Skip to content

Commit 71f792d

Browse files
committed
Code cleanup (2)
1 parent 750f29b commit 71f792d

11 files changed

Lines changed: 45 additions & 45 deletions

File tree

api-generator/generator-interfaces/src/main/java/esa/mo/tools/stubgen/MOTypeInformation.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ----------------------------------------------------------------------------
2-
* Copyright (C) 2013 European Space Agency
2+
* Copyright (C) 2026 European Space Agency
33
* European Space Operations Centre
44
* Darmstadt
55
* Germany
@@ -30,8 +30,8 @@
3030

3131
/**
3232
* {@link TypeInformation} implementation that composes a neutral
33-
* {@link MOTypeRegistry} for type classification and renders the fully qualified
34-
* type names using a {@link GeneratorConfiguration}.
33+
* {@link MOTypeRegistry} for type classification and renders the fully
34+
* qualified type names using a {@link GeneratorConfiguration}.
3535
* <p>
3636
* The rendering is driven entirely by the supplied configuration (package
3737
* prefix, naming separator, structure folder), so a generator for a different
@@ -170,7 +170,6 @@ public String convertToNamespace(String targetType) {
170170
// Convenience lookups delegating to the composed registry, so a single
171171
// type object covers all type queries used by the generators and helpers.
172172
// ------------------------------------------------------------------------
173-
174173
/**
175174
* Returns enumeration details if enumeration type.
176175
*

api-generator/generator-interfaces/src/main/java/esa/mo/tools/stubgen/MOTypeRegistry.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ----------------------------------------------------------------------------
2-
* Copyright (C) 2013 European Space Agency
2+
* Copyright (C) 2026 European Space Agency
33
* European Space Operations Centre
44
* Darmstadt
55
* Germany
@@ -47,8 +47,9 @@
4747
* native type, and lookups for their details).
4848
* <p>
4949
* It deliberately knows nothing about how types are rendered in any target
50-
* language; that is the job of a {@link esa.mo.tools.stubgen.specification.TypeInformation}
51-
* implementation, which composes this registry.
50+
* language; that is the job of a
51+
* {@link esa.mo.tools.stubgen.specification.TypeInformation} implementation,
52+
* which composes this registry.
5253
*/
5354
public class MOTypeRegistry {
5455

api-generator/generator-interfaces/src/main/java/esa/mo/tools/stubgen/StubUtils.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
package esa.mo.tools.stubgen;
2222

2323
import esa.mo.tools.stubgen.specification.CompositeField;
24+
import static esa.mo.tools.stubgen.specification.InteractionPatternEnum.INVOKE_OP;
25+
import static esa.mo.tools.stubgen.specification.InteractionPatternEnum.PROGRESS_OP;
26+
import static esa.mo.tools.stubgen.specification.InteractionPatternEnum.REQUEST_OP;
27+
import static esa.mo.tools.stubgen.specification.InteractionPatternEnum.SEND_OP;
28+
import static esa.mo.tools.stubgen.specification.InteractionPatternEnum.SUBMIT_OP;
29+
import esa.mo.tools.stubgen.specification.OperationSummary;
2430
import java.io.File;
2531
import java.io.FileInputStream;
2632
import java.io.FileNotFoundException;
@@ -300,4 +306,21 @@ public static List<CompositeField> concatenateArguments(
300306

301307
return firstArg;
302308
}
309+
310+
public static String createConsumerPatternCall(OperationSummary op) {
311+
switch (op.getPattern()) {
312+
case SEND_OP:
313+
return "send";
314+
case SUBMIT_OP:
315+
return "submit";
316+
case REQUEST_OP:
317+
return "request";
318+
case INVOKE_OP:
319+
return "invoke";
320+
case PROGRESS_OP:
321+
return "progress";
322+
}
323+
324+
return null;
325+
}
303326
}

api-generator/generator-interfaces/src/main/java/esa/mo/tools/stubgen/specification/OperationSummary.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import esa.mo.xsd.OperationErrorList;
2525
import esa.mo.xsd.OperationType;
2626
import esa.mo.xsd.PubSubOperationType;
27-
import esa.mo.xsd.SubmitOperationType;
2827
import java.util.List;
2928

3029
/**

api-generator/generator-interfaces/src/main/java/esa/mo/tools/stubgen/writers/InterfaceMethodBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ----------------------------------------------------------------------------
2-
* Copyright (C) 2013 European Space Agency
2+
* Copyright (C) 2026 European Space Agency
33
* European Space Operations Centre
44
* Darmstadt
55
* Germany

api-generator/generator-interfaces/src/main/java/esa/mo/tools/stubgen/writers/MethodBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ----------------------------------------------------------------------------
2-
* Copyright (C) 2013 European Space Agency
2+
* Copyright (C) 2026 European Space Agency
33
* European Space Operations Centre
44
* Darmstadt
55
* Germany

api-generator/generator-java/src/main/java/esa/mo/tools/stubgen/GeneratorJava.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ protected void createFolderComment(ClassWriter file, String area,
398398
@Override
399399
public CompositeField createCompositeElementsDetails(TargetWriter file, boolean checkType,
400400
String fieldName, TypeReference elementType, boolean isStructure, boolean canBeNull, String comment) {
401-
JavaCompositeFields javaComposites = new JavaCompositeFields(this, typeInformation);
401+
JavaCompositeFields javaComposites = new JavaCompositeFields(typeInformation);
402402
return javaComposites.createCompositeElementsDetails((LanguageWriter) file,
403403
checkType, fieldName, elementType, isStructure, canBeNull, comment);
404404
}

api-generator/generator-java/src/main/java/esa/mo/tools/stubgen/GeneratorLangs.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,23 +1512,6 @@ public String checkForReservedWords(String arg) {
15121512
return (replacementWord != null) ? replacementWord : arg;
15131513
}
15141514

1515-
public static String createConsumerPatternCall(OperationSummary op) {
1516-
switch (op.getPattern()) {
1517-
case SEND_OP:
1518-
return "send";
1519-
case SUBMIT_OP:
1520-
return "submit";
1521-
case REQUEST_OP:
1522-
return "request";
1523-
case INVOKE_OP:
1524-
return "invoke";
1525-
case PROGRESS_OP:
1526-
return "progress";
1527-
}
1528-
1529-
return null;
1530-
}
1531-
15321515
public String getOperationInstanceType(OperationSummary op) {
15331516
switch (op.getPattern()) {
15341517
case SEND_OP:

api-generator/generator-java/src/main/java/esa/mo/tools/stubgen/java/JavaClassWriter.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,10 @@ public MethodWriter addMethodOpenStatementOverride(CompositeField rtype,
322322
}
323323

324324
@Override
325-
public MethodWriter addMethodOpenStatement(boolean isFinal,
326-
boolean isStatic, String scope,
327-
CompositeField rtype, String methodName, List<CompositeField> args,
328-
String throwsSpec, String comment, String returnComment, List<String> throwsComment,
329-
boolean isDeprecated) throws IOException {
325+
public MethodWriter addMethodOpenStatement(boolean isFinal, boolean isStatic,
326+
String scope, CompositeField rtype, String methodName, List<CompositeField> args,
327+
String throwsSpec, String comment, String returnComment,
328+
List<String> throwsComment, boolean isDeprecated) throws IOException {
330329
List<String> comments = normaliseArgComments(comment, returnComment, args, throwsComment);
331330
addMultilineComment(1, false, comments, false);
332331

@@ -389,8 +388,8 @@ public void addInterfaceCloseStatement() throws IOException {
389388
}
390389

391390
@Override
392-
public void addInterfaceMethodDeclaration(CompositeField rtype,
393-
String methodName, List<CompositeField> args, String throwsSpec, String comment,
391+
public void addInterfaceMethodDeclaration(CompositeField rtype, String methodName,
392+
List<CompositeField> args, String throwsSpec, String comment,
394393
String returnComment, List<String> throwsComment) throws IOException {
395394
String srtype = createLocalType(rtype);
396395
String argString = processArgs(args, true);

api-generator/generator-java/src/main/java/esa/mo/tools/stubgen/java/JavaCompositeFields.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
*/
2121
package esa.mo.tools.stubgen.java;
2222

23-
import esa.mo.tools.stubgen.GeneratorBase;
2423
import esa.mo.tools.stubgen.GeneratorLangs;
2524
import esa.mo.tools.stubgen.MOTypeInformation;
2625
import esa.mo.tools.stubgen.StubUtils;
@@ -37,12 +36,9 @@
3736
*/
3837
public class JavaCompositeFields {
3938

40-
private final GeneratorLangs generator;
41-
4239
private final MOTypeInformation typeInformation;
4340

44-
public JavaCompositeFields(GeneratorLangs generator, MOTypeInformation typeInformation) {
45-
this.generator = generator;
41+
public JavaCompositeFields(MOTypeInformation typeInformation) {
4642
this.typeInformation = typeInformation;
4743
}
4844

0 commit comments

Comments
 (0)