samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToOld.java
changeset 154 0fd5e9c500b9
parent 153 b5cbb797ec0a
     1.1 --- a/samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToOld.java	Sat Jun 14 09:58:08 2008 +0200
     1.2 +++ b/samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToOld.java	Sat Jun 14 09:58:11 2008 +0200
     1.3 @@ -1,8 +1,3 @@
     1.4 -/*
     1.5 - * To change this template, choose Tools | Templates
     1.6 - * and open the template in the editor.
     1.7 - */
     1.8 -
     1.9  package org.apidesign.impl.security.extension;
    1.10  
    1.11  import org.apidesign.api.security.Digest;
    1.12 @@ -41,7 +36,10 @@
    1.13              if ("MessageDigest".equals(type)) {
    1.14                  Digest dig = Digest.getInstance(algorithm);
    1.15                  if (dig != null) {
    1.16 -                    return new ServiceImpl(dig, this, type, algorithm, "", Collections.<String>emptyList(), Collections.<String,String>emptyMap());
    1.17 +                    return new ServiceImpl(
    1.18 +                        dig, this, type, algorithm, "", 
    1.19 +                        Collections.<String>emptyList(), 
    1.20 +                        Collections.<String,String>emptyMap());
    1.21                  }
    1.22              }
    1.23              return null;
    1.24 @@ -54,13 +52,19 @@
    1.25      private static class ServiceImpl<Data> extends Service {
    1.26          Digest dig;
    1.27  
    1.28 -        public ServiceImpl(Digest dig, Provider provider, String type, String algorithm, String className, List<String> aliases, Map<String, String> attributes) {
    1.29 -            super(provider, type, algorithm, className, aliases, attributes);
    1.30 +        public ServiceImpl(Digest dig, Provider provider, 
    1.31 +            String type, String algorithm, String className, 
    1.32 +            List<String> aliases, Map<String, String> attributes
    1.33 +        ) {
    1.34 +            super(
    1.35 +                provider, type, algorithm, className, aliases, attributes
    1.36 +            );
    1.37              this.dig = dig;
    1.38          }
    1.39  
    1.40          @Override
    1.41 -        public Object newInstance(Object constructorParameter) throws NoSuchAlgorithmException {
    1.42 +        public Object newInstance(Object constructorParameter) 
    1.43 +        throws NoSuchAlgorithmException {
    1.44              return new MessageDigest(getAlgorithm()) {
    1.45                  private byte[] res;
    1.46                  
    1.47 @@ -71,7 +75,9 @@
    1.48                  }
    1.49  
    1.50                  @Override
    1.51 -                protected void engineUpdate(byte[] input, int offset, int len) {
    1.52 +                protected void engineUpdate(
    1.53 +                    byte[] input, int offset, int len
    1.54 +                ) {
    1.55                      ByteBuffer bb = ByteBuffer.wrap(input);
    1.56                      bb.position(offset);
    1.57                      bb.limit(offset + len);