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

IllegalArgumentException: Argument is not an array for compound attribute #338

Closed
raedma opened this issue Jan 10, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@raedma
Copy link

raedma commented Jan 10, 2022

First of all, thanks for all your work.

Describe the bug

I try to read a hdf5 file group with a compound scalar attribute but get a java.lang.IllegalArgumentException when calling attribute.getData().

To Reproduce

Steps to reproduce the behaviour:

  • Example file: test.zip

  • Code:

    HdfFile hdf = new HdfFile(PATH);
    Node node = input.getByPath("GROUP");
    Attribute attribute = node.getAttribute("VERSION");
    System.out.println(attribute.getJavaType()); // gives "interface java.util.Map"
    Object data = attribute.getData();
    

Expected behaviour

I'd like the compound attribute data available for further processing.

Please complete the following information:

  • jhdf version: 0.6.4

  • Java version: 13

  • OS: Windows

  • Stack trace if available:

    java.lang.IllegalArgumentException: Argument is not an array
       at java.base/java.lang.reflect.Array.get(Native Method)
       at io.jhdf.dataset.DatasetReader.readDataset(DatasetReader.java:67)
       at io.jhdf.AttributeImpl.getData(AttributeImpl.java:73)
    
jamesmudd added a commit that referenced this issue Jan 10, 2022
@jamesmudd
Copy link
Owner

Thanks a lot for raising this issue. I have reproduced it using your supplied file. Your right this is a jHDF bug. I have had a really quick look and have a possible fix here #339 but I need to add tests and verify there are not any other cases where this could be wrong. In the meantime if you want to look at, or try the fix would be great to hear if it works for you. If you wanted to add tests and open a PR that would also be great, otherwise I will try to get round to it asap.

@jamesmudd jamesmudd added the bug Something isn't working label Jan 10, 2022
jamesmudd added a commit that referenced this issue Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants