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