Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Monday, January 14, 2019

mvn-jlink 1.0.0

Java provides some modularity since Java 9 (project Jigsaw) and it provides way to build JDK images containing only needed modules. There are two nice tool in JDK called jdeps and jlink which helps in build new JDK image but I use maven to build my own OSS projects and I wanted some way to automate process. So I have developed and published maven plug-in MVN-JLINK which can call jdeps and jlink (and any tool provided by JDK) and even it can load and unpack OpenJDK builds from Adopt and Bellsoft (Liberica).

Thursday, September 21, 2017

JDK 9 + JEP-238 + Maven + Preprocessor

I have made small example project to show how to use Java preprocessor and Maven to build multi-release JAR (as described in JEP-238) which is supported in JDK 9.
https://github.com/raydac/jep-238-jcp-example

Sunday, September 3, 2017

JBBP 1.3.0

Java Binary Block Parser 1.3.0 is out and accessible in the Maven Central. The Main feature of the version - to generate Java class sources from JBBP scripts, the feature allows to use the framework for more or less high-load systems. The Library still has size less than 200 kBt but since the version it needs Java 1.6+ (minimal Android version is still 2.0). Also there are published two plugins for Maven and Gradle which allow to generate Java classes from JBBP scripts on fly during project build phase.
Also of course minor refactoring and bugfixing.
p.s.
The Library is used by Orange for its Datavenue Live Objects service

Sunday, August 7, 2016

added one more example for JBBP

Added one more example for JBBP to show how to add a custom type into parser, as example I have written a parser for three byte non-signed integer value with "int24" as name of the type . The Example formed as a JUnit test and published in the GitHub.

Sunday, June 26, 2016

Standalone Mind Map editor

I have published standalone Mind Map editor based on NB MindMap plugin. It is a small standalone Java application (about 3 Mb) needs Java 1.7+ and can be started as regular JAR or EXE file (under Windows), it can be downloaded from the folder

Tuesday, December 8, 2015

Java Comment Preprocessor 6.0.1

The New 6.0.1 version of Java Comment Preprocessor has been available in Maven Central

Tuesday, August 25, 2015

Catch link clicks in JLabel

The javax.swing.JLabel allows to show a HTML document which contains multiple HTML links but there is not any way to catch click on the links. If such JLabel has only HTML link then you can just catch all clicks and open browser with the link, but if you have several links shown by JLabel then there is no way to separate them. For such case I have written small modification of JLabel which allows to separate clicked links inside JLabel, the Gist cand be found here.

Tuesday, June 9, 2015

JBBP 1.2.0 is out

JBBP 1.2.0 (most comfortable way to work with binary data in Java) has been published in Maven central
https://github.com/raydac/java-binary-block-parser

Sunday, June 7, 2015

JUte 1.1.0

JUte 1.1.0 has been published in maven central. The New version includes many improvements and now JUte has special annotation provided by jute-annotations artifact to recognize its tests. Now JUte can be used and without JUnit, also full life-cycle for JUnit tests has been supported, it means that test marked by @JUteTest also will be processed with methods marked by JUnit annotations @BeforeClass..@Before..@After..@AfterClass if they presented.

Sunday, May 17, 2015

Isolation of JUnit tests in external processes

I had some needs to test complex legacy code with JUnit but it was very hard to isolate tests from their influence to each other. It was too expensive to find all internal influence points
 so I wrote small Maven plugin called Jute, which allows to start every JUnit test method in external JVM process, also it allows to start test methods  with different JVM and different JVM options.
The Project sources has been published in GitHub and 1.0.0 version has been published in Maven central

Sunday, May 3, 2015

J-J-JVM

I had found my old (2009) project of implementation a JVM interpreter in Java to play class files in J2ME (which didn't support class loaders), I made some changes, added tests and added support of long and double processing and moved the project to github, so that now it has been published under Apache License 2.0 and fully accessible
p.s.
also I renamed the project from M-JVM to J-J-JVM

Sunday, August 10, 2014

Java Binary data parsing and packing

 I have published "yet another Java framework to parse and pack binary blocks"  (because I am too lazy to write tons of lines for different cases), I wanted some small compatible with JavaSE and Android solution so that meet the JBBP (Java Binary Block Parser).


Friday, July 11, 2014

Two more OSS projects

Started two more OSS projects
JHexed - a small hexagonal Java based engine + Editor
JBBP - a small framework to parse binary blocks in Java

Saturday, April 12, 2014

PROL is now an OSS project

I had got a request from a Japan graduate student to open sources of my Prol engine (it is a small Prolog engine written in Java with embedded GUI editor), so that now it is an OSS project under Apache License 2.0
If you are going to use the engine then please keep in mind that it was developed for academic purposes and to check some ideas and tested not very well.

Sunday, January 8, 2012

Translation JVM bytecodes into Z80 machine codes

I had some free time during these holidays and have made some "spike" to check possibility to translate JVM byte-codes into Z80 commands and it works. You can see screenshot of a Java program and its translated version execution under the Fuse ZX-Spectrum emulator. The length of translated binary block is 376 bytes but mainly (80%) it contains some garbage imported from the class constant pool.

Tuesday, November 8, 2011

Usage EnumSet instead of boolean variables

I had a Java class which contained a lot of boolean variable definitions as I show below
boolean specialFlag1;
boolean specialFlag2;
boolean specialFlag3;
boolean specialFlag4;
...
specialFlag1 = true;
...
if (specialFlag1){
...
It looked very bad and made my code ugly so I decided to extract the variables into an enum
public enum SpecialFlag {
  Flag1,
  Flag2,
  Flag3,
  Flag4;
}
so the boolean variables part of the core class was changed to the code below
final Set specialFlags = EnumSet.noneOf(SpecialFlag.class);
...
specialFlags.add(SpecialFlag.Flag1)
...
if (specialFlags.contains(SpecialFlag.Flag1){
...
as you can see above, the EnumSet based variant looks really better but I was worrying about productivity and wrote a small test to compare the speed of working with the EnumSet variant and the boolean one. My test shows that difference between boolean and EnumSet variants is no so big and about 13%.