Commit 192ccd5a authored by Philippe Merle's avatar Philippe Merle

* Improved the code quality according to checking rules of Sonar.

* Cosmetic updates.
parent e535e760
/***
/**
* OW2 FraSCAti Examples: HelloWorld with JNA
* Copyright (C) 2010 INRIA, University of Lille 1
*
......@@ -18,7 +18,7 @@
*
* Author: Romain Rouvoy
*
* Contributor(s):
* Contributor(s): Philippe Merle
*
*/
package jna.hw;
......@@ -31,12 +31,14 @@ import org.osoa.sca.annotations.Reference;
*
* @Author <a href="romain.rouvoy@lifl.fr">Romain Rouvoy</a>
*/
public class Client implements Runnable {
public class Client
implements Runnable
{
@Reference
private Service service ;
private Service service;
public void run() {
public final void run()
{
service.printf("Hello, World!\n");
}
}
\ No newline at end of file
}
/***
/**
* OW2 FraSCAti Examples: HelloWorld with JNA
* Copyright (C) 2010 INRIA, University of Lille 1
*
......@@ -18,7 +18,7 @@
*
* Author: Romain Rouvoy
*
* Contributor(s):
* Contributor(s): Philippe Merle
*
*/
package jna.hw;
......@@ -30,11 +30,11 @@ import com.sun.jna.Library;
*
* @Author <a href="romain.rouvoy@lifl.fr">Romain Rouvoy</a>
*/
public interface Service extends Library {
public interface Service
extends Library
{
/**
* Reflection of the method printf() provided by the library stdio.h
*/
void printf(String format, Object... args);
void printf(String format, Object... args);
}
/***
/**
* OW2 FraSCAti Examples: HelloWorld JNA
* Copyright (C) 2010 INRIA, University of Lille 1
*
......@@ -26,16 +26,19 @@
package org.ow2.frascati.examples.helloworld.jna;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
/**
* Test the HelloWorld JNA composite.
*
*/
public class HelloWorldJNATestCase extends FraSCAtiTestCase {
public class HelloWorldJNATestCase
extends FraSCAtiTestCase
{
@Override
public String getComposite() {
public final String getComposite()
{
String composite ="helloworld-jna";
String osName = System.getProperty("os.name");
......@@ -47,7 +50,8 @@ public class HelloWorldJNATestCase extends FraSCAtiTestCase {
}
@Test
public void testService() {
public final void testService()
{
getService(Runnable.class, "r").run();
}
......
/***
/**
* OW2 FraSCAti Examples: HelloWorld with JNA
* Copyright (C) 2010 INRIA, University of Lille 1
*
......@@ -18,12 +18,13 @@
*
* Author: Romain Rouvoy
*
* Contributor(s):
* Contributor(s): Philippe Merle
*
*/
package native_.hw;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Reference;
import stdio.StdioLibrary;
/**
......@@ -32,12 +33,14 @@ import stdio.StdioLibrary;
*
* @Author <a href="romain.rouvoy@lifl.fr">Romain Rouvoy</a>
*/
public class Client implements Runnable {
public class Client
implements Runnable
{
@Reference
private StdioLibrary service ;
public void run() {
public final void run()
{
service.printf("Hello, World!\n");
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment