Asserts removed in Cross-compiled code - gwt

are asserts removed in the resulting JavaScript of a GWT programm.
Regards,
Stefan

The GWT compiler removes them by default.
However there is a way to tell the compiler to keep them.
See here and here for more details.

Related

Eclipse custom breakpoint (execute a java method, do not halt)

I am looking to instrument a near-production application to simply print the stack trace when a variable is modified. I don't want to halt-thread or halt-VM.
What is a best and least complex approach?
Do I need to write my own plugin to handle 'DebugElement'?
Do I need to write a custom Debug Adapter?
Are there any examples out there? I know about EclipseCon2005_Tutorial21-v2 (Darin Wright, Bjorn Freeman-Benson) example for an Eclipse debug plugin contains deprecated code (e.g., "IPluginDescriptor").
I'm trying to follow Vogella's tutorial but some things are not clear enough.
Ah, just call a method from the conditional expression. It can do what is needed, and then "return false;" so that the VM is not suspended.

Groovy Deprecated Methods and Eclipse - sort

I've got the following code which I wrote in groovy 1.8
someListOfLists.flatten().sort().unique()
I've moved over to groovy 2.3.x, and eclipse (using e4.4 GroovyEclipse plugin for Juno from snapshot release) is showing me the sort() method is now deprecated for sort(Collection<T> self), to which the advice is to use the sort(Iterable<T> self).
How do I now chain methods like this together to avoid the deprecation warnings?
My thinking was that as flatten() is returning an ArrayList (which is an Iterable) it should be fine. Also, I see doing
((Iterable) someListOfLists.flatten()).sort().unique()
removes the warning, but looks ugly.
So is this just eclipse not seeing that the correct sort will actually be used, or is there some other way to express my chain of methods?
The deprecation warnings are due to the fact that Eclipse is mapping Groovy methods to the mostly deprecated DefaultGroovyMethods class, which was just replaced by many separate other classes such as StringGroovyMethods, ResourceGroovyMethods etc.
It seems that in version 2.7.1 of the Groovy plugin, this was fixed... check your version of the plugin, maybe you just need to upgrade.
If that does not solve the problem, unfortunately, unless you can make the Groovy plugin change the methods mapping, you won't be able to get rid of the warnings, as far as I know. In IntelliJ I have the same problem.

Compiler warning "Missing optimization information" OnEntry and OnExit with NullGuard.PostSharp

Just installed Postsharp 2.1 from the nuget package and then installed Phil Haack's NullGuard package.
As I add the [EnsureNonNullAspect] aspect at either the class or method level I immediately get the following compiler warnings:
Warning 1 Missing optimization information on method'
NullGuard.PostSharp.EnsureNonNullAspect.OnEntry(
PostSharp.Aspects.MethodExecutionArgs)'.
This information is computed automatically by PostSharp.
Make sure that assembly NullGuard.PostSharp is processed by PostSharp
Warning 2 Missing optimization information on method
'NullGuard.PostSharp.EnsureNonNullAspect.OnExit(
PostSharp.Aspects.MethodExecutionArgs)'.
This information is computed automatically by PostSharp.
Make sure that assembly NullGuard.PostSharp is processed by PostSharp
It could be that this is nothing to worry about, but:
a) I don't like compiler warnings that I can't find the answer to anywhere on Google.
b) it could be something to worry about.
Any help would be most appreciated.
Cheers!
Tod.
It's because you're using the free version of PostSharp, which doesn't include the aspect optimization feature. See the comparison of features on PostSharp.net.
https://github.com/Haacked/NullGuard/issues/3
A bit late but I might have found a solution. I added the following tag in the project files that were raising the warnings:
<PropertyGroup>
<UsePostSharp>true</UsePostSharp>
</PropertyGroup>
This solved the issue to me.
This is because the library included in that NuGet package has not been processed by PostSharp.

Making GWT 2.5 compiler use closure compiler

The release notes for GWT 2.5 say that the GWT compiler can optionally use the Closure compiler to provide additional JavaScript optimizations, does anyone know how to turn this optimization on?
The compile option is -XenableClosureCompiler. But I'm not sure if it already works with 2.5RC1.

Problems with GWT 2.4

I compiled the version in svn tagged as gwt2.4rc. Now there are a
couple of more libraries than I had the last time. Are the any
instructions on which library is needed for what? I tried it with only
the standard libraries (servlet, servlet-deps, user) but I get the
following error when a requestfactory call is made:
java.lang.NoSuchMethodError:
com.google.gwt.core.client.impl.WeakMapping.setWeak(Ljava/lang/
Object;Ljava/lang/String;Ljava/lang/Object;)
I tried declaring the requestfactory-client and requestfactory-server
jars as dependencies, but i doesn't help. I am using maven to manage
my dependencies.
I would go back to 2.4 beta, but I need the drag&drop features that
were introduced later.
Does anybody has an idea what could be wrong? or any hints how i can
dig deeper into this? I spend a lot of time trying to figure this out
but without any success :(
Do I need to provide more information?
Regards,
arne
Are you sure you deployed the 2.4-rc1 gwt-servlet.jar in your war/WEB-INF/lib ? Also, make sure you override the SDK for the gwt-maven-plugin: http://mojo.codehaus.org/gwt-maven-plugin/user-guide/using-different-gwt-sdk-version.html
That being said:
when using Maven, you shouldn't use gwt-servlet-deps but instead reference org.json:json and javax.validation:validation-api
requestfactory-server can be used instead of gwt-servlet if you only use RequestFactory on the server-side (no GWT-RPC, no SafeHtml, no RegExp, etc.); requestfactory-client is to be used for Java clients (such as Android), not the case here.