Skip to content

Commit

Permalink
Fixed javadoc errors.
Browse files Browse the repository at this point in the history
If you clone the nailgun repository, it builds just fine. However, if
you try to use this version of nailgun with scalafmt [1], it doesn't
actually work [2]. In [2], they suggest building the nailgun-all-0.9.1
tag. But, this tag doesn't build because of javadoc errors. This commit
fixes those errors so that the code builds again.

[1]: https://scalameta.org/scalafmt/#Nailgun
[2]: scalameta/scalafmt#1115
  • Loading branch information
mwhittaker committed Jun 16, 2018
1 parent cd3ff15 commit 94afedb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
Copyright 2004-2012, Martian Software, Inc.
Expand Down Expand Up @@ -46,73 +46,73 @@ public class NGServer implements Runnable {
* Default size for thread pool
*/
public static final int DEFAULT_SESSIONPOOLSIZE = 10;

/**
* The address on which to listen, or null to listen on all local addresses
*/
private InetAddress addr = null;

/**
* The port on which to listen, or zero to select a port automatically
*/
private int port = 0;

/**
* The socket doing the listening
*/
private ServerSocket serversocket;

/**
* True if this NGServer has received instructions to shut down
*/
private boolean shutdown = false;

/**
* True if this NGServer has been started and is accepting connections
*/
private boolean running = false;

/**
* This NGServer's AliasManager, which maps aliases to classes
*/
private AliasManager aliasManager;

/**
* If true, fully-qualified classnames are valid commands
*/
private boolean allowNailsByClassName = true;

/**
* The default class to use if an invalid alias or classname is specified by
* the client.
*/
private Class defaultNailClass = null;

/**
* A pool of NGSessions ready to handle client connections
*/
private NGSessionPool sessionPool = null;

/**
* <code>System.out</code> at the time of the NGServer's creation
*/
public final PrintStream out = System.out;

/**
* <code>System.err</code> at the time of the NGServer's creation
*/
public final PrintStream err = System.err;

/**
* <code>System.in</code> at the time of the NGServer's creation
*/
public final InputStream in = System.in;

/**
* a collection of all classes executed by this server so far
*/
private Map allNailStats = null;

/**
* Remember the security manager we start with so we can restore it later
*/
Expand Down Expand Up @@ -145,8 +145,6 @@ public NGServer(InetAddress addr, int port, int sessionPoolSize) {
* @param addr the address at which to listen, or
* <code>null</code> to bind to all local addresses
* @param port the port on which to listen.
* @param sessionPoolSize the max number of idle sessions allowed by the
* pool
*/
public NGServer(InetAddress addr, int port) {
init(addr, port, DEFAULT_SESSIONPOOLSIZE);
Expand All @@ -162,7 +160,7 @@ public NGServer(InetAddress addr, int port) {
public NGServer() {
init(null, NGConstants.DEFAULT_PORT, DEFAULT_SESSIONPOOLSIZE);
}

/**
* Sets up the NGServer internals
*
Expand Down Expand Up @@ -301,10 +299,10 @@ public AliasManager getAliasManager() {
* <p>Shuts down the server. The server will stop listening and its thread
* will finish. Any running nails will be allowed to finish.</p>
*
* <p>Any nails that provide a
* Any nails that provide a
* <pre><code>public static void nailShutdown(NGServer)</code></pre> method
* will have this method called with this NGServer as its sole
* parameter.</p>
* parameter.
*
* @param exitVM if true, this method will also exit the JVM after calling
* nailShutdown() on any nails. This may prevent currently running nails
Expand Down Expand Up @@ -450,6 +448,7 @@ private static void usage() {
* @param args a single optional argument specifying the port on which to
* listen.
* @throws NumberFormatException if a non-numeric port is specified
* @throws UnknownHostException TODO
*/
public static void main(String[] args) throws NumberFormatException, UnknownHostException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
Copyright 2004-2012, Martian Software, Inc.
Expand Down Expand Up @@ -28,18 +28,17 @@
/**
* <p>Provides a means to view and add aliases. This is aliased by default
* to the command "<code>ng-alias</code>".</p>
*
*
* <p>No command line validation is performed. If you trigger an exception,
* your client will display it.</p>
*
* <p><b>To view the current alias list</b>, issue the command:
*
* <b>To view the current alias list</b>, issue the command:
* <pre><code>ng-alias</code></pre>
* with no arguments.</p>
*
* <p><b>To add or replace an alias</b>, issue the command:
* with no arguments.
*
* <b>To add or replace an alias</b>, issue the command:
* <pre><code>ng-alias [alias name] [fully qualified aliased class name]</code></pre>
* </p>
*
*
* @author <a href="http://www.martiansoftware.com/contact.html">Marty Lamb</a>
*/
public class NGAlias {
Expand All @@ -49,15 +48,15 @@ private static String padl(String s, int len) {
while(buf.length() < len) buf.append(" ");
return (buf.toString());
}

public static void nailMain(NGContext context) throws ClassNotFoundException {

String[] args = context.getArgs();
NGServer server = context.getNGServer();

if (args.length == 0) {
Set aliases = server.getAliasManager().getAliases();

// let's pad this nicely. first, find the longest alias
// name. then pad the others to that width.
int maxAliasLength = 0;
Expand All @@ -69,8 +68,8 @@ public static void nailMain(NGContext context) throws ClassNotFoundException {
}
for (Iterator i = aliases.iterator(); i.hasNext();) {
Alias alias = (Alias) i.next();
context.out.println(padl(alias.getName(), maxAliasLength)
+ "\t"
context.out.println(padl(alias.getName(), maxAliasLength)
+ "\t"
+ padl(alias.getAliasedClass().getName(), maxClassnameLength));
context.out.println(padl("", maxAliasLength) + "\t" + alias.getDescription());
context.out.println();
Expand Down

0 comments on commit 94afedb

Please sign in to comment.