Discussion:
Problem with replacing the class
Kirill Prazdnikov
2018-07-19 15:55:51 UTC
Permalink
Hi
I`m having troubles to replace one class by another

This is the class I want to replace:

package delightex.math.fp;

public class FloatBits {
public static int floatToRawIntBits(float v) { return Float.floatToIntBits(v); }
public static float intBitsToFloat(int v) { return Float.intBitsToFloat(v); }
}


So I have a better one in FloatBitsJs with the same API.
And this I have in module.gwt.xml:

<replace-with class="delightex.math.fp.FloatBitsJs">
<when-type-is class="delightex.math.fp.FloatBits"/>
</replace-with>


But it does not get replaced. It still generates calls to FloatBits in both
super-dev-mode and production modes.
(Production is single permutation Chrome only "user.agent"="safari")

Any help ?
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Thomas Broyer
2018-07-19 16:04:56 UTC
Permalink
<replace-with> is related to "deferred binding", i.e. creating an instance
through GWT.create(), where the actual class being instantiated is "bound"
at compile-time, depending on properties (and/or permutations).

What you want to achieve can be done through "super sourcing". See
“Overriding one package implementation with another”
at http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml
Post by Kirill Prazdnikov
Hi
I`m having troubles to replace one class by another
package delightex.math.fp;
public class FloatBits {
public static int floatToRawIntBits(float v) { return Float.floatToIntBits(v); }
public static float intBitsToFloat(int v) { return Float.intBitsToFloat(v); }
}
So I have a better one in FloatBitsJs with the same API.
<replace-with class="delightex.math.fp.FloatBitsJs">
<when-type-is class="delightex.math.fp.FloatBits"/>
</replace-with>
But it does not get replaced. It still generates calls to FloatBits in
both super-dev-mode and production modes.
(Production is single permutation Chrome only "user.agent"="safari")
Any help ?
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Kirill Prazdnikov
2018-07-23 09:48:07 UTC
Permalink
Post by Thomas Broyer
What you want to achieve can be done through "super sourcing". See
“Overriding one package implementation with another” at
http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml
Thanks, that works.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Loading...