Is there support in MapStruct for parametrized constructors?
I found in many posts from 2015 that this feature will be implemented in 1.1 release. Now I'm using 1.1.0.Final but I'm not able to find out in doc how to map target object that requires parametrized constructor.
Is this feature implemented?
Support for parametrized constructors is available since version 1.4 as described in chapter "Object Factories".
No, there is no support for other constructors than parameterless (default) constructors currently. There is issue #73 for tracking it. It's high on our wish list and I hope it will be done soon, but it's too early to tell when it will be.
Related
The TestRunner action is excluded from strategies set using the command line
parameter strategy_regexp. What are the reasons for not being able to map strategies
for the TestRunner?
In the code there is a comment on not overriding test strategies for
backwards compatibility. Do you know what test strategies it may conflict with?
Code that excludes the TestRunner:
https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/exec/SpawnStrategyRegistry.java#L93
The background is that I would like to map individual C++ unit tests to remote execution but cannot find any support for that in Bazel? Is there perhaps some other mechanism that can be used for this?
Kind regards,
Jonas Hansson
EDIT: Steve Vinoski kindly provided in the comments the official name for those : tuple modules.
My original question remains though: are tuple modules officially documented by the OTP team? And are they expected to remain supported in the future?
Original question:
Consider the following erlang module:
-module(foo).
-compile(export_all).
new(Bar) -> {foo, Bar}.
get({foo, Bar}) -> Bar.
I was quite amazed to see it allows the following (using erlang 19.1):
2> Foo = foo:new(bar).
{foo,bar}
3> Foo:get().
bar
which differs quite strongly from the usual way of calling a module's function.
As far as I can tell, it seems to be a remnant of parametrized modules, which have been deprecated since R16; and I can't find anything in the official documentation stating this is a supported, stable feature of the language.
My question is: is this a documented feature of the language? And if yes, where?
As far as I know this is an undocumented remnant of parameterized modules and exists to prevent legacy code from breaking. I imagine it is intended chiefly to prevent Mochiweb from breaking, as I can't think of any other serious libraries that make use of parameterized modules.
I can't locate any documentation on it and it doesn't seem to be a subject of current consideration. There was an announcement I cannot locate (but found references to, but not links) that claimed this would be documented, but that was quite a while ago.
The release readme for R16B where parameterized modules were removed mentions this:
OTP-10616
The experimental feature "parameterized modules" (also
called "abstract modules") has been removed. For applications that
depends on parameterized modules, there is a parse transform
that can be used to still use parameterized modules.
The parse transform can be found at: github.com/erlang/pmod_transform
That issue number does not appear in OTP's issue tracker anymore, and I can't even find an occurrence of "parameterized module" or "tuple module" anywhere in OTP's Jira instance. So I'm assuming this is an undocumented legacy crutch and nothing more.
The Dart Node implementation is missing lookupNamespaceURI.
Is support planned in the near future?
I didn't find a reference but namespaces are outdated in HTML5 as far as I know.
Maybe this question/answers has some information.
Is this statement true:
com.sun.xml.internal package is an internal package as the name suggestes.
Users should not write code that depends on internal JDK implementation classes. Such classes are internal implementation details of the JDK and subject to change without notice
One of my colleagues used one of the classes in his code, which caused javac task in Ant fail to compile our project as the compiler couldn't find the class. Answer from Sun/Oracle says that this is expected behavior of the compiler as user shouldn't use the package.
Question is why the classes in the package made public in the first place?
Thanks,
Sarah
Sun classes in the JDK are prefixed sun.* and are not part of the public supported interface so should be used with care. From the Sun FAQ:
The classes that Sun includes with the
Java 2 SDK, Standard Edition, fall
into package groups java., javax.,
org.* and sun.. All but the sun.
packages are a standard part of the
Java platform and will be supported
into the future. In general, packages
such as sun., that are outside of the
Java platform, can be different across
OS platforms (Solaris, Windows, Linux,
Macintosh, etc.) and can change at any
time without notice with SDK versions
(1.2, 1.2.1, 1.2.3, etc). Programs
that contain direct calls to the sun.
packages are not 100% Pure Java. In
other words:
The java., javax. and org.* packages
documented in the Java 2 Platform
Standard Edition API Specification
make up the official, supported,
public interface.
If a Java program directly calls only
API in these packages, it will operate
on all Java-compatible platforms,
regardless of the underlying OS
platform.
The sun.* packages are not part of the
supported, public interface.
A Java program that directly calls
into sun.* packages is not guaranteed
to work on all Java-compatible
platforms. In fact, such a program is
not guaranteed to work even in future
versions on the same platform.
It's because Java visibility modifiers (especially at the type level, where there are only two options) don't currently have the granularity to achieve the sort of visibility you're hinting at. I don't know the specifics of the internal class or classes you're using, but basically making the classes private would have made them unfit for their intended purpose, so the only other choice was public.
Sadly JAXB (bundled with Java6) seems to rely on a non-public class "com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper" to allow you to specify namespace prefixes when marshalling to xml.
You have to really go out of your way to get this compiling with ant:
http://pragmaticintegration.blogspot.com/
Summary:
Option 1.
Add jre libs as bootclasspathref
Add property: includeJavaRuntime="yes"
Option 2.
Use JAXB-RI libs - change property to "com.sun.xml.bind.marshaller.NamespacePrefixMapper"
Also mentioned here:
Define Spring JAXB namespaces without using NamespacePrefixMapper
Any list of Testing frameworks for ActionScript 2.0/3.0 around there?
UPDATE 2010-05-18
Since this post is a little old and I just received an upvote, it's probably worth providing some updated information so people don't chase down old frameworks.
The original fluint team now produce the official (and open source) unit testing framework, FlexUnit. You also might want to check out asunit, particularly if you need AS2 support.
flexcover is the go-to code coverage framework, and requires you use an alternate compiler.
You have a bit more choice for mocking/isolation frameworks, since most use dynamic proxy generation now:
asmock supports a strongly typed record-replay-verify mocking model and (I hope) a pretty comprehensive wiki to get started. (Though I'm a tad biased here :)
mockito supports supports a strongly typed arrange-act-assert syntax
mockolate is from the same author as mock-as3 (now discontinued) and provides an alternate model for mocking (though requires you specify method names as a string)
mock4as is a static mocking framework
Try AsUnit. It currently supports ActionScript 2.0 and 3.0 development. And, it's open source.
FlexUnit is the "official" unit testing framework. It's owned by Adobe's Research guys I believe.
http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries
Here's a tutorial on how to use it:
http://langexplr.blogspot.com/2008/10/creating-flex-unit-tests-with-flexunit.html
Also check out fluint
Based loosely on the concepts of FlexUnit and its ancestor JUnit, fluint provides enhanced asynchronous support, a graphical test runner, integration with continuous build systems and an optional Adobe AIR client for directory watching.
Try AS3Unit from libspark. They also have an async beta test kit.