Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
jrivard authored Dec 10, 2019
2 parents 2f8e7a1 + 820882b commit 333395e
Show file tree
Hide file tree
Showing 418 changed files with 8,193 additions and 6,095 deletions.
8 changes: 6 additions & 2 deletions build/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,16 @@
<module name="FallThrough"/>
<module name="EqualsHashCode"/>
<module name="ArrayTrailingCommaCheck"/>
<module name="FinalLocalVariable"/>
<module name="FinalLocalVariable">
<property name="validateEnhancedForLoopVariable" value="true"/>
</module>
<module name="MissingSwitchDefault"/>
<module name="ModifiedControlVariable"/>
<module name="MultipleVariableDeclarations"/>
<module name="OneStatementPerLine"/>
<module name="FinalParameters"/>
<module name="FinalParameters">
<property name="tokens" value="METHOD_DEF,CTOR_DEF,LITERAL_CATCH"/>
</module>
<module name="ParameterAssignment"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
Expand Down
14 changes: 7 additions & 7 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"@microfocus/ng-ias": "1.0.1",
"@microfocus/ux-ias": "1.1.2",
"@uirouter/angularjs": "1.0.15",
"angular": "1.7.8",
"angular": "^1.7.9",
"angular-aria": "1.7.8",
"angular-sanitize": "1.7.8",
"angular-sanitize": "1.7.9",
"angular-translate": "2.18.1",
"core-js": "3.2.1",
"textangular": "1.5.16"
Expand All @@ -38,18 +38,18 @@
"angular-mocks": "1.6.9",
"autoprefixer": "8.1.0",
"copy-webpack-plugin": "4.5.1",
"css-loader": "^3.2.0",
"css-loader": "^3.2.1",
"file-loader": "1.1.11",
"html-loader": "0.5.5",
"html-webpack-plugin": "3.0.6",
"ignore-loader": "0.1.2",
"imports-loader": "0.8.0",
"jasmine": "3.2.0",
"jasmine-core": "3.2.1",
"jshint": "^2.10.2",
"jshint": "^2.10.3",
"jshint-loader": "0.8.4",
"json-loader": "0.5.7",
"karma": "^4.3.0",
"karma": "^4.4.1",
"karma-chrome-launcher": "2.2.0",
"karma-jasmine": "1.1.2",
"karma-jasmine-html-reporter": "1.3.1",
Expand All @@ -59,7 +59,7 @@
"karma-webpack": "3.0.5",
"moment": "2.21.0",
"ngtemplate-loader": "2.0.1",
"node-sass": "^4.12.0",
"node-sass": "^4.13.0",
"phantomjs": "2.1.7",
"phantomjs-prebuilt": "2.1.16",
"postcss-loader": "2.1.1",
Expand All @@ -76,7 +76,7 @@
"uglifyjs-webpack-plugin": "1.2.3",
"url-loader": "1.0.1",
"webpack": "4.1.1",
"webpack-cli": "^3.3.8",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "3.1.14",
"webpack-merge": "4.1.2",
"write-file-webpack-plugin": "4.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void readData( final Storage storage )
{
readFile( ftpClient, fileName, storage );
}
catch ( Exception e )
catch ( final Exception e )
{
app.getStatus().setLastFtpIngest( Instant.now() );
final String msg = "error while reading ftp file '" + fileName + "': " + e.getMessage();
Expand All @@ -93,7 +93,7 @@ void readData( final Storage storage )
app.getStatus().setLastFtpIngest( Instant.now() );
app.getStatus().setLastFtpFilesRead( files.size() );
}
catch ( Exception e )
catch ( final Exception e )
{
app.getStatus().setLastFtpIngest( Instant.now() );
app.getStatus().setLastFtpStatus( "error during ftp scan: " + e.getMessage() );
Expand Down Expand Up @@ -130,7 +130,7 @@ private void readZippedByteStream( final InputStream inputStream, final String f
storage.store( bean );
}
}
catch ( Exception e )
catch ( final Exception e )
{
final String msg = "error reading ftp file '" + fileName + "', error: " + e.getMessage();
LOGGER.info( msg );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public PwmReceiverApp( )
{
settings = Settings.readFromFile( propsFile );
}
catch ( IOException e )
catch ( final IOException e )
{
final String errorMsg = "can't read configuration: " + JavaHelper.readHostileExceptionMessage( e );
status.setErrorState( errorMsg );
Expand All @@ -65,7 +65,7 @@ public PwmReceiverApp( )
{
storage = new Storage( settings );
}
catch ( Exception e )
catch ( final Exception e )
{
final String errorMsg = "can't start storage system: " + JavaHelper.readHostileExceptionMessage( e );
status.setErrorState( errorMsg );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private void doNext( )
}
nextValue = string;
}
catch ( Exception e )
catch ( final Exception e )
{
e.printStackTrace();
throw e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ protected void doPost( final HttpServletRequest req, final HttpServletResponse r
stoage.store( telemetryPublishBean );
resp.getWriter().print( RestResultBean.forSuccessMessage( null, null, null, Message.Success_Unknown ).toJson() );
}
catch ( PwmUnrecoverableException e )
catch ( final PwmUnrecoverableException e )
{
resp.getWriter().print( RestResultBean.fromError( e.getErrorInformation() ).toJson() );
}
catch ( Exception e )
catch ( final Exception e )
{
final RestResultBean restResultBean = RestResultBean.fromError( new ErrorInformation( PwmError.ERROR_INTERNAL, e.getMessage() ) );
resp.getWriter().print( restResultBean.toJson() );
Expand Down
2 changes: 1 addition & 1 deletion onejar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<properties>
<project.root.basedir>${project.basedir}/..</project.root.basedir>
<tomcat.version>9.0.27</tomcat.version>
<tomcat.version>9.0.29</tomcat.version>
</properties>

<build>
Expand Down
10 changes: 5 additions & 5 deletions onejar/src/main/java/password/pwm/onejar/ArgumentParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public OnejarConfig parseArguments( final String[] args )
{
commandLine = new DefaultParser().parse( Argument.asOptions(), args );
}
catch ( ParseException e )
catch ( final ParseException e )
{
throw new ArgumentParserException( "unable to parse command line: " + e.getMessage() );
}
Expand Down Expand Up @@ -100,7 +100,7 @@ else if ( commandLine.hasOption( Argument.help.name() ) )
{
onejarConfig = makeTomcatConfig( argumentMap );
}
catch ( IOException e )
catch ( final IOException e )
{
throw new ArgumentParserException( "error while reading input: " + e.getMessage() );
}
Expand All @@ -118,7 +118,7 @@ private Map<Argument, String> mapFromProperties( final String filename ) throws
{
props.load( is );
}
catch ( IOException e )
catch ( final IOException e )
{
throw new ArgumentParserException( "unable to read properties input file: " + e.getMessage() );
}
Expand Down Expand Up @@ -204,7 +204,7 @@ private OnejarConfig makeTomcatConfig( final Map<Argument, String> argumentMap )
port = Integer.parseInt( argumentMap.get( Argument.port ) );
onejarConfig.port( port );
}
catch ( NumberFormatException e )
catch ( final NumberFormatException e )
{
final String msg = Argument.port.name() + " argument must be numeric";
System.out.println( msg );
Expand All @@ -228,7 +228,7 @@ private OnejarConfig makeTomcatConfig( final Map<Argument, String> argumentMap )
final ServerSocket socket = new ServerSocket( port, 100, InetAddress.getByName( localAddress ) );
socket.close();
}
catch ( Exception e )
catch ( final Exception e )
{
throw new ArgumentParserException( "port or address conflict: " + e.getMessage() );
}
Expand Down
6 changes: 3 additions & 3 deletions onejar/src/main/java/password/pwm/onejar/OnejarMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static void main( final String[] args )
{
onejarConfig = argumentParser.parseArguments( args );
}
catch ( ArgumentParserException | OnejarException e )
catch ( final ArgumentParserException | OnejarException e )
{
output( "error parsing command line: " + e.getMessage() );
}
Expand Down Expand Up @@ -91,7 +91,7 @@ private void execCommand( final OnejarConfig onejarConfig )

mainMethod.invoke( null, ( Object ) arguments );
}
catch ( Exception e )
catch ( final Exception e )
{
e.printStackTrace( );
}
Expand All @@ -111,7 +111,7 @@ void deployWebApp( final OnejarConfig onejarConfig )
runner.startTomcat( onejarConfig );

}
catch ( OnejarException | ServletException | IOException e )
catch ( final OnejarException | ServletException | IOException e )
{
out( "error starting tomcat: " + e.getMessage() );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void startTomcat( final OnejarConfig onejarConfig )
tlsProperties = this.executeOnejarHelper( onejarConfig );
out( "keystore generated" );
}
catch ( Exception e )
catch ( final Exception e )
{
throw new OnejarException( "error generating keystore: " + e.getMessage() );
}
Expand Down Expand Up @@ -113,7 +113,7 @@ void startTomcat( final OnejarConfig onejarConfig )
tomcat.start();
out( "tomcat started in " + Duration.between( Instant.now(), startTime ).toString() );
}
catch ( Exception e )
catch ( final Exception e )
{
throw new OnejarException( "unable to start tomcat: " + e.getMessage() );
}
Expand Down Expand Up @@ -199,7 +199,7 @@ static String getVersion( ) throws OnejarException
return attr.getValue( "Implementation-Version-Display" )
+ " [" + ServerInfo.getServerInfo() + "]";
}
catch ( IOException e )
catch ( final IOException e )
{
throw new OnejarException( "error reading internal version info: " + e.getMessage() );
}
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.25</version>
<version>8.27</version>
</dependency>
</dependencies>
<executions>
Expand Down Expand Up @@ -308,13 +308,13 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.13.2</version>
<version>3.14.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -332,13 +332,13 @@
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.21</version>
<version>1.22</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.21</version>
<version>1.22</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public Map<Type, StoredResponseSet> read( final Reader input )
{
timestamp = CrUtils.parseDateString( timeStr );
}
catch ( ParseException e )
catch ( final ParseException e )
{
throw new IllegalArgumentException( "unexpected error attempting to parse timestamp: " + e.getMessage() );
}
Expand Down Expand Up @@ -173,14 +173,14 @@ public Map<Type, StoredResponseSet> read( final Reader input )
break;

default:
throw new IllegalStateException( "unknown response type '" + type + "'" );
throw new IllegalStateException( "unknown response type '" + type + '\'' );

}
}
}
}
}
catch ( JDOMException | IOException | NullPointerException e )
catch ( final JDOMException | IOException | NullPointerException e )
{
throw new IllegalArgumentException( "error parsing stored response record: " + e.getMessage() );
}
Expand Down Expand Up @@ -228,7 +228,7 @@ private static String elementNameForType( final Type type )
return XML_NODE_HELPDESK_RESPONSE;

default:
throw new IllegalArgumentException( "unknown type '" + type + "'" );
throw new IllegalArgumentException( "unknown type '" + type + '\'' );
}
}

Expand Down Expand Up @@ -279,7 +279,7 @@ private static StoredResponseItem parseAnswerElement( final Element element )
{
saltCount = Integer.parseInt( hashCount );
}
catch ( NumberFormatException e )
catch ( final NumberFormatException e )
{
/* noop */
}
Expand All @@ -306,7 +306,7 @@ private static String makeId(
final byte[] hashedBytes = md.digest( questionText.getBytes( StandardCharsets.UTF_8 ) );
return net.iharder.Base64.encodeBytes( hashedBytes, Base64.URL_SAFE );
}
catch ( NoSuchAlgorithmException | IOException e )
catch ( final NoSuchAlgorithmException | IOException e )
{
throw new IllegalStateException( "unable to load SHA1 message digest algorithm: " + e.getMessage() );
}
Expand Down
1 change: 1 addition & 0 deletions pwm-cr/src/main/java/password/pwm/cr/CrUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.time.Instant;
import java.util.TimeZone;

@SuppressWarnings( "checkstyle:MultipleStringLiterals" )
public class CrUtils
{
static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss Z";
Expand Down
4 changes: 2 additions & 2 deletions pwm-cr/src/main/java/password/pwm/cr/hash/HashFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private static ResponseHashMachine machineForStoredResponse( final StoredRespons
{
alg = ResponseHashAlgorithm.valueOf( algName );
}
catch ( IllegalArgumentException e )
catch ( final IllegalArgumentException e )
{
throw new IllegalArgumentException( "unknown format type '" + algName + "'" );
}
Expand All @@ -64,7 +64,7 @@ private static ResponseHashMachine machineForStoredResponse( final StoredRespons
{
responseHashMachine = ( ResponseHashMachineSpi ) algClass.newInstance();
}
catch ( Exception e )
catch ( final Exception e )
{
throw new IllegalStateException( "unexpected error instantiating response hash machine spi class: " + e.getMessage() );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private String hashValue( final String input, final int iterations, final String
final byte[] hash = skf.generateSecret( spec ).getEncoded();
return Base64.encodeBytes( hash );
}
catch ( Exception e )
catch ( final Exception e )
{
throw new IllegalStateException( "unable to perform PBKDF2 hashing operation: " + e.getMessage() );
}
Expand Down
Loading

0 comments on commit 333395e

Please sign in to comment.