mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
23.06.2012 9cb4730adfb2ad5fcf171c48a4d0aee46777902e
opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/LDAPResource.java
@@ -160,14 +160,13 @@
                        public void handleResult(final SearchResultEntry entry) {
                            final String revision = entryContainer.getEtagFromEntry(entry);
                            final ResultHandler<Map<String, Object>> mapHandler =
                                    new ResultHandler<Map<String, Object>>() {
                                        public void handleErrorResult(
                                                final ErrorResultException error) {
                                            out.setFailure(adaptErrorResult(error));
                            final AttributeMapperCompletionHandler<Map<String, Object>> mapHandler =
                                    new AttributeMapperCompletionHandler<Map<String, Object>>() {
                                        public void onFailure(final ResourceException e) {
                                            out.setFailure(e);
                                        }
                                        public void handleResult(final Map<String, Object> result) {
                                        public void onSuccess(final Map<String, Object> result) {
                                            out.setResult(id, revision, new JsonValue(result));
                                        }
                                    };
@@ -227,18 +226,19 @@
     *         attributes.
     */
    private Collection<String> getRequestedLDAPAttributes(final Set<JsonPointer> requestedAttributes) {
        final Set<String> requestedLDAPAttributes;
        if (requestedAttributes.isEmpty()) {
            // Full read.
            return attributeMapper.getAllLDAPAttributes();
            requestedLDAPAttributes = new LinkedHashSet<String>();
            attributeMapper.getLDAPAttributes(requestedLDAPAttributes);
        } else {
            // Partial read.
            final Set<String> requestedLDAPAttributes =
                    new LinkedHashSet<String>(requestedAttributes.size());
            requestedLDAPAttributes = new LinkedHashSet<String>(requestedAttributes.size());
            for (final JsonPointer requestedAttribute : requestedAttributes) {
                attributeMapper.getLDAPAttributesFor(requestedAttribute, requestedLDAPAttributes);
                attributeMapper.getLDAPAttributes(requestedLDAPAttributes, requestedAttribute);
            }
            return requestedLDAPAttributes;
        }
        return requestedLDAPAttributes;
    }
}