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

Impossible to export FB using FORTE Lua exporter #809

Open
melekhove opened this issue Dec 2, 2024 · 0 comments
Open

Impossible to export FB using FORTE Lua exporter #809

melekhove opened this issue Dec 2, 2024 · 0 comments

Comments

@melekhove
Copy link

Steps to reproduce:

  • create new FB (composite for example)
  • Try to export using '4diac IDE type Export'
  • Select exporter 'FORTE Lua'
  • Observe the following exception
!MESSAGE InvocationTargetException
!STACK 0
java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:396)
	...
	at org.eclipse.equinox.launcher.Main.main(Main.java:1454)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.emf.ecore.EObject.eClass()" because "type" is null
	at org.eclipse.fordiac.ide.export.forte_lua.ForteLuaExportFilter.export(ForteLuaExportFilter.java:68)
	at org.eclipse.fordiac.ide.export.ui.wizard.FordiacExportWizard$Exporter.exportElement(FordiacExportWizard.java:195)
	at org.eclipse.fordiac.ide.export.ui.wizard.FordiacExportWizard$Exporter.run(FordiacExportWizard.java:151)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:124)
Root exception:
java.lang.NullPointerException: Cannot invoke "org.eclipse.emf.ecore.EObject.eClass()" because "type" is null
	at org.eclipse.fordiac.ide.export.forte_lua.ForteLuaExportFilter.export(ForteLuaExportFilter.java:68)
	at org.eclipse.fordiac.ide.export.ui.wizard.FordiacExportWizard$Exporter.exportElement(FordiacExportWizard.java:195)
	at org.eclipse.fordiac.ide.export.ui.wizard.FordiacExportWizard$Exporter.run(FordiacExportWizard.java:151)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:124)

Using code similar to this

if (source == null && typeFile != null && TypeLibraryManager.INSTANCE.getTypeEntryForFile(typeFile) == null) {
getWarnings().add(MessageFormat.format(Messages.TemplateExportFilter_PREFIX_ERRORMESSAGE_WITH_TYPENAME,
typeFile.getFullPath(), Messages.TemplateExportFilter_FILE_IGNORED));
return; // Do not export files passed to the export that are not in the TypeLibrary
}
try {
if (source == null && typeFile != null) {
final ResourceSet resourceSet = new ResourceSetImpl();
final Resource resource = resourceSet
.getResource(URI.createPlatformResourceURI(typeFile.getFullPath().toString(), true), true);
source = resource.getContents().get(0);
}
helps

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

1 participant