japi-cvs Mailing List for JAPI
Status: Beta
Brought to you by:
christianhujer
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(115) |
May
(11) |
Jun
(5) |
Jul
(2) |
Aug
(10) |
Sep
(35) |
Oct
(14) |
Nov
(49) |
Dec
(27) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(57) |
Feb
(1) |
Mar
|
Apr
(2) |
May
(25) |
Jun
(134) |
Jul
(76) |
Aug
(34) |
Sep
(27) |
Oct
(5) |
Nov
|
Dec
(1) |
2008 |
Jan
(3) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(63) |
Nov
(30) |
Dec
(43) |
2009 |
Jan
(10) |
Feb
(420) |
Mar
(67) |
Apr
(3) |
May
(61) |
Jun
(21) |
Jul
(19) |
Aug
|
Sep
(6) |
Oct
(16) |
Nov
(1) |
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
(7) |
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: <aki...@us...> - 2010-12-20 20:26:05
|
Revision: 1410 http://japi.svn.sourceforge.net/japi/?rev=1410&view=rev Author: akirschbaum Date: 2010-12-20 20:25:59 +0000 (Mon, 20 Dec 2010) Log Message: ----------- Use case-insensitive comparisons on case-insensitive file systems. Modified Paths: -------------- libs/util/trunk/src/prj/net/sf/japi/util/filter/file/EndingFileFilter.java Modified: libs/util/trunk/src/prj/net/sf/japi/util/filter/file/EndingFileFilter.java =================================================================== --- libs/util/trunk/src/prj/net/sf/japi/util/filter/file/EndingFileFilter.java 2010-06-18 21:28:32 UTC (rev 1409) +++ libs/util/trunk/src/prj/net/sf/japi/util/filter/file/EndingFileFilter.java 2010-12-20 20:25:59 UTC (rev 1410) @@ -30,6 +30,9 @@ */ public class EndingFileFilter extends AbstractFileFilter { + /** Whether the file system is case-insensitive. */ + private static final boolean CASE_INSENSITIVE_FILE_SYSTEM = new File("a").equals(new File("A")); + /** Whether to accept directories. */ private final boolean acceptDirectories; @@ -66,6 +69,11 @@ this.negate = negate; this.description = description; this.endings = endings.clone(); + if (CASE_INSENSITIVE_FILE_SYSTEM) { + for (int i = 0; i < this.endings.length; i++) { + this.endings[i] = this.endings[i].toLowerCase(); + } + } } /** {@inheritDoc} */ @@ -78,7 +86,7 @@ if (pathname.isDirectory()) { return acceptDirectories; } - final String fileName = pathname.getName(); + final String fileName = CASE_INSENSITIVE_FILE_SYSTEM ? pathname.getName().toLowerCase() : pathname.getName(); for (final String ending : endings) { if (fileName.endsWith(ending)) { return !negate; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-06-18 21:28:38
|
Revision: 1409 http://japi.svn.sourceforge.net/japi/?rev=1409&view=rev Author: christianhujer Date: 2010-06-18 21:28:32 +0000 (Fri, 18 Jun 2010) Log Message: ----------- Fix issues with findbugs. Modified Paths: -------------- common/trunk/commonBuild.xml Modified: common/trunk/commonBuild.xml =================================================================== --- common/trunk/commonBuild.xml 2010-05-26 08:11:28 UTC (rev 1408) +++ common/trunk/commonBuild.xml 2010-06-18 21:28:32 UTC (rev 1409) @@ -83,6 +83,7 @@ <path id="class.path"> <fileset dir="." includes="lib/*.jar" excludes="lib/LICENSE-*.jar" /> <fileset dir="${commonPath}" includes="lib/*.jar" excludes="lib/LICENSE-*.jar" /> + <fileset dir="${japiUserPath}" includes="antlib.auto/findbugs-1.3.8/lib/findbugs.jar" /> </path> <available property="has3rdparty" file="lib/annotations.jar" /> @@ -546,6 +547,7 @@ <auxclasspath refid="class.path" /> <auxclasspath location="${japiUserPath}/antlib.auto/junit.jar" /> <auxclasspath location="classes/production/${module.shortname}" /> + <auxclasspath location="classes/test/${module.shortname}" /> <ruleset>${commonPath}/pmd_checks.xml</ruleset> <formatter type="text" toConsole="true" /> <fileset dir="src/prj"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-26 08:11:35
|
Revision: 1408 http://japi.svn.sourceforge.net/japi/?rev=1408&view=rev Author: akirschbaum Date: 2010-05-26 08:11:28 +0000 (Wed, 26 May 2010) Log Message: ----------- Add @NotNull annotations. Modified Paths: -------------- libs/swing-action/trunk/src/prj/net/sf/japi/swing/action/ActionProvider.java libs/swing-action/trunk/src/prj/net/sf/japi/swing/action/IconManager.java Modified: libs/swing-action/trunk/src/prj/net/sf/japi/swing/action/ActionProvider.java =================================================================== --- libs/swing-action/trunk/src/prj/net/sf/japi/swing/action/ActionProvider.java 2010-05-26 06:27:55 UTC (rev 1407) +++ libs/swing-action/trunk/src/prj/net/sf/japi/swing/action/ActionProvider.java 2010-05-26 08:11:28 UTC (rev 1408) @@ -19,6 +19,7 @@ package net.sf.japi.swing.action; import javax.swing.Action; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** Interface for classes that provide actions. @@ -31,6 +32,6 @@ * @param key Key to find * @return Action for <var>key</var> or <code>null</code> */ - @Nullable Action getAction(final String key); + @Nullable Action getAction(@NotNull final String key); } // interface ActionProvider Modified: libs/swing-action/trunk/src/prj/net/sf/japi/swing/action/IconManager.java =================================================================== --- libs/swing-action/trunk/src/prj/net/sf/japi/swing/action/IconManager.java 2010-05-26 06:27:55 UTC (rev 1407) +++ libs/swing-action/trunk/src/prj/net/sf/japi/swing/action/IconManager.java 2010-05-26 08:11:28 UTC (rev 1408) @@ -28,6 +28,7 @@ import java.util.WeakHashMap; import javax.swing.Icon; import javax.swing.ImageIcon; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** Class to handle icons. @@ -43,11 +44,13 @@ public final class IconManager { /** The default IconManager. */ + @NotNull private static final IconManager DEFAULT_ICON_MANAGER = createDefaultIconManager(); /** Create the default IconManager. * @return default IconManager */ + @NotNull private static IconManager createDefaultIconManager() { final IconManager defaultIconManager = new IconManager(); defaultIconManager.iconPaths.add("icons/"); @@ -56,24 +59,29 @@ } /** ClassLoader to get icons from, must not be null. */ + @NotNull private final ClassLoader classLoader; /** The available sizes provided by this IconManager. */ + @NotNull private final int[] availableSizes = { 16, 24 }; /** The icon cache. * Key: short name for icon, which is likely to be used as a relative file name. * Value: Icon */ + @NotNull private final Map<String, Icon> smallCache = new WeakHashMap<String, Icon>(); /** The paths to search icons in. */ + @NotNull private final List<String> iconPaths = new ArrayList<String>(); /** Get the default IconManager. * The ClassLoader in use is the classloader IconManager was loaded with, whatever classloader that was. * @return default IconManaager */ + @NotNull public static IconManager getDefaultIconManager() { return DEFAULT_ICON_MANAGER; } @@ -88,6 +96,7 @@ //this(IconManager.class.getClassLoader()); } + @NotNull private static ClassLoader getContextClassLoader() { return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { public ClassLoader run() { @@ -103,20 +112,21 @@ /** Create an IconManager. * @param clazz Class to get ClassLoader for IconManager */ - public IconManager(final Class<?> clazz) { + public IconManager(@NotNull final Class<?> clazz) { classLoader = clazz.getClassLoader(); } /** Create an IconManager. * @param cl ClassLoader to create IconManager for */ - public IconManager(final ClassLoader cl) { + public IconManager(@NotNull final ClassLoader cl) { classLoader = cl; } /** Return the available sizes for icons. * @return available icon sizes */ + @NotNull public int[] getAvailableSizes() { return availableSizes.clone(); } @@ -126,7 +136,7 @@ * @return Icon for <var>s</var> */ @Nullable - public Icon getIcon(final String s) { + public Icon getIcon(@NotNull final String s) { Icon icon = smallCache.get(s); if (icon == null) { URL url = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-26 06:28:02
|
Revision: 1407 http://japi.svn.sourceforge.net/japi/?rev=1407&view=rev Author: akirschbaum Date: 2010-05-26 06:27:55 +0000 (Wed, 26 May 2010) Log Message: ----------- Fix typo. Modified Paths: -------------- libs/xml/trunk/src/prj/net/sf/japi/xml/NodeListIterator.java Modified: libs/xml/trunk/src/prj/net/sf/japi/xml/NodeListIterator.java =================================================================== --- libs/xml/trunk/src/prj/net/sf/japi/xml/NodeListIterator.java 2010-05-16 11:43:49 UTC (rev 1406) +++ libs/xml/trunk/src/prj/net/sf/japi/xml/NodeListIterator.java 2010-05-26 06:27:55 UTC (rev 1407) @@ -84,7 +84,7 @@ } /** Create a NodeListIterator. - * @param xpath XPath to evaulate against + * @param xpath XPath to evaluate against * @param item Object to evaluate against * @param expression XPath expression to evaluate * @throws XPathExpressionException in case of xpath errors This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-05-16 11:43:55
|
Revision: 1406 http://japi.svn.sourceforge.net/japi/?rev=1406&view=rev Author: christianhujer Date: 2010-05-16 11:43:49 +0000 (Sun, 16 May 2010) Log Message: ----------- Improve documentation. Modified Paths: -------------- libs/swing-about/trunk/src/prj/net/sf/japi/swing/about/AboutDialog.java Modified: libs/swing-about/trunk/src/prj/net/sf/japi/swing/about/AboutDialog.java =================================================================== --- libs/swing-about/trunk/src/prj/net/sf/japi/swing/about/AboutDialog.java 2010-04-11 11:06:48 UTC (rev 1405) +++ libs/swing-about/trunk/src/prj/net/sf/japi/swing/about/AboutDialog.java 2010-05-16 11:43:49 UTC (rev 1406) @@ -50,6 +50,7 @@ /** * Class for constructing and showing About dialogs. + * * It features: * <ul> * <li>logo</li> @@ -58,6 +59,7 @@ * <li>All runtime properties</li> * <li>All licenses the software uses</li> * </ul> + * * It requires the following properties to be available in the named ActionBuilder: * <ul> * <li><code>about.logo</code> specifies the logo to display (optional)</li> @@ -66,12 +68,13 @@ * <code>about</code> specifies the format string for the about text in the about tab. * It takes the following parameters: * <ol> - * <li>The runtime's Java Version</li> - * <li>The build number</li> - * <li>The build developer</li> - * <li>The build timestamp</li> + * <li><code>{0}</code>: The runtime's Java Version</li> + * <li><code>{1}</code>: The build number (see build resource bundle below)</li> + * <li><code>{2}</code>: The build developer (see build resource bundle below)</li> + * <li><code>{3}</code>: The build timestamp (see build resource bundle below)</li> * </ol> * (See information on the build for how to specify the build information) + * Hint: Use Swing HTML 3.2 if you want formatted text (tables etc.). * </li> * <li> * Licenses: @@ -84,12 +87,20 @@ * <li><code>aboutBuildProperties.title</code> specifies the title for the build properties tab (optional - only required if the build properties tab is used)</li> * <li><code>aboutRuntimeProperties.title</code> specifies the title for the runtime properties tab (required)</li> * </ul> + * + * <h2>build resource bundle</h2> * The information on the build is specified by: * <ul> * <li> - * A ResourceBundle <code>build</code> (optional, e.g. <code>build.properties</code> toplevel on classpath) + * A ResourceBundle <code>build</code> (optional, e.g. <code>build.properties</code> toplevel on classpath). + * All properties in that bundle are going to be displayed on the build tab. + * The following properties have special meaning and are message format parameters to about (see above): * <ul> - * <li><code>build.developer</code> The developer that made the build (optional)</li> + * <li> + * <code>build.developer</code> The developer that made the build (optional). + * Note: This is meant to be the developer that performed the build, not the developers that developed the software. + * Use the <code>about</code> property described above to specify copyright / authors / contributors / developers. + * </li> * <li><code>build.number</code> The build number, e.g. incremented by Ant or the Subversion revision (optional)</li> * <li><code>build.tstamp</code> The timestamp when the build was made (optional)</li> * </ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-04-11 11:06:54
|
Revision: 1405 http://japi.svn.sourceforge.net/japi/?rev=1405&view=rev Author: christianhujer Date: 2010-04-11 11:06:48 +0000 (Sun, 11 Apr 2010) Log Message: ----------- Move the logging classes to a package of their own. Modified Paths: -------------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/RegexLineCheck.java Added Paths: ----------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/ tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/LogEntry.java tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/LogSystem.java tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/Logger.java tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/StreamLogger.java Removed Paths: ------------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogEntry.java tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogSystem.java tools/archStat/trunk/src/prj/net/sf/japi/archstat/Logger.java tools/archStat/trunk/src/prj/net/sf/japi/archstat/StreamLogger.java Deleted: tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogEntry.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogEntry.java 2010-04-11 10:44:37 UTC (rev 1404) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogEntry.java 2010-04-11 11:06:48 UTC (rev 1405) @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2009 Christian Hujer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sf.japi.archstat; - -import java.io.File; -import java.util.Formatter; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** A LogEntry represents an atomic ArchStat information. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @since 0.1 - */ -public class LogEntry { - - /** The File for which this LogEntry is being logged. */ - private final File file; - - /** The line in {@link #file} for which this LogEntry is being logged. - * Maybe <code>null</code> if the LogEntry does not apply to a particular line. - */ - @Nullable private final String line; - - /** The lineNumber in {@link #file} for which this LogEntry is being logged. - * Maybe <code>null</code> if the LogEntry does not apply to a particular lineNumber. - * The line number is the user line, the first line is 1. - */ - @Nullable private final Integer lineNumber; - - /** The column in {@link #file} {@link #lineNumber} for which this LogEntry is being logged. - * Maybe <code>null</code> if the LogEntry does not apply to a particular column. - * The column is the user column, the first column is 1. - */ - @Nullable private final Integer column; - - /** The MessageType for this LogEntry. */ - @NotNull private final MessageType messageType; - - /** The message ID of this type of log entry. */ - @NotNull private final String messageId; - - /** The message of this log entry. */ - @NotNull private final String message; - - /** Creates a LogEntry. - * @param file File for which this LogEntry is being logged. - * @param line Line in <var>file</var> or <code>null</code>. - * @param lineNumber Line number in <var>file</var> or <code>null</code> (user line, first line is 1). - * @param column Column in <var>lineNumber</var> or <code>null</code> (user column, first column is 1). - * @param messageType Message Type. - * @param messageId Message ID. - * @param message The message. - */ - public LogEntry(final File file, @Nullable final String line, @Nullable final Integer lineNumber, @Nullable final Integer column, @NotNull final MessageType messageType, @NotNull final String messageId, @NotNull final String message) { - this.file = file; - this.line = removeEOL(line); - this.lineNumber = lineNumber; - this.column = column; - this.messageType = messageType; - this.messageId = messageId; - this.message = message; - } - - /** Returns a String with any trailing end of line characters removed. - * Trailing whitespace other than EOL characters are not removed. - * This method currently treats LF and CR as EOL characters. - * @param line Line from which to remove trailing end of line characters, maybe <code>null</code> - * @return The line with trailing end of line characters removed. - */ - private static String removeEOL(@Nullable final String line) { - if (line != null) { - return line.replaceAll("[\n\r]+$", ""); - } - return line; - } - - /** Creates a LogEntry. - * @param file File for which this LogEntry is being logged. - * @param messageType Message Type. - * @param messageId Message ID. - * @param message The message. - */ - public LogEntry(final File file, @NotNull final MessageType messageType, @NotNull final String messageId, @NotNull final String message) { - this(file, null, null, null, messageType, messageId, message); - } - - /** Returns the file for which this LogEntry was created. - * @return The file for which this LogEntry was created. - */ - public File getFile() { - return file; - } - - /** Returns the lineNumber for which this LogEntry was created. - * @return The lineNumber number or <code>null</code> in case it's not applicable. - */ - @Nullable public Integer getLineNumber() { - return lineNumber; - } - - /** Returns the column for which this LogEntry was created. - * @return The column number or <code>null</code> in case it's not applicable. - */ - @Nullable public Integer getColumn() { - return column; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return toString(new Formatter()).toString(); - } - - /** Formats this LogEntry to the specified formatter. - * @param out Formatter to log to. - * @return <var>out</var> for convenience. - */ - public Formatter toString(@NotNull final Formatter out) { - if (lineNumber != null && column != null) { - out.format("%s:%s:%s: %s: (%s): %s", file, lineNumber, column, messageType, messageId, message); - if (line != null) { - out.format("%n%s%n", line); - for (int i = 1; i < column; i++) { - out.format("-"); - } - out.format("^%n"); - } - } else if (lineNumber != null) { - out.format("%s:%s: %s: (%s): %s", file, lineNumber, messageType, messageId, message); - } else { - out.format("%s: %s: (%s): %s", file, messageType, messageId, message); - } - return out; - } -} Deleted: tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogSystem.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogSystem.java 2010-04-11 10:44:37 UTC (rev 1404) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogSystem.java 2010-04-11 11:06:48 UTC (rev 1405) @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2009 Christian Hujer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sf.japi.archstat; - -import org.jetbrains.annotations.NotNull; - -/** Static access to logging. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @since 0.1 - */ -public final class LogSystem { - - /** The loggers. */ - private static final Logger[] LOGGERS = { new StreamLogger(System.err) }; - - /** Utility class - do not instanciate. */ - private LogSystem() { - } - - /** Logs a single log entry. - * @param logEntry LogEntry to log. - */ - public static void log(@NotNull final LogEntry logEntry) { - for (final Logger logger : LOGGERS) { - logger.log(logEntry); - } - } -} Deleted: tools/archStat/trunk/src/prj/net/sf/japi/archstat/Logger.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/Logger.java 2010-04-11 10:44:37 UTC (rev 1404) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/Logger.java 2010-04-11 11:06:48 UTC (rev 1405) @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2009 Christian Hujer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sf.japi.archstat; - -import org.jetbrains.annotations.NotNull; - -/** Loggers log LogEntries. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @since 0.1 - */ -public interface Logger { - - /** Logs a LogEntry. - * @param logEntry LogEntry to log. - */ - void log(@NotNull LogEntry logEntry); -} Modified: tools/archStat/trunk/src/prj/net/sf/japi/archstat/RegexLineCheck.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/RegexLineCheck.java 2010-04-11 10:44:37 UTC (rev 1404) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/RegexLineCheck.java 2010-04-11 11:06:48 UTC (rev 1405) @@ -23,6 +23,8 @@ import org.w3c.dom.Element; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import net.sf.japi.archstat.log.LogEntry; +import net.sf.japi.archstat.log.LogSystem; /** A Line-based Check. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> Deleted: tools/archStat/trunk/src/prj/net/sf/japi/archstat/StreamLogger.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/StreamLogger.java 2010-04-11 10:44:37 UTC (rev 1404) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/StreamLogger.java 2010-04-11 11:06:48 UTC (rev 1405) @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2009 Christian Hujer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sf.japi.archstat; - -import java.util.Formatter; -import org.jetbrains.annotations.NotNull; - -/** The StreamLogger is a Logger for LogEntries that logs to the specified Stream. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @since 0.1 - */ -public class StreamLogger implements Logger { - - /** The Stream for logging. */ - @NotNull - private final Formatter out; - - /** Creates a StreamLogger. - * @param out Stream for logging. - */ - public StreamLogger(@NotNull final Appendable out) { - this.out = new Formatter(out); - } - - /** {@inheritDoc} */ - public void log(@NotNull final LogEntry logEntry) { - out.format("%s%n", logEntry); - } -} Copied: tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/LogEntry.java (from rev 1404, tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogEntry.java) =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/LogEntry.java (rev 0) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/LogEntry.java 2010-04-11 11:06:48 UTC (rev 1405) @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2009 - 2010 Christian Hujer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package net.sf.japi.archstat.log; + +import java.io.File; +import java.util.Formatter; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import net.sf.japi.archstat.MessageType; + +/** A LogEntry represents an atomic ArchStat information. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @since 0.1 + */ +public class LogEntry { + + /** The File for which this LogEntry is being logged. */ + private final File file; + + /** The line in {@link #file} for which this LogEntry is being logged. + * Maybe <code>null</code> if the LogEntry does not apply to a particular line. + */ + @Nullable private final String line; + + /** The lineNumber in {@link #file} for which this LogEntry is being logged. + * Maybe <code>null</code> if the LogEntry does not apply to a particular lineNumber. + * The line number is the user line, the first line is 1. + */ + @Nullable private final Integer lineNumber; + + /** The column in {@link #file} {@link #lineNumber} for which this LogEntry is being logged. + * Maybe <code>null</code> if the LogEntry does not apply to a particular column. + * The column is the user column, the first column is 1. + */ + @Nullable private final Integer column; + + /** The MessageType for this LogEntry. */ + @NotNull private final MessageType messageType; + + /** The message ID of this type of log entry. */ + @NotNull private final String messageId; + + /** The message of this log entry. */ + @NotNull private final String message; + + /** Creates a LogEntry. + * @param file File for which this LogEntry is being logged. + * @param line Line in <var>file</var> or <code>null</code>. + * @param lineNumber Line number in <var>file</var> or <code>null</code> (user line, first line is 1). + * @param column Column in <var>lineNumber</var> or <code>null</code> (user column, first column is 1). + * @param messageType Message Type. + * @param messageId Message ID. + * @param message The message. + */ + public LogEntry(final File file, @Nullable final String line, @Nullable final Integer lineNumber, @Nullable final Integer column, @NotNull final MessageType messageType, @NotNull final String messageId, @NotNull final String message) { + this.file = file; + this.line = removeEOL(line); + this.lineNumber = lineNumber; + this.column = column; + this.messageType = messageType; + this.messageId = messageId; + this.message = message; + } + + /** Returns a String with any trailing end of line characters removed. + * Trailing whitespace other than EOL characters are not removed. + * This method currently treats LF and CR as EOL characters. + * @param line Line from which to remove trailing end of line characters, maybe <code>null</code> + * @return The line with trailing end of line characters removed. + */ + private static String removeEOL(@Nullable final String line) { + if (line != null) { + return line.replaceAll("[\n\r]+$", ""); + } + return line; + } + + /** Creates a LogEntry. + * @param file File for which this LogEntry is being logged. + * @param messageType Message Type. + * @param messageId Message ID. + * @param message The message. + */ + public LogEntry(final File file, @NotNull final MessageType messageType, @NotNull final String messageId, @NotNull final String message) { + this(file, null, null, null, messageType, messageId, message); + } + + /** Returns the file for which this LogEntry was created. + * @return The file for which this LogEntry was created. + */ + public File getFile() { + return file; + } + + /** Returns the lineNumber for which this LogEntry was created. + * @return The lineNumber number or <code>null</code> in case it's not applicable. + */ + @Nullable public Integer getLineNumber() { + return lineNumber; + } + + /** Returns the column for which this LogEntry was created. + * @return The column number or <code>null</code> in case it's not applicable. + */ + @Nullable public Integer getColumn() { + return column; + } + + /** {@inheritDoc} */ + @Override public String toString() { + return toString(new Formatter()).toString(); + } + + /** Formats this LogEntry to the specified formatter. + * @param out Formatter to log to. + * @return <var>out</var> for convenience. + */ + public Formatter toString(@NotNull final Formatter out) { + if (lineNumber != null && column != null) { + out.format("%s:%s:%s: %s: (%s): %s", file, lineNumber, column, messageType, messageId, message); + if (line != null) { + out.format("%n%s%n", line); + for (int i = 1; i < column; i++) { + out.format("-"); + } + out.format("^%n"); + } + } else if (lineNumber != null) { + out.format("%s:%s: %s: (%s): %s", file, lineNumber, messageType, messageId, message); + } else { + out.format("%s: %s: (%s): %s", file, messageType, messageId, message); + } + return out; + } +} Property changes on: tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/LogEntry.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/LogSystem.java (from rev 1404, tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogSystem.java) =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/LogSystem.java (rev 0) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/LogSystem.java 2010-04-11 11:06:48 UTC (rev 1405) @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2009 - 2010 Christian Hujer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package net.sf.japi.archstat.log; + +import org.jetbrains.annotations.NotNull; + +/** Static access to logging. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @since 0.1 + */ +public final class LogSystem { + + /** The loggers. */ + private static final Logger[] LOGGERS = { new StreamLogger(System.err) }; + + /** Utility class - do not instanciate. */ + private LogSystem() { + } + + /** Logs a single log entry. + * @param logEntry LogEntry to log. + */ + public static void log(@NotNull final LogEntry logEntry) { + for (final Logger logger : LOGGERS) { + logger.log(logEntry); + } + } +} Property changes on: tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/LogSystem.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/Logger.java (from rev 1404, tools/archStat/trunk/src/prj/net/sf/japi/archstat/Logger.java) =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/Logger.java (rev 0) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/Logger.java 2010-04-11 11:06:48 UTC (rev 1405) @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2009 - 2010 Christian Hujer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package net.sf.japi.archstat.log; + +import org.jetbrains.annotations.NotNull; + +/** Loggers log LogEntries. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @since 0.1 + */ +public interface Logger { + + /** Logs a LogEntry. + * @param logEntry LogEntry to log. + */ + void log(@NotNull LogEntry logEntry); +} Property changes on: tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/Logger.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/StreamLogger.java (from rev 1404, tools/archStat/trunk/src/prj/net/sf/japi/archstat/StreamLogger.java) =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/StreamLogger.java (rev 0) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/StreamLogger.java 2010-04-11 11:06:48 UTC (rev 1405) @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2009 - 2010 Christian Hujer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package net.sf.japi.archstat.log; + +import java.util.Formatter; +import org.jetbrains.annotations.NotNull; + +/** The StreamLogger is a Logger for LogEntries that logs to the specified Stream. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @since 0.1 + */ +public class StreamLogger implements Logger { + + /** The Stream for logging. */ + @NotNull + private final Formatter out; + + /** Creates a StreamLogger. + * @param out Stream for logging. + */ + public StreamLogger(@NotNull final Appendable out) { + this.out = new Formatter(out); + } + + /** {@inheritDoc} */ + public void log(@NotNull final LogEntry logEntry) { + out.format("%s%n", logEntry); + } +} Property changes on: tools/archStat/trunk/src/prj/net/sf/japi/archstat/log/StreamLogger.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-04-11 10:44:43
|
Revision: 1404 http://japi.svn.sourceforge.net/japi/?rev=1404&view=rev Author: christianhujer Date: 2010-04-11 10:44:37 +0000 (Sun, 11 Apr 2010) Log Message: ----------- Remove trailing end of line characters of code lines for log output. Modified Paths: -------------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogEntry.java Modified: tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogEntry.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogEntry.java 2010-04-11 10:19:34 UTC (rev 1403) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/LogEntry.java 2010-04-11 10:44:37 UTC (rev 1404) @@ -68,7 +68,7 @@ */ public LogEntry(final File file, @Nullable final String line, @Nullable final Integer lineNumber, @Nullable final Integer column, @NotNull final MessageType messageType, @NotNull final String messageId, @NotNull final String message) { this.file = file; - this.line = line; + this.line = removeEOL(line); this.lineNumber = lineNumber; this.column = column; this.messageType = messageType; @@ -76,6 +76,19 @@ this.message = message; } + /** Returns a String with any trailing end of line characters removed. + * Trailing whitespace other than EOL characters are not removed. + * This method currently treats LF and CR as EOL characters. + * @param line Line from which to remove trailing end of line characters, maybe <code>null</code> + * @return The line with trailing end of line characters removed. + */ + private static String removeEOL(@Nullable final String line) { + if (line != null) { + return line.replaceAll("[\n\r]+$", ""); + } + return line; + } + /** Creates a LogEntry. * @param file File for which this LogEntry is being logged. * @param messageType Message Type. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-04-11 10:19:39
|
Revision: 1403 http://japi.svn.sourceforge.net/japi/?rev=1403&view=rev Author: christianhujer Date: 2010-04-11 10:19:34 +0000 (Sun, 11 Apr 2010) Log Message: ----------- Fix some IntelliJ IDEA warnings. Modified Paths: -------------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java Modified: tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java 2010-04-11 10:19:05 UTC (rev 1402) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java 2010-04-11 10:19:34 UTC (rev 1403) @@ -115,7 +115,7 @@ for (final RegexLineCheck regexLineCheck : checkers) { final Integer i = checkWarnings.get(regexLineCheck); if (i != null && i > 0) { - System.err.println(file + ": " + regexLineCheck.getMessageType() + ": " + i + " " + regexLineCheck.getPlural()); + System.err.printf("%s: %s: %d %s%n", file, regexLineCheck.getMessageType(), i, regexLineCheck.getPlural()); } } if (getWarnings() > 0) { @@ -185,7 +185,7 @@ /** {@inheritDoc} */ @Override public String toString() { - return title + ";" + errors.size() + ";" + linesRaw + ";" + linesNoComment + ";" + commentLines + ";" + sourceLines; + return title + ';' + errors.size() + ';' + linesRaw + ';' + linesNoComment + ';' + commentLines + ';' + sourceLines; } /** Prints recursive statistics including table header to the specified appendable. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-04-11 10:19:11
|
Revision: 1402 http://japi.svn.sourceforge.net/japi/?rev=1402&view=rev Author: christianhujer Date: 2010-04-11 10:19:05 +0000 (Sun, 11 Apr 2010) Log Message: ----------- Use project settings for warnings. Modified Paths: -------------- tools/archStat/trunk/archStat.ipr Modified: tools/archStat/trunk/archStat.ipr =================================================================== --- tools/archStat/trunk/archStat.ipr 2010-04-11 10:13:08 UTC (rev 1401) +++ tools/archStat/trunk/archStat.ipr 2010-04-11 10:19:05 UTC (rev 1402) @@ -50,7 +50,7 @@ <component name="IdProvider" IDEtalkID="3252B0EE1010872AF5D1E872ECBFD2E1" /> <component name="InspectionProjectProfileManager"> <option name="PROJECT_PROFILE" value="Project Default" /> - <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" /> + <option name="USE_PROJECT_LEVEL_SETTINGS" value="true" /> <scopes /> <profiles> <profile version="1.0" is_locked="false"> @@ -693,7 +693,12 @@ </inspection_tool> </profile> </profiles> - <list size="0" /> + <list size="4"> + <item index="0" class="java.lang.String" itemvalue="SERVER PROBLEM" /> + <item index="1" class="java.lang.String" itemvalue="INFO" /> + <item index="2" class="java.lang.String" itemvalue="WARNING" /> + <item index="3" class="java.lang.String" itemvalue="ERROR" /> + </list> </component> <component name="JavacSettings"> <option name="DEBUGGING_INFO" value="true" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-04-11 10:13:14
|
Revision: 1401 http://japi.svn.sourceforge.net/japi/?rev=1401&view=rev Author: christianhujer Date: 2010-04-11 10:13:08 +0000 (Sun, 11 Apr 2010) Log Message: ----------- Configure GPL copyright. Modified Paths: -------------- tools/archStat/trunk/archStat.ipr Modified: tools/archStat/trunk/archStat.ipr =================================================================== --- tools/archStat/trunk/archStat.ipr 2010-04-11 10:12:10 UTC (rev 1400) +++ tools/archStat/trunk/archStat.ipr 2010-04-11 10:13:08 UTC (rev 1401) @@ -27,6 +27,15 @@ <entry name="?*.ftl" /> </wildcardResourcePatterns> </component> + <component name="CopyrightManager" default="GPL"> + <copyright> + <option name="notice" value="Copyright (C) 2009 - &#36;today.year Christian Hujer This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>." /> + <option name="keyword" value="Copyright" /> + <option name="myName" value="GPL" /> + <option name="myLocal" value="true" /> + </copyright> + <module2copyright /> + </component> <component name="DependencyValidationManager"> <option name="SKIP_IMPORT_STATEMENTS" value="false" /> </component> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-04-11 10:12:19
|
Revision: 1400 http://japi.svn.sourceforge.net/japi/?rev=1400&view=rev Author: christianhujer Date: 2010-04-11 10:12:10 +0000 (Sun, 11 Apr 2010) Log Message: ----------- Rename LineCheck to RegexLineCheck. Modified Paths: -------------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/ArchStat.java tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java Added Paths: ----------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/RegexLineCheck.java Removed Paths: ------------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/LineCheck.java Modified: tools/archStat/trunk/src/prj/net/sf/japi/archstat/ArchStat.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/ArchStat.java 2010-04-01 13:03:16 UTC (rev 1399) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/ArchStat.java 2010-04-11 10:12:10 UTC (rev 1400) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Christian Hujer + * Copyright (C) 2009 - 2010 Christian Hujer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,17 @@ package net.sf.japi.archstat; +import net.sf.japi.io.args.ArgParser; +import net.sf.japi.io.args.BasicCommand; +import net.sf.japi.io.args.Option; +import org.jetbrains.annotations.NotNull; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; @@ -27,16 +38,6 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.jetbrains.annotations.NotNull; -import org.xml.sax.SAXException; -import net.sf.japi.io.args.BasicCommand; -import net.sf.japi.io.args.ArgParser; -import net.sf.japi.io.args.Option; /** A Command for performing recursive source code file statistics. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -128,7 +129,7 @@ } /** The checks that should be performed. */ - private final List<LineCheck> checkers = new ArrayList<LineCheck>(); + private final List<RegexLineCheck> checkers = new ArrayList<RegexLineCheck>(); /** Reads a file. * @param file File to read. @@ -234,12 +235,12 @@ private void readCheckers(final Document doc) { final NodeList nl = doc.getElementsByTagName("pattern"); for (int i = 0; i < nl.getLength(); i++) { - final LineCheck check = new LineCheck((Element) nl.item(i)); - if (checkers.contains(check)) { + final RegexLineCheck regexLineCheck = new RegexLineCheck((Element) nl.item(i)); + if (checkers.contains(regexLineCheck)) { // TODO:2009-02-18:christianhujer:Improve. - throw new RuntimeException("Duplicate Checker " + check.getName()); + throw new RuntimeException("Duplicate Checker " + regexLineCheck.getName()); } - checkers.add(check); + checkers.add(regexLineCheck); } } Modified: tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java 2010-04-01 13:03:16 UTC (rev 1399) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java 2010-04-11 10:12:10 UTC (rev 1400) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Christian Hujer + * Copyright (C) 2009 - 2010 Christian Hujer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,10 +35,10 @@ public class FileStat { /** The checks that should be performed. */ - private final List<LineCheck> checkers; + private final List<RegexLineCheck> checkers; /** The warnings that occurred in that individual check. */ - private final Map<LineCheck, Integer> checkWarnings = new HashMap<LineCheck, Integer>(); + private final Map<RegexLineCheck, Integer> checkWarnings = new HashMap<RegexLineCheck, Integer>(); /** The children of this statistic. */ private final Map<File, FileStat> children = new HashMap<File, FileStat>(); @@ -71,14 +71,14 @@ private int warnings; @SuppressWarnings({"AssignmentToCollectionOrArrayFieldFromParameter"}) - FileStat(final List<LineCheck> checkers) { + FileStat(final List<RegexLineCheck> checkers) { this.checkers = checkers; title = "<SUM>"; file = null; } @SuppressWarnings({"AssignmentToCollectionOrArrayFieldFromParameter"}) - FileStat(final List<LineCheck> checkers, @NotNull final File file, final boolean printSummaries) { + FileStat(final List<RegexLineCheck> checkers, @NotNull final File file, final boolean printSummaries) { this.checkers = checkers; this.file = file; title = file.toString(); @@ -112,10 +112,10 @@ } } void treeWarnings() { - for (final LineCheck lineCheck : checkers) { - final Integer i = checkWarnings.get(lineCheck); + for (final RegexLineCheck regexLineCheck : checkers) { + final Integer i = checkWarnings.get(regexLineCheck); if (i != null && i > 0) { - System.err.println(file + ": " + lineCheck.getMessageType() + ": " + i + " " + lineCheck.getPlural()); + System.err.println(file + ": " + regexLineCheck.getMessageType() + ": " + i + " " + regexLineCheck.getPlural()); } } if (getWarnings() > 0) { @@ -123,20 +123,21 @@ } } void checkLine(final String line, final int lineNumber) { - for (final LineCheck lineCheck : checkers) { - if (lineCheck.hasProblem(file, line, lineNumber)) { - incWarning(lineCheck); + for (final RegexLineCheck regexLineCheck : checkers) { + if (regexLineCheck.hasProblem(file, line, lineNumber)) { + incWarning(regexLineCheck); } } } - public void incWarning(final LineCheck lineCheck) { + public void incWarning(final RegexLineCheck regexLineCheck) { warnings = getWarnings() + 1; - final Integer i = checkWarnings.get(lineCheck); - checkWarnings.put(lineCheck, i != null ? i + 1 : 1); + final Integer i = checkWarnings.get(regexLineCheck); + checkWarnings.put(regexLineCheck, i != null ? i + 1 : 1); } /** Adds a child with the specified filename. * @param filename Filename of the child to add. + * @param printSummaries Whether or not to print summaries. */ public void addChild(final String filename, final boolean printSummaries) { addChild(new File(filename), printSummaries); @@ -144,6 +145,7 @@ /** Adds a child with the specified file. * @param file File of the child to add. + * @param printSummaries Whether or not to print summaries. */ public void addChild(final File file, final boolean printSummaries) { if (!isIgnored(file)) { @@ -171,11 +173,11 @@ sourceLines += child.sourceLines; commentLines += child.commentLines; warnings = getWarnings() + child.getWarnings(); - for (final LineCheck lineCheck : checkers) { - final Integer childI = child.checkWarnings.get(lineCheck); + for (final RegexLineCheck regexLineCheck : checkers) { + final Integer childI = child.checkWarnings.get(regexLineCheck); if (childI != null) { - final Integer i = checkWarnings.get(lineCheck); - checkWarnings.put(lineCheck, i != null ? i + childI : childI); + final Integer i = checkWarnings.get(regexLineCheck); + checkWarnings.put(regexLineCheck, i != null ? i + childI : childI); } } } Deleted: tools/archStat/trunk/src/prj/net/sf/japi/archstat/LineCheck.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/LineCheck.java 2010-04-01 13:03:16 UTC (rev 1399) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/LineCheck.java 2010-04-11 10:12:10 UTC (rev 1400) @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2009 Christian Hujer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sf.japi.archstat; - -import java.util.regex.Pattern; -import java.util.regex.Matcher; -import java.io.File; -import org.w3c.dom.Element; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** A Line-based Check. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @since 0.1 - */ -public class LineCheck { - - /** The message type to emit if this check found something. */ - @NotNull private final MessageType messageType; - - /** The name of this check. */ - @NotNull private final String name; - - /** The regular expression for this check. - * If it matches, the check found something to report. - */ - @NotNull private final Pattern regex; - - /** The message to emit if this check found something. */ - @NotNull private final String message; - - /** Create a line check. - * @param elem XML Element with the check information. - */ - public LineCheck(@NotNull final Element elem) { - this(Enum.valueOf(MessageType.class, elem.getAttribute("messageType")), elem.getAttribute("name"), Pattern.compile(elem.getAttribute("regex")), elem.getAttribute("message")); - } - - /** Create a line check. - * @param messageType The message type to emit if this check found something. - * @param name The name of this check. - * @param regex The regular expression for this check. - * @param message The message to emit if this check found something. - */ - public LineCheck(@NotNull final MessageType messageType, @NotNull final String name, @NotNull final Pattern regex, @NotNull final String message) { - this.messageType = messageType; - this.name = name; - this.regex = regex; - this.message = message; - } - - /** Returns whether or not this line check finds something. - * @param file File to check (informational purpose only, e.g. for error message). - * @param line Line to check. - * @param lineNumber Line number of the line that's checked. - * @return true if this check found a problem, otherwise false. - */ - boolean hasProblem(@NotNull final File file, @NotNull final String line, final int lineNumber) { - boolean ret = false; - final Matcher matcher = regex.matcher(line); - if (matcher.find()) { - final int column = matcher.start(); - ret = true; - LogSystem.log(new LogEntry(file, line, lineNumber, column + 1, messageType, name, message)); - } - return ret; - } - - /** Returns the name of this check. - * @return The name of this check. - */ - @NotNull public String getName() { - return name; - } - - /** Returns the message type of this check. - * @return The message type of this check. - */ - @NotNull public MessageType getMessageType() { - return messageType; - } - - /** Returns the plural name of this check. - * @return The plural name of this check. - */ - @NotNull public String getPlural() { - return name; // TODO:2009-02-18:christianhujer:Implement proper plural support. - } - - /** {@inheritDoc} */ - @Override - public boolean equals(@Nullable final Object obj) { - return obj != null && obj instanceof LineCheck && ((LineCheck) obj).name.equals(name); - } - - /** {@inheritDoc} */ - @Override - public int hashCode() { - return name.hashCode(); - } - -} Copied: tools/archStat/trunk/src/prj/net/sf/japi/archstat/RegexLineCheck.java (from rev 1397, tools/archStat/trunk/src/prj/net/sf/japi/archstat/LineCheck.java) =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/RegexLineCheck.java (rev 0) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/RegexLineCheck.java 2010-04-11 10:12:10 UTC (rev 1400) @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2009 - 2010 Christian Hujer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package net.sf.japi.archstat; + +import java.util.regex.Pattern; +import java.util.regex.Matcher; +import java.io.File; +import org.w3c.dom.Element; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** A Line-based Check. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @since 0.1 + */ +public class RegexLineCheck { + + /** The message type to emit if this check found something. */ + @NotNull private final MessageType messageType; + + /** The name of this check. */ + @NotNull private final String name; + + /** The regular expression for this check. + * If it matches, the check found something to report. + */ + @NotNull private final Pattern regex; + + /** The message to emit if this check found something. */ + @NotNull private final String message; + + /** Create a line check. + * @param elem XML Element with the check information. + */ + public RegexLineCheck(@NotNull final Element elem) { + this(Enum.valueOf(MessageType.class, elem.getAttribute("messageType")), elem.getAttribute("name"), Pattern.compile(elem.getAttribute("regex")), elem.getAttribute("message")); + } + + /** Create a line check. + * @param messageType The message type to emit if this check found something. + * @param name The name of this check. + * @param regex The regular expression for this check. + * @param message The message to emit if this check found something. + */ + public RegexLineCheck(@NotNull final MessageType messageType, @NotNull final String name, @NotNull final Pattern regex, @NotNull final String message) { + this.messageType = messageType; + this.name = name; + this.regex = regex; + this.message = message; + } + + /** Returns whether or not this line check finds something. + * @param file File to check (informational purpose only, e.g. for error message). + * @param line Line to check. + * @param lineNumber Line number of the line that's checked. + * @return true if this check found a problem, otherwise false. + */ + boolean hasProblem(@NotNull final File file, @NotNull final String line, final int lineNumber) { + boolean ret = false; + final Matcher matcher = regex.matcher(line); + if (matcher.find()) { + final int column = matcher.start(); + ret = true; + LogSystem.log(new LogEntry(file, line, lineNumber, column + 1, messageType, name, message)); + } + return ret; + } + + /** Returns the name of this check. + * @return The name of this check. + */ + @NotNull public String getName() { + return name; + } + + /** Returns the message type of this check. + * @return The message type of this check. + */ + @NotNull public MessageType getMessageType() { + return messageType; + } + + /** Returns the plural name of this check. + * @return The plural name of this check. + */ + @NotNull public String getPlural() { + return name; // TODO:2009-02-18:christianhujer:Implement proper plural support. + } + + /** {@inheritDoc} */ + @Override + public boolean equals(@Nullable final Object obj) { + return obj != null && obj instanceof RegexLineCheck && ((RegexLineCheck) obj).name.equals(name); + } + + /** {@inheritDoc} */ + @Override + public int hashCode() { + return name.hashCode(); + } + +} Property changes on: tools/archStat/trunk/src/prj/net/sf/japi/archstat/RegexLineCheck.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-04-01 13:09:49
|
Revision: 1399 http://japi.svn.sourceforge.net/japi/?rev=1399&view=rev Author: christianhujer Date: 2010-04-01 13:03:16 +0000 (Thu, 01 Apr 2010) Log Message: ----------- Add missing serial version. Modified Paths: -------------- libs/swing-font/trunk/src/prj/net/sf/japi/swing/font/FontChooser.java Modified: libs/swing-font/trunk/src/prj/net/sf/japi/swing/font/FontChooser.java =================================================================== --- libs/swing-font/trunk/src/prj/net/sf/japi/swing/font/FontChooser.java 2010-01-31 11:03:41 UTC (rev 1398) +++ libs/swing-font/trunk/src/prj/net/sf/japi/swing/font/FontChooser.java 2010-04-01 13:03:16 UTC (rev 1399) @@ -61,6 +61,9 @@ */ public class FontChooser extends JComponent implements ListSelectionListener, ChangeListener { + /** Serial Version. */ + private static final long serialVersionUID = 1L; + /** Action Builder. */ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.font"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-01-31 11:03:50
|
Revision: 1398 http://japi.svn.sourceforge.net/japi/?rev=1398&view=rev Author: akirschbaum Date: 2010-01-31 11:03:41 +0000 (Sun, 31 Jan 2010) Log Message: ----------- Properly update JFileField's layout after resize. Modified Paths: -------------- libs/swing-misc/trunk/src/prj/net/sf/japi/swing/misc/JFileField.java Modified: libs/swing-misc/trunk/src/prj/net/sf/japi/swing/misc/JFileField.java =================================================================== --- libs/swing-misc/trunk/src/prj/net/sf/japi/swing/misc/JFileField.java 2009-11-03 00:30:52 UTC (rev 1397) +++ libs/swing-misc/trunk/src/prj/net/sf/japi/swing/misc/JFileField.java 2010-01-31 11:03:41 UTC (rev 1398) @@ -18,11 +18,12 @@ package net.sf.japi.swing.misc; -import java.awt.FlowLayout; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; import javax.swing.JComponent; +import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JTextField; -import javax.swing.JFileChooser; /** Component for selecting a file. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -56,13 +57,11 @@ * @see JFileChooser for fileSelectionMode. */ public JFileField(final String labelText, final String initial, final int fileSelectionMode) { - setLayout(new FlowLayout(FlowLayout.RIGHT)); + setLayout(new GridBagLayout()); fileField = new JTextField(initial, DEFAULT_TEXTFIELD_COLUMNS); chooserButton = new JFileChooserButton(fileField, fileSelectionMode); label = new JLabel(labelText); - add(label); - add(fileField); - add(chooserButton); + addFields(); } /** @@ -72,14 +71,33 @@ * @see JFileChooser for fileSelectionMode. */ public JFileField(final String initial, final int fileSelectionMode) { - setLayout(new FlowLayout(FlowLayout.RIGHT)); + setLayout(new GridBagLayout()); fileField = new JTextField(initial, DEFAULT_TEXTFIELD_COLUMNS); chooserButton = new JFileChooserButton(fileField, fileSelectionMode); label = null; - add(fileField); - add(chooserButton); + addFields(); } + /** + * Adds all fields to this component. + */ + private void addFields() { + final GridBagConstraints gbc = new GridBagConstraints(); + gbc.gridx = 0; + gbc.gridy = 0; + gbc.fill = GridBagConstraints.HORIZONTAL; + if (label != null) { + gbc.weightx = 0.0; + add(label, gbc); + } + gbc.gridx++; + gbc.weightx = 1.0; + add(fileField, gbc); + gbc.gridx++; + gbc.weightx = 0.0; + add(chooserButton, gbc); + } + /** {@inheritDoc} */ @Override public void setEnabled(final boolean enabled) { super.setEnabled(enabled); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-11-03 00:31:02
|
Revision: 1397 http://japi.svn.sourceforge.net/japi/?rev=1397&view=rev Author: christianhujer Date: 2009-11-03 00:30:52 +0000 (Tue, 03 Nov 2009) Log Message: ----------- Move antlib.auto to a common place so it can be shared between different users of japi-common. Modified Paths: -------------- common/trunk/commonBuild.xml Modified: common/trunk/commonBuild.xml =================================================================== --- common/trunk/commonBuild.xml 2009-10-26 05:59:53 UTC (rev 1396) +++ common/trunk/commonBuild.xml 2009-11-03 00:30:52 UTC (rev 1397) @@ -59,6 +59,7 @@ <basename property="dir.version" file="${user.dir}" /> <dirname property="parent" file="${user.dir}" /> +<property name="japiUserPath" value="${user.home}/.japi" /> <basename property="parentRegion" file="${parent}" /> <exec outputproperty="svnversion" executable="svnversion"> <env key="LC_ALL" value="C" /> @@ -85,14 +86,14 @@ </path> <available property="has3rdparty" file="lib/annotations.jar" /> -<available property="hasJava2html" file="${commonPath}/antlib.auto/java2html.jar" /> -<available property="hasAntmeat" file="${commonPath}/antlib.auto/antmeat.jar" /> -<available property="hasCheckstyle" file="${commonPath}/antlib.auto/checkstyle-all-4.4.jar" /> -<available property="hasJunit" file="${commonPath}/antlib.auto/junit.jar" /> -<available property="hasPack200" file="${commonPath}/antlib.auto/Pack200Task.jar" /> -<available property="hasPmd" file="${commonPath}/antlib.auto/pmd-4.2.5.jar" /> -<available property="hasTaglets" file="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> -<available property="hasFindbugs" file="${commonPath}/antlib.auto/findbugs-1.3.8/lib/findbugs-ant.jar" /> +<available property="hasJava2html" file="${japiUserPath}/antlib.auto/java2html.jar" /> +<available property="hasAntmeat" file="${japiUserPath}/antlib.auto/antmeat.jar" /> +<available property="hasCheckstyle" file="${japiUserPath}/antlib.auto/checkstyle-all-4.4.jar" /> +<available property="hasJunit" file="${japiUserPath}/antlib.auto/junit.jar" /> +<available property="hasPack200" file="${japiUserPath}/antlib.auto/Pack200Task.jar" /> +<available property="hasPmd" file="${japiUserPath}/antlib.auto/pmd-4.2.5.jar" /> +<available property="hasTaglets" file="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> +<available property="hasFindbugs" file="${japiUserPath}/antlib.auto/findbugs-1.3.8/lib/findbugs-ant.jar" /> <!-- targets are sorted alphabetically. --> @@ -108,24 +109,24 @@ </target> <target name="getPack200" unless="hasPack200"> - <mkdir dir="${commonPath}/antlib.auto" /> - <get src="https://java-pack200-ant-task.dev.java.net/files/documents/1526/6272/ant-task.zip" dest="${commonPath}/antlib.auto/ant-task.zip" usetimestamp="true" /> - <unzip src="${commonPath}/antlib.auto/ant-task.zip" dest="${commonPath}/antlib.auto"> + <mkdir dir="${japiUserPath}/antlib.auto" /> + <get src="https://java-pack200-ant-task.dev.java.net/files/documents/1526/6272/ant-task.zip" dest="${japiUserPath}/antlib.auto/ant-task.zip" usetimestamp="true" /> + <unzip src="${japiUserPath}/antlib.auto/ant-task.zip" dest="${japiUserPath}/antlib.auto"> <patternset includes="**/*Pack200Task.jar" /> <mapper type="flatten" /> </unzip> </target> <target name="getAntmeat" unless="hasAntmeat"> - <mkdir dir="${commonPath}/antlib.auto" /> - <get src="http://downloads.sourceforge.net/antmeat/antmeat-0.3.zip" dest="${commonPath}/antlib.auto/antmeat-0.3.zip" usetimestamp="true" /> - <unzip src="${commonPath}/antlib.auto/antmeat-0.3.zip" dest="${commonPath}/antlib.auto"> + <mkdir dir="${japiUserPath}/antlib.auto" /> + <get src="http://downloads.sourceforge.net/antmeat/antmeat-0.3.zip" dest="${japiUserPath}/antlib.auto/antmeat-0.3.zip" usetimestamp="true" /> + <unzip src="${japiUserPath}/antlib.auto/antmeat-0.3.zip" dest="${japiUserPath}/antlib.auto"> <patternset includes="**/*.jar" /> </unzip> - <move file="${commonPath}/antlib.auto/antmeat-0.3/antmeat.jar" tofile="${commonPath}/antlib.auto/antmeat.jar" /> - <delete dir="${commonPath}/antlib.auto/antmeat-0.3/" /> - <get src="http://mirror.serversupportforum.de/apache/ws/xmlrpc/binaries/xmlrpc-3.1.1-bin.tar.gz" dest="${commonPath}/antlib.auto/xmlrpc-3.1.1-bin.tar.gz" usetimestamp="true" /> - <untar compression="gzip" src="${commonPath}/antlib.auto/xmlrpc-3.1.1-bin.tar.gz" dest="${commonPath}/antlib.auto"> + <move file="${japiUserPath}/antlib.auto/antmeat-0.3/antmeat.jar" tofile="${japiUserPath}/antlib.auto/antmeat.jar" /> + <delete dir="${japiUserPath}/antlib.auto/antmeat-0.3/" /> + <get src="http://mirror.serversupportforum.de/apache/ws/xmlrpc/binaries/xmlrpc-3.1.1-bin.tar.gz" dest="${japiUserPath}/antlib.auto/xmlrpc-3.1.1-bin.tar.gz" usetimestamp="true" /> + <untar compression="gzip" src="${japiUserPath}/antlib.auto/xmlrpc-3.1.1-bin.tar.gz" dest="${japiUserPath}/antlib.auto"> <patternset includes="**/*.jar" excludes="**/*sources*.jar,**/*javadoc*.jar" /> <mapper type="flatten" /> </untar> @@ -136,7 +137,7 @@ description = "announce new version on freshmeat.net" depends = "getAntmeat" > - <taskdef name="freshmeat" classpath="${commonPath}/antlib.auto/antmeat.jar" classname="de.frewert.ant.freshmeat.Announcement" /> + <taskdef name="freshmeat" classpath="${japiUserPath}/antlib.auto/antmeat.jar" classname="de.frewert.ant.freshmeat.Announcement" /> <echo>Announcing. Press return to start announcing this release at FreshMeat.</echo> <input /> <echo><![CDATA[ @@ -167,17 +168,17 @@ </target> <target name="getCheckstyle" unless="hasCheckstyle"> - <mkdir dir="${commonPath}/antlib.auto" /> - <get src="http://downloads.sourceforge.net/checkstyle/checkstyle-4.4.tar.gz" dest="${commonPath}/antlib.auto/checkstyle-4.4.tar.gz" usetimestamp="true" /> - <untar src="${commonPath}/antlib.auto/checkstyle-4.4.tar.gz" dest="${commonPath}/antlib.auto" compression="gzip"> + <mkdir dir="${japiUserPath}/antlib.auto" /> + <get src="http://downloads.sourceforge.net/checkstyle/checkstyle-4.4.tar.gz" dest="${japiUserPath}/antlib.auto/checkstyle-4.4.tar.gz" usetimestamp="true" /> + <untar src="${japiUserPath}/antlib.auto/checkstyle-4.4.tar.gz" dest="${japiUserPath}/antlib.auto" compression="gzip"> <patternset includes="checkstyle-4.4/checkstyle-all-4.4.jar" /> </untar> - <move file="${commonPath}/antlib.auto/checkstyle-4.4/checkstyle-all-4.4.jar" tofile="${commonPath}/antlib.auto/checkstyle-all-4.4.jar" /> - <delete dir="${commonPath}/antlib.auto/checkstyle-4.4/" /> + <move file="${japiUserPath}/antlib.auto/checkstyle-4.4/checkstyle-all-4.4.jar" tofile="${japiUserPath}/antlib.auto/checkstyle-all-4.4.jar" /> + <delete dir="${japiUserPath}/antlib.auto/checkstyle-4.4/" /> </target> <target name="checkstyle" description="Runs checkstyle over the source code." depends="getCheckstyle"> - <taskdef classpath="${commonPath}/antlib.auto/checkstyle-all-4.4.jar" resource="checkstyletask.properties" /> + <taskdef classpath="${japiUserPath}/antlib.auto/checkstyle-all-4.4.jar" resource="checkstyletask.properties" /> <checkstyle config="${commonPath}/sun_checks.xml" > @@ -281,8 +282,8 @@ description = "Creates and packs distribution archives." depends = "clean, compile, test, doc, build, getPack200" > - <taskdef name="pack200" classpath="${commonPath}/antlib.auto/Pack200Task.jar" classname="com.sun.tools.apache.ant.pack200.Pack200Task" /> - <taskdef name="unpack200" classpath="${commonPath}/antlib.auto/Pack200Task.jar" classname="com.sun.tools.apache.ant.pack200.Unpack200Task" /> + <taskdef name="pack200" classpath="${japiUserPath}/antlib.auto/Pack200Task.jar" classname="com.sun.tools.apache.ant.pack200.Pack200Task" /> + <taskdef name="unpack200" classpath="${japiUserPath}/antlib.auto/Pack200Task.jar" classname="com.sun.tools.apache.ant.pack200.Unpack200Task" /> <mkdir dir="dist" /> <parallel> @@ -290,7 +291,7 @@ <tarfileset dir="." prefix="${module.name}-${module.version}"> <include name="src/**" /> <include name="${commonPath}/**" /> - <exclude name="${commonPath}/antlib.auto/**" /> + <exclude name="${japiUserPath}/antlib.auto/**" /> <include name="devlib/**" /> <include name="lib/**" /> <include name="*.iml,build.xml,module.properties" /> @@ -302,7 +303,7 @@ <zipfileset dir="." prefix="${module.name}-${module.version}"> <include name="src/**" /> <include name="${commonPath}/**" /> - <exclude name="${commonPath}/antlib.auto/**" /> + <exclude name="${japiUserPath}/antlib.auto/**" /> <include name="devlib/**" /> <include name="lib/**" /> <include name="*.iml,build.xml,module.properties" /> @@ -314,7 +315,7 @@ <zipfileset dir="." prefix="${module.name}-${module.version}"> <include name="src/**" /> <include name="${commonPath}/**" /> - <exclude name="${commonPath}/antlib.auto/**" /> + <exclude name="${japiUserPath}/antlib.auto/**" /> <include name="devlib/**" /> <include name="lib/**" /> <include name="*.iml,build.xml,module.properties" /> @@ -368,12 +369,12 @@ </target> <target name="getTaglets" unless="hasTaglets"> - <get src="http://downloads.sourceforge.net/japi/japi-lib-taglets-0.1.0.jar" dest="${commonPath}/antlib.auto/japi-lib-taglets.jar" usetimestamp="true" /> + <get src="http://downloads.sourceforge.net/japi/japi-lib-taglets-0.1.0.jar" dest="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" usetimestamp="true" /> </target> <target name="getJava2html" unless="hasJava2htmL"> - <get src="http://www.java2html.de/java2html_50.zip" dest="${commonPath}/antlib.auto/java2html_50.zip" usetimestamp="true" /> - <unzip src="${commonPath}/antlib.auto/java2html_50.zip" dest="${commonPath}/antlib.auto"> + <get src="http://www.java2html.de/java2html_50.zip" dest="${japiUserPath}/antlib.auto/java2html_50.zip" usetimestamp="true" /> + <unzip src="${japiUserPath}/antlib.auto/java2html_50.zip" dest="${japiUserPath}/antlib.auto"> <patternset includes="java2html.jar" /> </unzip> </target> @@ -413,18 +414,18 @@ dir="src/prj" defaultexcludes="yes" /> - <taglet name="net.sf.japi.taglets.FixmeTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.HistoryTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.InvariantTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.NoteTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.PostconditionTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.PreconditionTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.ReturnValueTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.TodoTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.WarningTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.XxxTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.IncludeTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar;${commonPath}/antlib.auto/java2html.jar" /> - <taglet name="net.sf.japi.taglets.ListingTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar;${commonPath}/antlib.auto/java2html.jar" /> + <taglet name="net.sf.japi.taglets.FixmeTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.HistoryTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.InvariantTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.NoteTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.PostconditionTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.PreconditionTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.ReturnValueTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.TodoTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.WarningTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.XxxTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.IncludeTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar;${japiUserPath}/antlib.auto/java2html.jar" /> + <taglet name="net.sf.japi.taglets.ListingTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar;${japiUserPath}/antlib.auto/java2html.jar" /> </javadoc> </target> @@ -458,30 +459,30 @@ overview = "src/overview.html" --> <classpath refid="class.path" /> - <classpath location="${commonPath}/antlib.auto/junit.jar" /> + <classpath location="${japiUserPath}/antlib.auto/junit.jar" /> <link offline="true" href="http://java.sun.com/javase/6/docs/api/" packagelistLoc="${java.home}/../docs/api/" /> <packageset dir="src/doc" defaultexcludes="yes" /> <packageset dir="src/prj" defaultexcludes="yes" /> <packageset dir="src/tst" defaultexcludes="yes" /> - <taglet name="net.sf.japi.taglets.FixmeTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.HistoryTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.InvariantTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.NoteTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.PostconditionTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.PreconditionTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.ReturnValueTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.TodoTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.WarningTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.XxxTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar" /> - <taglet name="net.sf.japi.taglets.IncludeTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar;${commonPath}/antlib.auto/java2html.jar" /> - <taglet name="net.sf.japi.taglets.ListingTaglet" path="${commonPath}/antlib.auto/japi-lib-taglets.jar;${commonPath}/antlib.auto/java2html.jar" /> + <taglet name="net.sf.japi.taglets.FixmeTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.HistoryTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.InvariantTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.NoteTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.PostconditionTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.PreconditionTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.ReturnValueTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.TodoTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.WarningTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.XxxTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar" /> + <taglet name="net.sf.japi.taglets.IncludeTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar;${japiUserPath}/antlib.auto/java2html.jar" /> + <taglet name="net.sf.japi.taglets.ListingTaglet" path="${japiUserPath}/antlib.auto/japi-lib-taglets.jar;${japiUserPath}/antlib.auto/java2html.jar" /> </javadoc> </target> <target name="test" description="Performs all tests (static and dynamic)" depends="checkstyle, unittest, pmd" /> <target name="getJunit" unless="hasJunit"> - <get src="http://downloads.sourceforge.net/junit/junit-4.5.jar" dest="${commonPath}/antlib.auto/junit.jar" usetimestamp="true" /> + <get src="http://downloads.sourceforge.net/junit/junit-4.5.jar" dest="${japiUserPath}/antlib.auto/junit.jar" usetimestamp="true" /> </target> <target name="unittest" description="Performs JUnit tests." depends="compile, getJunit"> @@ -497,7 +498,7 @@ > <compilerarg value="-Xlint:all" /> <classpath refid="class.path" /> - <classpath location="${commonPath}/antlib.auto/junit.jar" /> + <classpath location="${japiUserPath}/antlib.auto/junit.jar" /> <classpath location="classes/production/${module.shortname}" /> <exclude name="**/package-info.java" /> </javac> @@ -508,7 +509,7 @@ </copy> <junit printsummary="yes" haltonfailure="yes"> <classpath refid="class.path" /> - <classpath location="${commonPath}/antlib.auto/junit.jar" /> + <classpath location="${japiUserPath}/antlib.auto/junit.jar" /> <classpath location="classes/production/${module.shortname}" /> <classpath location="classes/test/${module.shortname}" /> <formatter type="plain" /> @@ -529,9 +530,9 @@ </target> <target name="getPmd" unless="hasPmd"> - <mkdir dir="${commonPath}/antlib.auto" /> - <get src="http://downloads.sourceforge.net/pmd/pmd-bin-4.2.5.zip" dest="${commonPath}/antlib.auto/pmd-bin-4.2.5.zip" usetimestamp="true" /> - <unzip src="${commonPath}/antlib.auto/pmd-bin-4.2.5.zip" dest="${commonPath}/antlib.auto"> + <mkdir dir="${japiUserPath}/antlib.auto" /> + <get src="http://downloads.sourceforge.net/pmd/pmd-bin-4.2.5.zip" dest="${japiUserPath}/antlib.auto/pmd-bin-4.2.5.zip" usetimestamp="true" /> + <unzip src="${japiUserPath}/antlib.auto/pmd-bin-4.2.5.zip" dest="${japiUserPath}/antlib.auto"> <patternset includes="**/lib/pmd-4.2.5.jar" /> <patternset includes="**/lib/jaxen-1.1.1.jar" /> <patternset includes="**/lib/asm-3.1.jar" /> @@ -540,10 +541,10 @@ </target> <target name="pmd" description="Performs quality checks using PMD." depends="compile,getPmd"> - <taskdef name="pmd" classpath="${commonPath}/antlib.auto/pmd-4.2.5.jar" classname="net.sourceforge.pmd.ant.PMDTask"/> + <taskdef name="pmd" classpath="${japiUserPath}/antlib.auto/pmd-4.2.5.jar" classname="net.sourceforge.pmd.ant.PMDTask"/> <pmd shortFilenames="true" failOnError="true" failOnRuleViolation="true"> <auxclasspath refid="class.path" /> - <auxclasspath location="${commonPath}/antlib.auto/junit.jar" /> + <auxclasspath location="${japiUserPath}/antlib.auto/junit.jar" /> <auxclasspath location="classes/production/${module.shortname}" /> <ruleset>${commonPath}/pmd_checks.xml</ruleset> <formatter type="text" toConsole="true" /> @@ -557,15 +558,15 @@ </target> <target name="getFindbugs" unless="hasFindbugs"> - <mkdir dir="${commonPath}/antlib.auto" /> - <get src="http://downloads.sourceforge.net/findbugs/findbugs-1.3.8.tar.gz" dest="${commonPath}/antlib.auto/findbugs-1.3.8.tar.gz" usetimestamp="true" /> - <untar src="${commonPath}/antlib.auto/findbugs-1.3.8.tar.gz" dest="${commonPath}/antlib.auto" compression="gzip" /> + <mkdir dir="${japiUserPath}/antlib.auto" /> + <get src="http://downloads.sourceforge.net/findbugs/findbugs-1.3.8.tar.gz" dest="${japiUserPath}/antlib.auto/findbugs-1.3.8.tar.gz" usetimestamp="true" /> + <untar src="${japiUserPath}/antlib.auto/findbugs-1.3.8.tar.gz" dest="${japiUserPath}/antlib.auto" compression="gzip" /> </target> <target name="findbugs" description="Performs quality checks using FindBugs." depends="compile,getFindbugs"> - <taskdef classpath="${commonPath}/antlib.auto/findbugs-1.3.8/lib/findbugs-ant.jar" name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" /> + <taskdef classpath="${japiUserPath}/antlib.auto/findbugs-1.3.8/lib/findbugs-ant.jar" name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" /> <findbugs - home="${commonPath}/antlib.auto/findbugs-1.3.8/" + home="${japiUserPath}/antlib.auto/findbugs-1.3.8/" output="emacs" reportLevel="low" > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-10-26 06:00:00
|
Revision: 1396 http://japi.svn.sourceforge.net/japi/?rev=1396&view=rev Author: christianhujer Date: 2009-10-26 05:59:53 +0000 (Mon, 26 Oct 2009) Log Message: ----------- Add a control for Virus TI (unfinished). Modified Paths: -------------- progs/jirus/trunk/src/prj/net/sf/jirus/Jirus.java progs/jirus/trunk/src/prj/net/sf/jirus/MyReceiver.java Added Paths: ----------- progs/jirus/trunk/src/prj/META-INF/ progs/jirus/trunk/src/prj/META-INF/services/ progs/jirus/trunk/src/prj/META-INF/services/javax.sound.midi.spi.MidiDeviceProvider progs/jirus/trunk/src/prj/net/sf/jirus/JirusControl.java progs/jirus/trunk/src/prj/net/sf/jirus/JirusControlProvider.java Added: progs/jirus/trunk/src/prj/META-INF/services/javax.sound.midi.spi.MidiDeviceProvider =================================================================== --- progs/jirus/trunk/src/prj/META-INF/services/javax.sound.midi.spi.MidiDeviceProvider (rev 0) +++ progs/jirus/trunk/src/prj/META-INF/services/javax.sound.midi.spi.MidiDeviceProvider 2009-10-26 05:59:53 UTC (rev 1396) @@ -0,0 +1 @@ +net.sf.jirus.JirusControlProvider Property changes on: progs/jirus/trunk/src/prj/META-INF/services/javax.sound.midi.spi.MidiDeviceProvider ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: progs/jirus/trunk/src/prj/net/sf/jirus/Jirus.java =================================================================== --- progs/jirus/trunk/src/prj/net/sf/jirus/Jirus.java 2009-10-26 05:56:43 UTC (rev 1395) +++ progs/jirus/trunk/src/prj/net/sf/jirus/Jirus.java 2009-10-26 05:59:53 UTC (rev 1396) @@ -23,6 +23,7 @@ import javax.sound.midi.Sequencer; import javax.sound.midi.SysexMessage; import javax.sound.midi.Transmitter; +import javax.swing.JFrame; import net.sf.japi.io.args.ArgParser; import net.sf.japi.io.args.BasicCommand; import net.sf.japi.midi.MidiUtils; @@ -59,27 +60,30 @@ /** {@inheritDoc} */ @SuppressWarnings({"InstanceMethodNamingConvention"}) public int run(@NotNull final List<String> args) throws Exception { - final MidiDevice device1 = MidiUtils.getTransmittingDevice("Virus TI Synth"); - final MidiDevice device2 = MidiUtils.getReceivingDevice("Virus TI Synth"); - final MidiDevice device3 = MidiUtils.getTransmittingDevice("Virus TI MIDI"); - final MidiDevice device4 = MidiUtils.getReceivingDevice("Virus TI MIDI"); - final Sequencer sequencer = (Sequencer) MidiUtils.getDeviceByName("Real Time Sequencer"); - device1.open(); - device2.open(); - device3.open(); - device4.open(); - final Transmitter transmitter = device1.getTransmitter(); - final Receiver receiver = device4.getReceiver(); - transmitter.setReceiver(new MyReceiver(receiver)); + final JFrame frame = new JFrame("foo"); + if (false) { + final MidiDevice device1 = MidiUtils.getTransmittingDevice("Virus TI Synth"); + final MidiDevice device2 = MidiUtils.getReceivingDevice("Virus TI Synth"); + final MidiDevice device3 = MidiUtils.getTransmittingDevice("Virus TI MIDI"); + final MidiDevice device4 = MidiUtils.getReceivingDevice("Virus TI MIDI"); + final Sequencer sequencer = (Sequencer) MidiUtils.getDeviceByName("Real Time Sequencer"); + device1.open(); + device2.open(); + device3.open(); + device4.open(); + final Transmitter transmitter = device1.getTransmitter(); + final Receiver receiver = device4.getReceiver(); + transmitter.setReceiver(new MyReceiver(receiver)); - // The following SysEx message is known to do the following: - // - It sets the tempo to 0x41 which is 128 BPM (63 is the base, + 65 which is 0x41 so that's 128 BPM) - // It sets "Local" to "Off", disabling the Synthesizer's internal feedback loop so all Midi is routed through this program. - final SysexMessage sysexMessage = MidiUtils.createSysexMessage("f0002033011071401041f7"); - receiver.send(new SysexMessage(), 0); - // The following sets logo groove to NN (0x00 - 0x7F) : f00020330100730834NNf7 + // The following SysEx message is known to do the following: + // - It sets the tempo to 0x41 which is 128 BPM (63 is the base, + 65 which is 0x41 so that's 128 BPM) + // It sets "Local" to "Off", disabling the Synthesizer's internal feedback loop so all Midi is routed through this program. + final SysexMessage sysexMessage = MidiUtils.createSysexMessage("f0002033011071401041f7"); + receiver.send(new SysexMessage(), 0); + // The following sets logo groove to NN (0x00 - 0x7F) : f00020330100730834NNf7 - System.out.println("Go!"); + System.out.println("Go!"); + } return 0; } Added: progs/jirus/trunk/src/prj/net/sf/jirus/JirusControl.java =================================================================== --- progs/jirus/trunk/src/prj/net/sf/jirus/JirusControl.java (rev 0) +++ progs/jirus/trunk/src/prj/net/sf/jirus/JirusControl.java 2009-10-26 05:59:53 UTC (rev 1396) @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2009, Your Corporation. All Rights Reserved. + */ + +package net.sf.jirus; + +import javax.sound.midi.MidiDevice; +import javax.sound.midi.MidiUnavailableException; +import javax.sound.midi.Receiver; +import javax.sound.midi.Transmitter; +import java.util.List; + +/** + * TODO:2009-06-21:christianhujer:Documentation. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @since 0.1 + */ +public class JirusControl implements MidiDevice { + + /** Constant that indicates that timestamps are not supported. */ + private static final int MICROSECOND_POSITION_UNSUPPORTED = 1; + + /** Constant that indicates support for an unlimited number of transmitters. */ + private static final int UNLIMITED_TRANSMITTERS = -1; + + /** Constant that indicates support for an unlimited number of receivers. */ + private static final int UNLIMITED_RECEIVERS = -1; + + /** Whether or not JirusControl is open. */ + private boolean open; + + /** {@inheritDoc} */ + public Info getDeviceInfo() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + /** {@inheritDoc} */ + public void open() throws MidiUnavailableException { + open = true; + } + + /** {@inheritDoc} */ + public void close() { + open = false; + } + + /** {@inheritDoc} */ + public boolean isOpen() { + return open; + } + + /** {@inheritDoc} */ + public long getMicrosecondPosition() { + return MICROSECOND_POSITION_UNSUPPORTED; + } + + /** {@inheritDoc} */ + public int getMaxReceivers() { + return UNLIMITED_RECEIVERS; + } + + /** {@inheritDoc} */ + public int getMaxTransmitters() { + return UNLIMITED_TRANSMITTERS; + } + + /** {@inheritDoc} */ + public Receiver getReceiver() throws MidiUnavailableException { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + /** {@inheritDoc} */ + public List<Receiver> getReceivers() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + /** {@inheritDoc} */ + public Transmitter getTransmitter() throws MidiUnavailableException { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + /** {@inheritDoc} */ + public List<Transmitter> getTransmitters() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } +} Property changes on: progs/jirus/trunk/src/prj/net/sf/jirus/JirusControl.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: progs/jirus/trunk/src/prj/net/sf/jirus/JirusControlProvider.java =================================================================== --- progs/jirus/trunk/src/prj/net/sf/jirus/JirusControlProvider.java (rev 0) +++ progs/jirus/trunk/src/prj/net/sf/jirus/JirusControlProvider.java 2009-10-26 05:59:53 UTC (rev 1396) @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2009, Your Corporation. All Rights Reserved. + */ + +package net.sf.jirus; + +import javax.sound.midi.spi.MidiDeviceProvider; +import javax.sound.midi.MidiDevice; + +/** + * TODO:2009-06-21:christianhujer:Documentation. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @since 0.1 + */ +public class JirusControlProvider extends MidiDeviceProvider { + + /** The DeficeInfos. */ + private MidiDevice.Info[] deviceInfo = { + new MidiDevice.Info("Jirus Control", "Christian Hujer", "Jirus Control", "trunk") {} + }; + public MidiDevice.Info[] getDeviceInfo() { + return new MidiDevice.Info[0]; + } + + public MidiDevice getDevice(final MidiDevice.Info info) { + return null; //To change body of implemented methods use File | Settings | File Templates. + } +} Property changes on: progs/jirus/trunk/src/prj/net/sf/jirus/JirusControlProvider.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: progs/jirus/trunk/src/prj/net/sf/jirus/MyReceiver.java =================================================================== --- progs/jirus/trunk/src/prj/net/sf/jirus/MyReceiver.java 2009-10-26 05:56:43 UTC (rev 1395) +++ progs/jirus/trunk/src/prj/net/sf/jirus/MyReceiver.java 2009-10-26 05:59:53 UTC (rev 1396) @@ -85,7 +85,7 @@ if (echoMessage) { receiver.send(message, timeStamp); } - } catch (InvalidMidiDataException e) { + } catch (final InvalidMidiDataException e) { // This should not happen. // It would mean that the program itself did something wrong. e.printStackTrace(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-10-26 05:56:55
|
Revision: 1395 http://japi.svn.sourceforge.net/japi/?rev=1395&view=rev Author: christianhujer Date: 2009-10-26 05:56:43 +0000 (Mon, 26 Oct 2009) Log Message: ----------- Remove news about financial calculations. Modified Paths: -------------- site/trunk/src/doc/start.xhtml Modified: site/trunk/src/doc/start.xhtml =================================================================== --- site/trunk/src/doc/start.xhtml 2009-10-26 05:55:39 UTC (rev 1394) +++ site/trunk/src/doc/start.xhtml 2009-10-26 05:56:43 UTC (rev 1395) @@ -33,11 +33,7 @@ Additionally it contains some useful classes about argument parsing, I/O and XML. Note: JAPI requires <em>J2SE 5.0</em> or later. </p> - <h2>News</h2> - <p> - JAPI gets additions for financial calculations. - New project member z0ra is adding some classes including unit tests to perform financial calculations with JAPI. - </p> + <!--<h2>News</h2>--> <h2>The JAPI sub projects</h2> <p> Because of its size and diversity, JAPI has undergone a major refactoring and is now split into several subprojects. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-10-26 05:55:47
|
Revision: 1394 http://japi.svn.sourceforge.net/japi/?rev=1394&view=rev Author: christianhujer Date: 2009-10-26 05:55:39 +0000 (Mon, 26 Oct 2009) Log Message: ----------- Fix bug: icon was not shown. Modified Paths: -------------- libs/swing-misc/trunk/src/prj/net/sf/japi/swing/misc/action.properties Modified: libs/swing-misc/trunk/src/prj/net/sf/japi/swing/misc/action.properties =================================================================== --- libs/swing-misc/trunk/src/prj/net/sf/japi/swing/misc/action.properties 2009-10-26 05:55:07 UTC (rev 1393) +++ libs/swing-misc/trunk/src/prj/net/sf/japi/swing/misc/action.properties 2009-10-26 05:55:39 UTC (rev 1394) @@ -16,4 +16,4 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # -optionsChooseFile.icon=toolbarButtonGraphics/general/Open16 +optionsChooseFile.icon=general/Open16 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-10-26 05:55:16
|
Revision: 1393 http://japi.svn.sourceforge.net/japi/?rev=1393&view=rev Author: christianhujer Date: 2009-10-26 05:55:07 +0000 (Mon, 26 Oct 2009) Log Message: ----------- Fix bug. Modified Paths: -------------- libs/swing-font/trunk/src/prj/net/sf/japi/swing/font/FontFamilyListCellRenderer.java Modified: libs/swing-font/trunk/src/prj/net/sf/japi/swing/font/FontFamilyListCellRenderer.java =================================================================== --- libs/swing-font/trunk/src/prj/net/sf/japi/swing/font/FontFamilyListCellRenderer.java 2009-10-26 05:54:27 UTC (rev 1392) +++ libs/swing-font/trunk/src/prj/net/sf/japi/swing/font/FontFamilyListCellRenderer.java 2009-10-26 05:55:07 UTC (rev 1393) @@ -40,7 +40,7 @@ /** The fonts to render. * @serial include */ - @NotNull private Map<String, Font> fonts; + @Nullable private Map<String, Font> fonts; /** Set the fonts to render. * The key of the map is the family name, the value of the map is the font to render. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-10-26 05:54:41
|
Revision: 1392 http://japi.svn.sourceforge.net/japi/?rev=1392&view=rev Author: christianhujer Date: 2009-10-26 05:54:27 +0000 (Mon, 26 Oct 2009) Log Message: ----------- Improve documentation. Modified Paths: -------------- libs/argparser/trunk/src/prj/net/sf/japi/io/args/ArgParser.java libs/argparser/trunk/src/prj/net/sf/japi/io/args/Option.java libs/argparser/trunk/src/prj/net/sf/japi/io/args/converter/ConverterRegistry.java Modified: libs/argparser/trunk/src/prj/net/sf/japi/io/args/ArgParser.java =================================================================== --- libs/argparser/trunk/src/prj/net/sf/japi/io/args/ArgParser.java 2009-10-05 23:51:41 UTC (rev 1391) +++ libs/argparser/trunk/src/prj/net/sf/japi/io/args/ArgParser.java 2009-10-26 05:54:27 UTC (rev 1392) @@ -38,10 +38,26 @@ /** * Parser for command line arguments. + * <p> + * The most popular usage is by extending {@link BasicCommand} and invoking {@link #simpleParseAndRun(Command, String[])}, like this: + * {@listing java import net.sf.japi.io.args.*; + * public class HelloCommand extends BasicCommand { + * public static void main(final String... args) { + * ArgParser.simpleParseAndRun(new HelloCommand(), args); + * } + * public void run(final List<String> args) throws Exception { + * System.out.println("Hello, world!"); + * } + * }} * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @since 0.2 * + * @see net.sf.japi.io.args + * @see Command + * @see BasicCommand + * @see ConverterRegistry + * * @todo better handling of boolean arguments * @todo Handling of - for STDIN as input argument filestream * @todo automatic printout of default values if property getter available. Modified: libs/argparser/trunk/src/prj/net/sf/japi/io/args/Option.java =================================================================== --- libs/argparser/trunk/src/prj/net/sf/japi/io/args/Option.java 2009-10-05 23:51:41 UTC (rev 1391) +++ libs/argparser/trunk/src/prj/net/sf/japi/io/args/Option.java 2009-10-26 05:54:27 UTC (rev 1392) @@ -26,8 +26,36 @@ /** * Annotation to mark a method as command argument method. + * <p> + * Examples: + * {@listing java @Option("r") + * public void recurse() { + * recursive = true; + * } + * + * @Option("recursive") + * public void setRecursive(final boolean recursive) { + * this.recursive = recursive; + * } + * + * @Option(type = OptionType.TERMINAL, value = {"listEncodings"}) + * public void listEncodings() { + * for (final String encoding : encodings) { + * System.out.println(encoding); + * } + * } + * } + * The commands derived from {@link CommandWithHelp} (incl. {@link BasicCommand}) support reading help descriptions from {@link ResourceBundle}s. + * For that, the package of the command implementation needs a {Resourcebundle} with the same basename as the command class. + * A properties file which matches above example could look like this: + * {@listing properties recurse=Recurse into subdirectories. + * setRecursive=Set whether or not to recurse into subdirectories. + * listEncodings=List the encodings and exit.} + * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @since 0.2 + * + * @see OptionType for the supported types of options. */ @Documented @Retention(RUNTIME) Modified: libs/argparser/trunk/src/prj/net/sf/japi/io/args/converter/ConverterRegistry.java =================================================================== --- libs/argparser/trunk/src/prj/net/sf/japi/io/args/converter/ConverterRegistry.java 2009-10-05 23:51:41 UTC (rev 1391) +++ libs/argparser/trunk/src/prj/net/sf/japi/io/args/converter/ConverterRegistry.java 2009-10-26 05:54:27 UTC (rev 1392) @@ -27,9 +27,9 @@ import org.jetbrains.annotations.Nullable; /** - * Registry for Converters. + * Registry for {@link Converter}s. * <p> - * Per default, the following are supported: + * Per default, the following {@link Converter}s are supported: * <ul> * <li>String (this is an identity conversion)</li> * <li>All primitive types (boolean, byte, short, int, long, char, float, double).</li> @@ -37,6 +37,7 @@ * <li>All types which have a public constructor that takes a single String argument.</li> * <li>All Enums.</li> * </ul> + * The ConverterRegistry uses the {@link ServiceLoader ServiceLoader} to find additional {@link Converter}s. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @since 0.2 */ @@ -128,6 +129,7 @@ */ public <T> void register(@NotNull final Converter<T> converter) { converters.put(converter.getTargetClass(), converter); + //noinspection NestedAssignment for (Class<?> superClass = converter.getTargetClass(); (superClass = superClass.getSuperclass()) != null;) { if (!converters.containsKey(superClass)) { converters.put(superClass, converter); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-10-05 23:51:48
|
Revision: 1391 http://japi.svn.sourceforge.net/japi/?rev=1391&view=rev Author: christianhujer Date: 2009-10-05 23:51:41 +0000 (Mon, 05 Oct 2009) Log Message: ----------- Commit current IntelliJ IDEA project / module files. Modified Paths: -------------- tools/archStat/trunk/archStat.iml tools/archStat/trunk/archStat.ipr Modified: tools/archStat/trunk/archStat.iml =================================================================== --- tools/archStat/trunk/archStat.iml 2009-10-05 23:50:55 UTC (rev 1390) +++ tools/archStat/trunk/archStat.iml 2009-10-05 23:51:41 UTC (rev 1391) @@ -41,153 +41,6 @@ <Base> <setting name="state" value="1" /> </Base> - <LanguageOptions name="HTML"> - <option name="templateOptions"> - <value> - <option name="block" value="true" /> - <option name="separateBefore" value="false" /> - <option name="separateAfter" value="false" /> - <option name="prefixLines" value="true" /> - <option name="lenBefore" value="80" /> - <option name="lenAfter" value="80" /> - <option name="box" value="false" /> - <option name="filler" value="$TEMPLATE$" /> - </value> - </option> - <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." /> - <option name="keyword" value="Copyright" /> - <option name="fileTypeOverride" value="2" /> - <option name="relativeBefore" value="true" /> - <option name="addBlankAfter" value="true" /> - <option name="fileLocation" value="1" /> - <option name="useAlternate" value="false" /> - </LanguageOptions> - <LanguageOptions name="JAVA"> - <option name="templateOptions"> - <value> - <option name="block" value="true" /> - <option name="separateBefore" value="false" /> - <option name="separateAfter" value="false" /> - <option name="prefixLines" value="true" /> - <option name="lenBefore" value="80" /> - <option name="lenAfter" value="80" /> - <option name="box" value="false" /> - <option name="filler" value="$TEMPLATE$" /> - </value> - </option> - <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." /> - <option name="keyword" value="Copyright" /> - <option name="fileTypeOverride" value="2" /> - <option name="relativeBefore" value="true" /> - <option name="addBlankAfter" value="true" /> - <option name="fileLocation" value="1" /> - <option name="useAlternate" value="false" /> - </LanguageOptions> - <LanguageOptions name="JSP"> - <option name="templateOptions"> - <value> - <option name="block" value="true" /> - <option name="separateBefore" value="false" /> - <option name="separateAfter" value="false" /> - <option name="prefixLines" value="true" /> - <option name="lenBefore" value="80" /> - <option name="lenAfter" value="80" /> - <option name="box" value="false" /> - <option name="filler" value="$TEMPLATE$" /> - </value> - </option> - <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." /> - <option name="keyword" value="Copyright" /> - <option name="fileTypeOverride" value="2" /> - <option name="relativeBefore" value="true" /> - <option name="addBlankAfter" value="true" /> - <option name="fileLocation" value="1" /> - <option name="useAlternate" value="false" /> - </LanguageOptions> - <LanguageOptions name="JavaScript"> - <option name="templateOptions"> - <value> - <option name="block" value="true" /> - <option name="separateBefore" value="false" /> - <option name="separateAfter" value="false" /> - <option name="prefixLines" value="true" /> - <option name="lenBefore" value="80" /> - <option name="lenAfter" value="80" /> - <option name="box" value="false" /> - <option name="filler" value="$TEMPLATE$" /> - </value> - </option> - <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." /> - <option name="keyword" value="Copyright" /> - <option name="fileTypeOverride" value="2" /> - <option name="relativeBefore" value="true" /> - <option name="addBlankAfter" value="true" /> - <option name="fileLocation" value="1" /> - <option name="useAlternate" value="false" /> - </LanguageOptions> - <LanguageOptions name="Properties"> - <option name="templateOptions"> - <value> - <option name="block" value="true" /> - <option name="separateBefore" value="false" /> - <option name="separateAfter" value="false" /> - <option name="prefixLines" value="true" /> - <option name="lenBefore" value="80" /> - <option name="lenAfter" value="80" /> - <option name="box" value="false" /> - <option name="filler" value="$TEMPLATE$" /> - </value> - </option> - <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." /> - <option name="keyword" value="Copyright" /> - <option name="fileTypeOverride" value="2" /> - <option name="relativeBefore" value="true" /> - <option name="addBlankAfter" value="true" /> - <option name="fileLocation" value="1" /> - <option name="useAlternate" value="false" /> - </LanguageOptions> - <LanguageOptions name="XML"> - <option name="templateOptions"> - <value> - <option name="block" value="true" /> - <option name="separateBefore" value="false" /> - <option name="separateAfter" value="false" /> - <option name="prefixLines" value="true" /> - <option name="lenBefore" value="80" /> - <option name="lenAfter" value="80" /> - <option name="box" value="false" /> - <option name="filler" value="$TEMPLATE$" /> - </value> - </option> - <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." /> - <option name="keyword" value="Copyright" /> - <option name="fileTypeOverride" value="2" /> - <option name="relativeBefore" value="true" /> - <option name="addBlankAfter" value="true" /> - <option name="fileLocation" value="1" /> - <option name="useAlternate" value="false" /> - </LanguageOptions> - <LanguageOptions name="__TEMPLATE__"> - <option name="templateOptions"> - <value> - <option name="block" value="true" /> - <option name="separateBefore" value="false" /> - <option name="separateAfter" value="false" /> - <option name="prefixLines" value="true" /> - <option name="lenBefore" value="80" /> - <option name="lenAfter" value="80" /> - <option name="box" value="false" /> - <option name="filler" value="$TEMPLATE$" /> - </value> - </option> - <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." /> - <option name="keyword" value="Copyright" /> - <option name="fileTypeOverride" value="4" /> - <option name="relativeBefore" value="true" /> - <option name="addBlankAfter" value="true" /> - <option name="fileLocation" value="1" /> - <option name="useAlternate" value="false" /> - </LanguageOptions> </component> </module> Modified: tools/archStat/trunk/archStat.ipr =================================================================== --- tools/archStat/trunk/archStat.ipr 2009-10-05 23:50:55 UTC (rev 1390) +++ tools/archStat/trunk/archStat.ipr 2009-10-05 23:51:41 UTC (rev 1391) @@ -881,8 +881,5 @@ <setting name="state" value="2" /> </Base> </component> - <UsedPathMacros> - <macro name="TEMPLATE" description="" /> - </UsedPathMacros> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-10-05 23:51:09
|
Revision: 1390 http://japi.svn.sourceforge.net/japi/?rev=1390&view=rev Author: christianhujer Date: 2009-10-05 23:50:55 +0000 (Mon, 05 Oct 2009) Log Message: ----------- Fix some IntelliJ IDEA warnings. Modified Paths: -------------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java tools/archStat/trunk/src/prj/net/sf/japi/archstat/LineCheck.java Modified: tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java 2009-10-05 00:36:09 UTC (rev 1389) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/FileStat.java 2009-10-05 23:50:55 UTC (rev 1390) @@ -20,6 +20,7 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -43,7 +44,7 @@ private final Map<File, FileStat> children = new HashMap<File, FileStat>(); /** The list of errors that occurred. */ - private final List<Throwable> errors = new ArrayList<Throwable>(); + private final Collection<Throwable> errors = new ArrayList<Throwable>(); /** The title of this statistic. */ private final String title; Modified: tools/archStat/trunk/src/prj/net/sf/japi/archstat/LineCheck.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/LineCheck.java 2009-10-05 00:36:09 UTC (rev 1389) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/LineCheck.java 2009-10-05 23:50:55 UTC (rev 1390) @@ -72,9 +72,9 @@ */ boolean hasProblem(@NotNull final File file, @NotNull final String line, final int lineNumber) { boolean ret = false; - final Matcher m = regex.matcher(line); - if (m.find()) { - final int column = m.start(); + final Matcher matcher = regex.matcher(line); + if (matcher.find()) { + final int column = matcher.start(); ret = true; LogSystem.log(new LogEntry(file, line, lineNumber, column + 1, messageType, name, message)); } @@ -104,8 +104,8 @@ /** {@inheritDoc} */ @Override - public boolean equals(@Nullable final Object o) { - return o != null && o instanceof LineCheck && ((LineCheck) o).name.equals(name); + public boolean equals(@Nullable final Object obj) { + return obj != null && obj instanceof LineCheck && ((LineCheck) obj).name.equals(name); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-10-05 01:22:57
|
Revision: 1383 http://japi.svn.sourceforge.net/japi/?rev=1383&view=rev Author: christianhujer Date: 2009-10-05 00:21:36 +0000 (Mon, 05 Oct 2009) Log Message: ----------- Remove duplicate object creation. Modified Paths: -------------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/ArchStat.java Modified: tools/archStat/trunk/src/prj/net/sf/japi/archstat/ArchStat.java =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/ArchStat.java 2009-10-05 00:20:45 UTC (rev 1382) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/ArchStat.java 2009-10-05 00:21:36 UTC (rev 1383) @@ -234,7 +234,7 @@ // TODO:2009-02-18:christianhujer:Improve. throw new RuntimeException("Duplicate Checker " + check.getName()); } - checkers.add(new LineCheck((Element) nl.item(i))); + checkers.add(check); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-10-05 01:22:51
|
Revision: 1381 http://japi.svn.sourceforge.net/japi/?rev=1381&view=rev Author: christianhujer Date: 2009-10-05 00:18:29 +0000 (Mon, 05 Oct 2009) Log Message: ----------- Improve error message. Modified Paths: -------------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml Modified: tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml 2009-09-29 20:41:21 UTC (rev 1380) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml 2009-10-05 00:18:29 UTC (rev 1381) @@ -101,7 +101,7 @@ message="Internal boolean type." filetypes="C" > - You used the internal boolean type. + You used the internal boolean type directly. Use the ISO/IEC 9899:1999 external type bool instead. </pattern> <pattern This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-10-05 00:36:19
|
Revision: 1389 http://japi.svn.sourceforge.net/japi/?rev=1389&view=rev Author: christianhujer Date: 2009-10-05 00:36:09 +0000 (Mon, 05 Oct 2009) Log Message: ----------- Consistently use lowerCamel for compounds. Modified Paths: -------------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml Modified: tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml 2009-10-05 00:33:57 UTC (rev 1388) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml 2009-10-05 00:36:09 UTC (rev 1389) @@ -16,7 +16,7 @@ --> <config> - <filetypes> + <fileTypes> <filetype id="CSource" match="^.+\.(c)$" description="C Source Code" /> <filetype id="CHeader" match="^.+\.(h)$" description="C Header"/> <filetype id="C" groups="CSource CHeader" description="C Language (Source and Header)"/> @@ -28,7 +28,7 @@ <filetype id="Curly" groups="C Java Jpp" description="Curly brace language source"/> <filetype id="Makefile" match="^(Makefile|.+\.mak)$" description="Makefile" /> <filetype id="All" groups="Curly Asm Makefile" description="All files" /> - </filetypes> + </fileTypes> <patterns> <pattern match="line" @@ -36,7 +36,7 @@ name="bogusLintSuppression" regex="/[/*] +lint" message="Bogus lint suppression - lint suppression with no effect." - filetypes="C" + fileTypes="C" > The way the lint suppression is written causes the lint suppression to have no effect. </pattern> @@ -46,7 +46,7 @@ name="trailingWhitespace" regex="[\p{javaWhitespace}&&[^\p{Zl}]]+?(\r\n|\r|\n)$" message="Trailing whitespace." - filetypes="All" + fileTypes="All" > Trailing whitespace is redundant, hinders searching and can be a cause of merge problems. </pattern> @@ -56,7 +56,7 @@ name="unixLine" regex="[^\r]\n$" message="Unix line." - filetypes="All" + fileTypes="All" > Use DOS line endings only to make sure the files are editable with stanard windows editors. </pattern> @@ -66,7 +66,7 @@ name="platformIntegerType" regex="\b(char|short|int|long)\b" message="Platform integer type." - filetypes="C" + fileTypes="C" > You used a type of which the sign (char) or size may vary depending on the platform. Instead use an ISO/IEC 9899:1999 integer type. @@ -77,7 +77,7 @@ name="oldIntegerType" regex="\b[US](08|16|32)_(EXACT|FAST)\b" message="Old integer type." - filetypes="C" + fileTypes="C" > You used an old integer type. Use ISO/IEC 9899:1999 integer types like uint8_t or int_fast32_t instead. @@ -88,7 +88,7 @@ name="oldBooleanType" regex="\bBOOL(_FAST)?\b" message="Old boolean type." - filetypes="C" + fileTypes="C" > You used an old boolean type. Use the ISO/IEC 9899:1999 type bool instead. @@ -99,7 +99,7 @@ name="internalBooleanType" regex="\b_Bool\b" message="Internal boolean type." - filetypes="C" + fileTypes="C" > You used the internal boolean type directly. Use the ISO/IEC 9899:1999 external type bool instead. @@ -110,7 +110,7 @@ name="tab" regex="\t" message="Tab character." - filetypes="Curly" + fileTypes="Curly" > Do not use tab for indention. Use spaces instead. @@ -125,7 +125,7 @@ name="commentStart" regex="/\*\*\s*?[\r\n]" message="Documentation comment text doesn't start in first line of documentation comment." - filetypes="Curly" + fileTypes="Curly" > If you start a documentation comment, the text should start in the first line, not later, e.g. /** Flushes the cache. @@ -138,7 +138,7 @@ name="oldStyleComment" regex="(\*{3,}|/{3,})" message="Old style comment." - filetypes="Curly" + fileTypes="Curly" /> <pattern match="line" @@ -146,7 +146,7 @@ name="krbraces" regex="^[\p{javaWhitespace}&&[^\p{Zl}]]+?(\{|else|catch|finally)" message="Bogus brace style found. Use K&R brace style." - filetypes="Curly" + fileTypes="Curly" > </pattern> <!--pattern @@ -155,7 +155,7 @@ name="spaces" regex="^ " message="Bogus indention in Makefile - use tabs, not spaces." - filetypes="Makefile" + fileTypes="Makefile" > </pattern--> <pattern @@ -164,7 +164,7 @@ name="fileComment" regex="/\*\* [^.\n]\.$.*? \* @file.*?$ \*/$" message="Malformed file header comment." - filetypes="C" + fileTypes="C" > </pattern> </patterns> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-10-05 00:34:06
|
Revision: 1388 http://japi.svn.sourceforge.net/japi/?rev=1388&view=rev Author: christianhujer Date: 2009-10-05 00:33:57 +0000 (Mon, 05 Oct 2009) Log Message: ----------- Add check for the file header comment (untested). Modified Paths: -------------- tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml Modified: tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml =================================================================== --- tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml 2009-10-05 00:29:39 UTC (rev 1387) +++ tools/archStat/trunk/src/prj/net/sf/japi/archstat/Checker.xml 2009-10-05 00:33:57 UTC (rev 1388) @@ -158,5 +158,14 @@ filetypes="Makefile" > </pattern--> + <pattern + match="file" + messageType="WARNING" + name="fileComment" + regex="/\*\* [^.\n]\.$.*? \* @file.*?$ \*/$" + message="Malformed file header comment." + filetypes="C" + > + </pattern> </patterns> </config> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |