-
Notifications
You must be signed in to change notification settings - Fork 42
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
Allowing injecting in constructor #30
Conversation
It is bad to assume that everyone does business logic outside of constructor. We don't want redirect conflict hell
Doesn't this allow cancelling final field initialization? |
Will do a few tweaks to prevent |
How about |
Signed-off-by: liach <[email protected]>
You cannot call static methods before super/this delegation in constructors unless you are calling it for parameters. Imo in that case redirects are better. Redirect, Modify arg, Modify variable is already |
Hmm, what's does the output look like (Dmixin.debug.output=true) |
@sfPlayer1 the before super injection does properly fail i.e. |
Signed-off-by: liach <[email protected]>
Signed-off-by: liach <[email protected]>
Disallowing cancellation is unnecessary. There's nothing wrong with final fields being left uninitialized. Here's some vanilla Java code that accesses a final field before it's initialized: public class Test {
private final int a;
public Test() {
a = f();
System.out.println(a); // prints 1
}
private int f() {
System.out.println(a); // a is accessed before being assigned, prints 0
return 1;
}
} Also, injecting before the public class Test extends Something {
public Test() {
super(f());
}
private static int f() {
// do anything here
return 0;
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rune is rite
pls merge w/ master tanqs i need feature :( |
Going to test and merge this in via: #40 |
* Allowing injecting in constructor It is bad to assume that everyone does business logic outside of constructor. We don't want redirect conflict hell * This should work Signed-off-by: liach <[email protected]> * Add notes for easy portin in the future Signed-off-by: liach <[email protected]> * Restore build number * Adopt new versioning scheme Signed-off-by: liach <[email protected]> Co-authored-by: liach <[email protected]> Co-authored-by: liach <[email protected]>
This reverts commit 536170a.
It is bad to assume that everyone does business logic outside of constructor. We don't want redirect conflict hell
Fixes #26