# HG changeset patch # User Jaroslav Tulach # Date 1213430172 -7200 # Node ID 3bc4c54f4bcc3e964b868738d4771b348a2c893a # Parent 7e5f84aa1196bdc9688686cb55b4d11acbdfac7f Truncating all examples to 80 characters per line diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/apifest1/day1/inputandoperation/nbproject/build-impl.xml --- a/samples/apifest1/day1/inputandoperation/nbproject/build-impl.xml Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/apifest1/day1/inputandoperation/nbproject/build-impl.xml Sat Jun 14 09:56:12 2008 +0200 @@ -19,7 +19,7 @@ - cleanup --> - + - - Builds, tests, and runs the project pinbasedsolution. + + Builds, tests, and runs the project pinbasedsolution - day1. - + - - Builds, tests, and runs the project stackbasedsolution. + + Builds, tests, and runs the project stackbasedsolution - day1. - + - + - - Builds, tests, and runs the project welltestedsolution. + + Builds, tests, and runs the project welltestedsolution - day2. - + - + - + g3tIcon getIcon diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/extensibleicon/src/org/apidesign/extensibleicon/CatQuery.java --- a/samples/extensibleicon/src/org/apidesign/extensibleicon/CatQuery.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/extensibleicon/src/org/apidesign/extensibleicon/CatQuery.java Sat Jun 14 09:56:12 2008 +0200 @@ -7,14 +7,18 @@ private CatQuery() { } public static boolean isCat(ExtIcon icon) { - for (CatQueryImplementation impl : Lookup.getDefault().lookupAll(CatQueryImplementation.class)) { + for (CatQueryImplementation impl : + Lookup.getDefault().lookupAll(CatQueryImplementation.class) + ) { Boolean res = impl.isCat(icon); if (res != null) { return res; } } - for (CatQueryImplementation impl : icon.getLookup().lookupAll(CatQueryImplementation.class)) { + for (CatQueryImplementation impl : + icon.getLookup().lookupAll(CatQueryImplementation.class) + ) { Boolean res = impl.isCat(icon); if (res != null) { return res; diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/extensibleicon/src/org/apidesign/extensibleicon/Icon2Image.java --- a/samples/extensibleicon/src/org/apidesign/extensibleicon/Icon2Image.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/extensibleicon/src/org/apidesign/extensibleicon/Icon2Image.java Sat Jun 14 09:56:12 2008 +0200 @@ -12,7 +12,11 @@ if (img != null) { return img; } - BufferedImage buf = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_RGB); + BufferedImage buf = new BufferedImage( + icon.getIconWidth(), + icon.getIconHeight(), + BufferedImage.TYPE_INT_RGB + ); icon.paintIcon(null, buf.getGraphics(), 0, 0); return buf; } diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/extensionpoint/src-api/org/apidesign/extensionpoint/Main.java --- a/samples/extensionpoint/src-api/org/apidesign/extensionpoint/Main.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/extensionpoint/src-api/org/apidesign/extensionpoint/Main.java Sat Jun 14 09:56:12 2008 +0200 @@ -12,7 +12,8 @@ public static void main(String[] args) { for (;;) { // BEGIN: extension.point.Query - Collection all = Lookup.getDefault().lookupAll(TipOfTheDay.class); + Collection all = + Lookup.getDefault().lookupAll(TipOfTheDay.class); List arr = new ArrayList(all); Collections.shuffle(arr); @@ -33,7 +34,9 @@ String again = "Once Again"; String exit = "Exit"; String[] options = new String[] { again, exit }; - int ret = JOptionPane.showOptionDialog(null, msg, title, 0, type, null, options, exit); + int ret = JOptionPane.showOptionDialog( + null, msg, title, 0, type, null, options, exit + ); if (ret != 0) { break; diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/forjoe/src-api1.0/api/InterfaceThatJustJoeCanImplement.java --- a/samples/forjoe/src-api1.0/api/InterfaceThatJustJoeCanImplement.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/forjoe/src-api1.0/api/InterfaceThatJustJoeCanImplement.java Sat Jun 14 09:56:12 2008 +0200 @@ -4,7 +4,9 @@ public abstract class InterfaceThatJustJoeCanImplement { protected InterfaceThatJustJoeCanImplement() { if (!"impl.joe.JoesImpl".equals(getClass().getName())) { - throw new IllegalStateException("Sorry, you are not allowed to implement this class"); + throw new IllegalStateException( + "Sorry, you are not allowed to implement this class" + ); } } diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/friendpackage/src/implpkg/Accessor.java --- a/samples/friendpackage/src/implpkg/Accessor.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/friendpackage/src/implpkg/Accessor.java Sat Jun 14 09:56:12 2008 +0200 @@ -30,7 +30,9 @@ } try { - Class.forName(Item.class.getName(), true, Item.class.getClassLoader()); + Class.forName( + Item.class.getName(), true, Item.class.getClassLoader() + ); } catch (Exception ex) { ex.printStackTrace(); } diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/gc/src/org/apidesign/gc/WeakListeners.java --- a/samples/gc/src/org/apidesign/gc/WeakListeners.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/gc/src/org/apidesign/gc/WeakListeners.java Sat Jun 14 09:56:12 2008 +0200 @@ -6,8 +6,12 @@ private WeakListeners() { } // BEGIN: gc.weaklistener.create - public static T create(Class type, T listener, Object source) { - return org.openide.util.WeakListeners.create(type, listener, source); + public static T create( + Class type, T listener, Object source + ) { + return org.openide.util.WeakListeners.create( + type, listener, source + ); } // END: gc.weaklistener.create } diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/growingparameters/src-api2.0/api/classes/Compute.java --- a/samples/growingparameters/src-api2.0/api/classes/Compute.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/growingparameters/src-api2.0/api/classes/Compute.java Sat Jun 14 09:56:12 2008 +0200 @@ -10,14 +10,17 @@ * @return list of strings to work with * @since 1.0 */ public abstract List getData(); - /** Computes the strings to work with together with their associated descriptions. - * Shall be overriden in subclasses. By default delegates to {@link #getData} - * and uses the provided strings as both, the string and its description. + /** Computes the strings to work with together with their + * associated descriptions. Shall be overriden in subclasses. + * By default delegates to {@link #getData} + * and uses the provided strings as both, the string + * and its description. * * @return name to description pairs to work with * @since 2.0 */ public Map getDataAndDescription() { - LinkedHashMap ret = new LinkedHashMap(); + LinkedHashMap ret = + new LinkedHashMap(); for (String s : getData()) { ret.put(s, s); } diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/hellowithsubclassing/src/org/apidesign/hello/ThreeWaysToUseHello.java --- a/samples/hellowithsubclassing/src/org/apidesign/hello/ThreeWaysToUseHello.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/hellowithsubclassing/src/org/apidesign/hello/ThreeWaysToUseHello.java Sat Jun 14 09:56:12 2008 +0200 @@ -19,7 +19,10 @@ // BEGIN: hello.supercall private static class SuperHello extends Hello { @Override - public void hello() { super.hello(); System.out.println("Hello once again"); } + public void hello() { + super.hello(); + System.out.println("Hello once again"); + } } // END: hello.supercall diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/javabeans/src/org/apidesign/javabeans/toomany/HighlightsContainer.java --- a/samples/javabeans/src/org/apidesign/javabeans/toomany/HighlightsContainer.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/javabeans/src/org/apidesign/javabeans/toomany/HighlightsContainer.java Sat Jun 14 09:56:12 2008 +0200 @@ -4,8 +4,9 @@ public interface HighlightsContainer { // BEGIN: javabeans.with.HighlightsContainer.TooMany - public void addHighlightsChangeListener(HighlightsChangeListener listener) throws TooManyListenersException; + public void addHighlightsChangeListener(HighlightsChangeListener l) + throws TooManyListenersException; // END: javabeans.with.HighlightsContainer.TooMany public HighlightsSequence getHighlights(int startOffset, int endOffset); - public void removeHighlightsChangeListener(HighlightsChangeListener listener); + public void removeHighlightsChangeListener(HighlightsChangeListener l); } diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/javabeans/test/org/apidesign/javabeans/use/toomany/MyHighlightsContainer.java --- a/samples/javabeans/test/org/apidesign/javabeans/use/toomany/MyHighlightsContainer.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/javabeans/test/org/apidesign/javabeans/use/toomany/MyHighlightsContainer.java Sat Jun 14 09:56:12 2008 +0200 @@ -11,11 +11,15 @@ final class MyHighlightsContainer implements HighlightsContainer { private HighlightsChangeListener listener; - public synchronized void addHighlightsChangeListener(HighlightsChangeListener l) throws TooManyListenersException { + public synchronized void addHighlightsChangeListener( + HighlightsChangeListener l + ) throws TooManyListenersException { if (listener != null) throw new TooManyListenersException(); listener = l; } - public synchronized void removeHighlightsChangeListener(HighlightsChangeListener l) { + public synchronized void removeHighlightsChangeListener( + HighlightsChangeListener l + ) { if (listener == l) listener = null; } public HighlightsSequence getHighlights(int startOffset, int endOffset) { diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/libs/build.xml --- a/samples/libs/build.xml Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/libs/build.xml Sat Jun 14 09:56:12 2008 +0200 @@ -1,6 +1,8 @@ + + diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToNew.java --- a/samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToNew.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToNew.java Sat Jun 14 09:56:12 2008 +0200 @@ -1,8 +1,3 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - package org.apidesign.impl.security.extension; import java.nio.ByteBuffer; @@ -18,7 +13,8 @@ */ // BEGIN: day.end.bridges.BridgeToNew public class BridgeToNew extends Digestor { - /** initializes the other bridge, and allow us to eliminate stack overflow */ + /** initializes the other bridge, and allow us to eliminate stack + * overflow */ private static final BridgeToOld oldBridge = new BridgeToOld(); @Override @@ -34,7 +30,9 @@ try { return MessageDigest.getInstance(algorithm); } catch (NoSuchAlgorithmException ex) { - Logger.getLogger(BridgeToNew.class.getName()).log(Level.FINE, "Cannot find " + algorithm, ex); + Logger.getLogger(BridgeToNew.class.getName()).log( + Level.FINE, "Cannot find " + algorithm, ex + ); return null; } } diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToOld.java --- a/samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToOld.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/messagedigest/src-bridge/org/apidesign/impl/security/extension/BridgeToOld.java Sat Jun 14 09:56:12 2008 +0200 @@ -1,8 +1,3 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - package org.apidesign.impl.security.extension; import org.apidesign.api.security.Digest; @@ -41,7 +36,10 @@ if ("MessageDigest".equals(type)) { Digest dig = Digest.getInstance(algorithm); if (dig != null) { - return new ServiceImpl(dig, this, type, algorithm, "", Collections.emptyList(), Collections.emptyMap()); + return new ServiceImpl( + dig, this, type, algorithm, "", + Collections.emptyList(), + Collections.emptyMap()); } } return null; @@ -54,13 +52,17 @@ private static class ServiceImpl extends Service { Digest dig; - public ServiceImpl(Digest dig, Provider provider, String type, String algorithm, String className, List aliases, Map attributes) { + public ServiceImpl(Digest dig, Provider provider, + String type, String algorithm, String className, + List aliases, Map attributes + ) { super(provider, type, algorithm, className, aliases, attributes); this.dig = dig; } @Override - public Object newInstance(Object constructorParameter) throws NoSuchAlgorithmException { + public Object newInstance(Object constructorParameter) + throws NoSuchAlgorithmException { return new MessageDigest(getAlgorithm()) { private byte[] res; @@ -71,7 +73,9 @@ } @Override - protected void engineUpdate(byte[] input, int offset, int len) { + protected void engineUpdate( + byte[] input, int offset, int len + ) { ByteBuffer bb = ByteBuffer.wrap(input); bb.position(offset); bb.limit(offset + len); diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/messagedigest/src-new-api/org/apidesign/api/security/Digest.java --- a/samples/messagedigest/src-new-api/org/apidesign/api/security/Digest.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/messagedigest/src-new-api/org/apidesign/api/security/Digest.java Sat Jun 14 09:56:12 2008 +0200 @@ -23,7 +23,9 @@ */ public static Digest getInstance(String algorithm) { for (Digestor digestor : ServiceLoader.load(Digestor.class)) { - DigestImplementation impl = DigestImplementation.create(digestor, algorithm); + DigestImplementation impl = DigestImplementation.create( + digestor, algorithm + ); if (impl != null) { return new Digest(impl); } diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/messagedigest/src-test/test/CountingDigestor.java --- a/samples/messagedigest/src-test/test/CountingDigestor.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/messagedigest/src-test/test/CountingDigestor.java Sat Jun 14 09:56:12 2008 +0200 @@ -17,7 +17,12 @@ @Override protected byte[] digest(int[] data) { int i = data[0]; - byte[] arr = { (byte) (i & 255), (byte) ((i >> 8) & 255), (byte) ((i >> 16) & 255), (byte) ((i >> 24) & 255) }; + byte[] arr = { + (byte) (i & 255), + (byte) ((i >> 8) & 255), + (byte) ((i >> 16) & 255), + (byte) ((i >> 24) & 255) + }; return arr; } diff -r 7e5f84aa1196 -r 3bc4c54f4bcc samples/misuse/src/org/apidesign/misuse/projectconfig/ProjectConfigurationCorrect.java --- a/samples/misuse/src/org/apidesign/misuse/projectconfig/ProjectConfigurationCorrect.java Sat Jun 14 09:55:24 2008 +0200 +++ b/samples/misuse/src/org/apidesign/misuse/projectconfig/ProjectConfigurationCorrect.java Sat Jun 14 09:56:12 2008 +0200 @@ -2,7 +2,8 @@ public class ProjectConfigurationCorrect { // BEGIN: misuse.prjconfig.correct - interface ProjectConfigurationProvider { + interface ProjectConfigurationProvider + { Configuration[] getConfigurations(); Configuration getActive(); void setActive(Configuration c); @@ -17,7 +18,7 @@ /* Following does not work: static { // BEGIN: misuse.prjconfig.correct.trivial.access - ProjectConfigurationProvider provider = null; // obtain from somewhere; + ProjectConfigurationProvider provider = null; // obtain elsewhere; provider.setActive(provider.getConfigurations()[0]); // END: misuse.prjconfig.correct.trivial.access } @@ -25,7 +26,7 @@ static { // BEGIN: misuse.prjconfig.correct.access - ProjectConfigurationProvider provider = null; // obtain from somewhere; + ProjectConfigurationProvider provider = null; // obtain elsewhere; resetToZero(provider); // END: misuse.prjconfig.correct.access } @@ -39,7 +40,9 @@ // END: misuse.prjconfig.correct.openmethod // BEGIN: misuse.prjconfig.correct.openclass - static void workWithProjectConfigurationProvider(ProjectConfigurationProvider p) { + static void workWithProjectConfigurationProvider( + ProjectConfigurationProvider p + ) { ResetToZero rtz = ResetToZero.create(p); rtz.obtainFirst(); // after a while @@ -54,7 +57,9 @@ this.provider = provider; } - static ResetToZero create(ProjectConfigurationProvider p) { + static ResetToZero create( + ProjectConfigurationProvider p + ) { return new ResetToZero(p); }