[gwt-contrib] NoSuchMethodException in HEAD-SNAPSHOT has been removed, breaking knightsoft gwt-bean-validators

2019-01-03 Thread stuckagain
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/329b21962075c675d1a2e2b3d48049ca5e9fe195

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-validators/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/supersource/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/util/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-validators/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/supersource/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-validators/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/supersource/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-validators/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-validators/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/supersource/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 google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/c41d9294-cfe5-4fec-a014-5578cab35cfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] Re: NoSuchMethodException in HEAD-SNAPSHOT has been removed, breaking knightsoft gwt-bean-validators

2019-01-03 Thread Jens
I would say this change should be reverted in GWT then. Personally I would 
never ever delete any already emulated class in GWT.

While this exception has been misused in some of the above code (e.g. 
URL.openStream() should not be emulated at all or throw 
UnsupportedOperationException), in the emulated apache commons classes they 
are part of the method signature.

-- J.

-- 
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 google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/88c39adc-17f5-4bbd-a71b-f29998b40eb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] Re: NoSuchMethodException in HEAD-SNAPSHOT has been removed, breaking knightsoft gwt-bean-validators

2019-01-03 Thread 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/329b21962075c675d1a2e2b3d48049ca5e9fe195
>
> 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-validators/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/supersource/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/util/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-validators/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/supersource/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-validators/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/supersource/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-validators/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-validators/1.0.0/gwt-bean-validators-1.0.0.jar!/de/knightsoftnet/validators/supersource/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 compi

[gwt-contrib] Re: NoSuchMethodException in HEAD-SNAPSHOT has been removed, breaking knightsoft gwt-bean-validators

2019-01-03 Thread Colin Alworth
I believe that the reason this class existed to begin with was to allow 
(for some reason..) RPC to serialize that exception and pass it to client 
code. But emulation that "needs" it to match the correct signature can 
safely remove it from a "throws" clause without breaking the contract, 
correct?

Or is this a case of "it isn't a runtime exception, so the _calling_ code 
must then declare the catch statement"? I'm still waking up, might not be 
fully clear here...

-- 
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 google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/f70256f6-a236-4f8f-b237-a191d44cb112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] Re: NoSuchMethodException in HEAD-SNAPSHOT has been removed, breaking knightsoft gwt-bean-validators

2019-01-03 Thread Jens
It is not a RuntimeException so even though you might be able to remove it 
from GWT emulation code, your IDE will still annoy you in calling code to 
either catch that exception or redeclare it because your IDE does not know 
that GWT emul is cheating. If that calling code is exclusively within other 
emulated code, then it kind of depends on how JDT behaves I guess.

But honestly, it is just an exception and I would simply add it to GWT 
emulation. Done. It is always preferable to have a single emulation within 
GWT proper instead of one emulation per project that needs it with various 
degrees of implementation quality.

-- J.

-- 
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 google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/188c7862-b408-467c-a140-4383cd619ca7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Re: NoSuchMethodException in HEAD-SNAPSHOT has been removed, breaking knightsoft gwt-bean-validators

2019-01-03 Thread 'Goktug Gokdogan' via GWT Contributors
I agree this is mostly a misuse like you said. We don't have any internal
usage in all Google either so I would rather push users to not
declare/catch such exceptions. Keeping such classes opens the door for
more: https://gwt-review.googlesource.com/c/gwt/+/21320
I think IDE warnings in couple of corner cases is just a minor
inconvenience for the end user.

On Thu, Jan 3, 2019 at 6:35 AM Jens  wrote:

> It is not a RuntimeException so even though you might be able to remove it
> from GWT emulation code, your IDE will still annoy you in calling code to
> either catch that exception or redeclare it because your IDE does not know
> that GWT emul is cheating. If that calling code is exclusively within other
> emulated code, then it kind of depends on how JDT behaves I guess.
>
> But honestly, it is just an exception and I would simply add it to GWT
> emulation. Done. It is always preferable to have a single emulation within
> GWT proper instead of one emulation per project that needs it with various
> degrees of implementation quality.
>
> -- J.
>
> --
> 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 google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/188c7862-b408-467c-a140-4383cd619ca7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAN%3DyUA2ATYFgsxJkDvNQNeUgwioXdHt4PM3Z%2BgaOmM3QoDAjRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Re: NoSuchMethodException in HEAD-SNAPSHOT has been removed, breaking knightsoft gwt-bean-validators

2019-01-03 Thread Manfred Tremmel
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:

Re: [gwt-contrib] Re: NoSuchMethodException in HEAD-SNAPSHOT has been removed, breaking knightsoft gwt-bean-validators

2019-01-03 Thread Jens


> I agree this is mostly a misuse like you said. We don't have any internal 
> usage in all Google either so I would rather push users to not 
> declare/catch such exceptions. Keeping such classes opens the door for 
> more: https://gwt-review.googlesource.com/c/gwt/+/21320
>

Actually I am totally fine with Colins change, because:

1.) It is more correct emulation
2.) It is very simple code, so it is not a maintenance burden
3.) Single source of trust if its inside GWT emulation.
4.) Reflection based code can be emulated to some extend using 
Generators/APT so it is not super unlikely nobody uses these exceptions. If 
Google does not use it, fine, others might do and for them it is a real 
breaking change which stops them from upgrading GWT.
5.) It reduces the noise when using diff tools between GWT emulation and 
JDK to a.) discover newly added APIs in JDK and b.) verify existing 
emulated APIs still match JDK APIs.

 

> I think IDE warnings in couple of corner cases is just a minor 
> inconvenience for the end user.
>

I don't think 2 classes with each 3 lines of real code outweighs the 
happiness of end users.


-- J.

-- 
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 google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/846bfc59-f3f5-4f0f-8642-a0ae3d02317a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] Re: NoSuchMethodException in HEAD-SNAPSHOT has been removed, breaking knightsoft gwt-bean-validators

2019-01-03 Thread Jens


>  It has always had a private constructor to make that completely 
> impossible.
>

Private constructor? Looks like it always was public as it should.

https://github.com/gwtproject/gwt/blob/2.8.2/user/super/com/google/gwt/emul/java/lang/NoSuchMethodException.java
 

-- J.

-- 
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 google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/86cb9f50-6679-4dc3-b441-c92808726bb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.