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

MooseApp erroneously redeclares _name attribute #29670

Open
pbehne opened this issue Jan 9, 2025 · 0 comments · May be fixed by #29671
Open

MooseApp erroneously redeclares _name attribute #29670

pbehne opened this issue Jan 9, 2025 · 0 comments · May be fixed by #29671
Assignees
Labels
P: normal A defect affecting operation with a low possibility of significantly affects. T: defect An anomaly, which is anything that deviates from expectations.

Comments

@pbehne
Copy link
Contributor

pbehne commented Jan 9, 2025

Bug Description

MooseApp is derived from MooseBase. MooseBase has an attribute called _name,
which described the name of the object. MooseApp erroneously redeclares this
attribute and does not initialize it. Thus, when a MooseApp or more derived
class tries to access _name, it defaults to the empty MooseApp::_name instead
of the desired MooseBase::_name. MooseBase::_name is still accessible without
using the namespace operator through the name() method because the name()
method is not erroneously redeclare in MooseApp.

Steps to Reproduce

From any MooseApp or more derived object, print out the values of _name and name() and note the difference.

Impact

MooseApp::_name and name() (which returns MooseBase::_name) are different, leading to confusion and unexpected behavior.

The solution is to remove the redeclaration of MooseApp::_name from MooseApp.h.

[Optional] Diagnostics

No response

@pbehne pbehne added T: defect An anomaly, which is anything that deviates from expectations. P: normal A defect affecting operation with a low possibility of significantly affects. labels Jan 9, 2025
@pbehne pbehne self-assigned this Jan 9, 2025
pbehne added a commit to pbehne/moose that referenced this issue Jan 9, 2025
MooseApp is derived from MooseBase. MooseBase has an attribute called _name,
which described the name of the object. MooseApp erroneously redeclares this
attribute and does not initialize it. Thus, when a MooseApp or more derived
class tries to access _name, it defaults to the empty MooseApp::_name instead
of the desired MooseBase::_name. MooseBase::_name is still accessible without
using the namespace operator through the name() method because the name()
method is not erroneously redeclare in MooseApp. This commit removes the
erroneous redeclaration of MooseApp::_name. Ref idaholab#29670.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P: normal A defect affecting operation with a low possibility of significantly affects. T: defect An anomaly, which is anything that deviates from expectations.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant