Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix returning is_plain [19541] #86

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@

package com.eprosima.idl.parser.exception;

import com.eprosima.log.ColorMessage;
import org.antlr.v4.runtime.RecognitionException;
import org.antlr.v4.runtime.Token;

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.eprosima.idl.parser.exception;

import java.lang.Exception;
import com.eprosima.log.ColorMessage;

public class RuntimeGenerationException extends Exception
{
public RuntimeGenerationException()
{
super("");
}

public RuntimeGenerationException(String message)
{
super(ColorMessage.error() + message);
}
}
Original file line number Diff line number Diff line change
@@ -116,14 +116,20 @@ public boolean addMember(Member member)
@Override
public boolean isIsPlain()
{
for (Member member : m_members.values())
if (isAnnotationFinal())
{
if (!member.isIsPlain())
for (Member member : m_members.values())
{
return false;
if (!member.isIsPlain())
{
return false;
}
}

return true;
}
return true;

return false;
}

@Override
9 changes: 8 additions & 1 deletion src/main/java/com/eprosima/idl/parser/typecode/TypeCode.java
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ public int get_value()
}
};

public static ExtensibilityKind default_extensibility = ExtensibilityKind.APPENDABLE;
public static STGroup idltypesgr = null;
public static STGroup cpptypesgr = null;
public static STGroup ctypesgr = null;
@@ -369,6 +370,12 @@ void calculate_extensibility()
{
extensibility_ = ExtensibilityKind.FINAL;
}
else if (null != m_annotations.get(Annotation.appendable_str) ||
(null != m_annotations.get(Annotation.extensibility_str) &&
m_annotations.get(Annotation.extensibility_str).getValue().equals(Annotation.ex_appendable_str)))
{
extensibility_ = ExtensibilityKind.APPENDABLE;
}
else if (null != m_annotations.get(Annotation.mutable_str) ||
(null != m_annotations.get(Annotation.extensibility_str) &&
m_annotations.get(Annotation.extensibility_str).getValue().equals(Annotation.ex_mutable_str)))
@@ -377,7 +384,7 @@ else if (null != m_annotations.get(Annotation.mutable_str) ||
}
else
{
extensibility_ = ExtensibilityKind.APPENDABLE;
extensibility_ = default_extensibility;
}
}
}