You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2022/02/25 09:35:08 UTC

[plc4x] branch feature/cleaned-up-type-references updated: feat(codegen): Removed some unreferenced code

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/cleaned-up-type-references
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/feature/cleaned-up-type-references by this push:
     new 10389a2  feat(codegen): Removed some unreferenced code
10389a2 is described below

commit 10389a22767b79378d987f7cc849ed14842c5a4d
Author: cdutz <ch...@c-ware.de>
AuthorDate: Fri Feb 25 10:34:37 2022 +0100

    feat(codegen): Removed some unreferenced code
---
 .../BaseFreemarkerLanguageTemplateHelper.java        | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/code-generation/language-base-freemarker/src/main/java/org/apache/plc4x/plugins/codegenerator/protocol/freemarker/BaseFreemarkerLanguageTemplateHelper.java b/code-generation/language-base-freemarker/src/main/java/org/apache/plc4x/plugins/codegenerator/protocol/freemarker/BaseFreemarkerLanguageTemplateHelper.java
index 74c553e..af8d4d0 100644
--- a/code-generation/language-base-freemarker/src/main/java/org/apache/plc4x/plugins/codegenerator/protocol/freemarker/BaseFreemarkerLanguageTemplateHelper.java
+++ b/code-generation/language-base-freemarker/src/main/java/org/apache/plc4x/plugins/codegenerator/protocol/freemarker/BaseFreemarkerLanguageTemplateHelper.java
@@ -37,7 +37,6 @@ import org.slf4j.LoggerFactory;
 import java.util.*;
 import java.util.function.Function;
 import java.util.function.Supplier;
-import java.util.stream.Collectors;
 
 public abstract class BaseFreemarkerLanguageTemplateHelper implements FreemarkerLanguageTemplateHelper {
 
@@ -85,13 +84,6 @@ public abstract class BaseFreemarkerLanguageTemplateHelper implements Freemarker
         return types;
     }
 
-    public List<TypeDefinition> getComplexTypeRootDefinitions() {
-        return types.values().stream()
-            .filter(ComplexTypeDefinition.class::isInstance)
-            .filter(typeDefinition -> !(typeDefinition instanceof DiscriminatedComplexTypeDefinition))
-            .collect(Collectors.toList());
-    }
-
     /* *********************************************************************************
      * Methods related to type-references.
      **********************************************************************************/
@@ -414,18 +406,6 @@ public abstract class BaseFreemarkerLanguageTemplateHelper implements Freemarker
     }
 
     /**
-     * Confirms if a variable is a discriminator variable. These need to be handled differently when serializing and parsing.
-     *
-     * @param variableLiteral The variable to search for.
-     * @return boolean returns true if the variable's name is an discriminator field
-     */
-    protected boolean isVariableLiteralDiscriminatorField(VariableLiteral variableLiteral) {
-        return thisType.asComplexTypeDefinition()
-            .map(complexTypeDefinition -> complexTypeDefinition.isVariableLiteralDiscriminatorField(variableLiteral))
-            .orElse(false);
-    }
-
-    /**
      * Returns the implicit field that has the same name as the variable. These need to be handled differently when serializing and parsing.
      *
      * @param variableLiteral The variable to search for.