From: Roland Haeder Date: Thu, 27 Aug 2015 06:52:41 +0000 (+0200) Subject: Better compare this way: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3345026dfa6b1915ab532c5e3883d185efa96b59;p=addressbook-swing.git Better compare this way: if (null == foo) Otherwise could lead to a bug if you miss only one equal sign + updated jcore Signed-off-by:Roland Häder --- diff --git a/lib/jcore.jar b/lib/jcore.jar index f4bdc10..d75f9b6 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/nbproject/project.properties b/nbproject/project.properties index 8bc500c..9f32019 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,10 +1,11 @@ annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false +annotation.processing.enabled.in.editor=true annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output application.title=Addressbook application.vendor=Roland Haeder +auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: @@ -34,7 +35,9 @@ file.reference.log4j-api-2.3.jar=lib/log4j-api-2.3.jar file.reference.log4j-core-2.3.jar=lib/log4j-core-2.3.jar file.reference.jcore.jar=./lib/jcore.jar includes=** +jar.archive.disabled=${jnlp.enabled} jar.compress=false +jar.index=${jnlp.enabled} javac.classpath=\ ${file.reference.log4j-api-2.3.jar}:\ ${file.reference.log4j-core-2.3.jar}:\ @@ -42,7 +45,7 @@ javac.classpath=\ ${file.reference.commons-codec-1.10.jar} # Space-separated list of extra javac options javac.compilerargs=-Xlint:deprecation -Xlint:unchecked -javac.deprecation=false +javac.deprecation=true javac.processorpath=\ ${javac.classpath} javac.source=1.7 @@ -53,20 +56,33 @@ javac.test.classpath=\ javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= -javadoc.author=false +javadoc.author=true javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false -javadoc.private=false +javadoc.private=true javadoc.splitindex=true javadoc.use=true -javadoc.version=false -javadoc.windowtitle= +javadoc.version=true +javadoc.windowtitle=Addressbook Documentation +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= main.class=org.mxchange.addressbook.application.AddressbookApplication +# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed +manifest.custom.codebase= +# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions) +manifest.custom.permissions= manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF -mkdist.disabled=false +mkdist.disabled=true platform.active=default_platform project.license=gpl30 run.classpath=\ diff --git a/src/org/mxchange/addressbook/client/console/ConsoleClient.java b/src/org/mxchange/addressbook/client/console/ConsoleClient.java index 06a6cc2..92df18a 100644 --- a/src/org/mxchange/addressbook/client/console/ConsoleClient.java +++ b/src/org/mxchange/addressbook/client/console/ConsoleClient.java @@ -83,7 +83,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.getLogger().trace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -106,7 +106,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.getLogger().trace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -118,7 +118,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC String companyName = contact.getCompanyName(); // If it is empty/null, then assume private contact - if ((companyName == null) || (companyName.isEmpty())) { + if ((null == companyName) || (companyName.isEmpty())) { // Now put all together: gender, surname, family name // @todo Use mask this.outputMessage(MessageFormat.format("Anrede, Vorname, Name: {0} {1} {2}", gender, contact.getFirstName(), contact.getFamilyName())); @@ -142,7 +142,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.getLogger().trace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -160,7 +160,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.getLogger().trace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -202,7 +202,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.getLogger().trace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -244,7 +244,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.getLogger().trace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Is it null? - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -418,7 +418,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.getLogger().trace(MessageFormat.format("validChars={0},message={1} - CALLED!", Arrays.toString(validChars), message)); //NOI18N // The validChars must not null be null and filled with at least one char - if (validChars == null) { + if (null == validChars) { // Is null throw new NullPointerException("validChars is null"); //NOI18N } else if (validChars.length == 0) { @@ -535,7 +535,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC String input = null; // Check if it is to short or to long - while (((input == null) || ((input.length() < minLength) && (!allowEmpty))) || ((input.length() > 0) && (input.length() < minLength) && (allowEmpty)) || ((input instanceof String) && (input.length() > maxLength))) { + while (((null == input) || ((input.length() < minLength) && (!allowEmpty))) || ((input.length() > 0) && (input.length() < minLength) && (allowEmpty)) || ((input instanceof String) && (input.length() > maxLength))) { // Output message System.out.print(message); @@ -635,7 +635,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC this.getLogger().trace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N // Contact must not be null - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } diff --git a/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java b/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java index 5f68c5c..02089cb 100644 --- a/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java +++ b/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java @@ -58,7 +58,7 @@ public class AddressbookContactDatabaseFrontend extends BaseDatabaseFrontend imp this.getLogger().trace(MessageFormat.format("manager={0} - CALLED!", manager)); //NOI18N // Manager instance must not be null - if (manager == null) { + if (null == manager) { // Abort here throw new NullPointerException("manager is null"); //NOI18N } @@ -89,7 +89,7 @@ public class AddressbookContactDatabaseFrontend extends BaseDatabaseFrontend imp this.getLogger().trace("CALLED!"); //NOI18N // Make sure the contact is set - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -222,7 +222,7 @@ public class AddressbookContactDatabaseFrontend extends BaseDatabaseFrontend imp this.getLogger().trace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // contact should not be null - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -267,13 +267,13 @@ public class AddressbookContactDatabaseFrontend extends BaseDatabaseFrontend imp @Override public boolean isOwnContactFound () throws SQLException, IOException, BadTokenException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Get search criteria instance - SearchableCriteria critera = new SearchCriteria(); + SearchableCriteria criteria = new SearchCriteria(); // Add condition - critera.addCriteria(AddressbookContactDatabaseConstants.COLUMN_OWN_CONTACT, true); + criteria.addCriteria(AddressbookContactDatabaseConstants.COLUMN_OWN_CONTACT, true); // Get result - Result result = this.getBackend().doSelectByCriteria(critera); + Result result = this.getBackend().doSelectByCriteria(criteria); // Deligate this call to backend return result.hasNext(); diff --git a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java index fd2a538..881d1ba 100644 --- a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java +++ b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java @@ -70,7 +70,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable this.getLogger().trace(MessageFormat.format("client={1} - CALLED!", client)); //NOI18N // Make sure all parameters are set correctly - if (client == null) { + if (null == client) { // Abort here throw new NullPointerException("client is null"); //NOI18N } @@ -104,7 +104,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable this.getLogger().trace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N // Contact instance must not be null - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -135,7 +135,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable this.getLogger().trace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N // Contact must not be null - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -170,7 +170,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable this.getLogger().trace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N // Contact must not be null - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -214,7 +214,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable this.getLogger().trace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N // Contact must not be null - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } @@ -609,7 +609,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable this.getLogger().debug(MessageFormat.format("storeable={0}", storeable)); // It may return null - if (storeable == null) { + if (null == storeable) { // Nothing found this.getLogger().warn("contact is null - returning null ..."); return null; @@ -677,7 +677,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable this.getLogger().trace(MessageFormat.format("contact={0} CALLED!", contact)); //NOI18N // Sanity check - if (contact == null) { + if (null == contact) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } diff --git a/src/org/mxchange/addressbook/menu/AddressbookMenu.java b/src/org/mxchange/addressbook/menu/AddressbookMenu.java index 12257eb..b59b13e 100644 --- a/src/org/mxchange/addressbook/menu/AddressbookMenu.java +++ b/src/org/mxchange/addressbook/menu/AddressbookMenu.java @@ -46,10 +46,10 @@ public class AddressbookMenu extends BaseAddressbookSystem { log.trace(MessageFormat.format("menuList={0},menuType={1},client={2} - CALLED!", menuList, menuType, client)); //NOI18N // Some instances must be set - if (menuList == null) { + if (null == menuList) { // Abort here throw new NullPointerException("menuList is null"); //NOI18N - } else if (client == null) { + } else if (null == client) { // Abort here throw new NullPointerException("contact is null"); //NOI18N } else if (!(client instanceof AddressbookClient)) { diff --git a/src/org/mxchange/addressbook/menu/BaseMenu.java b/src/org/mxchange/addressbook/menu/BaseMenu.java index f554820..207a9b3 100644 --- a/src/org/mxchange/addressbook/menu/BaseMenu.java +++ b/src/org/mxchange/addressbook/menu/BaseMenu.java @@ -70,7 +70,7 @@ public class BaseMenu extends BaseAddressbookSystem { this.getLogger().trace(MessageFormat.format("client={0} CALLED!", client)); //NOI18N // Client must not be null - if (client == null) { + if (null == client) { // Abort here throw new NullPointerException("client is null"); //NOI18N } diff --git a/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java b/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java index 965f68a..b5c2e43 100644 --- a/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java +++ b/src/org/mxchange/addressbook/menu/console/ConsoleMenu.java @@ -39,7 +39,7 @@ public class ConsoleMenu extends BaseMenu implements Menu { this.getLogger().trace(MessageFormat.format("menuType={0},client={1} - CALLED!", menuType, client)); //NOI18N // Client must not be null - if (client == null) { + if (null == client) { // Abort here throw new NullPointerException("client is null"); } diff --git a/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java b/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java index 1090a63..091787d 100644 --- a/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java +++ b/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java @@ -93,7 +93,7 @@ public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem this.getLogger().trace(MessageFormat.format("client={0} - CALLED!", client)); //NOI18N // Client must not be null - if (client == null) { + if (null == client) { // Abort here throw new NullPointerException("client is null"); } else if (!(client instanceof AddressbookClient)) {