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

Aspect-orientation does not apply to derived attributes #1028

Closed
ahmedvc opened this Issue Mar 30, 2017 · 2 comments

Comments

@ahmedvc
Contributor

ahmedvc commented Mar 30, 2017

Try the model below. The aspect code block will be ignored in the generated code.

class Test{
name= {"Some value"}

before getName{
//I will be ignored
}
}

@TimLethbridge TimLethbridge added this to the April 2018 for release 1.28 milestone Dec 8, 2017

@gublan24 gublan24 assigned gublan24 and unassigned gublan24 Jan 31, 2018

@TimLethbridge

This comment has been minimized.

Show comment
Hide comment
@TimLethbridge

TimLethbridge Mar 9, 2018

Member

We realize that the injection should be for the get method. It still does not work. Example:

class Test{
   firstName;
   lastName;
   fullName= {firstName+lastName}

  
  before getFullName{
    firstName = firstName+ " ";
   }
}
Member

TimLethbridge commented Mar 9, 2018

We realize that the injection should be for the get method. It still does not work. Example:

class Test{
   firstName;
   lastName;
   fullName= {firstName+lastName}

  
  before getFullName{
    firstName = firstName+ " ";
   }
}

@hugessen hugessen self-assigned this Mar 16, 2018

@hugessen

This comment has been minimized.

Show comment
Hide comment
@hugessen

hugessen Mar 16, 2018

Contributor

The problem is in the way JavaClassGenerator is written. It has multiple if blocks for different cases when injecting code. This code should be getting sent to the attribute_GetDerivedCodeInjection block, but is instead being sent to the attribute_GetDerived. This is because the if statement around attribute_GetDerivedCodeInjection requires the existence of after functionality.

If I add an after statement, both the before and after code are appended. It also works if I use after alone, but does not work with before alone.

Contributor

hugessen commented Mar 16, 2018

The problem is in the way JavaClassGenerator is written. It has multiple if blocks for different cases when injecting code. This code should be getting sent to the attribute_GetDerivedCodeInjection block, but is instead being sent to the attribute_GetDerived. This is because the if statement around attribute_GetDerivedCodeInjection requires the existence of after functionality.

If I add an after statement, both the before and after code are appended. It also works if I use after alone, but does not work with before alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment