From b5c8b725655d2ad8a715cfb1fbbdf25dbdcd4ceb Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 16 Oct 2009 09:32:36 +0200 Subject: Fixed issue #24 by refactoring the AST.Node class - taken it out, and in the process fixed a lot of type annoyance by adding more generics. Also changed coding style from for/while/if/switch/catch/do ( expr ) {} to for (expr) {}, hence the changes _everywhere_. --- src/lombok/installer/WindowsDriveInfo.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/lombok/installer/WindowsDriveInfo.java') diff --git a/src/lombok/installer/WindowsDriveInfo.java b/src/lombok/installer/WindowsDriveInfo.java index fd16ee6e..41a6b17e 100644 --- a/src/lombok/installer/WindowsDriveInfo.java +++ b/src/lombok/installer/WindowsDriveInfo.java @@ -77,8 +77,8 @@ public class WindowsDriveInfo { int flags = getLogicalDrives0(); List letters = new ArrayList(); - for ( int i = 0 ; i < 26 ; i++ ) { - if ( (flags & (1 << i)) != 0 ) letters.add(Character.toString((char)('A' + i))); + for (int i = 0; i < 26; i++) { + if ((flags & (1 << i)) != 0) letters.add(Character.toString((char)('A' + i))); } return letters; @@ -94,9 +94,9 @@ public class WindowsDriveInfo { * Feed it a drive letter (such as 'A') to see if it is a fixed disk. */ public boolean isFixedDisk(String letter) { - if ( letter.length() != 1 ) throw new IllegalArgumentException("Supply 1 letter, not: " + letter); + if (letter.length() != 1) throw new IllegalArgumentException("Supply 1 letter, not: " + letter); char drive = Character.toUpperCase(letter.charAt(0)); - if ( drive < 'A' || drive > 'Z' ) throw new IllegalArgumentException( + if (drive < 'A' || drive > 'Z') throw new IllegalArgumentException( "A drive is indicated by a letter, so A-Z inclusive. Not " + drive); return getDriveType(drive + ":\\") == 3L; } @@ -119,7 +119,7 @@ public class WindowsDriveInfo { System.loadLibrary("WindowsDriveInfo"); WindowsDriveInfo info = new WindowsDriveInfo(); - for ( String letter : info.getLogicalDrives() ) { + for (String letter : info.getLogicalDrives()) { System.out.printf("Drive %s: - %s\n", letter, info.isFixedDisk(letter) ? "Fixed Disk" : "Not Fixed Disk"); } -- cgit