-
Couldn't load subscription status.
- Fork 1.4k
Make project friendlier for Eclipse IDE development #11915
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -142,20 +142,20 @@ public PartitionedByError<ReconcilableTopic, TopicState> createTopics(List<Recon | |||||||
| var values = ctr.values(); | ||||||||
| return TopicOperatorUtil.partitionedByError(reconcilableTopics.stream().map(reconcilableTopic -> { | ||||||||
| if (newTopicsErrors.containsKey(reconcilableTopic)) { | ||||||||
| return new Pair<>(reconcilableTopic, Either.ofLeft(newTopicsErrors.get(reconcilableTopic))); | ||||||||
| return new Pair<>(reconcilableTopic, Either.<TopicOperatorException, TopicState>ofLeft(newTopicsErrors.get(reconcilableTopic))); | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why these changes? Does Eclipse fail the compile without them? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it seems as though Eclipse JDT is not smart enough to determine the generic type arguments on these. I suspect the same errors would appear in VS Code, which at some point also used JDT. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem I have with this is that we can fix them now. Then we'll develop more but not using this syntax and then at some point someone using Eclipse will raise the issue. Is there really nothing that can't be done in Eclipse JDT to avoid this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's for sure an issue, but as I understand it the JDT compiler is a different implementation aiming for incremental compilation in the editor so it's always possible for these kind of differences. The generic use in this class is probably on the more complex end of the spectrum, so it may not be that common and it could just be dealt with if they occur again. There are other occurrences of the type params being set already in this class, so it's not unprecedented. Apparently even strimzi-kafka-operator/topic-operator/src/main/java/io/strimzi/operator/topic/KafkaHandler.java Lines 193 to 195 in d311680
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI, I did find that Intellij can use the Eclipse compiler via Settings > Build, Execution, Deployment > Compiler > Java Compiler. |
||||||||
| } | ||||||||
| try { | ||||||||
| values.get(reconcilableTopic.topicName()).get(); | ||||||||
| return new Pair<>(reconcilableTopic, Either.ofRight( | ||||||||
| new TopicState(new TopicDescription(reconcilableTopic.topicName(), | ||||||||
| return new Pair<>(reconcilableTopic, Either.<TopicOperatorException, TopicState>ofRight( | ||||||||
| new TopicState(new TopicDescription(reconcilableTopic.topicName(), | ||||||||
| false, List.of(), Set.of(), ctr.topicId(reconcilableTopic.topicName()).get()), null) | ||||||||
| )); | ||||||||
| } catch (ExecutionException e) { | ||||||||
| if (e.getCause() != null && e.getCause() instanceof TopicExistsException) { | ||||||||
| // we treat this as a success, the next reconciliation checks the configuration | ||||||||
| return new Pair<>(reconcilableTopic, Either.ofRight(null)); | ||||||||
| return new Pair<>(reconcilableTopic, Either.<TopicOperatorException, TopicState>ofRight(null)); | ||||||||
| } else { | ||||||||
| return new Pair<>(reconcilableTopic, Either.ofLeft(handleAdminException(e))); | ||||||||
| return new Pair<>(reconcilableTopic, Either.<TopicOperatorException, TopicState>ofLeft(handleAdminException(e))); | ||||||||
| } | ||||||||
| } catch (InterruptedException e) { | ||||||||
| throw new UncheckedInterruptedException(e); | ||||||||
|
|
@@ -247,9 +247,9 @@ public PartitionedByError<ReconcilableTopic, Void> alterConfigs(List<Pair<Reconc | |||||||
| var alterConfigsResult = acr.values(); | ||||||||
| Stream<Pair<ReconcilableTopic, Either<TopicOperatorException, Void>>> entryStream = someAlterConfigs.stream().map(entry -> { | ||||||||
| try { | ||||||||
| return new Pair<>(entry.getKey(), Either.ofRight(alterConfigsResult.get(buildTopicConfigResource(entry.getKey().topicName())).get())); | ||||||||
| return new Pair<>(entry.getKey(), Either.<TopicOperatorException, Void>ofRight(alterConfigsResult.get(buildTopicConfigResource(entry.getKey().topicName())).get())); | ||||||||
| } catch (ExecutionException e) { | ||||||||
| return new Pair<>(entry.getKey(), Either.ofLeft(handleAdminException(e))); | ||||||||
| return new Pair<>(entry.getKey(), Either.<TopicOperatorException, Void>ofLeft(handleAdminException(e))); | ||||||||
| } catch (InterruptedException e) { | ||||||||
| throw new UncheckedInterruptedException(e); | ||||||||
| } | ||||||||
|
|
@@ -359,9 +359,9 @@ public PartitionedByError<ReconcilableTopic, TopicState> describeTopics(List<Rec | |||||||
| throw new UncheckedInterruptedException(e); | ||||||||
| } | ||||||||
| if (exception != null) { | ||||||||
| return new Pair<>(reconcilableTopic, Either.ofLeft(handleAdminException(exception))); | ||||||||
| return new Pair<>(reconcilableTopic, Either.<TopicOperatorException, TopicState>ofLeft(handleAdminException(exception))); | ||||||||
| } else { | ||||||||
| return new Pair<>(reconcilableTopic, Either.ofRight(new TopicState(description, configs))); | ||||||||
| return new Pair<>(reconcilableTopic, Either.<TopicOperatorException, TopicState>ofRight(new TopicState(description, configs))); | ||||||||
| } | ||||||||
| })); | ||||||||
| } | ||||||||
|
|
@@ -398,12 +398,12 @@ public PartitionedByError<ReconcilableTopic, Object> deleteTopics(List<Reconcila | |||||||
| .map(reconcilableTopic -> { | ||||||||
| try { | ||||||||
| futuresMap.get(reconcilableTopic.topicName()).get(); | ||||||||
| return new Pair<>(reconcilableTopic, Either.ofRight(null)); | ||||||||
| return new Pair<>(reconcilableTopic, Either.<TopicOperatorException, Object>ofRight(null)); | ||||||||
| } catch (ExecutionException e) { | ||||||||
| if (e.getCause() instanceof UnknownTopicOrPartitionException) { | ||||||||
| return new Pair<>(reconcilableTopic, Either.ofRight(null)); | ||||||||
| return new Pair<>(reconcilableTopic, Either.<TopicOperatorException, Object>ofRight(null)); | ||||||||
| } else { | ||||||||
| return new Pair<>(reconcilableTopic, Either.ofLeft(handleAdminException(e))); | ||||||||
| return new Pair<>(reconcilableTopic, Either.<TopicOperatorException, Object>ofLeft(handleAdminException(e))); | ||||||||
| } | ||||||||
| } catch (InterruptedException e) { | ||||||||
| throw new UncheckedInterruptedException(e); | ||||||||
|
|
||||||||
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.
I am struggling to understand why it was removed from here but then having an execution task to copy it, IIUC
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.
Basically, it's due to this bug in Eclipse: eclipse-m2e/m2e-core#1790
Granted, it's Eclipse's bug, but nonetheless an impediment to using that IDE with Strimzi.