Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: joist/java/org/joist/util URL.java

Project highlights: Architectural Overview

joist
Discussion topic

Back to topic list

CVS update: joist/java/org/joist/util URL.java

Author dlr
Full name Daniel Rall
Date 2001-04-02 15:09:36 PDT
Message User: dlr
  Date: 01/04/02 15:09:36

  Modified: java/org/joist/util URL.java
  Log:
  Cleaned up getPort() class method.
  
  Revision Changes Path
  1.36 +7 -13 joist/java/org/joist​/util/URL.java
  
  Index: URL.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/util/URL.java,​v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- URL.java 2001/04/02 22:05:59 1.35
  +++ URL.java 2001/04/02 22:09:35 1.36
  @@ -65,7 +65,7 @@
    *
    * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
    * @author <a href="mailto:dlr@col​lab.net">Daniel Rall</a>
  - * @version $Id: URL.java,v 1.35 2001/04/02 22:05:59 dlr Exp $
  + * @version $Id: URL.java,v 1.36 2001/04/02 22:09:35 dlr Exp $
    *
    * Copyright (c) 1999 dataweb systems, inc.
    * Copyright (c) 1999-2001 CollabNet, Inc.
  @@ -264,24 +264,18 @@
        public String getPort( String inProtocol )
           throws NullPointerException
        {
  - String port = null; // Port to return
  - String protocol = ( inProtocol == null )? getProtocol( ): inProtocol;
  -
  - // JoistProperties is a singleton of system properties.
  - org.joist.util.JoistProperties properties
  - = org.joist.util.Joist​Properties.getInstan​ce( );
  - if( properties == null )
  - throw new NullPointerException( "JoistProperties is null" );
  + String port = null;
   
  + String protocol = (inProtocol == null ? getProtocol() : inProtocol);
           boolean isHttp = protocol.equalsIgnoreCase( HTTP_PROTOCOL );
           Integer defaultPort = (isHttp ? DEFAULT_HTTP_PORT: DEFAULT_HTTPS_PORT);
           String portKey = (isHttp ? HTTP_PORT_KEY : HTTPS_PORT_KEY);
  - port = properties.getProperty( portKey );
  - if( port == null )
  + port = JoistProperties.getP​roperty(portKey);
  + if (port == null)
               throw new NullPointerException( portKey + " is null" );
  - if( port.equals( defaultPort.toString( ) ) )
  + if ( port.equals(defaultP​ort.toString()) )
               port = null; // Return null if port is default for the protocol.
  -
  +
           return port;
        }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: joist/java/org/joist/util URL.java dlr Daniel Rall 2001-04-02 15:09:36 PDT
Messages per page: