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

extrange wrong error when disableXLSXNumberCellFormat is true #234

Closed
dacopan opened this issue Mar 30, 2022 · 9 comments
Closed

extrange wrong error when disableXLSXNumberCellFormat is true #234

dacopan opened this issue Mar 30, 2022 · 9 comments

Comments

@dacopan
Copy link

dacopan commented Mar 30, 2022

Currently when try parse attached files we have a error on parse number cells

  1. java.lang.NullPointerException: Cannot invoke "String.length()" because "address" is null
  2. java.lang.ArrayIndexOutOfBoundsException: Attempt to modify attribute at illegal index: 5

autos2.xlsx
autos3.xlsx

After exhaustive debuggin I can find that when

if (poijiOptions.isDisableXLSXNumberCellFormat()) {

this line run, somethings extrange and errors occurs after pass this line

@github-actions
Copy link

Thank you for contributing to Poiji! Feel free to create a PR If you want to contribute directly :)

@ozlerhakan
Copy link
Owner

Hi @dacopan ,

I'll look at the problem, thank you!

@ozlerhakan
Copy link
Owner

ozlerhakan commented Apr 1, 2022

can you share your entity model and all code you run as well @dacopan ?

@dacopan
Copy link
Author

dacopan commented Apr 4, 2022

Hi, sorry by the late, this is my Entity, UqaiExcelBase has only rowIndex
please tell me if you need more info

package com.uqai.excelutil.dto;

import com.poiji.annotation.ExcelCell;
import com.poiji.annotation.ExcelCellName;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * @author dacopan on 19/3/22
 */
public class AutoImport extends UqaiExcelBase {

    //marca	modelo	cilindraje	fabricacion	activo	valor	celular
    @ExcelCellName(value = "fabricacion", mandatory = false)
    private LocalDate fecha;

    @ExcelCell(0)
    private String clase;

    @ExcelCell(1)
    private String tipo;

    @ExcelCell(2)
    private String subtipo;

    @ExcelCell(3)
    private String marca;

    @ExcelCell(4)
    private String modelo;

    @ExcelCell(5)
    private String submodelo;

    @ExcelCell(6)
    private String dsc;

    @ExcelCell(7)
    private Double pmercado;

    @ExcelCell(8)
    private Double ptoma;

    @ExcelCell(9)
    private String anio;

    @ExcelCell(10)
    private String cil;

    @ExcelCell(11)
    private String com;

    @ExcelCell(12)
    private String tp;

    @ExcelCell(13)
    private Integer pasajeros;

    @ExcelCell(14)
    private Integer puertas;

    // todo Zonedateime
    // todo BigDecimal

}

@dacopan
Copy link
Author

dacopan commented Apr 4, 2022

please see this repo https://github.com/dacopan/poiji-error-demo
in Test package you can change autos2 and autos3 both show strange error derivated of the reported error
Note.- Sorry by the bad code, it's a starter library I'm testing

@ozlerhakan
Copy link
Owner

thank you @dacopan , I see what It causes!

@stale
Copy link

stale bot commented Apr 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the bot label Apr 19, 2022
@stale stale bot removed the bot label Apr 19, 2022
@falko
Copy link

falko commented May 10, 2022

@ozlerhakan any news on this? I'm also getting an ArrayIndexOutOfBoundsException: Attempt to modify attribute at illegal index 3 when using disableXLSXNumberCellFormat() to parse into a double.

@ozlerhakan
Copy link
Owner

Hi @falko , could you please share with me your excel file and model class?

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

No branches or pull requests

3 participants