-
Notifications
You must be signed in to change notification settings - Fork 25
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
Adds @External
annotation
#553
Conversation
Any reason for that? |
Aesthetics |
hmm wait a sec |
Pull request was converted to draft
Okay, I'm good with this |
I'm pretty sure this does not support partial compile. Edit: Seems like it isn't needed - all good !! |
@Factory
public class JdbiFactory {
private static final String JDBC_URL = "jdbc:mysql://localhost:3306/myapp?serverTimeZone=Asia/Shanghai";
private static final String DB_USER = "demo";
private static final String DB_PASSWORD = "demo";
private static Jdbi JDBI = null;
@Bean
public DataSource getDataSource() {
HikariConfig config = new HikariConfig();
config.setJdbcUrl(JDBC_URL);
config.setUsername(DB_USER);
config.setPassword(DB_PASSWORD);
DataSource ds = new com.zaxxer.hikari.HikariDataSource(config);
return ds;
}
@Bean
public Jdbi getJdbi(DataSource ds) {
JDBI = Jdbi.create(ds);
JDBI.installPlugin(new org.jdbi.v3.sqlobject.SqlObjectPlugin());
return JDBI;
}
}
public class JdbiTodoService implements TodoService {
final Jdbi jdbi;
// @Inject
//need to add @External before Jdbi parameter to compile
public JdbiTodoService(Jdbi jdbi) {
if (jdbi == null) {
throw new IllegalArgumentException("jdbi is null");
}
this.jdbi = jdbi;
}
} When I use version 10.1, why required to use |
is it the same in inject 10.0? Also does the |
|
Is it possible for you to upload an example repo to GitHub so that I can reproduce? |
Also is it the same on inject 10.2-RC1? If it is fine there then we should be good. |
@SentryMan |
did you have any luck with |
It’s really strange. Without adding |
There were 2 regressions for "Partial Compile" starting in version
You don't see these bugs with a full compile - so mvn clean package should have always worked, but partial compile with any 10.x prior to 10.2 could definitely produce those errors. I suspect that was what this issue is. You should see no issue with 10.2 with partial compilation now. |
Adds a similar annotation to
@Nullable
such that compile time validations can be disabled for beans not managed by Inject, but will still fail at runtime if the bean is not present. An example use case is beans provided by Jooby@External
marker annotation