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

Issue in type conversion for using @Separator for Abstract attribute #89

Closed
hemus2121 opened this Issue Aug 19, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@hemus2121

hemus2121 commented Aug 19, 2014

Hi,
In Type conversion example we have following for Separator Annotation [http://owner.aeonbits.org/docs/type-conversion/]

@Separator(File.pathSeparator);
File[] path();

-- I fails compilation saying "Attribute value must be Constant", on probing further found that we have pathSeparator in defined as
" public static final String pathSeparator = "" + pathSeparatorChar;" in File.java
and pathSeparatorChar resolves to fs.getPathSeparator() and method getPathSeparator()resolves to abstract char attribute of FileSystem.java

--During compile time we will not be able make out what is actual value for getPathSeparator() since its abstract and no concrete values can be deduced and during run-time this depends on underlying OS File System.

-- So Separator can't make out run-time dependent values and values has to be resolved at compile time only.

@lviggiano

This comment has been minimized.

Show comment
Hide comment
@lviggiano

lviggiano Aug 19, 2014

Owner

Good catch. We should probably remove that line from the example.

Owner

lviggiano commented Aug 19, 2014

Good catch. We should probably remove that line from the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment