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

[BUG] Field is not found when it is declared in a super class #57

Open
Artur- opened this issue Jan 6, 2025 · 2 comments
Open

[BUG] Field is not found when it is declared in a super class #57

Artur- opened this issue Jan 6, 2025 · 2 comments
Assignees

Comments

@Artur-
Copy link
Member

Artur- commented Jan 6, 2025

Description of the Bug

Extracted from #56

When trying to get translatable properties for the grid in the events view, you get

java.lang.IllegalArgumentException: No field found with name grid
	at com.vaadin.copilot.javarewriter.JavaRewriterUtil.lambda$findFieldDeclaration$21(JavaRewriterUtil.java:922) ~[copilot-24.6.0.jar:na]
	at java.base/java.util.Optional.orElseThrow(Optional.java:403) ~[na:na]
	at com.vaadin.copilot.javarewriter.JavaRewriterUtil.findFieldDeclaration(JavaRewriterUtil.java:922) ~[copilot-24.6.0.jar:na]
	at com.vaadin.copilot.javarewriter.ComponentInfo.find(ComponentInfo.java:144) ~[copilot-24.6.0.jar:na]
	at com.vaadin.copilot.javarewriter.JavaRewriter.findComponentInfo(JavaRewriter.java:460) ~[copilot-24.6.0.jar:na]
	at com.vaadin.copilot.plugins.i18n.I18nHandler.handleGetTranslatableProperties(I18nHandler.java:266) ~[copilot-24.6.0.jar:na]
	at com.vaadin.copilot.plugins.i18n.I18nHandler.handleMessage(I18nHandler.java:156) ~[copilot-24.6.0.jar:na]

The grid field is not declared in the EventsView class but in its super class EditView

@czp13 czp13 self-assigned this Jan 20, 2025
@czp13
Copy link
Contributor

czp13 commented Jan 20, 2025

This is debug level as well I guess.

@czp13
Copy link
Contributor

czp13 commented Jan 20, 2025

The copilot version was raised to 24.6.2 in my case, and have different errors:

2025-01-20T16:19:08.336+01:00 DEBUG 14901 --- [registration] [nio-8080-exec-1] c.v.copilot.plugins.i18n.I18nHandler     : Failed to get translatable properties

java.lang.IllegalArgumentException: Component has no create location in the project
	at com.vaadin.copilot.javarewriter.ComponentTypeAndSourceLocation.lambda$getCreateLocationOrThrow$0(ComponentTypeAndSourceLocation.java:49) ~[copilot-24.6.2.jar:na]
	at java.base/java.util.Optional.orElseThrow(Optional.java:403) ~[na:na]
	at com.vaadin.copilot.javarewriter.ComponentTypeAndSourceLocation.getCreateLocationOrThrow(ComponentTypeAndSourceLocation.java:49) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.javarewriter.ComponentInfo.find(ComponentInfo.java:76) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.javarewriter.ComponentInfo.findPossibleAttachExpressionFromParentInfo(ComponentInfo.java:257) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.javarewriter.ComponentInfo.find(ComponentInfo.java:161) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.javarewriter.JavaRewriter.findComponentInfo(JavaRewriter.java:543) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.plugins.i18n.I18nHandler.handleGetTranslatableProperties(I18nHandler.java:266) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.plugins.i18n.I18nHandler.handleMessage(I18nHandler.java:156) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.CopilotSession.handleMessageSync(CopilotSession.java:140) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.CopilotSession.handleMessage(CopilotSession.java:116) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.Copilot.handleMessage(Copilot.java:62) ~[copilot-24.6.2.jar:na]

Or this:

2025-01-20T16:19:33.954+01:00 DEBUG 14901 --- [registration] [io-8080-exec-10] c.v.copilot.plugins.i18n.I18nHandler     : Failed to get translatable properties

java.lang.IllegalArgumentException: Unable to find component in source
	at com.vaadin.copilot.ComponentSourceFinder.findTypeAndSourceLocation(ComponentSourceFinder.java:106) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.ComponentSourceFinder.findTypeAndSourceLocation(ComponentSourceFinder.java:64) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.ComponentSourceFinder.findTypeAndSourceLocation(ComponentSourceFinder.java:52) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.plugins.i18n.I18nHandler.handleGetTranslatableProperties(I18nHandler.java:262) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.plugins.i18n.I18nHandler.handleMessage(I18nHandler.java:156) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.CopilotSession.handleMessageSync(CopilotSession.java:140) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.CopilotSession.handleMessage(CopilotSession.java:116) ~[copilot-24.6.2.jar:na]
	at com.vaadin.copilot.Copilot.handleMessage(Copilot.java:62) ~[copilot-24.6.2.jar:na]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants