gnodet-bot commented on code in PR #27552: URL: https://github.com/apache/camel/pull/27552#discussion_r4220084833
########## components/camel-datasonnet/src/test/java/org/apache/camel/language/datasonnet/DataWeaveExecutedCorpusTest.java: ########## @@ -0,0 +1,221 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.language.datasonnet; + +import com.datasonnet.document.MediaTypes; +import org.apache.camel.component.dataweave.DataWeaveConversionException; +import org.apache.camel.RoutesBuilder; +import org.apache.camel.builder.RouteBuilder; Review Comment: 💡 **Import ordering:** `org.apache.camel.component.dataweave.DataWeaveConversionException` appears before `org.apache.camel.RoutesBuilder`, which violates alphabetical order. ```suggestion import org.apache.camel.RoutesBuilder; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.dataweave.DataWeaveConversionException; ``` ########## components/camel-dataweave/src/main/java/org/apache/camel/component/dataweave/DataWeaveConversionException.java: ########## @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.dataweave; + +/** + * Thrown when a DataWeave script cannot be converted to DataSonnet, either because the parser encountered a syntax + * error or because a construct is not supported by the converter. + * <p> + * The message identifies the DataWeave source location (line:column) and the construct that failed. Review Comment: 💡 **Minor Javadoc inaccuracy:** the second paragraph says _"The message identifies the DataWeave source location (line:column) and the construct that failed"_ — but this only holds for exceptions thrown directly by `DataWeaveParser` (`expect()` / `parsePrimary()`). The `todoCount > 0` path in `DatasonnetLanguage.convertDataWeave()` throws with a message like `"DataWeave expression contains N construct(s) that cannot be auto-converted…"` — no line:col included. ```suggestion * <p> * When thrown by the parser, the message includes the DataWeave source location (line:column) and the * unexpected token. When thrown for unsupported constructs detected after conversion, the message * describes the failure but does not include a source location. ``` -- 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]
