stevedlawrence commented on code in PR #977:
URL: https://github.com/apache/daffodil/pull/977#discussion_r1124682320


##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/dsom/SDE.scala:
##########
@@ -120,20 +120,14 @@ class SchemaDefinitionWarning(
     args: _*,
   ) {
 
-  def this(sc: SchemaFileLocation, kind: String, args: Any*) =
-    this(None, Some(sc), None, kind, args: _*)
+  def this(w: WarnID, sc: SchemaFileLocation, kind: String, args: Any*) =
+    this(w, Some(sc), None, kind, args: _*)
 
   override def isError = false
   def modeName = "Schema Definition"
 
-  override def toString = warnID match {
-    case Some(id) =>
-      super.toString + "\n" +
-        s"To suppress this warning, add '${id}' to the " +
-        "daf:suppressSchemaDefinitionWarnings element of a Daffodil 
defineConfig " +
-        "used when processing"
-    case None => super.toString
-  }
+  override def getMessage = super.getMessage + s" (id: ${warnID})"

Review Comment:
   I believe this puts the warn id after file/line number info if it's included 
in the SDW (which is almost always is), which might be confusing? Does the warn 
id want to be closer to the actual message?
   
   Maybe we do somehing like:
   ```scala
   class SchemaDefinitionWarning(
     ...
   ) extends SchemaDefinitionDiagnosticBase(
       ...,
       Maybe(kind + s" (id: ${warnID})")
       ...,
   ) {
   ```
   
   So we actually append the warnID to the diagnostic format string so it 
appears before any location information.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to