From ff976abdc0f201064cd0fb608c39990ba2656561 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 19 Dec 2016 19:00:02 +0100 Subject: [PATCH] cosmetics --- src/bindings/java/org/simgrid/msg/Comm.java | 5 +- .../org/simgrid/msg/HostFailureException.java | 3 +- .../simgrid/msg/HostNotFoundException.java | 3 +- .../java/org/simgrid/msg/JniException.java | 6 +- .../java/org/simgrid/msg/MsgException.java | 3 +- .../java/org/simgrid/msg/NativeException.java | 2 +- .../org/simgrid/msg/ProcessKilledError.java | 6 +- .../simgrid/msg/ProcessNotFoundException.java | 20 ++---- .../simgrid/msg/StorageNotFoundException.java | 15 +---- src/bindings/java/org/simgrid/msg/Task.java | 3 +- .../simgrid/msg/TaskCancelledException.java | 15 +---- .../org/simgrid/msg/TimeoutException.java | 15 +---- .../simgrid/msg/TransferFailureException.java | 9 +-- src/bindings/java/org/simgrid/msg/VM.java | 62 ++++++------------- 14 files changed, 46 insertions(+), 121 deletions(-) diff --git a/src/bindings/java/org/simgrid/msg/Comm.java b/src/bindings/java/org/simgrid/msg/Comm.java index 2ea34c3223..c48a820e9e 100644 --- a/src/bindings/java/org/simgrid/msg/Comm.java +++ b/src/bindings/java/org/simgrid/msg/Comm.java @@ -6,10 +6,7 @@ package org.simgrid.msg; -/** - * Communication action, representing an ongoing communication - * between processes. - */ +/** Communication action, representing an ongoing communication between processes. */ public class Comm { /** Indicates if the communication is a receiving communication */ protected boolean receiving; diff --git a/src/bindings/java/org/simgrid/msg/HostFailureException.java b/src/bindings/java/org/simgrid/msg/HostFailureException.java index 7070131571..edb471bd94 100644 --- a/src/bindings/java/org/simgrid/msg/HostFailureException.java +++ b/src/bindings/java/org/simgrid/msg/HostFailureException.java @@ -1,5 +1,4 @@ -/* Copyright (c) 2006-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2014. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ diff --git a/src/bindings/java/org/simgrid/msg/HostNotFoundException.java b/src/bindings/java/org/simgrid/msg/HostNotFoundException.java index 79ef54c6f7..13d69939ca 100644 --- a/src/bindings/java/org/simgrid/msg/HostNotFoundException.java +++ b/src/bindings/java/org/simgrid/msg/HostNotFoundException.java @@ -1,5 +1,4 @@ -/* Copyright (c) 2006-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ diff --git a/src/bindings/java/org/simgrid/msg/JniException.java b/src/bindings/java/org/simgrid/msg/JniException.java index 322ffde831..741e35e782 100644 --- a/src/bindings/java/org/simgrid/msg/JniException.java +++ b/src/bindings/java/org/simgrid/msg/JniException.java @@ -1,7 +1,6 @@ /* This exception is raised when there is a problem within the bindings (in JNI). */ -/* Copyright (c) 2006-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -9,7 +8,8 @@ package org.simgrid.msg; /** - * This exception is raised when there is a problem within the bindings (in JNI). + * Exception raised when there is a problem within the bindings (in JNI). + * * That's a RuntimeException: I guess nobody wants to survive a JNI error in SimGrid */ public class JniException extends RuntimeException { diff --git a/src/bindings/java/org/simgrid/msg/MsgException.java b/src/bindings/java/org/simgrid/msg/MsgException.java index e683264d9d..c93ace1495 100644 --- a/src/bindings/java/org/simgrid/msg/MsgException.java +++ b/src/bindings/java/org/simgrid/msg/MsgException.java @@ -1,7 +1,6 @@ /* This exception is an abstract class grouping all MSG-related exceptions */ -/* Copyright (c) 2006-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ diff --git a/src/bindings/java/org/simgrid/msg/NativeException.java b/src/bindings/java/org/simgrid/msg/NativeException.java index 73b25233d9..ecc12de68c 100644 --- a/src/bindings/java/org/simgrid/msg/NativeException.java +++ b/src/bindings/java/org/simgrid/msg/NativeException.java @@ -8,7 +8,7 @@ package org.simgrid.msg; -/** This exception is raised when there is an error within the C world of SimGrid. */ +/** Exception raised when there is an error within the C world of SimGrid. */ public class NativeException extends MsgException { private static final long serialVersionUID = 1L; diff --git a/src/bindings/java/org/simgrid/msg/ProcessKilledError.java b/src/bindings/java/org/simgrid/msg/ProcessKilledError.java index 023e5cfa2d..91769db752 100644 --- a/src/bindings/java/org/simgrid/msg/ProcessKilledError.java +++ b/src/bindings/java/org/simgrid/msg/ProcessKilledError.java @@ -1,13 +1,11 @@ -/* Copyright (c) 2006-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ package org.simgrid.msg; -/** This error class is only used to interrupt the java user code - * when the process gets killed by an external event. +/** Used internally to interrupt the user code when the process gets killed. * Don't catch it. */ diff --git a/src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java b/src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java index 6f90ce61de..7bdd8920eb 100644 --- a/src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java +++ b/src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java @@ -1,31 +1,19 @@ -/* This exception is raised when looking for a non-existing process. */ - -/* Copyright (c) 2006-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ package org.simgrid.msg; -/** - * This exception is raised when looking for a non-existing process. - */ +/** Exception raised when looking for a non-existing process. */ public class ProcessNotFoundException extends MsgException { private static final long serialVersionUID = 1L; - /** - * Constructs an ProcessNotFoundException without a - * detail message. - */ + /** Constructs an ProcessNotFoundException without a detail message. */ public ProcessNotFoundException() { super(); } - /** - * Constructs an ProcessNotFoundException with a detail message. - * - * @param s the detail message. - */ + /** Constructs an ProcessNotFoundException with a detail message. */ public ProcessNotFoundException(String s) { super(s); } diff --git a/src/bindings/java/org/simgrid/msg/StorageNotFoundException.java b/src/bindings/java/org/simgrid/msg/StorageNotFoundException.java index 5f8e6d57e4..839b7339b8 100644 --- a/src/bindings/java/org/simgrid/msg/StorageNotFoundException.java +++ b/src/bindings/java/org/simgrid/msg/StorageNotFoundException.java @@ -1,16 +1,11 @@ -/* This exception is raised when looking for a non-existing storage. */ - -/* Copyright (c) 2006-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ package org.simgrid.msg; -/** - * This exception is raised when looking for a non-existing storage. - */ +/** Exception raised when looking for a non-existing storage. */ public class StorageNotFoundException extends MsgException { private static final long serialVersionUID = 1L; @@ -18,11 +13,7 @@ public class StorageNotFoundException extends MsgException { public StorageNotFoundException() { super(); } - /** - * Constructs an StorageNotFoundException with a detail message. - * - * @param s the detail message. - */ + /** Constructs an StorageNotFoundException with a detail message. */ public StorageNotFoundException(String s) { super(s); } diff --git a/src/bindings/java/org/simgrid/msg/Task.java b/src/bindings/java/org/simgrid/msg/Task.java index 26dc2b021c..e267422a5e 100644 --- a/src/bindings/java/org/simgrid/msg/Task.java +++ b/src/bindings/java/org/simgrid/msg/Task.java @@ -1,5 +1,4 @@ -/* Copyright (c) 2006-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ diff --git a/src/bindings/java/org/simgrid/msg/TaskCancelledException.java b/src/bindings/java/org/simgrid/msg/TaskCancelledException.java index 950899d137..d63f7a1970 100644 --- a/src/bindings/java/org/simgrid/msg/TaskCancelledException.java +++ b/src/bindings/java/org/simgrid/msg/TaskCancelledException.java @@ -1,16 +1,11 @@ -/* This exception is raised when looking for a non-existing host. */ - -/* Copyright (c) 2006-2007, 2010, 2013-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ package org.simgrid.msg; -/** - * This exception is raised when task is cancelled. - */ +/** Exception raised when a task is cancelled. */ public class TaskCancelledException extends MsgException { private static final long serialVersionUID = 1L; @@ -18,11 +13,7 @@ public class TaskCancelledException extends MsgException { public TaskCancelledException() { super(); } - /** - * Constructs an TaskCancelledException with a detail message. - * - * @param s the detail message. - */ + /** Constructs an TaskCancelledException with a detail message. */ public TaskCancelledException(String s) { super(s); } diff --git a/src/bindings/java/org/simgrid/msg/TimeoutException.java b/src/bindings/java/org/simgrid/msg/TimeoutException.java index 1600faed78..d4a3ed0365 100644 --- a/src/bindings/java/org/simgrid/msg/TimeoutException.java +++ b/src/bindings/java/org/simgrid/msg/TimeoutException.java @@ -1,16 +1,11 @@ -/* This exception is raised when looking for a non-existing host. */ - -/* Copyright (c) 2006-2007, 2010, 2013-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ package org.simgrid.msg; -/** - * This exception is raised when time's out while sending tasks. - */ +/** Exception raised when sending a task timeouts */ public class TimeoutException extends MsgException { private static final long serialVersionUID = 1L; @@ -18,11 +13,7 @@ public class TimeoutException extends MsgException { public TimeoutException() { super(); } - /** - * Constructs an TransferFailureException with a detail message. - * - * @param s the detail message. - */ + /** Constructs an TransferFailureException with a detail message. */ public TimeoutException(String s) { super(s); } diff --git a/src/bindings/java/org/simgrid/msg/TransferFailureException.java b/src/bindings/java/org/simgrid/msg/TransferFailureException.java index 9ba2df93c8..1bc952ac5c 100644 --- a/src/bindings/java/org/simgrid/msg/TransferFailureException.java +++ b/src/bindings/java/org/simgrid/msg/TransferFailureException.java @@ -1,16 +1,11 @@ -/* This exception is raised when looking for a non-existing host. */ - -/* Copyright (c) 2006-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2014. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ package org.simgrid.msg; -/** - * This exception is raised if transfer failed while sending tasks. - */ +/** Exception raised if sending a task fails */ public class TransferFailureException extends MsgException { private static final long serialVersionUID = 1L; diff --git a/src/bindings/java/org/simgrid/msg/VM.java b/src/bindings/java/org/simgrid/msg/VM.java index d3893a49fd..a393c95aac 100644 --- a/src/bindings/java/org/simgrid/msg/VM.java +++ b/src/bindings/java/org/simgrid/msg/VM.java @@ -1,7 +1,6 @@ /* JNI interface to virtual machine in Simgrid */ -/* Copyright (c) 2006-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2014. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -9,28 +8,22 @@ package org.simgrid.msg; import java.util.ArrayList; -public class VM extends Host{ - // Please note that we are not declaring a new bind variable - //(the bind variable has been inherited from the super class Host) +public class VM extends Host { + // No need to declare a new bind variable: we use the one inherited from the super class Host /* Static functions */ - // GetByName is inherited from the super class Host - private static ArrayList vms= new ArrayList<>(); private Host currentHost; - /* Constructors / destructors */ - /** - * Create a `basic' VM (i.e. 1GB of RAM, other values are not taken into account). - */ + /** Create a `basic' VM (i.e. 1GB of RAM, other values are not taken into account). */ public VM(Host host, String name) { this(host,name,1024, 0, 0); } /** - * Create a VM - * @param host Host node + * Create a VM + * @param host Host node * @param name name of the machine * @param ramSize size of the RAM that should be allocated (in MBytes) * @param migNetSpeed (network bandwith allocated for migrations in MB/s, if you don't know put zero ;)) @@ -38,7 +31,7 @@ public class VM extends Host{ */ public VM(Host host, String name, int ramSize, int migNetSpeed, int dpIntensity){ super(); - super.name = name; + super.name = name; this.currentHost = host; create(host, name, ramSize, migNetSpeed, dpIntensity); vms.add(this); @@ -66,34 +59,25 @@ public class VM extends Host{ /* JNI / Native code */ - /* get/set property methods are inherited from the Host class. */ - - /** Returns whether the given VM is currently suspended - */ + /** Returns whether the given VM is currently suspended */ public native int isCreated(); - /** Returns whether the given VM is currently running - */ + /** Returns whether the given VM is currently running */ public native int isRunning(); - /** Returns whether the given VM is currently running - */ + /** Returns whether the given VM is currently running */ public native int isMigrating(); - /** Returns whether the given VM is currently suspended - */ + /** Returns whether the given VM is currently suspended */ public native int isSuspended(); - /** Returns whether the given VM is currently saving - */ + /** Returns whether the given VM is currently saving */ public native int isSaving(); - /** Returns whether the given VM is currently saved - */ + /** Returns whether the given VM is currently saved */ public native int isSaved(); - /** Returns whether the given VM is currently restoring its state - */ + /** Returns whether the given VM is currently restoring its state */ public native boolean isRestoring(); /** @@ -111,21 +95,18 @@ public class VM extends Host{ */ public native void setBound(double bound); - /** - * start the VM - */ + /** start the VM */ public native void start(); /** - * Immediately kills all processes within the given VM. Any memory that they allocated will be leaked. - * No extra delay occurs. If you want to simulate this too, you want to use a MSG_process_sleep() or something + * Immediately kills all processes within the given VM. + * + * No extra delay occurs. If you want to simulate this too, you want to use a MSG_process_sleep() */ public native void shutdown(); - /** - * Invoke native migration routine - */ + /** Invoke native migration routine */ public native void internalmig(Host destination) throws Exception; // TODO add throws DoubleMigrationException (i.e. when you call migrate on a VM that is already migrating); @@ -179,10 +160,7 @@ public class VM extends Host{ */ public native void restore(); - - /** - * Class initializer, to initialize various JNI stuff - */ + /** Class initializer (for JNI), don't do it yourself */ public static native void nativeInit(); static { nativeInit(); -- 2.20.1