How can I add a packge to the reflection support on Graalvm? - graalvm

Is it possible to add a package in the reflection-config.json?
Something like:
[
{
"name" : "org.apache.tinkerpop.shaded.kryo.serializers.*",
"allDeclaredConstructors" : true
}
}
Instead of doing it one by one.
Thanks :)

As far as I know, that isn't possible yet. There is an open feature request for this: https://github.com/oracle/graal/issues/1236

Probably the best would be to create a Feature class which would register classes for reflection programmatically. Here's a short example: https://www.graalvm.org/reference-manual/native-image/Reflection/#configuration-with-features
The feature class needs to be on classpath then referenced using the --features= command line option.

I am using tracing agent features to auto generate a list for reflection/jni/resources, this should be quite convenient until one day the wildcard features is implemented. (I bet it will not be implemented due to performance concern.)

Related

Use plugin config as paramater in services.yml

The documentation only shows that you can pass the SystemConfigService as a parameter to another service.
Is there also the possibility to pass directly the value from the plugin configuration?
Background of the question: I would like to initialize directly an instance of an external component. But this expects fixed arguments as strings. Alternatively, one would otherwise have to write some kind of factory.
Hm, it's possible to do. I have not done this directly myself, but 99% confident that it will work. You may need to play around with it a little.
In the services.xml you can use symfony expressions.
<argument type="expression">service('Shopware\Core\System\SystemConfig\SystemConfigService').get('SwagBasicExample.config.example')</argument>
You may need to find the alias name for the Shopware\Core\System\SystemConfig\SystemConfigService class instead. Also check the Symfony documentation, you can do a lot more with this!
I myself passed an array as an argument, but used a custom class as a config getter like so:
<argument type="expression">
{
"shop_is_active": service('config_bridge').get('isActive'),
"customer_number": service('config_bridge').get('customerNumber'),
"shop_number": service('config_bridge').get('shopNumber'),
"apikey": service('config_bridge').get('apiKey')
}
</argument>
Not strictly necessary as Shopware already requires it, but always a good practice to add the requirement to your plugin composer file:
"require": {
...,
"symfony/expression-language": "~5.3.0|~5.4.0"
},
As of today it's not possible to inject specific system_config values in services.

Get structure of variables in Jenkins

Running println(Jenkins.instance.pluginManager.plugins) in the jenkins console returns lots of useful stuff like:
[Plugin:external-monitor-job, Plugin:docker-workflow,
Plugin:pipeline-rest-api, Plugin:javadoc,
Plugin:resource-disposer, Plugin:conditional-buildstep, ...
]
I want to see the class structure. Where can I find the reference for those classes? Can I generate it? Is it possible to represent those classes like the the variables view in Eclipse, where I can expand all the subclasses and functions?
Those information's are really use full for creating pipeline scripts.
https://javadoc.jenkins-ci.org/hudson/model/Job.html
... and so on.
Maybe some could mention, in a comment how to ask for this information the right way. Is it a api-reference, a class description, a ... ?

Struts2 ResultPath per package or something similar

Currently, we can define a global path that'll be used for all results, under all packages.
I have different paths for different results and hence, is it possible to have the resultPath package wise ?
Or is there something that can help me achieve this ?
Obviously, I don't want to write the complete result-location in every-result, neither I want to change at every place if the location changes.
A workaround is to use #ResultPath on a Class by Class basis;
apply it to some abstract baseActions, one per package.
All other actions will extend the one of their <package>, inheriting the ResultPath setting.

GXT 3.x Custom PropertyEditor / ValueBaseInputCell

I'm trying to write a custom field editor that will translate between Long and String. IE: String representation on screen but field type is a Long.
I've implemented the PropertyEditor (HrMinPropertyEditor) but don't know how to wire it in. My HrMinField is quite clunky as I needed to use a TriggerFieldCell because the generic types inside TextInputCell etc. prevented me from using them.
Do I need to do a subclass of ValueBaseInputCell? That seems strange since my PropertyEditor has all the Long / String conversions. It also looks difficult.
If so, is there a simple example or some documentation I can read?
BTW, my learning project is Maven based and should be easy to fire up if necessary:
svn checkout http://subversion.assembla.com/svn/freshcode_public/learn/gwt/ learn-gwt
cd learn-gwt
mvn gwt:run
Navigate to GXT | Forms | Time Edit
Thanks in advance,
Pete
PS: I've asked this on the Sencha forum too.
You should use method setPropertyEditor from Field class to specify your custom property editor:
HrMinField f = new HrMinField();
f.setPropertyEditor( new HrMinPropertyEditor() );
I managed to come up with a solution using a Converter and a Validator.
The more complete answer is on the Sencha thread.

Lint for ASP.NET MVC?

Is there a lint utility for ASP.NET MVC? Given that I frequently specify views and links via strings, when I move things around or change entity names I often break things, which I then only find out about when something fails at runtime.
ReSharper's v6 (whose nightlies are now available, if you don't mind living on the edge) will catch this kind of error for you.
You can use Refactor -> Rename and enable Search in Strings to replace every string in the solution
Other option -- use the strongly typed helpers (which might still be in the futures assemblies). EG, Html.Action<ProductsController>(x => x.ShowProduct(id)) ; really the only way to fly.
I don't know that there's something like that, but I'll tell you what I do: All my view names are in a struct that contains string constants. It's a pain to keep it sync'ed as the project changes, but it's worth it because you're far more likely to catch errors if you're using
ViewNames.Customer
rather than
"customer"

Resources