From 26732f2fdd4720deee653ab96cd453ed65dcaa87 Mon Sep 17 00:00:00 2001 From: Vlad Dumitrescu Date: Thu, 13 Nov 2014 10:28:08 +0100 Subject: [jinterface] cleanup code according to new style --- .../com/ericsson/otp/erlang/OtpLocalNode.java | 110 ++++++++++----------- 1 file changed, 55 insertions(+), 55 deletions(-) (limited to 'lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java') diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java index fbd0eb4073..b996ba6f6c 100644 --- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java +++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * + * * Copyright Ericsson AB 2000-2009. All Rights Reserved. - * + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ package com.ericsson.otp.erlang; @@ -32,86 +32,86 @@ public class OtpLocalNode extends AbstractNode { protected java.net.Socket epmd; protected OtpLocalNode() { - super(); - init(); + super(); + init(); } /** * Create a node with the given name and the default cookie. */ protected OtpLocalNode(final String node) { - super(node); - init(); + super(node); + init(); } /** * Create a node with the given name and cookie. */ protected OtpLocalNode(final String node, final String cookie) { - super(node, cookie); - init(); + super(node, cookie); + init(); } private void init() { - serial = 0; - pidCount = 1; - portCount = 1; - refId = new int[3]; - refId[0] = 1; - refId[1] = 0; - refId[2] = 0; + serial = 0; + pidCount = 1; + portCount = 1; + refId = new int[3]; + refId[0] = 1; + refId[1] = 0; + refId[2] = 0; } /** * Get the port number used by this node. - * + * * @return the port number this server node is accepting connections on. */ public int port() { - return port; + return port; } /** * Set the Epmd socket after publishing this nodes listen port to Epmd. - * + * * @param s - * The socket connecting this node to Epmd. + * The socket connecting this node to Epmd. */ protected void setEpmd(final java.net.Socket s) { - epmd = s; + epmd = s; } /** * Get the Epmd socket. - * + * * @return The socket connecting this node to Epmd. */ protected java.net.Socket getEpmd() { - return epmd; + return epmd; } /** * Create an Erlang {@link OtpErlangPid pid}. Erlang pids are based upon * some node specific information; this method creates a pid using the * information in this node. Each call to this method produces a unique pid. - * + * * @return an Erlang pid. */ public synchronized OtpErlangPid createPid() { - final OtpErlangPid p = new OtpErlangPid(node, pidCount, serial, - creation); + final OtpErlangPid p = new OtpErlangPid(node, pidCount, serial, + creation); - pidCount++; - if (pidCount > 0x7fff) { - pidCount = 0; + pidCount++; + if (pidCount > 0x7fff) { + pidCount = 0; - serial++; - if (serial > 0x1fff) { /* 13 bits */ - serial = 0; - } - } + serial++; + if (serial > 0x1fff) { /* 13 bits */ + serial = 0; + } + } - return p; + return p; } /** @@ -120,18 +120,18 @@ public class OtpLocalNode extends AbstractNode { * information in this node. Each call to this method produces a unique * port. It may not be meaningful to create a port in a non-Erlang * environment, but this method is provided for completeness. - * + * * @return an Erlang port. */ public synchronized OtpErlangPort createPort() { - final OtpErlangPort p = new OtpErlangPort(node, portCount, creation); + final OtpErlangPort p = new OtpErlangPort(node, portCount, creation); - portCount++; - if (portCount > 0xfffffff) { /* 28 bits */ - portCount = 0; - } + portCount++; + if (portCount > 0xfffffff) { /* 28 bits */ + portCount = 0; + } - return p; + return p; } /** @@ -139,23 +139,23 @@ public class OtpLocalNode extends AbstractNode { * based upon some node specific information; this method creates a * reference using the information in this node. Each call to this method * produces a unique reference. - * + * * @return an Erlang reference. */ public synchronized OtpErlangRef createRef() { - final OtpErlangRef r = new OtpErlangRef(node, refId, creation); + final OtpErlangRef r = new OtpErlangRef(node, refId, creation); - // increment ref ids (3 ints: 18 + 32 + 32 bits) - refId[0]++; - if (refId[0] > 0x3ffff) { - refId[0] = 0; + // increment ref ids (3 ints: 18 + 32 + 32 bits) + refId[0]++; + if (refId[0] > 0x3ffff) { + refId[0] = 0; - refId[1]++; - if (refId[1] == 0) { - refId[2]++; - } - } + refId[1]++; + if (refId[1] == 0) { + refId[2]++; + } + } - return r; + return r; } } -- cgit v1.2.3