From b642b8eca4bac9daad2f37cd0598cb117d60313c Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 14 Aug 2015 21:50:20 +0200 Subject: [PATCH] =?utf8?q?Added=20more=20thrown=20exception=20(yes,=20agai?= =?utf8?q?n)=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Addressbook/nbproject/project.properties | 170 +++++++++--------- .../contact/AddressbookContactManager.java | 5 +- 2 files changed, 90 insertions(+), 85 deletions(-) diff --git a/Addressbook/nbproject/project.properties b/Addressbook/nbproject/project.properties index 2864028..7cc6fa2 100644 --- a/Addressbook/nbproject/project.properties +++ b/Addressbook/nbproject/project.properties @@ -1,83 +1,87 @@ -annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false -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 -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -build.generated.sources.dir=${build.dir}/generated-sources -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -# Uncomment to specify the preferred debugger connection transport: -#debug.transport=dt_socket -debug.classpath=\ - ${run.classpath} -debug.test.classpath=\ - ${run.test.classpath} -# Files in build.classes.dir which should be excluded from distribution jar -dist.archive.excludes= -# This directory is removed when the project is cleaned: -dist.dir=dist -dist.jar=${dist.dir}/Addressbook.jar -dist.javadoc.dir=${dist.dir}/javadoc -endorsed.classpath= -excludes= -file.reference.log4j-api-2.3.jar=C:\\Users\\KLC\\Documents\\NetBeansProjects\\jcore\\lib\\log4j-api-2.3.jar -file.reference.log4j-core-2.3.jar=C:\\Users\\KLC\\Documents\\NetBeansProjects\\jcore\\lib\\log4j-core-2.3.jar -includes=** -jar.compress=false -javac.classpath=\ - ${file.reference.log4j-api-2.3.jar}:\ - ${file.reference.log4j-core-2.3.jar}:\ - ${reference.jcore.jar} -# Space-separated list of extra javac options -javac.compilerargs=-Xlint:deprecation -Xlint:unchecked -javac.deprecation=false -javac.processorpath=\ - ${javac.classpath} -javac.source=1.7 -javac.target=1.7 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -javac.test.processorpath=\ - ${javac.test.classpath} -javadoc.additionalparam= -javadoc.author=false -javadoc.encoding=${source.encoding} -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -main.class=org.mxchange.addressbook.application.AddressbookApplication -manifest.file=manifest.mf -meta.inf.dir=${src.dir}/META-INF -mkdist.disabled=false -platform.active=default_platform -project.jcore=../../jcore -project.license=gpl30 -reference.jcore.jar=${project.jcore}/dist/jcore.jar -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project. -# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. -# To set system properties for unit tests define test-sys-prop.name=value: -run.jvmargs=-ea -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -source.encoding=UTF-8 -src.dir=src -test.src.dir=test +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +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 +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/Addressbook.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.log4j-api-2.3.jar=C:\\Users\\KLC\\Documents\\NetBeansProjects\\jcore\\lib\\log4j-api-2.3.jar +file.reference.log4j-core-2.3.jar=C:\\Users\\KLC\\Documents\\NetBeansProjects\\jcore\\lib\\log4j-core-2.3.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.log4j-api-2.3.jar}:\ + ${file.reference.log4j-core-2.3.jar}:\ + ${reference.jcore.jar} +# Space-separated list of extra javac options +javac.compilerargs=-Xlint:deprecation -Xlint:unchecked +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.7 +javac.target=1.7 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.reference.log4j-api-2.3.jar=/home/quix0r/MyProjects/JARs/log4j-api-2.3-javadoc.jar +javadoc.reference.log4j-core-2.3.jar=/home/quix0r/MyProjects/JARs/log4j-core-2.3-javadoc.jar +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=org.mxchange.addressbook.application.AddressbookApplication +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +project.jcore=../../jcore +project.license=gpl30 +reference.jcore.jar=${project.jcore}/dist/jcore.jar +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs=-ea +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +source.reference.log4j-api-2.3.jar=/home/quix0r/MyProjects/JARs/log4j-api-2.3-sources.jar +source.reference.log4j-core-2.3.jar=/home/quix0r/MyProjects/JARs/log4j-core-2.3-sources.jar +src.dir=src +test.src.dir=test diff --git a/Addressbook/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java b/Addressbook/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java index ab71513..ef41687 100644 --- a/Addressbook/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java +++ b/Addressbook/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java @@ -32,6 +32,7 @@ import org.mxchange.jcore.client.Client; import org.mxchange.jcore.contact.Contact; import org.mxchange.jcore.contact.Gender; import org.mxchange.jcore.exceptions.BadTokenException; +import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException; import org.mxchange.jcore.exceptions.UnhandledUserChoiceException; import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException; import org.mxchange.jcore.manager.BaseManager; @@ -654,7 +655,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable try { // Deligate this call to frontend isAdded = this.getContactDatabase().isOwnContactFound(); - } catch (final SQLException | IOException | BadTokenException ex) { + } catch (final SQLException | IOException | BadTokenException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { // Something bad happened this.abortProgramWithException(ex); } @@ -697,7 +698,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable // Add contact to internal list this.addContact(contact); - } catch (final ContactAlreadyAddedException | BadTokenException | IOException ex) { + } catch (final ContactAlreadyAddedException | BadTokenException | SQLException | IOException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { // Abort here this.abortProgramWithException(ex); } -- 2.39.5