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

POI-3.15でCellLink 型で、アドレスA1の形式を書き込むと例外が発生する。 #96

Closed
mygreen opened this issue Dec 24, 2016 · 1 comment
Labels
Milestone

Comments

@mygreen
Copy link
Owner

mygreen commented Dec 24, 2016

POI-3.15でCellLink 型で、アドレスA1の形式を書き込むと例外が発生する。

java.lang.IllegalStateException: Invalid Hyperlink type: NONE
	at org.apache.poi.xssf.usermodel.XSSFHyperlink.validate(XSSFHyperlink.java:281)
	at org.apache.poi.xssf.usermodel.XSSFHyperlink.setAddress(XSSFHyperlink.java:255)
	at com.gh.mygreen.xlsmapper.cellconvert.converter.CellLinkCellConverter.toCell(CellLinkCellConverter.java:89)
	at com.gh.mygreen.xlsmapper.cellconvert.converter.CellLinkCellConverter.toCell(CellLinkCellConverter.java:1)
	at com.gh.mygreen.xlsmapper.fieldprocessor.processor.HorizontalRecordsProcessor.saveRecords(HorizontalRecordsProcessor.java:1001)
	at com.gh.mygreen.xlsmapper.fieldprocessor.processor.HorizontalRecordsProcessor.saveRecords(HorizontalRecordsProcessor.java:786)
	at com.gh.mygreen.xlsmapper.fieldprocessor.processor.HorizontalRecordsProcessor.saveProcess(HorizontalRecordsProcessor.java:681)
	at com.gh.mygreen.xlsmapper.fieldprocessor.processor.HorizontalRecordsProcessor.saveProcess(HorizontalRecordsProcessor.java:1)
	at com.gh.mygreen.xlsmapper.FieldAdaptorProxy.saveProcess(FieldAdaptorProxy.java:65)
	at com.gh.mygreen.xlsmapper.XlsSaver.saveSheet(XlsSaver.java:302)
	at com.gh.mygreen.xlsmapper.XlsSaver.save(XlsSaver.java:115)
	at com.gh.mygreen.xlsmapper.XlsSaver.save(XlsSaver.java:67)
	at com.gh.mygreen.xlsmapper.XlsMapper.save(XlsMapper.java:339)
	at com.gh.mygreen.xlsmapper.cellconvert.LinkCellConverterTest.test_save_link(LinkCellConverterTest.java:337)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

@mygreen
Copy link
Owner Author

mygreen commented Dec 24, 2016

POI-3.15から、CreationHepler#createHyperlink(<リンクタイプ>)で不明な値(-1など)せを設定してリンクを作成すると、例外がスローされるようになったため。

A1 の形式のような通常のセルのアドレス形式の場合は、 Hyperlink.LINK_DOCUMENT 型にするよう対応。

@mygreen mygreen added the bug label Dec 24, 2016
@mygreen mygreen added this to the 1.6 milestone Dec 24, 2016
@mygreen mygreen closed this as completed Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant