2525
2626import  org .apache .commons .logging .Log ;
2727import  org .apache .commons .logging .LogFactory ;
28+ 
2829import  org .springframework .core .log .LogMessage ;
2930import  org .springframework .core .serializer .DefaultDeserializer ;
3031import  org .springframework .core .serializer .Deserializer ;
@@ -47,8 +48,8 @@ public final class JdbcAssertingPartyMetadataRepository implements AssertingPart
4748
4849	private  final  JdbcOperations  jdbcOperations ;
4950
50- 	private  RowMapper <AssertingPartyMetadata > assertingPartyMetadataRowMapper  =
51- 			new   AssertingPartyMetadataRowMapper ( ResultSet ::getBytes );
51+ 	private  RowMapper <AssertingPartyMetadata > assertingPartyMetadataRowMapper  =  new   AssertingPartyMetadataRowMapper ( 
52+ 			ResultSet ::getBytes );
5253
5354	// @formatter:off 
5455	static  final  String  COLUMN_NAMES  = "entity_id, " 
@@ -79,7 +80,6 @@ public final class JdbcAssertingPartyMetadataRepository implements AssertingPart
7980	/** 
8081	 * Constructs a {@code JdbcRelyingPartyRegistrationRepository} using the provided 
8182	 * parameters. 
82- 	 * 
8383	 * @param jdbcOperations the JDBC operations 
8484	 */ 
8585	public  JdbcAssertingPartyMetadataRepository (JdbcOperations  jdbcOperations ) {
@@ -91,21 +91,18 @@ public JdbcAssertingPartyMetadataRepository(JdbcOperations jdbcOperations) {
9191	 * Sets the {@link RowMapper} used for mapping the current row in 
9292	 * {@code java.sql.ResultSet} to {@link AssertingPartyMetadata}. The default is 
9393	 * {@link AssertingPartyMetadataRowMapper}. 
94- 	 * 
9594	 * @param assertingPartyMetadataRowMapper the {@link RowMapper} used for mapping the 
96- 	 *                                         current row in {@code java.sql.ResultSet} to {@link AssertingPartyMetadata} 
95+ 	 * current row in {@code java.sql.ResultSet} to {@link AssertingPartyMetadata} 
9796	 */ 
98- 	public  void  setAssertingPartyMetadataRowMapper (
99- 			RowMapper <AssertingPartyMetadata > assertingPartyMetadataRowMapper ) {
97+ 	public  void  setAssertingPartyMetadataRowMapper (RowMapper <AssertingPartyMetadata > assertingPartyMetadataRowMapper ) {
10098		Assert .notNull (assertingPartyMetadataRowMapper , "assertingPartyMetadataRowMapper cannot be null" );
10199		this .assertingPartyMetadataRowMapper  = assertingPartyMetadataRowMapper ;
102100	}
103101
104102	@ Override 
105103	public  AssertingPartyMetadata  findByEntityId (String  entityId ) {
106104		Assert .hasText (entityId , "entityId cannot be empty" );
107- 		SqlParameterValue [] parameters  = new  SqlParameterValue []{
108- 				new  SqlParameterValue (Types .VARCHAR , entityId )};
105+ 		SqlParameterValue [] parameters  = new  SqlParameterValue [] { new  SqlParameterValue (Types .VARCHAR , entityId ) };
109106		PreparedStatementSetter  pss  = new  ArgumentPreparedStatementSetter (parameters );
110107		List <AssertingPartyMetadata > result  = this .jdbcOperations .query (LOAD_BY_ID_SQL , pss ,
111108				this .assertingPartyMetadataRowMapper );
@@ -123,7 +120,7 @@ public Iterator<AssertingPartyMetadata> iterator() {
123120	 * The default {@link RowMapper} that maps the current row in 
124121	 * {@code java.sql.ResultSet} to {@link AssertingPartyMetadata}. 
125122	 */ 
126- 	private  final   static  class  AssertingPartyMetadataRowMapper  implements  RowMapper <AssertingPartyMetadata > {
123+ 	private  static   final  class  AssertingPartyMetadataRowMapper  implements  RowMapper <AssertingPartyMetadata > {
127124
128125		private  final  Log  logger  = LogFactory .getLog (AssertingPartyMetadataRowMapper .class );
129126
@@ -151,38 +148,37 @@ public AssertingPartyMetadata mapRow(ResultSet rs, int rowNum) throws SQLExcepti
151148			AssertingPartyMetadata .Builder <?> builder  = new  AssertingPartyDetails .Builder ();
152149			try  {
153150				if  (signingAlgorithmsBytes  != null ) {
154- 					List <String > signingAlgorithms  = (List <String >)
155- 							 this . deserializer .deserializeFromByteArray (signingAlgorithmsBytes );
156- 					builder .signingAlgorithms (algorithms  -> algorithms .addAll (signingAlgorithms ));
151+ 					List <String > signingAlgorithms  = (List <String >)  this . deserializer 
152+ 						.deserializeFromByteArray (signingAlgorithmsBytes );
153+ 					builder .signingAlgorithms (( algorithms )  -> algorithms .addAll (signingAlgorithms ));
157154				}
158155				if  (verificationCredentialsBytes  != null ) {
159- 					Collection <Saml2X509Credential > verificationCredentials  = (Collection <Saml2X509Credential >)
160- 							this .deserializer .deserializeFromByteArray (verificationCredentialsBytes );
161- 					builder .verificationX509Credentials (
162- 							credentials  -> credentials .addAll (verificationCredentials ));
156+ 					Collection <Saml2X509Credential > verificationCredentials  = (Collection <Saml2X509Credential >) this .deserializer 
157+ 						.deserializeFromByteArray (verificationCredentialsBytes );
158+ 					builder .verificationX509Credentials ((credentials ) -> credentials .addAll (verificationCredentials ));
163159				}
164160				if  (encryptionCredentialsBytes  != null ) {
165- 					Collection <Saml2X509Credential > encryptionCredentials  = (Collection <Saml2X509Credential >)
166- 							this .deserializer .deserializeFromByteArray (encryptionCredentialsBytes );
167- 					builder .encryptionX509Credentials (
168- 							credentials  -> credentials .addAll (encryptionCredentials ));
161+ 					Collection <Saml2X509Credential > encryptionCredentials  = (Collection <Saml2X509Credential >) this .deserializer 
162+ 						.deserializeFromByteArray (encryptionCredentialsBytes );
163+ 					builder .encryptionX509Credentials ((credentials ) -> credentials .addAll (encryptionCredentials ));
169164				}
170- 			} catch  (Exception  ex ) {
171- 				this .logger .debug (
172- 						LogMessage .format ("Parsing serialized credentials for entity %s failed" , entityId ), ex );
165+ 			}
166+ 			catch  (Exception  ex ) {
167+ 				this .logger .debug (LogMessage .format ("Parsing serialized credentials for entity %s failed" , entityId ),
168+ 						ex );
173169				return  null ;
174170			}
175171
176- 			builder 
177- 					.entityId (entityId )
178- 					.wantAuthnRequestsSigned (singleSignOnSignRequest )
179- 					.singleSignOnServiceLocation (singleSignOnUrl )
180- 					.singleSignOnServiceBinding (singleSignOnBinding )
181- 					.singleLogoutServiceLocation (singleLogoutUrl )
182- 					.singleLogoutServiceBinding (singleLogoutBinding )
183- 					.singleLogoutServiceResponseLocation (singleLogoutResponseUrl );
172+ 			builder .entityId (entityId )
173+ 				.wantAuthnRequestsSigned (singleSignOnSignRequest )
174+ 				.singleSignOnServiceLocation (singleSignOnUrl )
175+ 				.singleSignOnServiceBinding (singleSignOnBinding )
176+ 				.singleLogoutServiceLocation (singleLogoutUrl )
177+ 				.singleLogoutServiceBinding (singleLogoutBinding )
178+ 				.singleLogoutServiceResponseLocation (singleLogoutResponseUrl );
184179			return  builder .build ();
185180		}
181+ 
186182	}
187183
188184	private  interface  GetBytes  {
0 commit comments