Skip to content
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

CAMEL-19970 - Avoid IllegalArgumentException for file without #11678

Conversation

apupier
Copy link
Contributor

@apupier apupier commented Oct 10, 2023

extension in same folder

when using JBang and that we let auto-detect routes, the files without extensions were added as potential routes and, as expected, no RouteLoader were found. An IllegalArgumentExeption was thrown at this time.

Note that the regression is a side effect. Previously it was part of Routes but there wasn't pre-parsing and so there was no error (at least when doing an export)

Description

Target

  • I checked that the commit is targeting the correct branch (note that Camel 3 uses camel-3.x, whereas Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally and I have committed all auto-generated changes

@apupier
Copy link
Contributor Author

apupier commented Oct 10, 2023

not found a way to write a test easily.

@apupier apupier marked this pull request as ready for review October 10, 2023 08:57
@apupier
Copy link
Contributor Author

apupier commented Oct 10, 2023

Given that it is a regression in Camel 3.21, I think we should backport it to 4.0.x and 3.21.x and 3.x if and when the PR is accepted

@apupier apupier force-pushed the 19970-fixIllegalArgumentExceptionForFileWithoutExtension branch from 6b3b169 to b091336 Compare October 10, 2023 08:59
@apupier apupier changed the title FUSETOOLS2-1970 - Avoid IllegalArgumentException for file without CAMEL-1970 - Avoid IllegalArgumentException for file without Oct 10, 2023
@apupier apupier force-pushed the 19970-fixIllegalArgumentExceptionForFileWithoutExtension branch from b091336 to 263ad76 Compare October 10, 2023 08:59
@apupier apupier changed the title CAMEL-1970 - Avoid IllegalArgumentException for file without CAMEL-19970 - Avoid IllegalArgumentException for file without Oct 10, 2023
Copy link
Contributor

@davsclaus davsclaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in the skipFile method instead, and I think its easier to just check if there is no file extension then return true to skip the file.

@apupier apupier force-pushed the 19970-fixIllegalArgumentExceptionForFileWithoutExtension branch from 263ad76 to fbaf184 Compare October 10, 2023 09:33
@davsclaus
Copy link
Contributor

Ah can you move that logic after the // skip dirs check as essentially almost all dirs are named without a dot / extension.

@apupier apupier force-pushed the 19970-fixIllegalArgumentExceptionForFileWithoutExtension branch from fbaf184 to 9fc7789 Compare October 10, 2023 09:45
extension in same folder

when using JBang and that we let auto-detect routes, the files without
extensions were added as potential routes and, as expected, no
RouteLoader were found. An IllegalArgumentExeption was thrown at this
time.

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
@apupier apupier force-pushed the 19970-fixIllegalArgumentExceptionForFileWithoutExtension branch from 9fc7789 to d5acbc8 Compare October 10, 2023 09:46
@davsclaus davsclaus merged commit 3974e96 into apache:main Oct 10, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants