Category: java

  • Deploying a pre-existing bundle on OSGi OBR

    Using the maven-bundle-plugin, you can deploy a preexisting jar bundle from your local maven repository to your remote OBR. For this you use the deploy-file target of the maven-bundle-plugin directly, with a command line like: mvn org.apache.felix:maven-bundle-plugin:2.4.0:deploy-file -DrepositoryId=my-repository-id -Durl=scp://url/to/my/repository -DpomFile=C:\Users\myuser\.m2\repository\com\…\the-bundle-to-deploy-1.0.0.pom where my-repository-id is the id you also use in your settings.xml for storing the access…

  • Getting the number of dimensions of a multidimensional array in Java

    Based on my [permalink href=”4″]previous post[/permalink] about cloning multidimensional arrays, I have come up with a short static function to get the number of dimensions which a multidimensional array has. Note that this method only returns the number of dimensions of the original object passed as argument. It does not expand into the contained objects…

  • Cloning multidimensional arrays in Java

    In Java, calling the clone() method on an array returns a copy of the array, that is a new array containing references to the same objects as the source array. In particular, the objects themselves are not copied. As multidimensional arrays are just arrays of arrays, cloning a multidimensional array result in only the first…