samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToOld.java
changeset 132 3bc4c54f4bcc
parent 51 130e099942d8
child 133 50bf1b976c0d
     1.1 --- a/samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToOld.java	Sat Jun 14 09:52:26 2008 +0200
     1.2 +++ b/samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToOld.java	Sat Jun 14 09:56:12 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,17 @@
    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 +        public ServiceImpl(Digest dig, Provider provider, 
    1.30 +            String type, String algorithm, String className, 
    1.31 +            List<String> aliases, Map<String, String> attributes
    1.32 +        ) {
    1.33              super(provider, type, algorithm, className, aliases, attributes);
    1.34              this.dig = dig;
    1.35          }
    1.36  
    1.37          @Override
    1.38 -        public Object newInstance(Object constructorParameter) throws NoSuchAlgorithmException {
    1.39 +        public Object newInstance(Object constructorParameter) 
    1.40 +        throws NoSuchAlgorithmException {
    1.41              return new MessageDigest(getAlgorithm()) {
    1.42                  private byte[] res;
    1.43                  
    1.44 @@ -71,7 +73,9 @@
    1.45                  }
    1.46  
    1.47                  @Override
    1.48 -                protected void engineUpdate(byte[] input, int offset, int len) {
    1.49 +                protected void engineUpdate(
    1.50 +                    byte[] input, int offset, int len
    1.51 +                ) {
    1.52                      ByteBuffer bb = ByteBuffer.wrap(input);
    1.53                      bb.position(offset);
    1.54                      bb.limit(offset + len);