You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/11/23 11:53:48 UTC

[GitHub] [ignite-3] tkalkirill commented on a change in pull request #465: IGNITE-15972 Improve network processor error message

tkalkirill commented on a change in pull request #465:
URL: https://github.com/apache/ignite-3/pull/465#discussion_r755049789



##########
File path: modules/network-annotation-processor/src/integrationTest/java/org/apache/ignite/internal/network/processor/ItTransferableObjectProcessorTest.java
##########
@@ -170,7 +170,8 @@ void testMissingMessageGroup() {
         Compilation compilation = compiler.compile(sources("AllTypesMessage"));
 
         assertThat(compilation).hadErrorContaining(
-                "No message groups (classes annotated with @MessageGroup) found"
+                "No message groups (classes annotated with @MessageGroup) found while processing messages from the "

Review comment:
       Maybe use: "@" + MessageGroup.class.getSimpleName()
   In case the name of the annotation changes.

##########
File path: modules/network-annotation-processor/src/integrationTest/java/org/apache/ignite/internal/network/processor/ItTransferableObjectProcessorTest.java
##########
@@ -170,7 +170,8 @@ void testMissingMessageGroup() {
         Compilation compilation = compiler.compile(sources("AllTypesMessage"));
 
         assertThat(compilation).hadErrorContaining(
-                "No message groups (classes annotated with @MessageGroup) found"
+                "No message groups (classes annotated with @MessageGroup) found while processing messages from the "
+                        + "following packages: [org.apache.ignite.internal.network.processor]"

Review comment:
       Same as ^

##########
File path: modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/TransferableObjectProcessor.java
##########
@@ -228,11 +231,22 @@ private void validateMessages(List<MessageClass> messages) {
     /**
      * Extracts and validates the declared message group types marked with the {@link MessageGroup} annotation.
      */
-    private static MessageGroupWrapper getMessageGroup(RoundEnvironment roundEnv) {
+    private MessageGroupWrapper getMessageGroup(RoundEnvironment roundEnv) {
         Set<? extends Element> messageGroupSet = roundEnv.getElementsAnnotatedWith(MessageGroup.class);
 
         if (messageGroupSet.isEmpty()) {
-            throw new ProcessingException("No message groups (classes annotated with @MessageGroup) found");
+            Elements elements = processingEnv.getElementUtils();
+
+            Set<String> packageNames = roundEnv.getRootElements().stream()
+                    .map(elements::getPackageOf)
+                    .map(PackageElement::getQualifiedName)
+                    .map(Name::toString)
+                    .collect(Collectors.toSet());
+
+            throw new ProcessingException(
+                    "No message groups (classes annotated with @MessageGroup) found while processing messages from the following packages: "

Review comment:
       Maybe use: "@" + MessageGroup.class.getSimpleName()
   In case the name of the annotation changes.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org