Hi together, the original validation code has no reflection emulation for accessing getters. In gwt-bean-validators you can simply use org.apache.commons.beanutils.PropertyUtils.getProperty(Object, String) and org.apache.commons.beanutils.BeanUtils.getProperty(Object, String) which both throw NoSuchMethodException on client side. Without this emulation I wouldn't be able use validation routines which need more input fields like MustBeEqual (https://gitlab.com/ManfredTremmel/gwt-bean-validators/blob/master/mt-bean-validators/src/main/java/de/knightsoftnet/ validators/shared/impl/MustBeEqualValidator.java).
cu Manfred Am Donnerstag, 3. Januar 2019, 06:11:19 CET schrieb Colin Alworth: > Thanks for the heads up - it was removed since it isn't possible to throw > in client code anyway, and projects could emulate it themselves if > necessary. I'm curious about why gwt-bean-validators must have it, as the > original validator code did not have it - is it expecting it to be possible > to throw? It has always had a private constructor to make that completely > impossible. > > I checked out the project so I could offer a pull request with the two > different approaches that could be used to fix this, but it doesnt appear > that the project builds out of the box - javadoc errors that are fatal just > for a plain mvn install or mvn package. Stepping down to just mvn compile > (so I could attempt to build, but never actually use it) then encounters a > dependency-check issue. Any advice you can offer on building my own copy to > contribute these fixes right away? > > Approach one: "super source" this exception - validators already require > some super source, so there should already be a clear place to put this in > the project. > > Approach two: stop indicating that methods could throw this, or that > try/catch blocks could catch it, since it wasn't possible to throw anyway. > Any emulated java code cannot have this exception naturally (no > classloader, no classes loaded from disk, etc), and as I mentioned, it has > a private constructor. > > Like I said, I'd be very glad to collaborate and build these patches and > get them merged so we can get this resolved. > > On Thursday, January 3, 2019 at 4:13:20 AM UTC-6, stuckagain wrote: > > Hi, > > > > I just noticed this morning that our project fails to build this morning > > due to a change in HEAD-SNAPSHOT. > > > > We are using knightsoft gwt-bean-validators and its source is apparently > > depending on the fact that GWT is emulating the NoSuchMethodException. > > > > I saw this commit where there is a mention that this was discussed: > > > > https://github.com/gwtproject/gwt/commit/329b21962075c675d1a2e2b3d48049ca5 > > e9fe195 > > > > This is what I get now when compiling: > > [INFO] Compiling module com.swift.cloud.platform.ui.demo.Demo > > [INFO] Tracing compile failure path for type > > 'org.apache.commons.beanutils.PropertyUtils' > > [INFO] [ERROR] Errors in > > 'jar:file:/home/dnouls/.m2/repository/de/knightsoft-net/gwt-bean-validator > > s/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/superso > > urce/org/apache/commons/beanutils/PropertyUtils.java' [INFO] > > [ERROR] Line 56: No source code is available for type > > java.lang.NoSuchMethodException; did you forget to inherit a required > > module? > > [INFO] Tracing compile failure path for type > > 'de.knightsoftnet.validators.shared.util.BeanPropertyReaderUtil' > > [INFO] [ERROR] Errors in > > 'jar:file:/home/dnouls/.m2/repository/de/knightsoft-net/mt-bean-validators > > /1.0.0/mt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/shared/ut > > il/BeanPropertyReaderUtil.java' [INFO] [ERROR] Line 60: No source > > code is available for type java.lang.NoSuchMethodException; did you > > forget to inherit a required module? > > [INFO] Tracing compile failure path for type 'java.net.URL' > > [INFO] [ERROR] Errors in > > 'jar:file:/home/dnouls/.m2/repository/de/knightsoft-net/gwt-bean-validator > > s/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/superso > > urce/java/net/URL.java' [INFO] [ERROR] Line 958: No source code > > is available for type java.lang.NoSuchMethodException; did you forget to > > inherit a required module? > > [INFO] Tracing compile failure path for type > > 'org.hibernate.validator.internal.util.logging.Log' > > [INFO] [ERROR] Errors in > > 'jar:file:/home/dnouls/.m2/repository/de/knightsoft-net/gwt-bean-validator > > s/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/superso > > urce/org/hibernate/validator/internal/util/logging/Log.java' [INFO] > > [ERROR] Line 415: No source code is available for type > > java.lang.NoSuchMethodException; did you forget to inherit a required > > module? > > [INFO] Tracing compile failure path for type > > 'de.knightsoftnet.validators.client.impl.AbstractGwtValidator' > > [INFO] [ERROR] Errors in > > 'jar:file:/home/dnouls/.m2/repository/de/knightsoft-net/gwt-bean-validator > > s/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/client/ > > impl/AbstractGwtValidator.java' [INFO] [ERROR] Line 144: No > > source code is available for type java.lang.NoSuchMethodException; did > > you forget to inherit a required module? > > [INFO] Tracing compile failure path for type > > 'org.apache.commons.beanutils.BeanUtils' > > [INFO] [ERROR] Errors in > > 'jar:file:/home/dnouls/.m2/repository/de/knightsoft-net/gwt-bean-validator > > s/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/superso > > urce/org/apache/commons/beanutils/BeanUtils.java' [INFO] [ERROR] > > Line 48: No source code is available for type > > java.lang.NoSuchMethodException; did you forget to inherit a required > > module? > > [INFO] [ERROR] Aborting compile due to errors in some input files > > > > I wonder what the impact is of this change to other libraries out there. > > I'll file a bug report on knightsoft's implementation, but what about libs > > that are no longer maintained that might refer to this exception class ? -- You received this message because you are subscribed to the Google Groups "GWT Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/4760783.2HWMQDLKoz%40thinkpad. For more options, visit https://groups.google.com/d/optout.
