This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 149ad8a3be1bc53103ec0c8b3228b4ca47c335f0 Author: Benoit Tellier <[email protected]> AuthorDate: Mon Nov 18 17:59:05 2019 +0700 [Refactoring] Better naming in CassandraMessageDAO --- .../james/mailbox/cassandra/mail/CassandraMessageDAO.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAO.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAO.java index e663b98..37976ab 100644 --- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAO.java +++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAO.java @@ -226,11 +226,11 @@ public class CassandraMessageDAO { private List<UDTValue> buildPropertiesUdt(MailboxMessage message) { return message.getProperties().stream() - .map(x -> typesProvider.getDefinedUserType(PROPERTIES) + .map(property -> typesProvider.getDefinedUserType(PROPERTIES) .newValue() - .setString(Properties.NAMESPACE, x.getNamespace()) - .setString(Properties.NAME, x.getLocalName()) - .setString(Properties.VALUE, x.getValue())) + .setString(Properties.NAMESPACE, property.getNamespace()) + .setString(Properties.NAME, property.getLocalName()) + .setString(Properties.VALUE, property.getValue())) .collect(Guavate.toImmutableList()); } @@ -278,12 +278,16 @@ public class CassandraMessageDAO { private PropertyBuilder getPropertyBuilder(Row row) { PropertyBuilder property = new PropertyBuilder( row.getList(PROPERTIES, UDTValue.class).stream() - .map(x -> new Property(x.getString(Properties.NAMESPACE), x.getString(Properties.NAME), x.getString(Properties.VALUE))) + .map(this::toProperty) .collect(Collectors.toList())); property.setTextualLineCount(row.getLong(TEXTUAL_LINE_COUNT)); return property; } + private Property toProperty(UDTValue udtValue) { + return new Property(udtValue.getString(Properties.NAMESPACE), udtValue.getString(Properties.NAME), udtValue.getString(Properties.VALUE)); + } + private Stream<MessageAttachmentRepresentation> getAttachments(Row row, FetchType fetchType) { switch (fetchType) { case Full: --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
