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

Problems executing "convert all property to TornadoFx properties" #96

Open
TioCoding opened this issue Dec 19, 2018 · 1 comment · May be fixed by #98
Open

Problems executing "convert all property to TornadoFx properties" #96

TioCoding opened this issue Dec 19, 2018 · 1 comment · May be fixed by #98

Comments

@TioCoding
Copy link

Hi, I'm trying to convert a 'data class' to a property object, but when I try to do it, IntelliJ freezes.

tornadofx

That is the moment in which we select the option to convert all the properties, but when selecting it, it loads but never ends.

captura de pantalla -2018-12-19 16-28-01

That's how intellij is frozen, and I have to force the closure by killing the instance.

I am doing something wrong? this is the class that I'm trying to convert:

package pe.com.clario.clariolibdomainfx.fxproperties

import java.time.LocalDateTime

data class AlmacenFX(val id: Int = -1,
                     val nombre: String? = null,
                     val status: Boolean? = null,
                     val descripcion: String? = null,
                     val idUserReg: Int? = null,
                     val fechaReg: LocalDateTime? = null,
                     val idUserMod: Int? = null,
                     val fechaMod: LocalDateTime? = null)
@SiebelsTim
Copy link
Collaborator

I'd argue that converting to JavaFxProperties in a data class wrong. In the end you'd have no parameters anymore, which is not allowed for data classes. The intention action would need to be more sophisticated for it.

Nevertheless, the plugin freezes on non-data classes as well an we'll fix it.

SiebelsTim added a commit to SiebelsTim/tornadofx-idea-plugin that referenced this issue Feb 22, 2019
I don't know why, but removing the whitespace will sometimes result
in an endless loop always getting a new PsiWhitespace object.

nullable primitive objects need to be SimpleObjectProperties as
the primitive counterpart do not support null.

Lastly, disable "convert all properties to TFX properties" in data classes
as that would result in an empty constructor which is not allowed
for data classes. It would break the data classes functions anyway.

We might want to consider improving the intention action to keep
constructor parameters so the user of that class can create an object
in the same way it was before running this action. Right now we remove the
parameters.
I still think it's wrong for data classes though

fixes edvin#96
@SiebelsTim SiebelsTim linked a pull request Feb 22, 2019 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants