diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/build.xml b/ws2012/P2P/uebungen/2/p2p_ex2/build.xml new file mode 100644 index 00000000..ecd442ef --- /dev/null +++ b/ws2012/P2P/uebungen/2/p2p_ex2/build.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + Builds, tests, and runs the project P2P. + + + diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/manifest.mf b/ws2012/P2P/uebungen/2/p2p_ex2/manifest.mf new file mode 100644 index 00000000..328e8e5b --- /dev/null +++ b/ws2012/P2P/uebungen/2/p2p_ex2/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/build-impl.xml b/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/build-impl.xml new file mode 100644 index 00000000..0a42dc22 --- /dev/null +++ b/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/build-impl.xml @@ -0,0 +1,883 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + + + + + + java -cp "${run.classpath.with.dist.jar}" ${main.class} + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/genfiles.properties b/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/genfiles.properties new file mode 100644 index 00000000..ce24c0ab --- /dev/null +++ b/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=42736814 +build.xml.script.CRC32=b6e6d2dd +build.xml.stylesheet.CRC32=28e38971@1.38.3.45 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=42736814 +nbproject/build-impl.xml.script.CRC32=082c0e5f +nbproject/build-impl.xml.stylesheet.CRC32=229523de@1.38.3.45 diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/private/private.properties b/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/private/private.properties new file mode 100644 index 00000000..86f01fb1 --- /dev/null +++ b/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\rylon\\.netbeans\\6.9\\build.properties diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/project.properties b/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/project.properties new file mode 100644 index 00000000..d87d7aaf --- /dev/null +++ b/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/project.properties @@ -0,0 +1,72 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +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} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/P2P.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +file.reference.p2p_ex2-src=src +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath}:\ + ${libs.junit_4.classpath} +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=buffered.BufferedNetworkStack +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=${file.reference.p2p_ex2-src} diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/project.xml b/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/project.xml new file mode 100644 index 00000000..639afa1e --- /dev/null +++ b/ws2012/P2P/uebungen/2/p2p_ex2/nbproject/project.xml @@ -0,0 +1,13 @@ + + + org.netbeans.modules.java.j2seproject + + + P2P + + + + + + + diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/src/buffered/BufferedNetworkStack.java b/ws2012/P2P/uebungen/2/p2p_ex2/src/buffered/BufferedNetworkStack.java index 396c75f5..5b92e4eb 100644 --- a/ws2012/P2P/uebungen/2/p2p_ex2/src/buffered/BufferedNetworkStack.java +++ b/ws2012/P2P/uebungen/2/p2p_ex2/src/buffered/BufferedNetworkStack.java @@ -34,7 +34,7 @@ class BufferedNetworkStack { boolean flag = false; StringBuilder result = new StringBuilder(16); for (String s : cunks) { - if (!s.isEmpty()) { + if (s != null && !s.isEmpty()) { result.append(s); flag = true; }